| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.study.domain.*; |
| | | import com.ruoyi.study.dto.StudyWeekDTO; |
| | | import com.ruoyi.study.mapper.TStudyMapper; |
| | | import com.ruoyi.study.service.*; |
| | | import com.ruoyi.study.service.ITGameRecordService; |
| | | import com.ruoyi.study.service.ITStudyService; |
| | | import com.ruoyi.study.service.ITSubjectService; |
| | | import com.ruoyi.study.service.ITUserStudyService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @Resource |
| | | private ITUserStudyService userStudyService; |
| | | @Resource |
| | | private ITStudyListenService studyListenService; |
| | | @Resource |
| | | private ITSubjectService subjectService; |
| | | @Resource |
| | | private ITGameRecordService gameRecordService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | private final static Map<String, Integer> GAME_DIFFICULTY_MAP = new HashMap<>(); |
| | | |
| | |
| | | throw new GlobalException("游戏等级异常,请重试!"); |
| | | } |
| | | // 获取用户游戏进度 |
| | | Long userId = SecurityUtils.getUserId(); |
| | | Integer userId = tokenService.getLoginUserStudy().getUserid(); |
| | | List<TGameRecord> list = gameRecordService.lambdaQuery().eq(TGameRecord::getUserId, userId).eq(TGameRecord::getGameId, game.getId()).list(); |
| | | boolean contains = list.stream().map(TGameRecord::getGameDifficulty).collect(Collectors.toList()).contains(level); |
| | | if (!contains) { |