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/AFERectifierController.java | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 46 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/whyc/controller/AFERectifierController.java b/src/main/java/com/whyc/controller/AFERectifierController.java index def8c6f..b3c6ac5 100644 --- a/src/main/java/com/whyc/controller/AFERectifierController.java +++ b/src/main/java/com/whyc/controller/AFERectifierController.java @@ -1,13 +1,57 @@ package com.whyc.controller; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.pagehelper.PageInfo; +import com.whyc.dto.Response; +import com.whyc.pojo.AFEInverterState; +import com.whyc.pojo.AFERectifierState; +import com.whyc.service.AFERectifierService; import io.swagger.annotations.Api; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("afeRectifier") @Api(tags = "afe鍙橀鍣�-鏁存祦鍣ㄧ殑鏁版嵁淇℃伅") public class AFERectifierController { + @Autowired + AFERectifierService service; + + @GetMapping("all") + @ApiOperation(value = "鏌ヨ鎵�鏈夋暟鎹俊鎭�") + public Response<IPage<AFERectifierState>> getAll(@RequestParam int pageNum, int pageSize){ + return service.getAll(pageNum,pageSize); + } + + @GetMapping("infoByDevId") + @ApiOperation(value = "鏌ヨ鍗曚釜鏁版嵁淇℃伅:鏍规嵁璁惧id") + public Response<AFERectifierState> getInfoByDevId(@RequestParam int devId){ + return service.getInfoByDevId(devId); + } + + @PutMapping("updateState1") + @ApiOperation(value = "鏇存柊鏁存祦鐘舵��-婕旂ず浣跨敤") + public Response updateState1(@RequestParam int devId,@RequestParam int rectifierRun){ + return service.updateState1(devId,rectifierRun); + } + + @PutMapping("updateState2") + @ApiOperation(value = "鏇存柊閫嗗彉鐘舵��-婕旂ず浣跨敤") + public Response updateState2(@RequestParam int devId,@RequestParam int inverterRun){ + return service.updateState2(devId,inverterRun); + } + + /** + * ======History====== + * 鍘嗗彶鏌ヨ鏃�,鍥犱负鍘嗗彶璁板綍鏄寜鐓ф棩鏈熷垎琛ㄧ殑,濡傛灉鏌ヨ鎵�鏈夌殑鏃ユ湡琛�(union)鍚庡啀鍒嗛〉,浼氬鑷撮�熷害鏋佹參,鏁呮煡璇㈡寜鐓у崟涓棩鏈熸煡璇� + * TODO 寰呯‘瀹氭槸鍚﹂渶瑕佸姞涓婃棩鏈� + * */ + @GetMapping("history/all") + @ApiOperation(value = "鏌ヨ鍘嗗彶璁板綍") + public Response<PageInfo<AFERectifierState>> getHistory(@RequestParam int pageNum, int pageSize, int devId){ + return service.getHistory(pageNum,pageSize,devId); + } } -- Gitblit v1.9.1