From 8c189b243bfbbacb2ab1ce79f4e1ff22708f125a Mon Sep 17 00:00:00 2001
From: whycxzp <perryhsu@163.com>
Date: 星期一, 26 七月 2021 16:45:09 +0800
Subject: [PATCH] 修复接口

---
 src/main/java/com/whyc/controller/AFEInverterController.java |   60 +++++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 51 insertions(+), 9 deletions(-)

diff --git a/src/main/java/com/whyc/controller/AFEInverterController.java b/src/main/java/com/whyc/controller/AFEInverterController.java
index 5586fa7..13dcfd7 100644
--- a/src/main/java/com/whyc/controller/AFEInverterController.java
+++ b/src/main/java/com/whyc/controller/AFEInverterController.java
@@ -1,18 +1,37 @@
 package com.whyc.controller;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageInfo;
 import com.whyc.dto.Response;
+import com.whyc.pojo.AFEInverterState;
 import com.whyc.service.AFEInverterService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import jdk.nashorn.internal.objects.annotations.Getter;
 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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 鐗瑰埆娉ㄦ剰:
+ * 閫氳鍗忚涓�:
+ * 鏈夊姛鍔熺巼鍗曚綅涓�0.1kW
+ * 杈撳嚭鐢垫祦鍗曚綅涓�0.1A
+ *
+ * web椤甸潰绔�:
+ * 鏈夊姛鍔熺巼鍗曚綅涓簁W
+ * 杈撳嚭鐢垫祦鍗曚綅涓篈
+ *
+ * 鏁�:
+ * 鏌ヨ鏃�,闇�瑕佸皢杩欎袱涓瓧娈电粨鏋�,*0.1
+ * TODO
+ */
 @RestController
 @RequestMapping("afeInverter")
-@Api(tags = "afe鍙橀鍣�-閫嗗彉鍣ㄧ殑瀹炴椂鏁版嵁淇℃伅")
+@Api(tags = "afe鍙橀鍣�-閫嗗彉鍣ㄧ殑鏁版嵁淇℃伅")
 public class AFEInverterController {
 
     @Autowired
@@ -24,10 +43,33 @@
         return service.getAll(pageNum,pageSize);
     }
 
-    @GetMapping("all2")
-    @ApiOperation(value="鏌ヨ鎵�鏈�")
-    public Response getAll2(@RequestParam int pageNum,int pageSize){
-        return service.getAll2(pageNum,pageSize);
+    @GetMapping("infoByDeviceId")
+    @ApiOperation(value = "鏌ヨ鍗曚釜:鏍规嵁璁惧id")
+    public Response<AFEInverterState> getInfoByDeviceId(@RequestParam int devId){
+        return service.getInfoByDeviceId(devId);
+    }
+
+    @GetMapping("field")
+    @ApiOperation(value = "鏌ヨ鍛婅闃堝�煎瓧娈�")
+    public Response<Map<String, List>> getField(){
+        return service.getField();
+    }
+
+    @GetMapping("tableNames")
+    @ApiOperation(value = "鏌ヨ鍘嗗彶璁板綍瀛樺湪鐨勮〃")
+    public Response<String> getTableNames(){
+        return service.getTableNames();
+    }
+
+    /**
+     * ======History======
+     * 鍘嗗彶鏌ヨ鏃�,鍥犱负鍘嗗彶璁板綍鏄寜鐓ф棩鏈熷垎琛ㄧ殑,濡傛灉鏌ヨ鎵�鏈夌殑鏃ユ湡琛�(union)鍚庡啀鍒嗛〉,浼氬鑷撮�熷害鏋佹參,鏁呮煡璇㈡寜鐓у崟涓棩鏈熸煡璇�
+     * TODO 寰呯‘瀹氭槸鍚﹂渶瑕佸姞涓婃棩鏈�
+     * */
+    @GetMapping("history/all")
+    @ApiOperation(value = "鏌ヨ鍘嗗彶璁板綍")
+    public Response<PageInfo<AFEInverterState>> getHistory(@RequestParam int pageNum, int pageSize,int devId){
+        return service.getHistory(pageNum,pageSize,devId);
     }
 
 }

--
Gitblit v1.9.1