Skip to content

Commit

Permalink
Merge pull request EveryUniv#93 from EveryUniv/dev
Browse files Browse the repository at this point in the history
feat: 내 정보 조회 시 재학생 여부 확인할 수 있는 값 추가
  • Loading branch information
gutanbug authored Jan 31, 2024
2 parents 7bd36f2 + 14c07e9 commit 8f6088a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ public class ResponseUserInfoDto {
private final Long likedPostCount;
private final Long petitionCount;
private final Long agreedPetitionCount;
private final boolean isDkuChecked;
private final boolean admin;
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public interface UserRepository extends JpaRepository<User, Long>, JpaSpecificat
Optional<User> findByIdWithNotActive(@Param("id") Long id);

/**
* 학기 단위 (3.1, 9.1)로 계정 인증을 false로 변경할 때 사용한다.
* 학기 단위 (3.1, 9.1)로 계정 인증을 false로 변경할 때 사용한다. (단, 관리자는 제외한다.)
*/
@Query("select u from User u where u.status = 'ACTIVE' and u.isDkuChecked = true")
List<User> findAllWithDkuChecked();
@Query("select u from User u where u.status = 'ACTIVE' and u.isDkuChecked = true and u.userRole != 'ADMIN'")
List<User> findAllWithDkuCheckedExceptAdmin();
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public ResponseUserInfoDto getFullUserInfo(Long userId) {
user.getNickname(), user.getAge(), user.getGender(), year,
major.getName(), major.getDepartment(), phoneNumber, user.getProfileImage(),
writePostCount, commentedPostCount, likedPostCount,
petitionCount, agreedPetitionCount, user.getUserRole().isAdmin());
petitionCount, agreedPetitionCount, user.isDkuChecked(), user.getUserRole().isAdmin());
}

@Transactional(readOnly = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class DkuAuthBatchService {
*/
@Transactional
public void resetDkuAuth() {
List<User> listUser = userRepository.findAllWithDkuChecked();
List<User> listUser = userRepository.findAllWithDkuCheckedExceptAdmin();
for (User user : listUser) {
user.changeIsDkuChecked();
}
Expand Down

0 comments on commit 8f6088a

Please sign in to comment.