新增 用户解绑鉴权卡接口

This commit is contained in:
Lemon
2023-05-24 10:55:55 +08:00
parent 6d7a390e39
commit 57fc7e2d98
4 changed files with 58 additions and 0 deletions

View File

@@ -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;
}
}