public Task <CreateGroupResponseDto> CreateGroupSync(CreateGroupRequestDto dto) { return(Task.Run(() => { CreateGroupResponseDto resp = new CreateGroupResponseDto(); var classifyEntity = _groupClassifyRepository.TableNoTracking.SingleOrDefault(t => t.Id.Equals(dto.classify_id)); if (classifyEntity != null) { var groupEntity = new GroupInfoEntity() { ClassifyId = dto.classify_id, CoverUrl = dto.cover_url, CreatedUser = Guid.Empty, Description = dto.description, GMTCreate = DateTime.Now, IsOffLine = false, IsHot = dto.is_hot, Name = dto.name }; _groupInfoRepository.Insert(groupEntity); resp.id = groupEntity.Id; } else { throw new NotFoundException("所属板块不存在"); } return resp; })); }
/// <summary> /// This method is only available in version 11+ /// </summary> /// <param name="createGroupRequest"></param> /// <param name="authToken"></param> /// <returns></returns> public Task <string> CreateUserGroup(CreateGroupRequestDto createGroupRequest, string authToken = null) { return(PostCyberArk <string>(CyberArkEndpointConst.GetUserGroups, createGroupRequest, false, authToken)); }
public async Task <IActionResult> CreateUserGroup(CreateGroupRequestDto createGroupRequest, string authToken = null) { Devon4NetLogger.Debug("Executing Login from controller CyberArk"); return(Ok(await CyberArkHandler.CreateUserGroup(createGroupRequest, authToken))); }
public async Task <IHttpActionResult> Get([FromBody] CreateGroupRequestDto dto) { var resp = await _groupService.CreateGroupSync(dto); return(Ok(resp)); }