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

Method CreateRole

internal/service/role.go:43–50  ·  view source on GitHub ↗

CreateRole 创建新角色

(ctx context.Context, role *domain.Role, menuIds []int, apiIds []int)

Source from the content-addressed store, hash-verified

41
42// CreateRole 创建新角色
43func (r *roleService) CreateRole(ctx context.Context, role *domain.Role, menuIds []int, apiIds []int) error {
44 if role == nil {
45 r.l.Warn("角色不能为空")
46 return ErrInvalidRole
47 }
48
49 return r.repo.CreateRole(ctx, role, menuIds, apiIds)
50}
51
52// GetRoleById 根据ID获取角色信息
53func (r *roleService) GetRoleById(ctx context.Context, id int) (*domain.Role, error) {

Callers

nothing calls this directly

Calls 1

CreateRoleMethod · 0.65

Tested by

no test coverage detected