File was renamed from src/main/java/com/ycl/jxkg/controller/admin/EducationController.java |
| | |
| | | import java.util.List; |
| | | |
| | | @RequiredArgsConstructor |
| | | @RestController("AdminEducationController") |
| | | @RequestMapping(value = "/api/admin/education") |
| | | public class EducationController extends BaseApiController { |
| | | @RestController("AdminSubjectController") |
| | | @RequestMapping(value = "/api/admin/subject") |
| | | public class SubjectController extends BaseApiController { |
| | | |
| | | private final SubjectService subjectService; |
| | | |
| | | @RequestMapping(value = "/subject/list", method = RequestMethod.POST) |
| | | @RequestMapping(value = "/list", method = RequestMethod.POST) |
| | | public Result<List<Subject>> list() { |
| | | List<Subject> subjects = subjectService.allSubject(); |
| | | return Result.ok(subjects); |
| | | } |
| | | |
| | | @RequestMapping(value = "/subject/page", method = RequestMethod.POST) |
| | | @RequestMapping(value = "/page", method = RequestMethod.POST) |
| | | public Result<PageInfo<SubjectResponseVO>> pageList(@RequestBody SubjectPageRequestVO model) { |
| | | PageInfo<Subject> pageInfo = subjectService.page(model); |
| | | PageInfo<SubjectResponseVO> page = PageInfoHelper.copyMap(pageInfo, e -> { |
| | |
| | | return Result.ok(page); |
| | | } |
| | | |
| | | @RequestMapping(value = "/subject/edit", method = RequestMethod.POST) |
| | | @RequestMapping(value = "/edit", method = RequestMethod.POST) |
| | | public Result edit(@RequestBody @Valid SubjectEditRequestVO model) { |
| | | Subject subject = new Subject(); |
| | | BeanUtils.copyProperties(model, subject); |
| | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/subject/select/{id}", method = RequestMethod.POST) |
| | | @RequestMapping(value = "/select/{id}", method = RequestMethod.POST) |
| | | public Result<SubjectEditRequestVO> select(@PathVariable Integer id) { |
| | | Subject subject = subjectService.getById(id); |
| | | SubjectEditRequestVO vo = new SubjectEditRequestVO(); |
| | |
| | | return Result.ok(vo); |
| | | } |
| | | |
| | | @RequestMapping(value = "/subject/delete/{id}", method = RequestMethod.POST) |
| | | @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST) |
| | | public Result delete(@PathVariable Integer id) { |
| | | Subject subject = subjectService.getById(id); |
| | | subjectService.updateById(subject); |