kaiyu
2022-03-14 5236663d1e40ca9ed0cbc0885cbc67a67c47943f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package com.moral.api.controller;
 
import com.fasterxml.jackson.annotation.JsonFormat;
import com.moral.api.config.properties.BulletinProperties;
import com.moral.api.config.properties.SpecialCitiesProperties;
import com.moral.api.service.CityAqiDailyService;
import com.moral.constant.ResultMessage;
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.CrossOrigin;
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.List;
 
/**
 * @ClassName
 * @Description 公告controller
 * @Author 陈凯裕
 * @Date 2022/3/11 14:53
 * @Version TODO
 **/
@RestController
@RequestMapping("/bulletin")
@CrossOrigin(origins = "*", maxAge = 3600)
public class BulletinController {
 
    @Autowired
    CityAqiDailyService cityAqiDailyService;
    @Autowired
    BulletinProperties bulletinProperties;
    @Autowired
    SpecialCitiesProperties specialCitiesProperties;
 
    /**
    * @Description: 根据地区和时间查询空气质量简报
            * @Param: [regionCode, time]
            * @return: com.moral.constant.ResultMessage
            * @Author: 陈凯裕
            * @Date: 2022/3/11
            */
    @GetMapping("airQualityBulletin")
    public ResultMessage airQualityBulletin(String regionCode,
                                            @DateTimeFormat(pattern = "yyyy-MM-dd") Date time) {
        List<String> strings = cityAqiDailyService.airQualityBulletin(regionCode, time);
        return ResultMessage.ok(strings);
    }
}