kcgFileManager/src/main/java/com/dbnt/kcgfilemanager/controller/adminController.java

70 lines
1.9 KiB
Java
Raw Normal View History

2021-11-30 10:05:43 +00:00
package com.dbnt.kcgfilemanager.controller;
2021-11-29 09:38:48 +00:00
2021-11-30 10:05:43 +00:00
import com.dbnt.kcgfilemanager.model.CommonCode;
import com.dbnt.kcgfilemanager.service.CommonCodeService;
2021-11-29 09:38:48 +00:00
import lombok.RequiredArgsConstructor;
2021-12-02 09:10:30 +00:00
import org.springframework.http.MediaType;
2021-12-01 09:54:01 +00:00
import org.springframework.web.bind.annotation.*;
2021-11-30 10:05:43 +00:00
import org.springframework.web.servlet.ModelAndView;
2021-12-02 09:10:30 +00:00
import javax.servlet.http.HttpServletRequest;
2021-12-01 09:54:01 +00:00
import javax.servlet.http.HttpServletResponse;
2021-12-02 09:10:30 +00:00
import java.util.ArrayList;
import java.util.HashMap;
2021-11-30 10:05:43 +00:00
import java.util.List;
2021-12-02 09:10:30 +00:00
import java.util.Map;
2021-11-29 09:38:48 +00:00
2021-12-02 09:10:30 +00:00
@RestController
2021-11-29 09:38:48 +00:00
@RequiredArgsConstructor
@RequestMapping("/admin")
public class adminController {
2021-11-30 10:05:43 +00:00
private final CommonCodeService commonCodeService;
2021-11-29 09:38:48 +00:00
@GetMapping("/main")
2021-12-02 09:10:30 +00:00
public ModelAndView goAdmin() {
ModelAndView mav = new ModelAndView("admin/main");
return mav;
2021-11-29 09:38:48 +00:00
}
@GetMapping("/userMgt")
2021-12-02 09:10:30 +00:00
public ModelAndView userMgt() {
ModelAndView mav = new ModelAndView("admin/userMgt");
return mav;
2021-11-29 09:38:48 +00:00
}
@GetMapping("/modifyRequest")
2021-12-02 09:10:30 +00:00
public ModelAndView modifyRequest() {
ModelAndView mav = new ModelAndView("admin/modifyRequest");
return mav;
2021-11-29 09:38:48 +00:00
}
@GetMapping("/codeMgt")
2021-11-30 10:05:43 +00:00
public ModelAndView codeMgt(CommonCode commonCode) {
ModelAndView mav = new ModelAndView("admin/codeMgt");
2021-12-01 09:54:01 +00:00
mav.addObject("categoryList", commonCodeService.selectCommonCodeCategory(commonCode));
2021-11-30 10:05:43 +00:00
return mav;
2021-11-29 09:38:48 +00:00
}
2021-12-01 09:54:01 +00:00
@GetMapping("/codeValue")
public ModelAndView codeValue(CommonCode commonCode) {
ModelAndView mav = new ModelAndView("admin/codeValue");
mav.addObject("valueList", commonCodeService.selectCommonCodeValue(commonCode));
return mav;
}
2021-12-03 01:08:44 +00:00
@PostMapping("/insertCode")
2021-12-02 09:10:30 +00:00
public CommonCode insertCommonCode(CommonCode commonCode){
2021-12-01 09:54:01 +00:00
commonCodeService.insertCommonCode(commonCode);
2021-12-02 09:10:30 +00:00
return commonCode;
2021-12-01 09:54:01 +00:00
}
2021-12-02 09:10:30 +00:00
2021-12-03 01:08:44 +00:00
@PutMapping(value = "/deleteCode")
2021-12-02 09:10:30 +00:00
@ResponseBody
2021-12-03 01:08:44 +00:00
public int deleteCommonCode(@RequestBody List<CommonCode> codeList) {
2021-12-02 09:10:30 +00:00
commonCodeService.updateCommonCode(codeList);
return codeList.size();
2021-12-01 09:54:01 +00:00
}
2021-12-02 09:10:30 +00:00
2021-11-29 09:38:48 +00:00
}