|
|
@@ -24,6 +24,7 @@ import java.util.List;
|
|
|
* @since 2023-06-27
|
|
|
*/
|
|
|
@RestController
|
|
|
+@RequestMapping("/charge")
|
|
|
public class ChargerController {
|
|
|
|
|
|
@Autowired
|
|
|
@@ -40,7 +41,7 @@ public class ChargerController {
|
|
|
|
|
|
@SneakyThrows
|
|
|
@ApiLog("充电站列表")
|
|
|
- @GetMapping("/api/charge/listStation")
|
|
|
+ @GetMapping("/listStation")
|
|
|
R listChargeStation(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
|
|
// 请求en+接口
|
|
|
List<Station> response = stationService.queryStationInfo(pageNum, pageSize);
|
|
|
@@ -48,39 +49,39 @@ public class ChargerController {
|
|
|
}
|
|
|
|
|
|
@ApiLog("充电站状态")
|
|
|
- @GetMapping("/api/charge/stationStatus")
|
|
|
+ @GetMapping("/stationStatus")
|
|
|
R stationStatus(@RequestParam("stationIds") String ids) {
|
|
|
// 请求en+接口
|
|
|
var response = stationService.stationStatus(ids.split(","));
|
|
|
return R.success(response);
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/api/charge/token")
|
|
|
+ @GetMapping("/token")
|
|
|
R<String> queryToken() {
|
|
|
return R.success(enPlusService.queryToken());
|
|
|
}
|
|
|
|
|
|
@ApiLog("启动充电")
|
|
|
- @GetMapping("/api/charge/startCharge")
|
|
|
+ @GetMapping("/startCharge")
|
|
|
R startCharge(@RequestParam("connectorId") String connectorId, @RequestParam("stationId") String stationId) {
|
|
|
return R.success(chargeService.queryStartCharge(connectorId, stationId));
|
|
|
}
|
|
|
|
|
|
@ApiLog("停止充电")
|
|
|
- @GetMapping("/api/charge/stopCharge/{connectorId}")
|
|
|
+ @GetMapping("/stopCharge/{connectorId}")
|
|
|
R stopCharge(@PathVariable("connectorId") String connectorId) {
|
|
|
chargeService.queryStopCharge(connectorId);
|
|
|
return R.success();
|
|
|
}
|
|
|
|
|
|
@ApiLog("查询充电状态")
|
|
|
- @GetMapping("/api/charge/chargeStatus/{startChargeSeq}")
|
|
|
+ @GetMapping("/chargeStatus/{startChargeSeq}")
|
|
|
R<ChargeOrder> chargeStatus(@PathVariable("startChargeSeq") String startChargeSeq) {
|
|
|
return R.success(chargeService.queryEquipChargeStatus(startChargeSeq));
|
|
|
}
|
|
|
|
|
|
@ApiLog("查询设备充电策略")
|
|
|
- @GetMapping("/api/charge/businessPolicy/{connectorId}")
|
|
|
+ @GetMapping("/businessPolicy/{connectorId}")
|
|
|
R businessPolicy(@PathVariable("connectorId") String connectorId) {
|
|
|
return R.success(chargeService.queryEquipBusinessPolicy(connectorId));
|
|
|
}
|
|
|
@@ -98,7 +99,7 @@ public class ChargerController {
|
|
|
* @return 0:接收 1:丢弃/忽略,不需要重试
|
|
|
*/
|
|
|
@ApiLog("EN+设备状态变化推送")
|
|
|
- @PostMapping("/charge/notification_stationStatus")
|
|
|
+ @PostMapping("/notification_stationStatus")
|
|
|
JSONObject notificationStationStatus(@RequestBody JSONObject json) {
|
|
|
// TODO: 2023-08-05 验签 业务逻辑
|
|
|
|
|
|
@@ -114,7 +115,7 @@ public class ChargerController {
|
|
|
* @return StartChargeSeq SuccStat 0:成功 1:失败 FailReason 0:无 1:接收失败
|
|
|
*/
|
|
|
@ApiLog("EN+推送启动充电结果")
|
|
|
- @PostMapping("/charge/notification_start_charge_result")
|
|
|
+ @PostMapping("/notification_start_charge_result")
|
|
|
@ResponseBody
|
|
|
EnResponse notificationStartChargeResult(@RequestBody JSONObject json) {
|
|
|
return new EnResponse(enNotifyService.handleNotificationStartChargeResult(json));
|
|
|
@@ -127,12 +128,14 @@ public class ChargerController {
|
|
|
* @param json
|
|
|
* @return
|
|
|
*/
|
|
|
- @ApiLog("EN+推送启动充电结果")
|
|
|
- @PostMapping("/charge/notification_start_charge_status")
|
|
|
- EnResponse notificationStartChargeStatus(@RequestBody JSONObject json) {
|
|
|
+ @ApiLog("EN+推送启动充电状态")
|
|
|
+ @PostMapping("/notification_equip_charge_status")
|
|
|
+ EnResponse notificationEquipChargeStatus(@RequestBody JSONObject json) {
|
|
|
return new EnResponse(enNotifyService.handleNotificationEquipChargeStatus(json));
|
|
|
}
|
|
|
|
|
|
+ // TODO: 2023-08-21 推送启动充电结果
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 推送停止充电结果
|
|
|
@@ -140,7 +143,7 @@ public class ChargerController {
|
|
|
* @param json
|
|
|
* @return
|
|
|
*/
|
|
|
- @PostMapping("/charge/notification_stop_charge_result")
|
|
|
+ @PostMapping("/notification_stop_charge_result")
|
|
|
EnResponse notificationStopChargeResult(@RequestBody JSONObject json) {
|
|
|
return new EnResponse(enNotifyService.handleNotificationStopChargeResult(json));
|
|
|
}
|
|
|
@@ -151,7 +154,7 @@ public class ChargerController {
|
|
|
* @param json
|
|
|
* @return
|
|
|
*/
|
|
|
- @PostMapping("/charge/notification_charge_order_info")
|
|
|
+ @PostMapping("/notification_charge_order_info")
|
|
|
EnResponse notificationChargeOrderInfo(@RequestBody JSONObject json) {
|
|
|
return new EnResponse(enNotifyService.handleNotificationChargeOrderInfo(json));
|
|
|
}
|
|
|
@@ -164,7 +167,7 @@ public class ChargerController {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- @GetMapping("/charge/pullEnStations")
|
|
|
+ @GetMapping("/pullEnStations")
|
|
|
R pullEnStationInfos() {
|
|
|
stationService.pullEnStationInfos();
|
|
|
return R.success();
|