Skip to content

Commit

Permalink
Fixed codesmells
Browse files Browse the repository at this point in the history
  • Loading branch information
ospodaryk committed Sep 25, 2023
1 parent d2bb1a5 commit d51aa36
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import greencity.enums.AchievementAction;
import greencity.enums.RatingCalculationEnum;
import greencity.rating.RatingCalculation;
import greencity.repository.AchievementCategoryRepo;
import greencity.repository.AchievementRepo;
import greencity.repository.UserAchievementRepo;
import greencity.repository.UserRepo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;

@Service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import greencity.exception.exceptions.UnsupportedSortException;
import greencity.filters.EcoNewsSpecification;
import greencity.filters.SearchCriteria;
import greencity.mapping.AddEcoNewsCommentDtoResponseMapper;
import greencity.repository.EcoNewsRepo;
import greencity.repository.EcoNewsSearchRepo;
import lombok.RequiredArgsConstructor;
Expand All @@ -38,13 +37,11 @@
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;

import static greencity.constant.AppConstant.AUTHORIZATION;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;

@Service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
import java.util.stream.Stream;

Expand Down Expand Up @@ -702,7 +701,7 @@ public HabitAssignDto enrollHabit(Long habitAssignId, Long userId, LocalDate dat
HabitStatusCalendar habitCalendar = HabitStatusCalendar.builder()
.enrollDate(date).habitAssign(habitAssign).build();

updateHabitAssignAfterEnroll(habitAssign, habitCalendar, userId);
updateHabitAssignAfterEnroll(habitAssign, habitCalendar);
UserVO userVO = userService.findById(userId);
achievementCalculation.calculateAchievement(userVO.getId(),
AchievementCategoryType.HABIT, AchievementAction.ASSIGN);
Expand Down Expand Up @@ -740,7 +739,7 @@ private void validateForEnroll(LocalDate date, HabitAssign habitAssign) {
* @param habitAssign {@link HabitAssign} instance.
*/
private void updateHabitAssignAfterEnroll(HabitAssign habitAssign,
HabitStatusCalendar habitCalendar, Long userId) {
HabitStatusCalendar habitCalendar) {
habitAssign.setWorkingDays(habitAssign.getWorkingDays() + 1);
habitAssign.setLastEnrollmentDate(ZonedDateTime.now());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import greencity.exception.exceptions.UserBlockedException;
import greencity.repository.PlaceCommentRepo;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import lombok.AllArgsConstructor;
Expand Down

0 comments on commit d51aa36

Please sign in to comment.