| | |
| | | private ITSubjectRecordService subjectRecordService; |
| | | |
| | | @PostMapping("/storyList") |
| | | @ApiOperation(value = "配置学习类型选择故事", tags = {"题目管理"}) |
| | | // @ApiOperation(value = "配置学习类型选择故事", tags = {"题目管理"}) |
| | | public R<PageInfo<TStory>> storyList(@RequestBody ChoiceStory query) { |
| | | PageInfo<TStory> res = new PageInfo<>(query.getPageNumber(), query.getPageSize()); |
| | | QueryWrapper<TStory> wrapper = new QueryWrapper<>(); |
| | |
| | | } |
| | | |
| | | @PostMapping("/subjectList") |
| | | @ApiOperation(value = "配置学习类型选择题目", tags = {"题目管理"}) |
| | | // @ApiOperation(value = "配置学习类型选择题目", tags = {"题目管理"}) |
| | | public R<PageInfo<TSubject>> subjectList(@RequestBody ChoiceSubject query) { |
| | | PageInfo<TSubject> res = new PageInfo<>(query.getPageNumber(), query.getPageSize()); |
| | | QueryWrapper<TSubject> wrapper = new QueryWrapper<>(); |
| | |
| | | return R.ok(res); |
| | | } |
| | | |
| | | /** |
| | | * 查询周目列表 |
| | | * |
| | | * @param type 所属类型 |
| | | * @param quarter 季度 |
| | | */ |
| | | @GetMapping("/weekList") |
| | | @ApiOperation(value = "根据季度获取周目列表", tags = {"根据季度获取周目列表"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "所属类型", name = "type", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "季度", name = "quarter", dataType = "Integer", required = true) |
| | | }) |
| | | public R<List<StudyWeekDTO>> weekList(@RequestParam(defaultValue = "1") Integer type, @RequestParam Integer quarter) { |
| | | List<StudyWeekDTO> result = studyService.weekList(type, quarter); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 可兑换商品推荐 |
| | | */ |
| | | @GetMapping("/goodRecommend") |
| | | @ApiOperation(value = "可兑换商品推荐", tags = {"学习端-首页"}) |
| | | public R<List<TGoodsVO>> studySchedule() { |
| | | return R.ok(goodsClient.goodRecommend().getData()); |
| | | } |
| | | /** |
| | | * 首次页面加载时调用,获取学习进度及学习时长等信息 |
| | | * |
| | |
| | | * @param day 所属day |
| | | */ |
| | | @GetMapping("/studySchedule") |
| | | @ApiOperation(value = "获取用户学习进度", tags = {"获取用户学习进度"}) |
| | | @ApiOperation(value = "获取用户学习进度", tags = {"学习端-首页"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "周目", name = "week", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "所属day", name = "day", dataType = "Integer", required = true) |
| | |
| | | TUserStudy result = studyService.studySchedule(String.valueOf(tokenService.getLoginUserStudy().getUserid()), week, day); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | /** |
| | | * 可兑换商品推荐 |
| | | * 查询周目列表 |
| | | * |
| | | * @param type 所属类型 |
| | | * @param quarter 季度 |
| | | */ |
| | | @GetMapping("/goodRecommend") |
| | | @ApiOperation(value = "可兑换商品推荐", tags = {"可兑换商品推荐"}) |
| | | public R<List<TGoodsVO>> studySchedule() { |
| | | return R.ok(goodsClient.goodRecommend().getData()); |
| | | @GetMapping("/weekList") |
| | | @ApiOperation(value = "根据季度获取周目列表 ", tags = {"学习端-首页"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "所属类型 1.0只有类型听 传1", name = "type", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "季度 首次进入季度quarter默认传1", name = "quarter", dataType = "Integer", required = true) |
| | | }) |
| | | public R<List<StudyWeekDTO>> weekList(@RequestParam(defaultValue = "1") Integer type, @RequestParam Integer quarter) { |
| | | List<StudyWeekDTO> result = studyService.weekList(type, quarter); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | /** |
| | | * 进入题组后,获取题组学习进度信息 |
| | | * |
| | |
| | | * @param day 所属day |
| | | */ |
| | | @GetMapping("/teamSchedule") |
| | | @ApiOperation(value = "获取题组学习进度信息", tags = {"获取题组学习进度信息"}) |
| | | @ApiOperation(value = "获取题组学习进度信息", tags = {"学习端-题目"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "周目", name = "week", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "所属day", name = "day", dataType = "Integer", required = true) |
| | |
| | | * 退出学习,记录学习进度、当日学习时长... |
| | | */ |
| | | @PostMapping("/exitLearning") |
| | | @ApiOperation(value = "退出学习(记录学习进度等信息)", tags = {"退出学习(记录学习进度等信息)"}) |
| | | @ApiOperation(value = "退出学习(记录学习进度等信息)", tags = {"学习端-题目"}) |
| | | public R<Boolean> exitLearning(@RequestBody TSubjectRecord subjectRecord) { |
| | | // 学习时长处理 |
| | | return R.ok(subjectRecordService.updateById(subjectRecord)); |
| | |
| | | * @param day 所属day |
| | | */ |
| | | @GetMapping("/listenSelectPicture") |
| | | @ApiOperation(value = "自主学习1-听音选图", tags = {"自主学习1-听音选图"}) |
| | | @ApiOperation(value = "自主学习1-听音选图", tags = {"学习端-首页"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "周目", name = "week", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "所属day", name = "day", dataType = "Integer", required = true) |
| | |
| | | Boolean isVip = userService.isVip(); |
| | | LambdaQueryChainWrapper<TStudyListen> wrapper = studyListenService.lambdaQuery().eq(TStudyListen::getWeek, week) |
| | | .eq(TStudyListen::getDay, day).eq(TStudyListen::getDisabled, 0); |
| | | |
| | | // 非会员只能查看非会员题目,会员可以查看所有题目 |
| | | if (!isVip) { |
| | | wrapper.eq(TStudyListen::getIsVip, 0); |
| | | } |
| | | // if (!isVip) { |
| | | // wrapper.eq(TStudyListen::getIsVip, 0); |
| | | // } |
| | | List<TStudyListen> studyListens = wrapper.list(); |
| | | for (TStudyListen studyListen : studyListens) { |
| | | if (studyListen.getIsVip() == 1){ |
| | | // 需要会员查看 |
| | | if (!isVip){ |
| | | // 不是会员 |
| | | return R.vipError("以下内容仅限会员查看,请通过家长端成为会员!"); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(studyService.listenSelectPicture(week, day, studyListens)); |
| | | } |
| | | |
| | |
| | | * @param day 所属day |
| | | */ |
| | | @GetMapping("/pictureSelectVoice") |
| | | @ApiOperation(value = "自主学习2-看图选音", tags = {"自主学习2-看图选音"}) |
| | | @ApiOperation(value = "自主学习2-看图选音", tags = {"学习端-首页"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "周目", name = "week", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "所属day", name = "day", dataType = "Integer", required = true) |
| | |
| | | LambdaQueryChainWrapper<TStudyLook> wrapper = studyLookService.lambdaQuery().eq(TStudyLook::getWeek, week) |
| | | .eq(TStudyLook::getDay, day).eq(TStudyLook::getDisabled, 0); |
| | | // 非会员只能查看非会员题目,会员可以查看所有题目 |
| | | if (!isVip) { |
| | | wrapper.eq(TStudyLook::getIsVip, 0); |
| | | } |
| | | |
| | | List<TStudyLook> lookList = studyLookService.lambdaQuery().eq(TStudyLook::getWeek, week) |
| | | .eq(TStudyLook::getDay, day).eq(TStudyLook::getDisabled, 0).list(); |
| | | for (TStudyLook studyListen : lookList) { |
| | | if (studyListen.getIsVip() == 1){ |
| | | // 需要会员查看 |
| | | if (!isVip){ |
| | | // 不是会员 |
| | | return R.vipError("以下内容仅限会员查看,请通过家长端成为会员!"); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(studyService.pictureSelectVoice(week, day, lookList)); |
| | | } |
| | | |
| | |
| | | * @param day 所属day |
| | | */ |
| | | @GetMapping("/induceExclude") |
| | | @ApiOperation(value = "自主学习3-归纳排除", tags = {"自主学习3-归纳排除"}) |
| | | @ApiOperation(value = "自主学习3-归纳排除", tags = {"学习端-首页"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "周目", name = "week", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "所属day", name = "day", dataType = "Integer", required = true) |
| | |
| | | LambdaQueryChainWrapper<TStudyInduction> wrapper = studyInductionService.lambdaQuery().eq(TStudyInduction::getWeek, week) |
| | | .eq(TStudyInduction::getDay, day).eq(TStudyInduction::getDisabled, 0); |
| | | // 非会员只能查看非会员题目,会员可以查看所有题目 |
| | | if (!isVip) { |
| | | wrapper.eq(TStudyInduction::getIsVip, 0); |
| | | } |
| | | // if (!isVip) { |
| | | // wrapper.eq(TStudyInduction::getIsVip, 0); |
| | | // } |
| | | List<TStudyInduction> inductionList = wrapper.list(); |
| | | for (TStudyInduction studyListen : inductionList) { |
| | | if (studyListen.getIsVip() == 1){ |
| | | // 需要会员查看 |
| | | if (!isVip){ |
| | | // 不是会员 |
| | | return R.vipError("以下内容仅限会员查看,请通过家长端成为会员!"); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(studyService.induceExclude(week, day, inductionList)); |
| | | } |
| | | |
| | |
| | | * @param day 所属day |
| | | */ |
| | | @GetMapping("/questionsAndAnswers") |
| | | @ApiOperation(value = "自主学习4-有问有答", tags = {"自主学习4-有问有答"}) |
| | | @ApiOperation(value = "自主学习4-有问有答", tags = {"学习端-首页"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "周目", name = "week", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "所属day", name = "day", dataType = "Integer", required = true) |
| | |
| | | LambdaQueryChainWrapper<TStudyAnswer> wrapper = studyAnswerService.lambdaQuery().eq(TStudyAnswer::getWeek, week) |
| | | .eq(TStudyAnswer::getDay, day).eq(TStudyAnswer::getDisabled, 0); |
| | | // 非会员只能查看非会员题目,会员可以查看所有题目 |
| | | if (!isVip) { |
| | | wrapper.eq(TStudyAnswer::getIsVip, 0); |
| | | } |
| | | // if (!isVip) { |
| | | // wrapper.eq(TStudyAnswer::getIsVip, 0); |
| | | // } |
| | | List<TStudyAnswer> answerList = wrapper.list(); |
| | | for (TStudyAnswer studyListen : answerList) { |
| | | if (studyListen.getIsVip() == 1){ |
| | | // 需要会员查看 |
| | | if (!isVip){ |
| | | // 不是会员 |
| | | return R.vipError("以下内容仅限会员查看,请通过家长端成为会员!"); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(studyService.questionsAndAnswers(week, day, answerList)); |
| | | } |
| | | |
| | |
| | | * @param day 所属day |
| | | */ |
| | | @GetMapping("/pictureMateVoice") |
| | | @ApiOperation(value = "自主学习5-音图相配", tags = {"自主学习5-音图相配"}) |
| | | @ApiOperation(value = "自主学习5-音图相配", tags = {"学习端-首页"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "周目", name = "week", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "所属day", name = "day", dataType = "Integer", required = true) |
| | |
| | | wrapper.eq(TStudyPair::getIsVip, 0); |
| | | } |
| | | TStudyPair pair = wrapper.one(); |
| | | if (pair.getIsVip() == 1){ |
| | | // 需要会员查看 |
| | | if (!isVip){ |
| | | // 不是会员 |
| | | return R.vipError("以下内容仅限会员查看,请通过家长端成为会员!"); |
| | | } |
| | | } |
| | | return R.ok(studyService.pictureMateVoice(week, day, pair)); |
| | | } |
| | | |
| | |
| | | * @param completeStudy 完成学习信息 |
| | | */ |
| | | @PostMapping("/completeLearning") |
| | | @ApiOperation(value = "完成学习", tags = {"完成学习"}) |
| | | @ApiOperation(value = "完成学习", tags = {"学习端-题目"}) |
| | | public R<Boolean> completeLearning(@RequestBody CompleteStudyDTO completeStudy) { |
| | | // 登录用户id |
| | | Integer userId = tokenService.getLoginUserStudy().getUserid(); |
| | |
| | | * @param week 所属周目 |
| | | */ |
| | | @GetMapping("/gameHearing") |
| | | @ApiOperation(value = "自主游戏1-超级听力", tags = {"自主游戏1-超级听力(difficulty: 0入门、1中级、2高级)"}) |
| | | @ApiOperation(value = "自主游戏1-超级听力", tags = {"学习端-游戏"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "难度(0入门、1中级、2困难)", name = "difficulty", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "所属周目", name = "week", dataType = "Integer", required = true) |
| | |
| | | * @param week 所属周目 |
| | | */ |
| | | @GetMapping("/gameMemory") |
| | | @ApiOperation(value = "自主游戏2-超级记忆", tags = {"自主游戏2-超级记忆(difficulty: 0入门、1中级、2高级)"}) |
| | | @ApiOperation(value = "自主游戏2-超级记忆", tags = {"学习端-游戏"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "难度(0入门、1中级、2困难)", name = "difficulty", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "所属周目", name = "week", dataType = "Integer", required = true) |
| | |
| | | * @param completeStudy 学习信息 |
| | | */ |
| | | @PostMapping("/gameAchievement") |
| | | @ApiOperation(value = "完成游戏-记录游戏测试成绩", tags = {"完成游戏-记录游戏测试成绩"}) |
| | | @ApiOperation(value = "完成游戏-记录游戏测试成绩", tags = {"学习端-游戏"}) |
| | | public R<Boolean> gameAchievement(@RequestBody CompleteGameDTO completeStudy) { |
| | | /* |
| | | * 游戏测试需要根据正确率计算本次测试可获得积分 |
| | |
| | | * @param week 周目 |
| | | */ |
| | | @GetMapping("/lookPictureDbu") |
| | | @ApiOperation(value = "自主故事1-看图配音", tags = {"自主故事1-看图配音"}) |
| | | @ApiOperation(value = "自主故事1-看图配音", tags = {"学习端-故事"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "所属周目", name = "week", dataType = "Integer", required = true) |
| | | }) |
| | |
| | | * @param week 周目 |
| | | */ |
| | | @GetMapping("/frameworkMemory") |
| | | @ApiOperation(value = "自主故事2-框架记忆", tags = {"自主故事2-框架记忆"}) |
| | | @ApiOperation(value = "自主故事2-框架记忆", tags = {"学习端-故事"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "所属周目", name = "week", dataType = "Integer", required = true) |
| | | }) |
| | |
| | | * 完成故事类型 |
| | | */ |
| | | @GetMapping("/completeStory") |
| | | @ApiOperation(value = "完成故事学习", tags = {"完成故事学习"}) |
| | | @ApiOperation(value = "完成故事学习", tags = {"学习端-故事"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "积分数量", name = "integral", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "故事id", name = "storyId", dataType = "Integer", required = true), |
| | |
| | | } |
| | | |
| | | @GetMapping("/studyRecord") |
| | | @ApiOperation(value = "个人中心-学习记录", tags = {"个人中心-学习记录"}) |
| | | @ApiOperation(value = "个人中心-学习记录", tags = {"学习端-个人中心"}) |
| | | public R<StudyRecordResultVO> studyRecord() { |
| | | Integer userId = tokenService.getLoginUserStudy().getUserid(); |
| | | |
| | | // 学习记录 |
| | | TUserStudy studyRecord = userStudyService.lambdaQuery().eq(TUserStudy::getUserId, userId) |
| | | .eq(TUserStudy::getDisabled, 0).one(); |
| | |
| | | .eq(TGameRecord::getDisabled, 0).list(); |
| | | return R.ok(new StudyRecordResultVO(studyRecord, gameRecordList)); |
| | | } |
| | | @GetMapping("/record") |
| | | @ApiOperation(value = "游戏测试成绩", tags = {"家长端-游戏测试成绩"}) |
| | | public R<StudyRecordResultVO> record() { |
| | | LoginUserParent loginUser1 = tokenService.getLoginUser1(); |
| | | if (loginUser1 == null){ |
| | | return R.tokenError("登陆失效,请重新登录"); |
| | | } |
| | | Integer userId = loginUser1.getUserid(); |
| | | |
| | | // 学习记录 |
| | | TUserStudy studyRecord = userStudyService.lambdaQuery().eq(TUserStudy::getUserId, userId) |
| | | .eq(TUserStudy::getDisabled, 0).one(); |
| | | // 查询剩余周目 |
| | | if (studyRecord!=null){ |
| | | int size = studyService.list(new QueryWrapper<TStudy>() |
| | | .eq("type", 1)).size(); |
| | | studyRecord.setSurplus(size-studyRecord.getWeek()); |
| | | }else{ |
| | | TUserStudy tUserStudy = new TUserStudy(); |
| | | tUserStudy.setSurplus(studyService.list(new QueryWrapper<TStudy>() |
| | | .eq("type", 1)).size()); |
| | | studyRecord = tUserStudy; |
| | | } |
| | | // 游戏测试成绩 |
| | | List<TGameRecord> gameRecordList = gameRecordService.lambdaQuery().eq(TGameRecord::getUserId, userId) |
| | | .eq(TGameRecord::getDisabled, 0).list(); |
| | | return R.ok(new StudyRecordResultVO(studyRecord, gameRecordList)); |
| | | } |
| | | @GetMapping("/getIntegral") |
| | | @ApiOperation(value = "获取剩余积分", tags = {"家长端-获取剩余积分"}) |
| | | public R<Integer> getIntegral() { |
| | | Integer userId = tokenService.getLoginUser1().getUserid(); |
| | | return R.ok(userService.getById(userId).getIntegral()); |
| | | } |
| | | @GetMapping("/getIntegralStudy") |
| | | @ApiOperation(value = "获取剩余积分", tags = {"学习端-获取剩余积分"}) |
| | | public R<Integer> getIntegralStudy() { |
| | | Integer userId = tokenService.getLoginUserStudy().getUserid(); |
| | | return R.ok(userService.getById(userId).getIntegral()); |
| | | } |
| | | |
| | | @GetMapping("/integralDetail") |
| | | @ApiOperation(value = "个人中心-积分明细", tags = {"个人中心-积分明细"}) |
| | | @ApiOperation(value = "个人中心-积分明细", tags = {"学习端-个人中心"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "查询时间", name = "time", dataType = "Integer"), |
| | | @ApiImplicitParam(value = "查询时间 格式yyyy-MM", name = "time", dataType = "Integer"), |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页显示条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<IPage<TIntegralRecord>> integralDetail(String time, |
| | | @RequestParam("pageNum") Integer pageNum, |
| | | @RequestParam("pageSize") Integer pageSize) { |
| | | if(tokenService.getLoginUserStudy() == null){ |
| | | return R.tokenError("登录失效"); |
| | | } |
| | | return R.ok(integralRecordService.integralDetail(new Page<>(pageNum, pageSize), tokenService.getLoginUserStudy().getUserid(), time)); |
| | | } |
| | | @GetMapping("/integralDetailParent") |
| | | @ApiOperation(value = "个人中心-积分明细", tags = {"家长端"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "查询时间 格式yyyy-MM", name = "time", dataType = "Integer"), |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页显示条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<IPage<TIntegralRecord>> integralDetailParent(String time, |
| | | @RequestParam("pageNum") Integer pageNum, |
| | | @RequestParam("pageSize") Integer pageSize) { |
| | | if(tokenService.getLoginUser1() == null){ |
| | | return R.tokenError("登录失效"); |
| | | } |
| | | |
| | | return R.ok(integralRecordService.integralDetail(new Page<>(pageNum, pageSize), tokenService.getLoginUser1().getUserid(), time)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param method 变动源 |
| | | */ |
| | | @GetMapping("/addIntegralDetail") |
| | | @ApiOperation(value = "添加-积分明细", tags = {"添加-积分明细"}) |
| | | // @ApiOperation(value = "添加-积分明细", tags = {"添加-积分明细"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "积分数量", name = "integral", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "变动源(完成学习、完成游戏...)", name = "method", dataType = "String", required = true) |
| | |
| | | public R<Boolean> addIntegralDetail(@RequestParam("integral") String integral, @RequestParam("method") String method) { |
| | | // 当前登录用户 |
| | | LoginUserParent userStudy = tokenService.getLoginUserStudy(); |
| | | // 生成积分明细信息 |
| | | TIntegralRecord integralRecord = new TIntegralRecord(); |
| | | integralRecord.setIntegral(integral); |
| | | integralRecord.setMethod(method); |
| | | integralRecord.setUserId(userStudy.getUserid()); |
| | | integralRecord.setDisabled(Boolean.FALSE); |
| | | integralRecord.setCreateBy(userStudy.getPhone()); |
| | | integralRecord.setCreateTime(new Date()); |
| | | integralRecord.setUpdateBy(userStudy.getPhone()); |
| | | integralRecord.setUpdateTime(new Date()); |
| | | return R.ok(integralRecordService.save(integralRecord)); |
| | | } |
| | | @GetMapping("/addIntegralDetail1") |
| | | // @ApiOperation(value = "添加-积分明细", tags = {"添加-积分明细"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "积分数量", name = "integral", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "变动源(完成学习、完成游戏...)", name = "method", dataType = "String", required = true) |
| | | }) |
| | | public R addIntegralDetail1(@RequestParam("integral") String integral, @RequestParam("method") String method) { |
| | | // 当前登录用户 |
| | | LoginUserParent userStudy = tokenService.getLoginUser1(); |
| | | if (userStudy == null){ |
| | | return R.tokenError("登录失效"); |
| | | } |
| | | // 生成积分明细信息 |
| | | TIntegralRecord integralRecord = new TIntegralRecord(); |
| | | integralRecord.setIntegral(integral); |
| | |
| | | * @param method 变动源 |
| | | */ |
| | | @GetMapping("/exchangeIntegral") |
| | | @ApiOperation(value = "用户积分变动", tags = {"用户积分变动"}) |
| | | // @ApiOperation(value = "用户积分变动", tags = {"用户积分变动"}) |
| | | public R<Boolean> exchangeIntegral(@RequestParam("integral") Integer integral, @RequestParam("method") String method) { |
| | | TUser user = userService.getById(tokenService.getLoginUserStudy().getUserid()); |
| | | if (Constants.BURDEN.equals(method)) { |
| | |
| | | } |
| | | return R.ok(userService.updateById(user)); |
| | | } |
| | | @GetMapping("/exchangeIntegral1") |
| | | // @ApiOperation(value = "用户积分变动", tags = {"用户积分变动"}) |
| | | public R<Boolean> exchangeIntegral1(@RequestParam("integral") Integer integral, @RequestParam("method") String method) { |
| | | TUser user = userService.getById(tokenService.getLoginUser1().getUserid()); |
| | | if (Constants.BURDEN.equals(method)) { |
| | | user.setIntegral(user.getIntegral() - integral); |
| | | } else { |
| | | user.setIntegral(user.getIntegral() + integral); |
| | | } |
| | | return R.ok(userService.updateById(user)); |
| | | } |
| | | |
| | | } |
| | | |