OWL ITS + 탐지시스템(인터넷 진흥원)
이민희
2022-01-06 6adb341db180240e0af34ace40100912d4ed5257
src/main/java/kr/wisestone/owl/web/controller/IssueController.java
@@ -5,7 +5,9 @@
import kr.wisestone.owl.service.IssueService;
import kr.wisestone.owl.util.ConvertUtil;
import kr.wisestone.owl.web.condition.ApiMonitorCondition;
import kr.wisestone.owl.web.condition.DepartmentCondition;
import kr.wisestone.owl.web.condition.IssueCondition;
import kr.wisestone.owl.web.form.EmailCommonForm;
import kr.wisestone.owl.web.form.EmailTemplateForm;
import kr.wisestone.owl.web.form.IssueForm;
import org.slf4j.Logger;
@@ -66,6 +68,21 @@
        return this.setSuccessMessage(resJsonData);
    }
    //  하위이슈 생성
    @RequestMapping(value = "/issue/downIssueAdd", method = RequestMethod.POST)
    public
    @ResponseBody
    Map<String, Object> downIssueAdd(MultipartHttpServletRequest request) {
        Map<String, Object> resJsonData = new HashMap<>();
        //  이슈 생성
        Issue issue = this.issueService.addDownIssue(IssueForm.make(ConvertUtil.convertJsonToMap(request.getParameter(Constants.REQ_KEY_CONTENT))), request.getFiles("file"));
        //  버전 생성
        this.issueService.addIssueVersion(issue.getId());
        resJsonData.put(Constants.RES_KEY_CONTENTS, issue.getId()); //하위이슈 ID
        return this.setSuccessMessage(resJsonData);
    }
    //  이슈 조회
    @RequestMapping(value = "/issue/find", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    public
@@ -91,13 +108,29 @@
        return this.setSuccessMessage(resJsonData);
    }
    //  파트너 목록 조회
    @RequestMapping(value = "/issue/findReadyDepartments", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    public
    @ResponseBody
    Map<String, Object> findReadyDepartments(@RequestBody Map<String, Map<String, Object>> params) {
        Map<String, Object> resJsonData = new HashMap<>();
        Pageable pageable = this.pageUtil.convertPageable(this.getPageVo(params));
        this.issueService.findReadyDepartments(resJsonData, DepartmentCondition.make(params.get(Constants.REQ_KEY_CONTENT)), pageable);
        return this.setSuccessMessage(resJsonData);
    }
    //  이슈 상세 조회
    @RequestMapping(value = "/issue/detail", produces = MediaType.APPLICATION_JSON_VALUE)
    public
    @ResponseBody
    Map<String, Object> detail(@RequestBody Map<String, Map<String, Object>> params) {
        Map<String, Object> resJsonData = new HashMap<>();
        this.issueService.detailIssue(resJsonData, IssueCondition.make(params.get(Constants.REQ_KEY_CONTENT)));
        Pageable relPageable = this.pageUtil.convertRelPageable(this.getPageVo(params));
        Pageable downPageable = this.pageUtil.convertDownPageable(this.getPageVo(params));
        this.issueService.detailIssue(resJsonData, IssueCondition.make(params.get(Constants.REQ_KEY_CONTENT)), relPageable, downPageable);
        return this.setSuccessMessage(resJsonData);
    }
@@ -189,7 +222,7 @@
    public @ResponseBody Map<String, Object> importExcel(MultipartHttpServletRequest request) throws Exception {
        Map<String, Object> resJsonData = new HashMap<>();
        this.issueService.importExcel(request.getFile("file"));
        this.issueService.importExcel(IssueForm.make(ConvertUtil.convertJsonToMap(request.getParameter(Constants.REQ_KEY_CONTENT))), request.getFile("file"));
        return this.setSuccessMessage(resJsonData);
    }
@@ -216,6 +249,17 @@
    }
    // 일반 메일 발송 (사용자 직접 작성)
    @RequestMapping(value = "/issue/sendCommonEmail", produces = MediaType.APPLICATION_JSON_VALUE)
    public
    @ResponseBody
    Map<String, Object> sendCommonEmail(@RequestBody Map<String, Map<String, Object>> params) {
        Map<String, Object> resJsonData = new HashMap<>();
        this.issueService.sendCommonEmail(EmailCommonForm.make(params.get(Constants.REQ_KEY_CONTENT)));
        return this.setSuccessMessage(resJsonData);
    }
    //  api 기록 조회
    @RequestMapping(value = "/api/findHistory", produces = MediaType.APPLICATION_JSON_VALUE)
    public