master
wenfei 3 months ago
parent c1ad5f6273
commit 23b238c6a7

@ -37,14 +37,14 @@ public class ScheduledService {
* @description: * @description:
* @Param: null * @Param: null
*/ */
@Scheduled(cron = "0 0 0/12 * * *") @Scheduled(cron = "0 0/1 * * * *")
public void getNmcWeatherProvince() { public void getNmcWeatherProvince() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
CmIp ipAddress = new CmIp(); CmIp ipAddress = new CmIp();
log.info("=====>>>>>使用cron:"+String.valueOf(System.currentTimeMillis())); log.info("=====>>>>>使用cron:"+String.valueOf(System.currentTimeMillis()));
Long addressId = 1L; Long addressId = 1L;
Gson gson = new Gson(); Gson gson = new Gson();
String ip = QueryHelper.queryIP(""); String ip = QueryHelper.queryIpHk("");
if(ip!=null){ if(ip!=null){
log.info("ip:"+ip); log.info("ip:"+ip);
} }

@ -40,8 +40,12 @@ public class QueryHelper {
System.out.println("url:"+url); System.out.println("url:"+url);
//String token = "b8b56497ffff4e110a3bf44193f7f751"; //String token = "b8b56497ffff4e110a3bf44193f7f751";
String token = "dfeaa72fc70037534c4b4e8d831a5207"; String token = "dfeaa72fc70037534c4b4e8d831a5207";
return get(url, token); return get(url, token);
} }
public static String queryIpHk(String ip) {
String url = "http://47.242.184.139:8088/ip2";
System.out.println("url:"+url);
String token = "dfeaa72fc70037534c4b4e8d831a5207";
return get(url,token);
}
} }
Loading…
Cancel
Save