36 lines
934 B
Java
36 lines
934 B
Java
package com.dbnt.faisp.codeMgt;
|
|
|
|
import com.dbnt.faisp.codeMgt.model.CodeCatg;
|
|
import com.dbnt.faisp.codeMgt.service.CodeMgtService;
|
|
import lombok.RequiredArgsConstructor;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
import java.util.List;
|
|
|
|
@RestController
|
|
@RequiredArgsConstructor
|
|
@RequestMapping("/codeMgt")
|
|
public class CodeMgtController {
|
|
|
|
private final CodeMgtService codeMgtService;
|
|
|
|
@GetMapping("/codeMgtPage")
|
|
public ModelAndView codeMgtPage() {
|
|
ModelAndView mav = new ModelAndView("adminPage/codeMgt/codeMgt");
|
|
return mav;
|
|
}
|
|
|
|
@PostMapping("/saveCode")
|
|
@ResponseBody
|
|
public String saveCode(@RequestBody List<CodeCatg> codeCategoryList){
|
|
codeMgtService.saveCode(codeCategoryList);
|
|
return "";
|
|
}
|
|
|
|
@GetMapping("/selectCodeCatgList")
|
|
public List<CodeCatg> selectCodeCatgList(){
|
|
return codeMgtService.selectCodeCatgAndChild();
|
|
}
|
|
}
|