-
Notifications
You must be signed in to change notification settings - Fork 2
[BE] [FEAT] 관리자 회원 관리 기능 추가 #228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
The head ref may contain hidden characters: "20260210_#206_\uAD00\uB9AC\uC790_\uD68C\uC6D0_\uAD00\uB9AC_\uAE30\uB2A5_\uCD94\uAC00"
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
786721a
[BE] [FEAT] Excel 처리용 Apache POI 의존성 추가
Yooonjeong d41a14a
[BE] [FEAT] 신입부원/준회원/정회원/선배 구분용 enum 추가
Yooonjeong 22a5bae
[BE] [FEAT] 기존의 isNewMember 필드 grade 필드로 변경
Yooonjeong 62f07e5
[BE] [FEAT] Gender, Role enum에 from 메서드 추가
Yooonjeong c562ec7
[BE] [FEAT] 엑셀 데이터 적용용 User 내부 메서드 정의
Yooonjeong 7a08724
[BE] [FEAT] 신규 회원가입 시 PENDING_MEMBER role 및 NEW_MEMBER grade 설정
Yooonjeong 68dec64
[BE] [FEAT] 관리자 페이지 사용자 조회용 Request DTO 정의
Yooonjeong 6497b56
[BE] [FEAT] 관리자 페이지 사용자 조회용 Response DTO 정의
Yooonjeong c1b8e18
[BE] [FEAT] 엑셀 파일의 한 행을 정의하는 DTO 추가
Yooonjeong df06ede
[BE] [FEAT] 엑셀 동기화 결과 반환 DTO 정의
Yooonjeong 063ae3c
[BE] [FEAT] 엑셀 관련 ErrorCode 정의
Yooonjeong 96c4be0
[BE] [REFACTOR] 로그인 시 비밀번호 검증 없이 일치 여부만 체크하도록 변경
Yooonjeong 17932cb
[BE] [FEAT] UserStatus 기반 조회 쿼리 정의
Yooonjeong b86ab35
[BE] [FEAT] 관리자 조회 및 프로젝션용 Repository 정의
Yooonjeong 8458f8f
[BE] [FEAT] 엑셀 추출 사용자 데이터 DB 동기화 로직 구현
Yooonjeong b0abfce
[BE] [FEAT] 관리자 페이지 사용자 관리 service 구현
Yooonjeong 6e32925
[BE] [FEAT] 관리자 페이지 사용자 관리 controller 구현
Yooonjeong 32ea2f5
[BE] [FEAT] 관리자 페이지용 선배 등급 변경 API 추가
Yooonjeong 4342654
Merge branch 'main' into 20260210_#206_관리자_회원_관리_기능_추가
Yooonjeong 83e3cc3
[BE] [REMOVE] 불필요한 정적 팩토리 메서드 제거
Yooonjeong d152530
[BE] [FEAT] grade 기본값 설정 추가
Yooonjeong 3dd1215
[BE] [FEAT] Apache POI 최신 버전(5.5.1)으로 업데이트
Yooonjeong e88e4a2
[BE] [FEAT] Account에 owner_id와 type 유니크 제약 추가
Yooonjeong d0ccbac
[BE] [REFACTOR] @Valid를 통해 검증되는 String 중복 검증 제거
Yooonjeong a9766ec
[BE] [REFACTOR] 불필요 매핑 메서드 제거
Yooonjeong ffe13c0
[BE] [FEAT] 엑셀 파일 동기화 로깅 추가
Yooonjeong fbff493
[BE] [REFACTOR] 상태 변경 메서드 UserService로 이동 및 AdminUserService에 적용
Yooonjeong 5ea09f0
[BE] [FEAT] User 엔티티에 로그인 가능 여부 판단 메서드 추가
Yooonjeong b86b71d
[BE] [REFACTOR] UserStatus의 PENDING 삭제
Yooonjeong 961060c
[BE] [FEAT] 활동 상태가 아닌 경우 에러 코드 정의
Yooonjeong 32016b4
[BE] [FEAT] 로그인 시 탈퇴 회원 차단 로직 추가
Yooonjeong 346fc77
[BE] [FEAT] 관리자용 사용자 조회 시 기본 정렬 추가 (기수 최신순, 이름 오름차순)
Yooonjeong a093b5b
[BE] [DOCS] 관리자 API Swagger Docs 수정
Yooonjeong 9c87ad2
[BE] [FIX] 엑셀 데이터 동기화 중 비활성화 시 SYSTEM_ADMIN 제외
Yooonjeong b99793a
[BE] [REFACTOR] 탈퇴 회원 로그인 차단 에러 코드 변경
Yooonjeong b06b212
[BE] [REFACTOR] 엑셀 파싱 시 DataFormatter를 로컬 변수로 변경하여 스레드 안전성 개선
Yooonjeong c48fcb6
[BE] [DOCS] 회원 탈퇴 Swagger Docs 수정
Yooonjeong 0bf7f35
[BE] [REFACTOR] 확장자 검증 시 소문자 변환 추가
Yooonjeong 54a564c
[BE] [REFACTOR] MANAGER role 검증 삭제
Yooonjeong 1c2e9e6
[BE] [FEAT] 관리자 회원 조회 시 전화번호 검색 기능 추가
Yooonjeong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 12 additions & 2 deletions
14
backend/src/main/java/org/sejongisc/backend/admin/dto/AdminUserRequest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,15 @@ | ||
| package org.sejongisc.backend.admin.dto; | ||
|
|
||
| public class AdminUserRequest { | ||
| import org.sejongisc.backend.user.entity.Role; | ||
| import org.sejongisc.backend.user.entity.UserStatus; | ||
|
|
||
| } | ||
| /** | ||
| * 관리자 페이지의 사용자 필터링/검색 조회 요청 | ||
| */ | ||
| public record AdminUserRequest ( | ||
| String keyword, // 키워드 | ||
| Integer generation, // 기수 | ||
| Role role, // 권한 | ||
| UserStatus status // 상태 | ||
| ) { | ||
| } |
25 changes: 25 additions & 0 deletions
25
backend/src/main/java/org/sejongisc/backend/admin/dto/AdminUserResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| package org.sejongisc.backend.admin.dto; | ||
|
|
||
| import lombok.Builder; | ||
| import org.sejongisc.backend.user.entity.*; | ||
|
|
||
| import java.util.UUID; | ||
|
|
||
| @Builder | ||
| public record AdminUserResponse( | ||
| UUID id, | ||
| String studentId, | ||
| String name, | ||
| String email, | ||
| String phoneNumber, | ||
| long point, // Account 엔티티의 balance 값 | ||
| Grade grade, | ||
| Role role, | ||
| UserStatus status, | ||
| Integer generation, | ||
| String college, | ||
| String department, | ||
| String teamName, | ||
| String positionName | ||
| ) { | ||
| } |
10 changes: 10 additions & 0 deletions
10
backend/src/main/java/org/sejongisc/backend/admin/dto/ExcelSyncResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package org.sejongisc.backend.admin.dto; | ||
|
|
||
| /** | ||
| * 엑셀 동기화 결과 응답 | ||
| */ | ||
| public record ExcelSyncResponse( | ||
| int createdCount, | ||
| int updatedCount | ||
| ) { | ||
| } |
21 changes: 21 additions & 0 deletions
21
backend/src/main/java/org/sejongisc/backend/admin/dto/UserExcelRow.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package org.sejongisc.backend.admin.dto; | ||
|
|
||
| import lombok.Builder; | ||
|
|
||
| /** | ||
| * 엑셀 파일의 한 행 데이터를 담는 Row | ||
| */ | ||
| @Builder | ||
| public record UserExcelRow( | ||
| String studentId, | ||
| String name, | ||
| String phone, | ||
| String teamName, | ||
| String generation, | ||
| String college, | ||
| String department, | ||
| String grade, | ||
| String position, | ||
| String gender | ||
| ) { | ||
| } |
65 changes: 65 additions & 0 deletions
65
backend/src/main/java/org/sejongisc/backend/admin/repository/AdminUserRepository.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| package org.sejongisc.backend.admin.repository; | ||
|
|
||
| import org.sejongisc.backend.admin.dto.AdminUserResponse; | ||
| import org.sejongisc.backend.point.entity.AccountType; | ||
| import org.sejongisc.backend.user.entity.Role; | ||
| import org.sejongisc.backend.user.entity.User; | ||
| import org.sejongisc.backend.user.entity.UserStatus; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
| import org.springframework.data.jpa.repository.Query; | ||
| import org.springframework.data.repository.query.Param; | ||
|
|
||
| import java.util.List; | ||
| import java.util.UUID; | ||
|
|
||
| /** | ||
| * 관리자 화면용 User 조회 전용 레포지토리 | ||
| * - User 도메인의 기본 CRUD는 user 패키지의 UserRepository에서 담당 | ||
| * - 해당 클래스는 Admin 페이지에서만 사용되는 조회 쿼리와 Admin DTO로의 프로젝션 로직을 정의 | ||
| */ | ||
| public interface AdminUserRepository extends JpaRepository<User, UUID> { | ||
|
|
||
| @Query(""" | ||
| SELECT new org.sejongisc.backend.admin.dto.AdminUserResponse( | ||
| u.userId, | ||
| u.studentId, | ||
| u.name, | ||
| u.email, | ||
| u.phoneNumber, | ||
| COALESCE(a.balance, 0), | ||
| u.grade, | ||
| u.role, | ||
| u.status, | ||
| u.generation, | ||
| u.college, | ||
| u.department, | ||
| u.teamName, | ||
| u.positionName | ||
| ) | ||
| FROM User u | ||
| LEFT JOIN Account a | ||
| ON u.userId = a.ownerId | ||
| AND a.type = :accountType | ||
| WHERE | ||
| (:keyword IS NULL OR | ||
| u.name LIKE %:keyword% OR | ||
| u.email LIKE %:keyword% OR | ||
| (:numericKeyword IS NOT NULL AND ( | ||
| u.studentId LIKE %:numericKeyword% OR | ||
| u.phoneNumber LIKE %:numericKeyword% | ||
| )) | ||
| ) | ||
| AND (:generation IS NULL OR u.generation = :generation) | ||
| AND (:role IS NULL OR u.role = :role) | ||
| AND (:status IS NULL OR u.status = :status) | ||
| ORDER BY u.generation DESC, u.name ASC | ||
| """) | ||
| List<AdminUserResponse> findAllByAdminFilter( | ||
| @Param("keyword") String keyword, | ||
| @Param("numericKeyword") String numericKeyword, | ||
| @Param("generation") Integer generation, | ||
| @Param("role") Role role, | ||
| @Param("status") UserStatus status, | ||
| @Param("accountType") AccountType accountType | ||
| ); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.