Skip to content

Commit

Permalink
Fix/#257 init point by delete all stamp (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
ozzing authored May 23, 2024
2 parents da16d3f + 0b68df4 commit f5c45d8
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public List<Point> findCurrentPointListBySoptampUserIds(List<Long> soptampUserId
@Transactional
public void addPoint(Long soptampUserId, Integer level) {
val soptampPoint = soptampPointRepository.findBySoptampUserIdAndGeneration(soptampUserId, currentGeneration);
if(soptampPoint.isPresent()){

if (soptampPoint.isPresent()) {
val soptampPointEntity = soptampPoint.get();
val newSoptampPoint = SoptampPoint.builder()
.id(soptampPointEntity.getId())
Expand All @@ -71,8 +70,7 @@ public void addPoint(Long soptampUserId, Integer level) {
@Transactional
public void subtractPoint(Long soptampUserId, Integer level) {
val soptampPoint = soptampPointRepository.findBySoptampUserIdAndGeneration(soptampUserId, currentGeneration);
if(soptampPoint.isEmpty()){

if (soptampPoint.isEmpty()) {
return;
}
val soptampPointEntity = soptampPoint.get();
Expand Down Expand Up @@ -115,6 +113,7 @@ public void initPoint(Long soptampUserId) {
.soptampUserId(soptampPointEntity.getSoptampUserId())
.points(0L)
.build();

soptampPointRepository.save(newSoptampPoint);
}

Expand Down

0 comments on commit f5c45d8

Please sign in to comment.