| | |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.management.api.feignClient.ManagementClient; |
| | | import com.ruoyi.management.api.model.TFeedback; |
| | | import com.ruoyi.management.api.model.TPage; |
| | | import com.ruoyi.management.api.model.TUseGuide; |
| | | import com.ruoyi.management.api.model.TVipSet; |
| | | import com.ruoyi.management.api.model.*; |
| | | import com.ruoyi.management.api.query.UseGuideQuery; |
| | | import com.ruoyi.study.domain.TUser; |
| | | import com.ruoyi.study.domain.TUserShare; |
| | | import com.ruoyi.study.domain.TVipOrder; |
| | | import com.ruoyi.study.dto.AppUserQuery; |
| | | import com.ruoyi.study.dto.UserInfoQuery; |
| | | import com.ruoyi.study.request.RegisterPhoneRequest; |
| | | import com.ruoyi.study.service.ITUserService; |
| | | import com.ruoyi.study.service.ITUserShareService; |
| | | import com.ruoyi.study.service.IVipOrderService; |
| | | import com.ruoyi.study.utils.PayMoneyUtil; |
| | | import com.ruoyi.study.utils.UUIDUtil; |
| | |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private RedisService redisService; |
| | | @Resource |
| | | private ITUserShareService userShareService; |
| | | |
| | | @PostMapping("/vipInfo") |
| | | @ApiOperation(value = "会员中心-获取会员说明、当前登录用户是否为会员、会员购买规格", tags = {"家长端-个人中心"}) |
| | |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PostMapping("/parentPage") |
| | | @ApiOperation(value = "平板", tags = {"家长端-启动页"}) |
| | | public AjaxResult<String> parentPage() { |
| | |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PostMapping("/parentPage1") |
| | | @ApiOperation(value = "手机", tags = {"家长端-启动页"}) |
| | | public AjaxResult<String> parentPage1() { |
| | |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PostMapping("/getProtocol") |
| | | @ApiOperation(value = "获取协议", tags = {"家长端-协议"}) |
| | | @ApiImplicitParams({ |
| | |
| | | return AjaxResult.error("登录失败,您的账号已被冻结!"); |
| | | } |
| | | } else { |
| | | // todo 验证码校验 |
| | | // 手机验证码校验 |
| | | Object redisPhoneCode = redisService.getCacheObject(RedisConstants.PHONE_CODE + phone); |
| | | if (null == redisPhoneCode) { |
| | | return AjaxResult.error("登录失败,手机验证码已过期!"); |
| | | } else { |
| | | // redis 验证码的value 为 code:时间戳 |
| | | String rCodeAndTime = String.valueOf(redisPhoneCode); |
| | | String rCode = rCodeAndTime.split(":")[0]; |
| | | if (!rCode.equalsIgnoreCase(phoneCode)) { |
| | | return AjaxResult.error("登录失败,手机验证码输入有误!"); |
| | | } else { |
| | | tUser1 = getUser(phone); |
| | | userService.save(tUser1); |
| | | } |
| | | } |
| | | } |
| | | LoginUserParent loginUserParent = new LoginUserParent(); |
| | | loginUserParent.setName(tUser1.getName()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 家长端 学习端都可用 |
| | | * |
| | | * @param url app网页链接 |
| | | * 分享图片、标题及可获积分数 |
| | | */ |
| | | @GetMapping("/weiXinShare") |
| | | @ApiOperation(value = "微信分享", tags = {"微信分享"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "应用分享url地址", name = "url", dataType = "string", required = true), |
| | | }) |
| | | public AjaxResult weiXinShare(@RequestParam String url) { |
| | | return AjaxResult.success(userService.weiXinShare(url)); |
| | | @GetMapping("/shareInfo") |
| | | @ApiOperation(value = "微信分享信息", tags = {"微信分享信息"}) |
| | | public AjaxResult shareInfo() { |
| | | // 分享信息 |
| | | TSysSet data = managementClient.shareInfo().getData(); |
| | | Integer userid = tokenService.getLoginUserStudy().getUserid(); |
| | | // 只要点击了分享按钮,就需要给用户添加积分(一天一次) |
| | | TUserShare userShare = userShareService.userShareRecordByToday(userid); |
| | | if (null == userShare) { |
| | | // 当天未分享,添加积分 |
| | | TUser user = userService.getById(userid); |
| | | int integral = Integer.parseInt(data.getIntegralShare()); |
| | | user.setIntegral(user.getIntegral() + integral); |
| | | userService.updateById(user); |
| | | // 添加分享记录 |
| | | TUserShare record = new TUserShare(); |
| | | record.setIntegral(integral); |
| | | record.setUserId(userid); |
| | | userShareService.save(record); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PostMapping("/deleteUser") |
| | |
| | | userService.saveOrUpdate(byId); |
| | | return AjaxResult.success("修改成功"); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/wxRefund") |
| | | public void cancelMySiteCallback(HttpServletRequest request, HttpServletResponse response) { |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/vipBack/{id}") |
| | | @ApiOperation(value = "会员退款", tags = {"管理后台-会员退款"}) |
| | | public R vipBack(@PathVariable("id") Integer id) throws AlipayApiException { |