| | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | // 获取登录token |
| | | map.put("token", tokenService.createTokenStudy(loginUserParent)); |
| | | // 学习进度检查 |
| | | TUserStudy userStudy = userStudyService.lambdaQuery().eq(TUserStudy::getUserId, user.getId()) |
| | | .eq(TUserStudy::getDisabled, 0).one(); |
| | | if (null == userStudy) { |
| | | TUserStudy study = new TUserStudy(); |
| | | study.setUserId(user.getId()); |
| | | // 学习周目 |
| | | TStudy tStudy = studyService.lambdaQuery().eq(TStudy::getQuarter, Constants.ONE) |
| | | .orderByAsc(TStudy::getWeek).last("limit 1").one(); |
| | | study.setWeek(tStudy.getWeek()); |
| | | study.setDay(Constants.ONE); |
| | | study.setTotalStudy(Constants.ZERO); |
| | | study.setTodayStudy(Constants.ZERO); |
| | | study.setWeekStudy(Constants.ZERO); |
| | | study.setMonthStudy(Constants.ZERO); |
| | | study.setListen(Constants.BURDEN_ONE); |
| | | study.setLook(Constants.BURDEN_ONE); |
| | | study.setInduction(Constants.BURDEN_ONE); |
| | | study.setAnswer(Constants.BURDEN_ONE); |
| | | study.setPair(Constants.BURDEN_ONE); |
| | | userStudyService.save(study); |
| | | } |
| | | return R.ok(map); |
| | | } |
| | | |