Exemplo n.º 1
0
        public async Task <IActionResult> AddRoleAsync([FromBody] AddRoleRequestDto request)
        {
            var roleBiz = new RoleBiz();
            var result  = await roleBiz.InsertAsync(new RoleModel
            {
                CreatedBy     = UserID,
                LastUpdatedBy = UserID,
                Enable        = request.Enable,
                RoleGuid      = Guid.NewGuid().ToString("N"),
                Description   = request.Description,
                RoleName      = request.RoleName,
                OrgGuid       = string.Empty,
                Sort          = request.Sort
            });

            if (!result)
            {
                return(Failed(ErrorCode.UserData, "修改失败"));
            }
            return(Success());
        }