소스 검색

feat(environment-service): 更新环境服务应用并优化 API 接口

- 在 EnvironmentApplication 中添加 com.zksy.api 包的扫描
- 移除 WarningThresholdController 中 API 接口参数的 example 属性
- 保留其他参数的 example 属性
林仔 9 달 전
부모
커밋
23c1c2d30e

+ 1 - 1
environment-service/src/main/java/com/zksy/environment/EnvironmentApplication.java

@@ -6,8 +6,8 @@ import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.scheduling.annotation.EnableAsync;
 
-@SpringBootApplication
 @MapperScan(basePackages = "com.zksy.environment.mapper")
+@SpringBootApplication(scanBasePackages = {"com.zksy.environment","com.zksy.api"})
 public class EnvironmentApplication {
     public static void main(String[] args) {
         SpringApplication.run(EnvironmentApplication.class, args);

+ 9 - 9
zk-api-service/src/main/java/com/zksy/api/controller/WarningThresholdController.java

@@ -27,19 +27,19 @@ public class WarningThresholdController {
     private WarningThresholdService service;
     @GetMapping("/findByPage")
     @ApiOperation(value = "预警阈值信息查询分页")
-    public AjaxResult findByPage(@ApiParam(value = "页码", example = "1", required = true)long pageNum,
-                                 @ApiParam(value = "页数", example = "10", required = true)long pageSize, @ApiParam(value = "设备名称", example = "反应釜A", required = false)String deviceName,
-                                 @ApiParam(value = "设备编码", example = "EQ-2023-001", required = false)String deviceCode,
-                                 @ApiParam(value = "预警类型", example = "温度预警", allowableValues = "温度预警,压力预警,湿度预警", required = false) String warningType,
-                                 @ApiParam(value = "预警编码", example = "WARN-TEMP-001", required = false) String warningCode){
+    public AjaxResult findByPage(@ApiParam(value = "页码", required = true)long pageNum,
+                                 @ApiParam(value = "页数", required = true)long pageSize, @ApiParam(value = "设备名称", example = "反应釜A", required = false)String deviceName,
+                                 @ApiParam(value = "设备编码", required = false)String deviceCode,
+                                 @ApiParam(value = "预警类型", allowableValues = "温度预警,压力预警,湿度预警", required = false) String warningType,
+                                 @ApiParam(value = "预警编码", required = false) String warningCode){
         return AjaxResult.success(service.findByPage(pageNum, pageSize, deviceName,deviceCode,warningType,warningCode));
     }
     @GetMapping("/getWarningThresholdList")
     @ApiOperation(value = "预警阈值信息查询")
-    public AjaxResult getWarningThresholdList(@ApiParam(value = "设备名称", example = "反应釜A", required = false)String deviceName,
-                                              @ApiParam(value = "设备编码", example = "EQ-2023-001", required = false)String deviceCode,
-                                              @ApiParam(value = "预警类型", example = "温度预警", allowableValues = "温度预警,压力预警,湿度预警", required = false) String warningType,
-                                              @ApiParam(value = "预警编码", example = "WARN-TEMP-001", required = false) String warningCode
+    public AjaxResult getWarningThresholdList(@ApiParam(value = "设备名称", required = false)String deviceName,
+                                              @ApiParam(value = "设备编码",  required = false)String deviceCode,
+                                              @ApiParam(value = "预警类型",  allowableValues = "温度预警,压力预警,湿度预警", required = false) String warningType,
+                                              @ApiParam(value = "预警编码",  required = false) String warningCode
     ){
         return AjaxResult.success(service.getWarningThresholdList(deviceName,deviceCode,warningType,warningCode));
     }