release: 根据类型查询积分列表

release-2024-08-08
huangyw 4 months ago
parent c3e7a7aced
commit 9c7c078432

@ -57,7 +57,7 @@ public class UserPointLogService {
public UserPointLogService(UserPointLogDao userPointLogDao, IdWorker idWorker, JwtUtil jwtUtil, public UserPointLogService(UserPointLogDao userPointLogDao, IdWorker idWorker, JwtUtil jwtUtil,
TaskPointService taskPointService, TaskPointDao taskPointDao, RabbitTemplate rabbitTemplate, TaskPointDao taskPointDao, RabbitTemplate rabbitTemplate,
UserInfoService userInfoService) { UserInfoService userInfoService) {
this.userPointLogDao = userPointLogDao; this.userPointLogDao = userPointLogDao;
this.idWorker = idWorker; this.idWorker = idWorker;
@ -78,10 +78,16 @@ public class UserPointLogService {
*/ */
public void addByTask(String taskPointId, String token) { public void addByTask(String taskPointId, String token) {
TaskPoint taskPoint = taskPointDao.findById(taskPointId).get();
UserLoginDto userLoginDto = jwtUtil.getUserLoginDto(token); UserLoginDto userLoginDto = jwtUtil.getUserLoginDto(token);
// 新手任务,只触发一次
if (!userPointLogDao.findUserPointLogByUserIdAndTaskPointId(userLoginDto.getUserId(),
taskPointId).isEmpty()) {
return;
}
TaskPoint taskPoint = taskPointDao.findById(taskPointId).get();
UserPointLog userPointLog = UserPointLog.builder() UserPointLog userPointLog = UserPointLog.builder()
.id(String.valueOf(idWorker.nextId())) .id(String.valueOf(idWorker.nextId()))
.score(taskPoint.getScore()) .score(taskPoint.getScore())
@ -143,7 +149,8 @@ public class UserPointLogService {
* @param size * @param size
* @return * @return
*/ */
public PageResult<UserPointLog> getUserPointLogList(String token, UserPointLogSearchDto userPointLogSearchDto, Integer page, public PageResult<UserPointLog> getUserPointLogList(String token,
UserPointLogSearchDto userPointLogSearchDto, Integer page,
Integer size) { Integer size) {
// //
UserLoginDto userLoginDto = jwtUtil.getUserLoginDto(token); UserLoginDto userLoginDto = jwtUtil.getUserLoginDto(token);

Loading…
Cancel
Save