| | |
| | | import com.dsh.account.model.vo.userBenefitDetail.*; |
| | | import com.dsh.account.service.RechargeRecordsService; |
| | | import com.dsh.account.service.TAppUserService; |
| | | import com.dsh.account.service.UserIntegralChangesService; |
| | | import com.dsh.account.util.ResultUtil; |
| | | import com.dsh.account.util.TokenUtil; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | |
| | | @Autowired |
| | | private RechargeRecordsService rechargeRService; |
| | | |
| | | @Autowired |
| | | private UserIntegralChangesService uicService; |
| | | |
| | | private final SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd"); |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 课时详情-支付 |
| | | * 充值中心-支付 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/startCource/payment") |
| | | @ApiOperation(value = "充值中心-支付", tags = {"APP-开始上课"}) |
| | | @PostMapping("/api/useBenefit/payment") |
| | | @ApiOperation(value = "充值中心-支付", tags = {"APP-使用福利"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public ResultUtil rechargePayment(RechargePayRequest request){ |
| | | public ResultUtil rechargeCenPayment(RechargePayRequest request){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return rechargeRService.rechargePayment(userIdFormRedis,request); |
| | | return rechargeRService.rechargeCenPayment(userIdFormRedis,request); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 积分商城 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/useBenefit/integralMallList") |
| | | @ApiOperation(value = "积分商城", tags = {"APP-使用福利"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public ResultUtil<PointMallDetailsResponse> pointsMallList(MallRequest request){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | // TODO: 2023/7/10 积分商品列表查询 |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 积分明细 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/useBenefit/integralDetails") |
| | | @ApiOperation(value = "积分明细", tags = {"APP-使用福利"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "年月", name = "yearMonth", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "记录(1充值 2扣除)", name = "recordId", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil<IntegralDetailsResponse> pointDetails(String yearMonth, Integer recordId){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(uicService.queryUserPointsDetails(yearMonth,recordId,userIdFormRedis)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |