ChargingBusinessController.java 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. package com.zsElectric.boot.charging.controller;
  2. import com.zsElectric.boot.charging.service.ChargingBusinessService;
  3. import com.zsElectric.boot.charging.vo.ChargingPricePolicyVO;
  4. import com.zsElectric.boot.charging.vo.EquipmentAuthResponseVO;
  5. import com.zsElectric.boot.charging.vo.QueryStationStatusVO;
  6. import com.zsElectric.boot.charging.vo.QueryStationsInfoVO;
  7. import com.zsElectric.boot.common.util.electric.ApiToken;
  8. import com.zsElectric.boot.core.web.Result;
  9. import io.swagger.v3.oas.annotations.Operation;
  10. import io.swagger.v3.oas.annotations.media.Schema;
  11. import io.swagger.v3.oas.annotations.tags.Tag;
  12. import lombok.RequiredArgsConstructor;
  13. import lombok.extern.slf4j.Slf4j;
  14. import org.springframework.web.bind.annotation.GetMapping;
  15. import org.springframework.web.bind.annotation.RequestMapping;
  16. import org.springframework.web.bind.annotation.RequestParam;
  17. import org.springframework.web.bind.annotation.RestController;
  18. import java.util.List;
  19. @Slf4j
  20. @RestController
  21. @RequiredArgsConstructor
  22. @Tag(name = "充电业务相关接口")
  23. @RequestMapping("/dev/v1/linkData")
  24. public class ChargingBusinessController {
  25. private final ChargingBusinessService chargingBusinessService;
  26. /**
  27. * <p>获取token</p>
  28. * @author wzq
  29. * @return 获取到的token
  30. *
  31. */
  32. @Operation(summary = "获取token")
  33. @GetMapping("/queryToken")
  34. public Result<ApiToken> queryToken(){
  35. return Result.success(chargingBusinessService.queryToken());
  36. }
  37. /**
  38. * <p>查询业务策略信息</p>
  39. * @author SheepHy
  40. * @param EquipBizSeq 设备业务流水号
  41. * @param ConnectorID 充电设备接口编码
  42. * @return 返回值描述,如无返回值则为void 返回值为类则包含{@link ChargingPricePolicyVO}
  43. *
  44. */
  45. @Operation(summary = "查询业务策略信息")
  46. @GetMapping("/queryEquipBusinessPolicy")
  47. public Result<ChargingPricePolicyVO> queryEquipBusinessPolicy(@RequestParam("EquipBizSeq") @Schema(description = "设备业务流水号", example = "123456789123456789123456789") String EquipBizSeq,
  48. @RequestParam("ConnectorID") @Schema(description = "充电设备接口编码") String ConnectorID) throws Exception{
  49. return Result.success(chargingBusinessService.queryEquipBusinessPolicy(EquipBizSeq, ConnectorID));
  50. }
  51. /**
  52. * <p>请求设备认证</p>
  53. * @author SheepHy
  54. * @param EquipAuthSeq 设备认证流水号
  55. * @param ConnectorID 充电设备接口编码
  56. * @return 返回值描述,如无返回值则为void 返回值为类则包含{@link EquipmentAuthResponseVO}
  57. *
  58. */
  59. @Operation(summary = "查询业务策略信息")
  60. @GetMapping("/queryEquipAuth")
  61. public Result<EquipmentAuthResponseVO> queryEquipAuth(String EquipAuthSeq, String ConnectorID) throws Exception {
  62. return Result.success(chargingBusinessService.queryEquipAuth(EquipAuthSeq, ConnectorID));
  63. }
  64. /**
  65. * <p>查询充电站信息</p>
  66. * @author wzq
  67. * @param LastQueryTime 最后一次查询时间
  68. * @param PageNo 页码
  69. * @param PageSize 页大小
  70. * @return 充电站信息列表
  71. *
  72. */
  73. @Operation(summary = "查询充电站信息")
  74. @GetMapping("/queryStationsInfo")
  75. public Result<QueryStationsInfoVO> queryStationsInfo(@RequestParam(value = "LastQueryTime", required = false) @Schema(description = "最后一次查询时间") String LastQueryTime,
  76. @RequestParam(value = "PageNo",defaultValue = "1") @Schema(description = "页码") Integer PageNo,
  77. @RequestParam(value = "PageSize", defaultValue = "10") @Schema(description = "页大小") Integer PageSize) throws Exception {
  78. return Result.success(chargingBusinessService.queryStationsInfo(LastQueryTime, PageNo, PageSize));
  79. }
  80. /**
  81. * <p>设备接口状态查询</p>
  82. * @author wzq
  83. * @param stationIDs 充电站ID列表
  84. * @return 设备接口状态
  85. *
  86. */
  87. @Operation(summary = "设备接口状态查询")
  88. @GetMapping("/queryStationStatus")
  89. public Result<QueryStationStatusVO> queryStationStatus(List<String> stationIDs) throws Exception {
  90. return Result.success(chargingBusinessService.queryStationStatus(stationIDs));
  91. }
  92. }