huangjn 3 سال پیش
والد
کامیت
8f534317a2

+ 12 - 3
blade-service/blade-business/src/main/java/org/springblade/business/controller/WeatherController.java

@@ -1,6 +1,9 @@
 package org.springblade.business.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
@@ -29,6 +32,7 @@ import java.util.Map;
 @RestController
 @AllArgsConstructor
 @RequestMapping(value = "weather")
+@Api(value = "", tags = "天气台账接口")
 public class WeatherController {
 
     private WeatherInfoService weatherInfoService;
@@ -39,7 +43,8 @@ public class WeatherController {
      * @return 删除结果
      */
     @PostMapping(value = "removeWeatherByIds")
-    public R<Boolean> removeWeatherByIds(@RequestParam String ids){
+    @ApiOperation(value = "删除(批量或单个)", notes = "传入ids")
+    public R<Boolean> removeWeatherByIds(@ApiParam(value = "主键集合", required = true) @RequestParam String ids){
         return R.status(this.weatherInfoService.removeBatchByIds(Func.toLongList(ids)));
     }
 
@@ -49,6 +54,7 @@ public class WeatherController {
      * @return 修改结果
      */
     @PostMapping(value = "updateWeatherById")
+    @ApiOperation(value = "修改", notes = "传入WeatherInfo")
     public R<Boolean> updateWeatherById(@RequestBody WeatherInfo weatherInfo){
         //记录修改时间及修改人
         setUserData(weatherInfo, true);
@@ -72,7 +78,8 @@ public class WeatherController {
      * @param query 分页条件
      * @return 查询结果
      */
-    @RequestMapping(value = "queryWeatherPage")
+    @GetMapping(value = "queryWeatherPage")
+    @ApiOperation(value = "天气台账列表分页", notes = "传入WeatherInfo")
     public R<IPage<WeatherInfo>> queryWeatherPage(WeatherInfoVo vo,Query query){
         Map<String,Object> weatherMap = new HashMap<>();
         if(StringUtils.isNotEmpty(vo.getRecordTime())){
@@ -103,7 +110,8 @@ public class WeatherController {
      * @param id 数据Id
      * @return 数据
      */
-    @RequestMapping(value = "queryWeatherById")
+    @PostMapping(value = "queryWeatherById")
+    @ApiOperation(value = "详情", notes = "传入WeatherInfo")
     public R<WeatherInfo> queryWeatherById(@RequestParam String id){
         try{
             return R.data(this.weatherInfoService.getById(id));
@@ -119,6 +127,7 @@ public class WeatherController {
      * @return 新增结果
      */
     @PostMapping(value = "saveWeatherInfo")
+    @ApiOperation(value = "新增", notes = "传入WeatherInfo")
     public R<Boolean> saveWeatherInfo(@RequestBody WeatherInfoVo weatherInfoVo){
         try{
             //todo 目前缺少合同段所在区域的地图编号及ID,所以暂时写死区域数据ID,之后修改为接口获取