| | |
| | | package com.ruoyi.study.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.study.domain.TGame; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.study.domain.TGameRecord; |
| | | import com.ruoyi.study.mapper.TGameMapper; |
| | | import com.ruoyi.study.dto.CompleteGameDTO; |
| | | import com.ruoyi.study.mapper.TGameRecordMapper; |
| | | import com.ruoyi.study.service.ITGameRecordService; |
| | | import com.ruoyi.study.service.ITGameService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TGameRecordServiceImpl extends ServiceImpl<TGameRecordMapper, TGameRecord> implements ITGameRecordService { |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean add(CompleteGameDTO gameAchievement) { |
| | | TGameRecord data = new TGameRecord(); |
| | | data.setUserId(SecurityUtils.getUserId().intValue()); |
| | | data.setAccuracy(gameAchievement.getAccuracy()); |
| | | data.setGameName(gameAchievement.getGameName()); |
| | | data.setUseTime(gameAchievement.getUseTime()); |
| | | data.setGameId(gameAchievement.getGameId()); |
| | | data.setGameDifficulty(gameAchievement.getDifficulty()); |
| | | return this.save(data); |
| | | } |
| | | } |