liurunyu
2025-08-07 d55721924174387377c0bd0b7964a82d4629224a
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;
@@ -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表单对象