mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-08 12:00:11 +08:00
update 个人桩接口
This commit is contained in:
@@ -45,14 +45,14 @@ public class PersonPileController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户绑定个人桩
|
* 用户绑定个人桩
|
||||||
*
|
* <p>
|
||||||
* http://localhost:8080/uniapp/personalPile/pileMemberBinding
|
* http://localhost:8080/uniapp/personalPile/pileMemberBinding
|
||||||
*
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/pileMemberBinding")
|
@RequestMapping("/pileMemberBinding")
|
||||||
public RestApiResponse<?> pileMemberBinding(HttpServletRequest request, @RequestBody PileMemberBindingDTO dto){
|
public RestApiResponse<?> pileMemberBinding(HttpServletRequest request, @RequestBody PileMemberBindingDTO dto) {
|
||||||
logger.info("绑定个人桩信息 params:{}", JSON.toJSONString(dto));
|
logger.info("绑定个人桩信息 params:{}", JSON.toJSONString(dto));
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
@@ -60,10 +60,10 @@ public class PersonPileController extends BaseController {
|
|||||||
dto.setMemberId(memberId);
|
dto.setMemberId(memberId);
|
||||||
int i = pileService.pileMemberBinding(dto);
|
int i = pileService.pileMemberBinding(dto);
|
||||||
response = new RestApiResponse<>(i);
|
response = new RestApiResponse<>(i);
|
||||||
}catch (BusinessException e){
|
} catch (BusinessException e) {
|
||||||
logger.error("绑定个人桩信息 error,", e);
|
logger.error("绑定个人桩信息 error,", e);
|
||||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
}catch (Exception exception){
|
} catch (Exception exception) {
|
||||||
logger.error("绑定个人桩信息 error,", exception);
|
logger.error("绑定个人桩信息 error,", exception);
|
||||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_BINDING_PERSONAL_PILE_ERROR);
|
response = new RestApiResponse<>(ReturnCodeEnum.CODE_BINDING_PERSONAL_PILE_ERROR);
|
||||||
}
|
}
|
||||||
@@ -74,6 +74,7 @@ public class PersonPileController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 用户解绑个人桩
|
* 用户解绑个人桩
|
||||||
* http://localhost:8080/uniapp/personalPile/userUnbindPile
|
* http://localhost:8080/uniapp/personalPile/userUnbindPile
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/userUnbindPile")
|
@RequestMapping("/userUnbindPile")
|
||||||
@@ -99,7 +100,7 @@ public class PersonPileController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 个人桩管理员下发给其他用户
|
* 个人桩管理员下发给其他用户
|
||||||
*
|
* <p>
|
||||||
* http://localhost:8080/uniapp/personalPile/adminIssuePile
|
* http://localhost:8080/uniapp/personalPile/adminIssuePile
|
||||||
*
|
*
|
||||||
* @param request
|
* @param request
|
||||||
@@ -107,7 +108,7 @@ public class PersonPileController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/adminIssuePile")
|
@RequestMapping("/adminIssuePile")
|
||||||
public RestApiResponse<?> adminIssuePile(HttpServletRequest request, @RequestBody PileMemberBindingDTO dto){
|
public RestApiResponse<?> adminIssuePile(HttpServletRequest request, @RequestBody PileMemberBindingDTO dto) {
|
||||||
logger.info("桩管理员下发个人桩 params: {}", JSON.toJSONString(dto));
|
logger.info("桩管理员下发个人桩 params: {}", JSON.toJSONString(dto));
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
@@ -122,10 +123,10 @@ public class PersonPileController extends BaseController {
|
|||||||
dto.setMemberId(memberId);
|
dto.setMemberId(memberId);
|
||||||
pileService.adminIssuePile(dto);
|
pileService.adminIssuePile(dto);
|
||||||
response = new RestApiResponse<>();
|
response = new RestApiResponse<>();
|
||||||
}catch (BusinessException e) {
|
} catch (BusinessException e) {
|
||||||
logger.error("桩管理员下发个人桩 error", e);
|
logger.error("桩管理员下发个人桩 error", e);
|
||||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
logger.error("桩管理员下发个人桩 error", e);
|
logger.error("桩管理员下发个人桩 error", e);
|
||||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_ADMIN_ISSUE_ERROR);
|
response = new RestApiResponse<>(ReturnCodeEnum.CODE_ADMIN_ISSUE_ERROR);
|
||||||
}
|
}
|
||||||
@@ -136,20 +137,20 @@ public class PersonPileController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过memberId查个人桩列表
|
* 通过memberId查个人桩列表
|
||||||
*
|
* <p>
|
||||||
* http://localhost:8080/uniapp/personalPile/getPersonalPileList
|
* http://localhost:8080/uniapp/personalPile/getPersonalPileList
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getPersonalPileList")
|
@GetMapping("/getPersonalPileList")
|
||||||
public RestApiResponse<?> getPersonalPileList(HttpServletRequest request){
|
public RestApiResponse<?> getPersonalPileList(HttpServletRequest request) {
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
String memberId = getMemberIdByAuthorization(request);
|
String memberId = getMemberIdByAuthorization(request);
|
||||||
logger.info("通过memberId查个人桩列表 params: {}", memberId);
|
logger.info("通过memberId查个人桩列表 params: {}", memberId);
|
||||||
List<PersonalPileInfoVO> list = pileBasicInfoService.getPileInfoByMemberId(memberId);
|
List<PersonalPileInfoVO> list = pileBasicInfoService.getPileInfoByMemberId(memberId);
|
||||||
response = new RestApiResponse<>(list);
|
response = new RestApiResponse<>(list);
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
logger.error("通过memberId查个人桩列表异常", e);
|
logger.error("通过memberId查个人桩列表异常", e);
|
||||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_PERSONAL_PILE_BY_MEMBER_ID_ERROR);
|
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_PERSONAL_PILE_BY_MEMBER_ID_ERROR);
|
||||||
}
|
}
|
||||||
@@ -160,7 +161,7 @@ public class PersonPileController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取枪口实时数据
|
* 获取枪口实时数据
|
||||||
*
|
* <p>
|
||||||
* http://localhost:8080/uniapp/personalPile/getConnectorRealTimeInfo
|
* http://localhost:8080/uniapp/personalPile/getConnectorRealTimeInfo
|
||||||
*
|
*
|
||||||
* @param request
|
* @param request
|
||||||
@@ -168,7 +169,7 @@ public class PersonPileController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/getConnectorRealTimeInfo")
|
@PostMapping("/getConnectorRealTimeInfo")
|
||||||
public RestApiResponse<?> getConnectorRealTimeInfo(HttpServletRequest request, @RequestBody QueryPersonPileDTO dto){
|
public RestApiResponse<?> getConnectorRealTimeInfo(HttpServletRequest request, @RequestBody QueryPersonPileDTO dto) {
|
||||||
logger.info("获取个人桩枪口实时数据 params:{}", JSON.toJSONString(dto));
|
logger.info("获取个人桩枪口实时数据 params:{}", JSON.toJSONString(dto));
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
@@ -176,10 +177,10 @@ public class PersonPileController extends BaseController {
|
|||||||
dto.setMemberId(memberId);
|
dto.setMemberId(memberId);
|
||||||
PersonPileRealTimeVO connectorRealTimeInfo = pileService.getConnectorRealTimeInfo(dto);
|
PersonPileRealTimeVO connectorRealTimeInfo = pileService.getConnectorRealTimeInfo(dto);
|
||||||
response = new RestApiResponse<>(connectorRealTimeInfo);
|
response = new RestApiResponse<>(connectorRealTimeInfo);
|
||||||
}catch (BusinessException e){
|
} catch (BusinessException e) {
|
||||||
logger.error("获取个人桩枪口实时数据 error", e);
|
logger.error("获取个人桩枪口实时数据 error", e);
|
||||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
logger.error("获取个人桩枪口实时数据 error", e);
|
logger.error("获取个人桩枪口实时数据 error", e);
|
||||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_PERSONAL_PILE_CONNECTOR_INFO_ERROR);
|
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_PERSONAL_PILE_CONNECTOR_INFO_ERROR);
|
||||||
}
|
}
|
||||||
@@ -190,7 +191,7 @@ public class PersonPileController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取某枪口某段时间内累计信息
|
* 获取某枪口某段时间内累计信息
|
||||||
*
|
* <p>
|
||||||
* http://localhost:8080/uniapp/personalPile/getAccumulativeInfo
|
* http://localhost:8080/uniapp/personalPile/getAccumulativeInfo
|
||||||
*
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
@@ -205,10 +206,10 @@ public class PersonPileController extends BaseController {
|
|||||||
dto.setMemberId(memberId);
|
dto.setMemberId(memberId);
|
||||||
PersonPileConnectorSumInfoVO accumulativeInfo = pileService.getAccumulativeInfo(dto);
|
PersonPileConnectorSumInfoVO accumulativeInfo = pileService.getAccumulativeInfo(dto);
|
||||||
response = new RestApiResponse<>(accumulativeInfo);
|
response = new RestApiResponse<>(accumulativeInfo);
|
||||||
} catch (BusinessException e){
|
} catch (BusinessException e) {
|
||||||
logger.error("获取某枪口某段时间内累计信息 error", e);
|
logger.error("获取某枪口某段时间内累计信息 error", e);
|
||||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
logger.error("获取某枪口某段时间内累计信息 error", e);
|
logger.error("获取某枪口某段时间内累计信息 error", e);
|
||||||
response = new RestApiResponse<>(e);
|
response = new RestApiResponse<>(e);
|
||||||
}
|
}
|
||||||
@@ -218,7 +219,7 @@ public class PersonPileController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取充电记录
|
* 获取充电记录
|
||||||
*
|
* <p>
|
||||||
* http://localhost:8080/uniapp/personalPile/getChargingRecord
|
* http://localhost:8080/uniapp/personalPile/getChargingRecord
|
||||||
*
|
*
|
||||||
* @param request
|
* @param request
|
||||||
@@ -226,7 +227,7 @@ public class PersonPileController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/getChargingRecord")
|
@RequestMapping("/getChargingRecord")
|
||||||
public RestApiResponse<?> getChargingRecord(HttpServletRequest request, @RequestBody QueryPersonPileDTO dto){
|
public RestApiResponse<?> getChargingRecord(HttpServletRequest request, @RequestBody QueryPersonPileDTO dto) {
|
||||||
logger.info("获取个人桩充电记录 params:{}", JSON.toJSONString(dto));
|
logger.info("获取个人桩充电记录 params:{}", JSON.toJSONString(dto));
|
||||||
RestApiResponse<?> response = null;
|
RestApiResponse<?> response = null;
|
||||||
try {
|
try {
|
||||||
@@ -234,10 +235,10 @@ public class PersonPileController extends BaseController {
|
|||||||
dto.setMemberId(memberId);
|
dto.setMemberId(memberId);
|
||||||
PageResponse chargingRecord = pileService.getChargingRecord(dto);
|
PageResponse chargingRecord = pileService.getChargingRecord(dto);
|
||||||
response = new RestApiResponse<>(chargingRecord);
|
response = new RestApiResponse<>(chargingRecord);
|
||||||
}catch (BusinessException e){
|
} catch (BusinessException e) {
|
||||||
logger.error("获取个人桩充电记录 error", e);
|
logger.error("获取个人桩充电记录 error", e);
|
||||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
logger.error("获取个人桩充电记录 error", e);
|
logger.error("获取个人桩充电记录 error", e);
|
||||||
response = new RestApiResponse<>(e);
|
response = new RestApiResponse<>(e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user