WeatherController.java
807 Bytes
package com.viontech.controller;
import com.viontech.service.impl.WeatherService;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* @author HlQ
* @date 2021/8/4
*/
@RestController
public class WeatherController {
@Resource
private WeatherService weatherService;
@GetMapping("/getWeather")
public Object get() {
System.out.println("手动调用天气");
try {
weatherService.getWeatherInfo();
} catch (IOException e) {
e.printStackTrace();
}
return "手动调用成功";
}
}