release: TaskPoint 封装DTO

release-2024-08-08
huangyw 4 months ago
parent cf78faaece
commit 8f674eec70

@ -61,7 +61,6 @@ public class TaskPointService {
taskPoint.setCreateUser(userLoginDto.getUserId()); taskPoint.setCreateUser(userLoginDto.getUserId());
taskPointDao.save(taskPoint); taskPointDao.save(taskPoint);
redisTemplate.opsForValue().set(TASK_POINT + taskPoint.getId(), taskPoint); redisTemplate.opsForValue().set(TASK_POINT + taskPoint.getId(), taskPoint);
} }
@ -75,8 +74,13 @@ public class TaskPointService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void update(TaskPoint taskPoint, String token) { public void update(TaskPoint taskPoint, String token) {
UserLoginDto userLoginDto = jwtUtil.getUserLoginDto(token); UserLoginDto userLoginDto = jwtUtil.getUserLoginDto(token);
taskPoint.setUpdateUser(userLoginDto.getUserId());
TaskPoint old = taskPointDao.getOne(taskPoint.getId());
old.setValid(taskPoint.getValid());
old.setDescription(taskPoint.getDescription());
old.setScore(taskPoint.getScore());
old.setType(taskPoint.getType());
old.setUpdateUser(userLoginDto.getUserId());
taskPointDao.save(taskPoint); taskPointDao.save(taskPoint);
redisTemplate.delete(TASK_POINT + taskPoint.getId()); redisTemplate.delete(TASK_POINT + taskPoint.getId());

Loading…
Cancel
Save