From 00cf6de9f5e3152b6afb73f276dd27dfaf3de439 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期四, 14 八月 2025 11:38:24 +0800
Subject: [PATCH] 完善代码
---
pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/crops/CropsCtrl.java | 32 ++++++++++++++++++++++++++++----
1 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/crops/CropsCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/crops/CropsCtrl.java
index 3d8f8f7..5c94eeb 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/crops/CropsCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/crops/CropsCtrl.java
@@ -8,6 +8,7 @@
import com.dy.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.pojoMd.MdCrops;
import com.dy.pipIrrGlobal.voMd.VoCrops;
+import com.dy.pipIrrGlobal.voMd.VoParam;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -55,7 +56,7 @@
schema = @Schema(implementation = VoCrops.class))}
)
})
- @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
+ @GetMapping(path = "one")
@SsoAop()
public BaseResponse<VoCrops> one(Long id){
return BaseResponseUtils.buildSuccess(this.sv.selectById(id));
@@ -73,9 +74,9 @@
schema = @Schema(implementation = VoCrops.class))}
)
})
- @PostMapping(path = "some")
+ @GetMapping(path = "some")
@SsoAop()
- public BaseResponse<QueryResultVo<List<VoCrops>>> some(@RequestBody CropsQo qo){
+ public BaseResponse<QueryResultVo<List<VoCrops>>> some(CropsQo qo){
try {
QueryResultVo<List<VoCrops>> res = this.sv.selectSome(qo) ;
return BaseResponseUtils.buildSuccess(res);
@@ -84,7 +85,30 @@
return BaseResponseUtils.buildException(e.getMessage()) ;
}
}
-
+ /**
+ * 瀹㈡埛绔姹傚緱鍒版墍鏈変綔鐗╂暟鎹�
+ * @return 鎵�鏈変綔鐗╂暟鎹�
+ */
+ @Operation(summary = "鑾峰緱鎵�鏈変綔鐗�", description = "杩斿洖鎵�鏈変綔鐗╂暟鎹�")
+ @ApiResponses(value = {
+ @ApiResponse(
+ responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
+ description = "杩斿洖鎵�鏈変綔鐗╂暟鎹紙BaseResponse.content:QueryResultVo[{}]锛�",
+ content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
+ schema = @Schema(implementation = VoParam.class))}
+ )
+ })
+ @GetMapping(path = "all")
+ @SsoAop()
+ public BaseResponse<List<VoCrops>> all(){
+ try {
+ List<VoCrops> res = this.sv.selectAll() ;
+ return BaseResponseUtils.buildSuccess(res);
+ } catch (Exception e) {
+ log.error("鏌ヨ浣滅墿寮傚父", e);
+ return BaseResponseUtils.buildException(e.getMessage()) ;
+ }
+ }
/**
* 鏂板淇濆瓨浣滅墿
* @param po 鏂板淇濆瓨浣滅墿form琛ㄥ崟瀵硅薄
--
Gitblit v1.8.0