예제 #1
0
        /// <summary>
        /// 保存角色菜单权限
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task <JsonResponse> SaveRoleMenu(RoleMenuRequestDto input)
        {
            var result = await GetAddOrRemoveRoleMenuAction(input);

            var resJson = await _applicationEnginee.TryTransactionAsync(async() =>
            {
                await _roleMenuAppService.BatchCreateAsync(result.Item1);
                await _roleMenuAppService.BatchRemoveAsync(result.Item2);
            });

            return(resJson);
        }
예제 #2
0
        /// <summary>
        /// 批量新增
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task <JsonResponse> BatchCreate(RoleMenuBatchRequestDto input)
        {
            foreach (var roleMenuRequestDto in input.RoleMenuRequestList)
            {
                roleMenuRequestDto.InitCreateRequest(input.Payload);
            }
            var resJson = await _applicationEnginee.TryTransactionAsync(async() =>
            {
                await _roleMenuAppService.BatchCreateAsync(input.RoleMenuRequestList);
            });

            return(resJson);
        }