|
|
@ -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);
|
|
|
|