From 4a50bd93dfcdedb85f117d25f89e67291eb65cf7 Mon Sep 17 00:00:00 2001
From: cjl <276999030@qq.com>
Date: Sat, 14 Oct 2023 10:55:51 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/cjl' into dev

---
 screen-job/src/main/java/com/moral/api/controller/PubController.java |   93 +++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 79 insertions(+), 14 deletions(-)

diff --git a/screen-job/src/main/java/com/moral/api/controller/PubController.java b/screen-job/src/main/java/com/moral/api/controller/PubController.java
index 7343dd5..5771894 100644
--- a/screen-job/src/main/java/com/moral/api/controller/PubController.java
+++ b/screen-job/src/main/java/com/moral/api/controller/PubController.java
@@ -1,20 +1,22 @@
 package com.moral.api.controller;
 
-import com.moral.api.service.HistoryDailyService;
-import com.moral.api.service.HistoryFiveMinutelyService;
+import com.moral.api.service.*;
+import com.moral.api.util.HttpUtils;
 import com.moral.constant.ResultMessage;
 import com.moral.util.DateUtils;
 import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpResponse;
+import org.apache.http.util.EntityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * @ClassName UserController
@@ -33,6 +35,16 @@
     @Autowired
     private HistoryFiveMinutelyService historyFiveMinutelyService;
 
+    @Autowired
+    private CityWeatherService cityWeatherService;
+    @Autowired
+    private ForecastService forecastService;
+
+    @Autowired
+    private HistoryAqiService historyAqiService;
+    @Autowired
+    private HistoryHourlyService historyHourlyService;
+
     @GetMapping("insertHistoryDaily")
     @ApiOperation(value = "���������������", notes = "���������������")
     public ResultMessage insertHistoryDaily(String time) {
@@ -41,24 +53,77 @@
         int i = 0;
         return new ResultMessage();
     }
+    @GetMapping("FiveMinutelyTest")
+    @ApiOperation(value = "5������������1", notes = "5������������1")
+    public ResultMessage FiveMinutelyTest(String yz,String mac) {
+        historyFiveMinutelyService.insertHistoryFiveMinutely(yz,mac);
+        return new ResultMessage();
+    }
 
-    @GetMapping("insertHistoryFiveMinutely")
-    @ApiOperation(value = "5������������", notes = "5������������")
-    public ResultMessage insertHistoryFiveMinutely() {
-        historyFiveMinutelyService.insertHistoryFiveMinutely();
+    @GetMapping("insertHistoryAqi")
+    @ApiOperation(value = "������������������", notes = "������������������")
+    public ResultMessage insertHistoryAqi(String time) {
+        historyAqiService.insertHistoryAqi(time);
+        return new ResultMessage();
+    }
+
+    @GetMapping("insertHCHistoryAqi")
+    @ApiOperation(value = "������������", notes = "������������")
+    public ResultMessage insertHCHistoryAqi() {
+        historyAqiService.insertHCHistoryAqi();
+        return new ResultMessage();
+    }
+    @GetMapping("dateToChangShu")
+    @ApiOperation(value = "������������������", notes = "������������������")
+    public ResultMessage dateToChangShu() {
+        historyHourlyService.dateToChangShu(null);
+        return new ResultMessage();
+    }
+
+    @GetMapping("forecastO3")
+    @ApiOperation(value = "O3������������������", notes = "O3")
+    public ResultMessage forecastO3() {
+        forecastService.forecastO3();
+        return new ResultMessage();
+    }
+    @GetMapping("insertCityWeather")
+    @ApiOperation(value = "������������������������", notes = "������������������������")
+    public ResultMessage insertCityWeather() {
+        cityWeatherService.insertCityWeather();
         return new ResultMessage();
     }
 
 
-
     public static void main(String[] args) {
-        String s = "2023-9-01";
-        Date d = DateUtils.getDate(s,"yyyy-MM-dd");
-        System.out.println(DateUtils.dateToDateFullString(d));
-        //System.out.println( DateUtils.dateToDateFullString(DateUtils.getDateOfDay(d, -1), "yyyy-MM-dd"));
+        String host = "https://pair.market.alicloudapi.com";
+        String path = "/api/v1/pair/station_list";
+        String method = "GET";
+        String appcode = "31b6ea8f804a4472be3b633cfee44849";
+        Map<String, String> headers = new HashMap<String, String>();
+        //���������header������������(���������������������)���Authorization:APPCODE 83359fd73fe94948385f570e3c139105
+        headers.put("Authorization", "APPCODE " + appcode);
+        Map<String, String> querys = new HashMap<String, String>();
+        querys.put("province", "���������");
 
 
-
+        try {
+            /**
+             * ������������������:
+             * HttpUtils������
+             * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/src/main/java/com/aliyun/api/gateway/demo/util/HttpUtils.java
+             * ������
+             *
+             * ������������������������
+             * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/pom.xml
+             */
+            HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys);
+            System.out.println(response.toString());
+            //������response���body
+            System.out.println(EntityUtils.toString(response.getEntity()));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
     }
 
+
 }

--
Gitblit v1.8.0