public async Task <EvoToolApiResponse> PutChat(long opsNoticeId, PutChatRequest request) { var response = await PutAsync($"/api/gmtool/opsnotice/chat/{opsNoticeId}", request); return(await BuildResponse(response)); }
public async Task <ActionResult <PutChatResponse> > PutChat(long opsNoticeId, PutChatRequest request) { // todo: CBT後 validation text // todo: validation enabledなtextは空文字列不可 var chatDesc = _mapper.Map <PutChatRequest, ChatDesc>(request); var result = await _opsNoticeService.UpdateChat(opsNoticeId, chatDesc); var response = _mapper.Map <OpsNotice, PutChatResponse>(result); return(Ok(response)); }
public async Task <ActionResult <PutChatResponse> > PutChat(long opsNoticeId, PutChatRequest request) { var authorizationResult = await _authorizationService.AuthorizeAsync(User, request.target, Policy.DomainRegionTarget); if (!authorizationResult.Succeeded) { return(Forbid()); } var registered = await _opsNoticeService.GetChat(opsNoticeId); if (registered.StatusCode != StatusCodes.Status200OK) { return(BuildResponse(registered)); } var registeredTarget = Newtonsoft.Json.JsonConvert.DeserializeObject <GetChatResponse>(registered.Content.ToString()).Target; authorizationResult = await _authorizationService.AuthorizeAsync(User, registeredTarget, Policy.DomainRegionTarget); if (!authorizationResult.Succeeded) { return(Forbid()); } var result = await _opsNoticeService.PutChat(opsNoticeId, request); return(BuildResponse(result)); }
public async Task <EvoToolApiResponse> PutChat(long opsNoticeId, PutChatRequest request) { return(await _opsNoticeRepository.PutChat(opsNoticeId, request)); }