mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
新增 用户解绑鉴权卡接口
This commit is contained in:
@@ -92,4 +92,33 @@ public class AuthCardController extends BaseController {
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户解绑鉴权卡
|
||||
* http://localhost:8080/uniapp/authCard/unbindAuthCard
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/unbindAuthCard")
|
||||
public RestApiResponse<?> unbindAuthCard(HttpServletRequest request, @RequestBody PileAuthCardDTO dto) {
|
||||
logger.info("用户解绑鉴权卡 params:{}", JSONObject.toJSONString(dto));
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
String memberId = getMemberIdByAuthorization(request);
|
||||
if (memberId == null) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_AUTHENTICATION_ERROR);
|
||||
}
|
||||
dto.setMemberId(memberId);
|
||||
pileAuthCardService.unbindAuthCard(dto);
|
||||
response = new RestApiResponse<>();
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("用户解绑鉴权卡 warn ", e);
|
||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||
}catch (Exception e) {
|
||||
logger.warn("用户解绑鉴权卡 error ", e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
logger.info("用户解绑鉴权卡 result :{}", response);
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user