예제 #1
0
        /// <summary>
        /// 保存机构菜单权限
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task <JsonResponse> SaveOrgMenu(OrganizationMenuRequestDto input)
        {
            var result = await GetAddOrRemoveOrganizationMenuRequest(input);

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

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

            return(resJson);
        }