GetRole 根据角色ID获取角色信息
(ctx context.Context, roleId int)
| 65 | |
| 66 | // GetRole 根据角色ID获取角色信息 |
| 67 | func (r *roleRepository) GetRole(ctx context.Context, roleId int) (*domain.Role, error) { |
| 68 | role, err := r.dao.GetRole(ctx, roleId) |
| 69 | if err != nil { |
| 70 | return nil, err |
| 71 | } |
| 72 | if role == nil { |
| 73 | return nil, nil |
| 74 | } |
| 75 | return r.roleFromDAO(role), nil |
| 76 | } |
| 77 | |
| 78 | // GetUserRole 获取用户的角色信息 |
| 79 | func (r *roleRepository) GetUserRole(ctx context.Context, userId int) (*domain.Role, error) { |
nothing calls this directly
no test coverage detected