GetUserRole 获取用户的角色信息
(ctx context.Context, userId int)
| 107 | |
| 108 | // GetUserRole 获取用户的角色信息 |
| 109 | func (r *roleService) GetUserRole(ctx context.Context, userId int) (*domain.Role, error) { |
| 110 | if userId <= 0 { |
| 111 | r.l.Warn("用户ID无效", zap.Int("userId", userId)) |
| 112 | return nil, ErrInvalidID |
| 113 | } |
| 114 | |
| 115 | return r.repo.GetUserRole(ctx, userId) |
| 116 | } |
nothing calls this directly
no test coverage detected