mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
update 调试联联接口
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
package com.jsowell.lianlian;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.jsowell.common.annotation.Anonymous;
|
||||
import com.jsowell.common.core.controller.BaseController;
|
||||
import com.jsowell.common.response.RestApiResponse;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.thirdparty.dto.QueryStationInfoDTO;
|
||||
import com.jsowell.thirdparty.service.LianLianService;
|
||||
import com.jsowell.thirdparty.vo.LianLianPageResponse;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 对接联联平台controller
|
||||
*
|
||||
* @author JS-ZZA
|
||||
* @date 2023/4/10 14:58
|
||||
*/
|
||||
@Anonymous
|
||||
@RestController
|
||||
@RequestMapping("/LianLian")
|
||||
public class LianLianController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private LianLianService lianLianService;
|
||||
|
||||
|
||||
/**
|
||||
* 联联平台查询充电站信息
|
||||
* http://localhost:8080/LianLian/query_stations_info
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/query_stations_info")
|
||||
public RestApiResponse<?> query_stations_info(@RequestBody QueryStationInfoDTO dto) {
|
||||
logger.info("联联平台查询充电站信息 params:{}", JSONObject.toJSONString(dto));
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
LianLianPageResponse pageResponse = lianLianService.query_stations_info(dto);
|
||||
response = new RestApiResponse<>(pageResponse);
|
||||
}catch (Exception e) {
|
||||
logger.error("联联平台查询充电站信息 error", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
logger.info("联联平台查询充电站信息 result:{}", response);
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询充电站状态信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/query_station_status")
|
||||
public RestApiResponse<?> query_station_status(@RequestBody ArrayList<String> StationIDs) {
|
||||
logger.info("联联平台查询充电站状态信息 params:{}", StationIDs);
|
||||
RestApiResponse<?> response;
|
||||
try {
|
||||
if (CollectionUtils.isEmpty(StationIDs)) {
|
||||
return null;
|
||||
}
|
||||
LianLianPageResponse pageResponse = lianLianService.query_station_status(StationIDs);
|
||||
response = new RestApiResponse<>(pageResponse);
|
||||
}catch (Exception e) {
|
||||
logger.error("联联平台查询充电站状态信息 error", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
logger.info("联联平台查询充电站状态信息 result:{}", response);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user