MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / GetUserRole

Method GetUserRole

internal/service/role.go:109–116  ·  view source on GitHub ↗

GetUserRole 获取用户的角色信息

(ctx context.Context, userId int)

Source from the content-addressed store, hash-verified

107
108// GetUserRole 获取用户的角色信息
109func (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}

Callers

nothing calls this directly

Calls 1

GetUserRoleMethod · 0.65

Tested by

no test coverage detected