gunshi-project-ss/src/main/java/com/gunshi/project/xyt/controller/WeatherController.java

46 lines
1.2 KiB
Java
Raw Normal View History

2024-07-09 11:28:36 +08:00
package com.gunshi.project.xyt.controller;
import com.gunshi.core.annotation.Post;
import com.gunshi.core.result.R;
import com.gunshi.project.xyt.entity.so.ShortWeatherSo;
import com.gunshi.project.xyt.entity.so.WeatherSo;
import com.gunshi.project.xyt.entity.vo.ForeRainVo;
import com.gunshi.project.xyt.service.ForecastService;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* Description:
* Created by wanyan on 2024/3/11
*
* @author wanyan
* @version 1.0
*/
@RestController
@RequestMapping("/weather")
@Tag(name = "天气预报")
public class WeatherController {
@Resource
private ForecastService forecastService;
@Post(path = "/fore", summary = "24小时")
public R<List<ForeRainVo>> fore(@RequestBody WeatherSo weatherSo) {
return R.ok(forecastService.fore(weatherSo));
}
@Post(path = "/short/fore", summary = "短临预报")
public R<List<ForeRainVo>> shortFore(@RequestBody ShortWeatherSo weatherSo) {
return R.ok(forecastService.shortFore(weatherSo));
}
}