From 6a4f68b8f99dca3a00c297cbcff82c065575212c Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期六, 16 八月 2025 11:25:20 +0800
Subject: [PATCH] 1、完善代码;2、作物去除lat属性,采用关联气象站的lat;3、project模块增加查询全部气象站的方法。
---
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherCtrl.java | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 55 insertions(+), 3 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherCtrl.java
index f40de60..523d071 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/mqtt/weather/WeatherCtrl.java
@@ -3,8 +3,11 @@
import com.dy.common.aop.SsoAop;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
+import com.dy.common.webUtil.QueryResultVo;
import com.dy.common.webUtil.ResultCodeMsg;
import com.dy.pipIrrGlobal.pojoPr.PrStWeather;
+import com.dy.pipIrrGlobal.voPr.VoWeather;
+import com.dy.pipIrrProject.mqtt.manure.QueryVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -19,6 +22,7 @@
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
+import java.util.List;
import java.util.Objects;
/**
@@ -39,6 +43,54 @@
this.sv = sv ;
}
+ /**
+ * 鏌ヨ鍏ㄩ儴姘旇薄绔欒褰�
+ * @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 = VoWeather.class))}
+ )
+ })
+ @GetMapping(path = "/all")
+ @SsoAop()
+ public BaseResponse<List<VoWeather>> all(){
+ try {
+ return BaseResponseUtils.buildSuccess(this.sv.allSimple());
+ } catch (Exception e) {
+ log.error("鑾峰彇姘旇薄绔欒褰曞紓甯�", e);
+ return BaseResponseUtils.buildException(e.getMessage()) ;
+ }
+ }
+
+ /**
+ * 鍒嗛〉鏌ヨ姘旇薄绔欒褰�
+ * @param vo
+ * @return
+ */
+ @Operation(summary = "鑾峰緱涓�椤垫皵璞$珯璁板綍", description = "杩斿洖涓�椤垫皵璞$珯鏁版嵁")
+ @ApiResponses(value = {
+ @ApiResponse(
+ responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
+ description = "杩斿洖涓�椤垫皵璞$珯鏁版嵁锛圔aseResponse.content:QueryResultVo[{}]锛�",
+ content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
+ schema = @Schema(implementation = VoWeather.class))}
+ )
+ })
+ @GetMapping(path = "/some")
+ @SsoAop()
+ public BaseResponse<QueryResultVo<List<VoWeather>>> some(QueryVo vo){
+ try {
+ return BaseResponseUtils.buildSuccess(this.sv.selectSome(vo));
+ } catch (Exception e) {
+ log.error("鑾峰彇姘旇薄绔欒褰曞紓甯�", e);
+ return BaseResponseUtils.buildException(e.getMessage()) ;
+ }
+ }
/**
* 寰楀埌涓�濂楁皵璞$珯鏁版嵁
@@ -50,13 +102,13 @@
responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
description = "杩斿洖涓�濂楁皵璞$珯鏁版嵁锛圔aseResponse.content:{}锛�",
content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
- schema = @Schema(implementation = PrStWeather.class))}
+ schema = @Schema(implementation = VoWeather.class))}
)
})
@GetMapping(path = "one")
@SsoAop()
- public BaseResponse<PrStWeather> one(Long id){
- return BaseResponseUtils.buildSuccess(this.sv.selectById(id));
+ public BaseResponse<VoWeather> one(Long id){
+ return BaseResponseUtils.buildSuccess(this.sv.selectOne(id));
}
/**
--
Gitblit v1.8.0