From 495822addbab0ac68f4cc790704346a7726277c6 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期一, 03 六月 2024 11:43:42 +0800
Subject: [PATCH] 注册接口放行
---
src/main/java/com/ycl/jxkg/controller/admin/EducationController.java | 28 +++++++++++-----------------
1 files changed, 11 insertions(+), 17 deletions(-)
diff --git a/src/main/java/com/ycl/jxkg/controller/admin/EducationController.java b/src/main/java/com/ycl/jxkg/controller/admin/EducationController.java
index e6cc819..b4beeab 100644
--- a/src/main/java/com/ycl/jxkg/controller/admin/EducationController.java
+++ b/src/main/java/com/ycl/jxkg/controller/admin/EducationController.java
@@ -3,30 +3,26 @@
import com.ycl.jxkg.base.BaseApiController;
import com.ycl.jxkg.base.Result;
-import com.ycl.jxkg.domain.Subject;
+import com.ycl.jxkg.domain.entity.Subject;
import com.ycl.jxkg.service.SubjectService;
import com.ycl.jxkg.utils.PageInfoHelper;
-import com.ycl.jxkg.vo.admin.education.SubjectEditRequestVO;
-import com.ycl.jxkg.vo.admin.education.SubjectPageRequestVO;
-import com.ycl.jxkg.vo.admin.education.SubjectResponseVO;
+import com.ycl.jxkg.domain.vo.admin.education.SubjectEditRequestVO;
+import com.ycl.jxkg.domain.vo.admin.education.SubjectPageRequestVO;
+import com.ycl.jxkg.domain.vo.admin.education.SubjectResponseVO;
import com.github.pagehelper.PageInfo;
+import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
+@RequiredArgsConstructor
@RestController("AdminEducationController")
@RequestMapping(value = "/api/admin/education")
public class EducationController extends BaseApiController {
private final SubjectService subjectService;
-
- @Autowired
- public EducationController(SubjectService subjectService) {
- this.subjectService = subjectService;
- }
@RequestMapping(value = "/subject/list", method = RequestMethod.POST)
public Result<List<Subject>> list() {
@@ -50,17 +46,16 @@
Subject subject = new Subject();
BeanUtils.copyProperties(model, subject);
if (model.getId() == null) {
- subject.setDeleted(false);
- subjectService.insertByFilter(subject);
+ subjectService.save(subject);
} else {
- subjectService.updateByIdFilter(subject);
+ subjectService.updateById(subject);
}
return Result.ok();
}
@RequestMapping(value = "/subject/select/{id}", method = RequestMethod.POST)
public Result<SubjectEditRequestVO> select(@PathVariable Integer id) {
- Subject subject = subjectService.selectById(id);
+ Subject subject = subjectService.getById(id);
SubjectEditRequestVO vo = new SubjectEditRequestVO();
BeanUtils.copyProperties(subject, vo);
return Result.ok(vo);
@@ -68,9 +63,8 @@
@RequestMapping(value = "/subject/delete/{id}", method = RequestMethod.POST)
public Result delete(@PathVariable Integer id) {
- Subject subject = subjectService.selectById(id);
- subject.setDeleted(true);
- subjectService.updateByIdFilter(subject);
+ Subject subject = subjectService.getById(id);
+ subjectService.updateById(subject);
return Result.ok();
}
}
--
Gitblit v1.8.0