From 942bd1345a126d6c088ad5c89f58856f9c172ce5 Mon Sep 17 00:00:00 2001 From: lisy <linlangsur163@163.com> Date: 星期五, 07 七月 2023 14:03:36 +0800 Subject: [PATCH] 去除请求参数的注解 --- cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java | 62 ++++++++++++++++++++++++++++++ 1 files changed, 61 insertions(+), 1 deletions(-) diff --git a/cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java b/cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java index 6e0c8ec..011d926 100644 --- a/cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java +++ b/cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java @@ -2,6 +2,7 @@ import com.dsh.account.entity.TAppUser; +import com.dsh.account.feignclient.other.SysLogClient; import com.dsh.account.model.vo.userBenefitDetail.AppUserDetailsVo; import com.dsh.account.model.vo.userBenefitDetail.BillingDetailsVo; import com.dsh.account.model.vo.userBenefitDetail.IndexOfUserBenefirVo; @@ -16,6 +17,10 @@ import java.text.SimpleDateFormat; +/** + * 使用福利 控制器 + */ + @RestController @RequestMapping("") public class UseBenefitsController { @@ -26,6 +31,9 @@ @Autowired private TokenUtil tokenUtil; + + @Autowired + private SysLogClient slClient; private final SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd"); @@ -78,6 +86,58 @@ } } + + + @ResponseBody + @PostMapping("/api/useBenefit/cancellation") + @ApiOperation(value = "个人信息-注销账号", tags = {"APP-使用福利"}) + @ApiImplicitParams({ + @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), + }) + public ResultUtil cancellationAccount(){ + try { + Integer appUserId = tokenUtil.getUserIdFormRedis(); + if(null == appUserId){ + return ResultUtil.tokenErr(); + } +// 变更账号的状态为删除 + tauService.cancellation(appUserId); +// 增加一条注销账号的日志 + slClient.cancellation(appUserId); +// 删除redis中用户key + tokenUtil.logout(); + return ResultUtil.success(); + }catch (Exception e){ + return ResultUtil.runErr(); + } + } + + + + @ResponseBody + @PostMapping("/api/useBenefit/logOut") + @ApiOperation(value = "个人信息-退出登录", tags = {"APP-使用福利"}) + @ApiImplicitParams({ + @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), + }) + public ResultUtil logOutAccount(){ + try { + Integer appUserId = tokenUtil.getUserIdFormRedis(); + if(null == appUserId){ + return ResultUtil.tokenErr(); + } + // 增加一条退出账号的日志 + slClient.logOut(appUserId); + // 删除redis中用户key + tokenUtil.logout(); + return ResultUtil.success(); + }catch (Exception e){ + return ResultUtil.runErr(); + } + } + + + @ResponseBody @PostMapping("/api/useBenefit/userBilling") @ApiOperation(value = "账单", tags = {"APP-使用福利"}) @@ -86,7 +146,7 @@ @ApiImplicitParam(value = "年月", name = "yearMonth", required = true, dataType = "string"), @ApiImplicitParam(value = "记录id", name = "recordId", required = true, dataType = "int"), }) - public ResultUtil<BillingDetailsVo> getUserBillingDetails(@RequestBody String yearMonth,@RequestBody Integer recordId){ + public ResultUtil<BillingDetailsVo> getUserBillingDetails( String yearMonth, Integer recordId){ try { Integer appUserId = tokenUtil.getUserIdFormRedis(); if(null == appUserId){ -- Gitblit v1.7.1