From b7d8bfbe09547aa2df1366c6ff8867cea5d64fab Mon Sep 17 00:00:00 2001 From: wyu <kknd09321@nate.com> Date: 수, 05 1월 2022 11:08:39 +0900 Subject: [PATCH] Merge branch 'master' of http://192.168.0.25:9001/r/owl-kisa --- src/main/java/kr/wisestone/owl/web/controller/ApiController.java | 54 +++++++++++++++++++++++++++--------------------------- 1 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/main/java/kr/wisestone/owl/web/controller/ApiController.java b/src/main/java/kr/wisestone/owl/web/controller/ApiController.java index fb3a53a..fb90cfd 100644 --- a/src/main/java/kr/wisestone/owl/web/controller/ApiController.java +++ b/src/main/java/kr/wisestone/owl/web/controller/ApiController.java @@ -3,16 +3,12 @@ import kr.wisestone.owl.constant.Constants; import kr.wisestone.owl.constant.MsgConstants; import kr.wisestone.owl.domain.Issue; -import kr.wisestone.owl.domain.User; import kr.wisestone.owl.exception.OwlRuntimeException; import kr.wisestone.owl.service.IssueService; import kr.wisestone.owl.util.ConvertUtil; import kr.wisestone.owl.web.form.IssueApiForm; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; @@ -22,25 +18,22 @@ import java.util.List; import java.util.Map; +/** + * OWL-API 而⑦듃濡ㅻ윭 + */ @Controller public class ApiController extends BaseController { @Autowired private IssueService issueService; - // �씠�뒋 異붽�(json 諛⑹떇�쑝濡� �뙆�씪�쟾�넚) -// @RequestMapping(value = "api/issue", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) -// public -// @ResponseBody -// Map<String, Object> addIssue(@RequestBody Map<String, Map<String, Object>> params) { -// Map<String, Object> resJsonData = new HashMap<>(); -// -// IssueApiForm issueForm = IssueApiForm.make(params.get(Constants.REQ_KEY_CONTENT)); -// Issue issue = this.issueService.addApiIssue(issueForm); -// // 踰꾩쟾 �깮�꽦 -// this.issueService.addIssueVersion(issue.getId()); -// return this.setSuccessMessage(resJsonData); -// } + + /** + * @param request multipart/form-data 濡� �슂泥��빐�빞 �븿 + * @return Json �쑝濡� 寃곌낵媛� �쟾�넚 + * @throws OwlRuntimeException 二쇰줈�뙆�씪誘명꽣 �삤瑜� 泥댄겕�떆 諛쒖깮 + * @throws CloneNotSupportedException 媛앹껜 蹂듭궗�븷 �븣 諛쒖깮 + */ @RequestMapping(value = "api/issue", method = RequestMethod.POST) public @ResponseBody @@ -53,6 +46,11 @@ if (issueForm == null) { throw new OwlRuntimeException(this.messageAccessor.getMessage(MsgConstants.API_PARAMETER_ERROR)); } + // �궗�슜�옄 �젙�쓽 �븘�뱶媛� �뾾�쓣 寃쎌슦 寃��깋�쓣 �븷 �닔 �뾾湲� �븣臾몄뿉 �삁�쇅泥섎━ + else if (issueForm.getCustomFieldValues() == null || issueForm.getCustomFieldValues().size() == 0) { + throw new OwlRuntimeException(this.messageAccessor.getMessage(MsgConstants.API_CUSTOM_FIELD_NOT_EXIST)); + } + if (issueForm.getApiType() == IssueApiForm.ApiType.add) { List<Issue> issues = this.issueService.addApiIssue(issueForm); // 踰꾩쟾 �깮�꽦 @@ -60,6 +58,8 @@ this.issueService.addIssueVersion(issue.getId(), issue.getRegisterId()); } } else { + + this.issueService.modifyIssue(issueForm, request.getFiles("file")); } @@ -67,15 +67,15 @@ } // �씠�뒋 議고쉶 - @RequestMapping(value = "/api/issueList", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) - public - @ResponseBody - Map<String, Object> find(@RequestBody Map<String, Map<String, Object>> params) { - Map<String, Object> resJsonData = new HashMap<>(); - Pageable pageable = this.pageUtil.convertPageable(this.getPageVo(params)); - - // todo - return this.setSuccessMessage(resJsonData); - } +// @RequestMapping(value = "/api/issueList", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) +// public +// @ResponseBody +// Map<String, Object> find(@RequestBody Map<String, Map<String, Object>> params) { +// Map<String, Object> resJsonData = new HashMap<>(); +// Pageable pageable = this.pageUtil.convertPageable(this.getPageVo(params)); +// +// // todo +// return this.setSuccessMessage(resJsonData); +// } } -- Gitblit v1.8.0