|
|
@@ -0,0 +1,54 @@
|
|
|
+package com.yunfeiyun.agmp.iotm.web.controller;
|
|
|
+
|
|
|
+import com.alibaba.fastjson2.JSONObject;
|
|
|
+import com.nlf.calendar.Lunar;
|
|
|
+import com.yunfeiyun.agmp.common.constant.ErrorCode;
|
|
|
+import com.yunfeiyun.agmp.common.core.controller.BaseController;
|
|
|
+import com.yunfeiyun.agmp.common.core.domain.AjaxResult;
|
|
|
+import com.yunfeiyun.agmp.common.exception.BizException;
|
|
|
+import com.yunfeiyun.agmp.common.service.WeatherService;
|
|
|
+import com.yunfeiyun.agmp.iotm.web.domain.reqvo.IotScreenStatReqVo;
|
|
|
+import com.yunfeiyun.agmp.iotm.web.domain.resvo.IotScreenDevStatResVo;
|
|
|
+import com.yunfeiyun.agmp.iotm.web.service.IIotScreenService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping("/iot/screen")
|
|
|
+public class IotScreenController extends BaseController {
|
|
|
+ @Autowired
|
|
|
+ private WeatherService weatherService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IIotScreenService iIotScreenService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询天气信息
|
|
|
+ * */
|
|
|
+
|
|
|
+ @GetMapping("/weather/info")
|
|
|
+ public AjaxResult weatherInfo() {
|
|
|
+ JSONObject result = weatherService.getProjectWeather();
|
|
|
+ if(result == null){
|
|
|
+ throw new BizException(ErrorCode.SYSTEM_ERROR);
|
|
|
+ }
|
|
|
+ Lunar chineseCalendar = new Lunar();
|
|
|
+ result.put("chineseCalendar",chineseCalendar.getMonthInChinese()+"月"+chineseCalendar.getDayInChinese());
|
|
|
+ return success(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取设备统计信息
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('iot:screen:dev:stat')")
|
|
|
+ @GetMapping("/dev/stat")
|
|
|
+ public AjaxResult devStat(IotScreenStatReqVo reqVo) {
|
|
|
+ IotScreenDevStatResVo devStatResVo = iIotScreenService.devStat(reqVo);
|
|
|
+ return success(devStatResVo);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|