| | |
| | | |
| | | |
| | | 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; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | |
| | | /** |
| | | * 使用福利 控制器 |
| | | */ |
| | | |
| | | @RestController |
| | | @RequestMapping("") |
| | |
| | | |
| | | @Autowired |
| | | private TokenUtil tokenUtil; |
| | | |
| | | @Resource |
| | | private SysLogClient slClient; |
| | | |
| | | private final SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd"); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @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-使用福利"}) |