You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
4.2 KiB
Java

package cokr.xit.fims.epst.web;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.epst.EpostQuery;
import cokr.xit.fims.epst.EpostRcptReg;
import cokr.xit.fims.epst.service.EpostRcptRegService;
/**
*
* <p> :
*
* <pre>
* ============ ============
* 2023-10-11 JoJH
* ================================
* </pre>
*/
public class Epst01Controller extends ApplicationController {
public static final String CLASS_URL = "/epst/epst01";
public class METHOD_URL {
public static final String
epostRcptRegMain = "/epostRcptRegMain.do" // 전자우편 접수 메인
, getEpostRcptRegList = "/getEpostRcptRegList.do" // 전자우편 접수 조회
, createEpostRcptReg = "/createEpostRcptReg.do" // 전자우편 접수 등록
, updateEpostRcptReg = "/updateEpostRcptReg.do" // 전자우편 접수 수정
, deleteEpostRcptReg = "/deleteEpostRcptReg" // 전자우편 접수 삭제
;
}
/**전자우편 접수 등록 서비스*/
@Resource(name = "epostRcptRegService")
private EpostRcptRegService epostRcptRegService;
/** (epostRcptReg/epostRcptReg-main) .
* {@link #getEpostRcptRegList(EpostRcptRegQuery) } .
* @return /epostRcptReg/epostRcptReg-main
*/
public ModelAndView epostRcptRegMain() {
ModelAndView mav = getEpostRcptRegList(new EpostQuery().setPageNum(1));
mav.setViewName("/epostRcptReg/epostRcptReg-main");
return mav.addObject("epostRcptRegList", toJson(mav.getModel().get("epostRcptRegList")));
}
/** .<br />
* {@link EpostRcptRegService#getEpostRcptRegList(EpostRcptRegQuery)}
* @param req
* @return jsonView
* <pre><code> {
* "epostRcptRegList": [ ]
* "epostRcptRegStart":
* "epostRcptRegFetch":
* "epostRcptRegTotal":
* }</code></pre>
*/
public ModelAndView getEpostRcptRegList(EpostQuery req) {
List<?> result = epostRcptRegService.getEpostRcptRegList(setFetchSize(req));
return setCollectionInfo(new ModelAndView("jsonView"), result, "epostRcptReg");
}
/** .
* @param epostRcptReg
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
public ModelAndView createEpostRcptReg(EpostRcptReg epostRcptReg) {
boolean saved = epostRcptRegService.createEpostRcptReg(epostRcptReg);
return new ModelAndView("jsonView")
.addObject("saved", saved);
}
/** .
* @param epostRcptReg
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name = "전자우편 접수 등록 수정", value = "/update.do")
public ModelAndView updateEpostRcptReg(EpostRcptReg epostRcptReg) {
boolean saved = epostRcptRegService.updateEpostRcptReg(epostRcptReg);
return new ModelAndView("jsonView")
.addObject("saved", saved);
}
/** .
* @param epostRcptRegIDs
* @return jsonView
* <pre><code> {
* "affected":
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name = "전자우편 접수 등록 제거", value = "/remove.do")
public ModelAndView removeEpostRcptReg(EpostRcptReg epostRcptReg) {
boolean saved = epostRcptRegService.removeEpostRcptReg(epostRcptReg);
return new ModelAndView("jsonView")
.addObject("saved", saved);
}
}