|
@@ -2,7 +2,10 @@ package com.fdkankan.fusion.controller;
|
|
|
|
|
|
|
|
|
import com.fdkankan.fusion.common.RequestBase;
|
|
|
+import com.fdkankan.fusion.common.ResultCode;
|
|
|
import com.fdkankan.fusion.common.ResultData;
|
|
|
+import com.fdkankan.fusion.entity.CaseImg;
|
|
|
+import com.fdkankan.fusion.exception.BusinessException;
|
|
|
import com.fdkankan.fusion.request.CaseImgParam;
|
|
|
import com.fdkankan.fusion.service.ICaseImgService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -24,12 +27,25 @@ public class CaseImgController {
|
|
|
ICaseImgService caseImgService;
|
|
|
|
|
|
|
|
|
- @PostMapping("/allList")
|
|
|
- public ResultData allList(@RequestBody CaseImgParam param){
|
|
|
+ @PostMapping("/list")
|
|
|
+ public ResultData list(@RequestBody CaseImgParam param){
|
|
|
|
|
|
return ResultData.ok(caseImgService.getByCaseId(param));
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/saveOrUpdate")
|
|
|
+ public ResultData saveOrUpdate(@RequestBody CaseImg caseImg){
|
|
|
+
|
|
|
+ return ResultData.ok(caseImgService.saveOrUpdate(caseImg));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/delete")
|
|
|
+ public ResultData delete(@RequestBody CaseImg caseImg){
|
|
|
+ if(caseImg.getId() == null){
|
|
|
+ throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
+ }
|
|
|
+ return ResultData.ok(caseImgService.removeById(caseImg.getId()));
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|