新增新电途推送接口

This commit is contained in:
YAS\29473
2025-09-28 15:10:46 +08:00
parent 94655706dc
commit 58a7bbfd8e
2 changed files with 175 additions and 53 deletions

View File

@@ -4,6 +4,7 @@ import com.alibaba.fastjson2.JSON;
import com.jsowell.common.annotation.Anonymous;
import com.jsowell.common.enums.thirdparty.ThirdPartyReturnCodeEnum;
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.response.RestApiResponse;
import com.jsowell.pile.dto.*;
@@ -54,32 +55,30 @@ public class XDTController extends ThirdPartyBaseController {
}
}
/**
* 推送充电站信息 notification_stationInfo
* http://localhost:8080/xindiantu/v1/pushStationInfo
* @param dto
* @return
*/
// @PostMapping("/pushStationInfo")
// public RestApiResponse<?> pushStationInfo(@RequestBody PushStationInfoDTO dto) {
// logger.info("推送新电途平台充电站信息 params:{}", JSON.toJSONString(dto));
// RestApiResponse<?> response = null;
// try {
// if (StringUtils.isBlank(String.valueOf(dto.getStationId()))) {
// throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
// }
// xdtService.pushStationInfo(dto);
// response = new RestApiResponse<>();
// }catch (BusinessException e) {
// logger.error("推送新电途平台充电站信息 error",e);
// response = new RestApiResponse<>(e.getCode(), e.getMessage());
// }catch (Exception e) {
// logger.error("推送新电途平台充电站信息 error", e);
// response = new RestApiResponse<>(e);
// }
// logger.info("推送新电途平台充电站信息 result:{}", response);
// return response;
// }
@PostMapping("/v1/notification_station_detail")
public RestApiResponse<?> pushStationInfo(@RequestBody PushStationInfoDTO dto) {
logger.info("推送新电途平台充电站信息 params:{}", JSON.toJSONString(dto));
RestApiResponse<?> response = null;
try {
platformLogic.notificationStationInfo(String.valueOf(dto.getStationId()));
response = new RestApiResponse<>();
}catch (BusinessException e) {
logger.error("推送新电途平台充电站信息 error",e);
response = new RestApiResponse<>(e.getCode(), e.getMessage());
}catch (Exception e) {
logger.error("推送新电途平台充电站信息 error", e);
response = new RestApiResponse<>(e);
}
logger.info("推送新电途平台充电站信息 result:{}", response);
return response;
}
/**
* 查询充电站信息
@@ -487,5 +486,5 @@ public class XDTController extends ThirdPartyBaseController {
// logger.info("新电途平台设备状态变化推送 result:{}", response);
// return response;
// }
}