Commit 8a4d8cfc by zhouhaibao

[+]代码修复

1 parent 9b87d80a
...@@ -22,11 +22,6 @@ ...@@ -22,11 +22,6 @@
<groupId>com.glsx</groupId> <groupId>com.glsx</groupId>
<artifactId>rest-admin-feign</artifactId> <artifactId>rest-admin-feign</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestParam;
/** /**
* @author payu * @author payu
*/ */
@FeignClient(name = "platform-charging-server", contextId = "pilecontrol", path = "/api/user/", decode404 = true) @FeignClient(name = "platform-charging", contextId = "pilecontrol", path = "/api/pilecontrol/", decode404 = true)
public interface PileControlFeignClient { public interface PileControlFeignClient {
/** /**
......
...@@ -117,6 +117,11 @@ ...@@ -117,6 +117,11 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -28,6 +28,7 @@ import javax.annotation.Resource; ...@@ -28,6 +28,7 @@ import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -40,7 +41,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -40,7 +41,7 @@ import org.springframework.web.bind.annotation.RestController;
@Slf4j @Slf4j
@Tag(name = "充电桩开放接口") @Tag(name = "充电桩开放接口")
@RestController @RestController
@RequestMapping(value = "/pilecontro") @RequestMapping(value = "/api/pilecontro")
@ResponseResultBody @ResponseResultBody
public class PileControlApiController implements PileControlFeignClient { public class PileControlApiController implements PileControlFeignClient {
...@@ -48,7 +49,7 @@ public class PileControlApiController implements PileControlFeignClient { ...@@ -48,7 +49,7 @@ public class PileControlApiController implements PileControlFeignClient {
private UserDemoService userDemoService; private UserDemoService userDemoService;
@Override @Override
public Result<Boolean> start(StartBo startBo) { public Result<Boolean> start(@RequestBody StartBo startBo) {
log.info("启动充电桩请求入参{}", JSONObject.toJSONString(startBo)); log.info("启动充电桩请求入参{}", JSONObject.toJSONString(startBo));
StartMachineReq req = new StartMachineReq(); StartMachineReq req = new StartMachineReq();
StartMachineReqData data = new StartMachineReqData(); StartMachineReqData data = new StartMachineReqData();
...@@ -71,7 +72,7 @@ public class PileControlApiController implements PileControlFeignClient { ...@@ -71,7 +72,7 @@ public class PileControlApiController implements PileControlFeignClient {
} }
@Override @Override
public Result<Boolean> end(EndBo endBo) { public Result<Boolean> end(@RequestBody EndBo endBo) {
log.info("停止充电桩请求入参{}", JSONObject.toJSONString(endBo)); log.info("停止充电桩请求入参{}", JSONObject.toJSONString(endBo));
ShutdownMachineReq req = new ShutdownMachineReq(); ShutdownMachineReq req = new ShutdownMachineReq();
ShutdownMachineReqData data = new ShutdownMachineReqData(); ShutdownMachineReqData data = new ShutdownMachineReqData();
...@@ -84,7 +85,7 @@ public class PileControlApiController implements PileControlFeignClient { ...@@ -84,7 +85,7 @@ public class PileControlApiController implements PileControlFeignClient {
} }
@Override @Override
public Result<Boolean> pileStart(StartBo startBo) { public Result<Boolean> pileStart(@RequestBody StartBo startBo) {
AdminSwipeConfirmRsp rsp = new AdminSwipeConfirmRsp(); AdminSwipeConfirmRsp rsp = new AdminSwipeConfirmRsp();
AdminSwipeConfirmRspData data = new AdminSwipeConfirmRspData(); AdminSwipeConfirmRspData data = new AdminSwipeConfirmRspData();
data.setPileId(Ocpp16Helper.strToBcd(startBo.getPileId(), data.getPileId())); data.setPileId(Ocpp16Helper.strToBcd(startBo.getPileId(), data.getPileId()));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!