Skip to content
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

v1.6.0 #281

Merged
merged 11 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions .github/workflows/pull_request_gradle_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ on:
pull_request:
branches: ["develop"]

permissions:
pull-requests: write

jobs:
build-test:
runs-on: ubuntu-latest

steps:
- name: Git Checkout
uses: actions/checkout@v3.0.2
uses: actions/checkout@v4

- name: JDK 설치
uses: actions/setup-java@v4
Expand All @@ -25,8 +28,16 @@ jobs:
- name: Start containers
run: docker-compose -f ./docker-compose-test.yaml up -d

- name: Gradle Build
uses: gradle/gradle-build-action@v2
- name: Build with Gradle
id: gradle
uses: gradle/actions/setup-gradle@v3
with:
arguments: check
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }}
arguments: |
check
--configuration-cache
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }} # feature 브랜치는 캐시를 읽기 전용으로 설정
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
add-job-summary-as-pr-comment: always
build-scan-publish: true
build-scan-terms-of-service-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-service-agree: "yes"
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'

// Lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'

// Spring Security
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'org.springframework.boot:spring-boot-starter-security'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.gdschongik.gdsc.domain.member.domain.RequirementStatus;
import com.gdschongik.gdsc.domain.member.dto.request.MemberGrantRequest;
import com.gdschongik.gdsc.domain.member.dto.request.MemberPaymentRequest;
import com.gdschongik.gdsc.domain.member.dto.request.MemberQueryRequest;
import com.gdschongik.gdsc.domain.member.dto.request.MemberQueryOption;
import com.gdschongik.gdsc.domain.member.dto.request.MemberUpdateRequest;
import com.gdschongik.gdsc.domain.member.dto.response.AdminMemberResponse;
import com.gdschongik.gdsc.domain.member.dto.response.MemberGrantResponse;
Expand Down Expand Up @@ -37,8 +37,8 @@ public class AdminMemberController {

@Operation(summary = "전체 회원 목록 조회", description = "전체 회원 목록을 조회합니다.")
@GetMapping
public ResponseEntity<Page<AdminMemberResponse>> getMembers(MemberQueryRequest queryRequest, Pageable pageable) {
Page<AdminMemberResponse> response = adminMemberService.findAll(queryRequest, pageable);
public ResponseEntity<Page<AdminMemberResponse>> getMembers(MemberQueryOption queryOption, Pageable pageable) {
Page<AdminMemberResponse> response = adminMemberService.findAll(queryOption, pageable);
return ResponseEntity.ok().body(response);
}

Expand All @@ -52,8 +52,8 @@ public ResponseEntity<Void> withdrawMember(@PathVariable Long memberId) {
@Operation(summary = "대기중인 회원 목록 조회", description = "대기중인 회원 목록을 조회합니다.")
@GetMapping("/pending")
public ResponseEntity<Page<AdminMemberResponse>> getPendingMembers(
MemberQueryRequest queryRequest, Pageable pageable) {
Page<AdminMemberResponse> response = adminMemberService.findAllPendingMembers(queryRequest, pageable);
MemberQueryOption queryOption, Pageable pageable) {
Page<AdminMemberResponse> response = adminMemberService.findAllPendingMembers(queryOption, pageable);
return ResponseEntity.ok().body(response);
}

Expand All @@ -75,19 +75,19 @@ public ResponseEntity<MemberGrantResponse> grantMember(@Valid @RequestBody Membe
@Operation(summary = "승인 가능 회원 전체 조회", description = "승인 가능한 회원 전체를 조회합니다.")
@GetMapping("/grantable")
public ResponseEntity<Page<AdminMemberResponse>> getGrantableMembers(
MemberQueryRequest queryRequest, Pageable pageable) {
Page<AdminMemberResponse> response = adminMemberService.getGrantableMembers(queryRequest, pageable);
MemberQueryOption queryOption, Pageable pageable) {
Page<AdminMemberResponse> response = adminMemberService.getGrantableMembers(queryOption, pageable);
return ResponseEntity.ok().body(response);
}

@Operation(summary = "회비 납부 상태에 따른 회원 전체 조회", description = "회비 납부 상태에 따라 회원 목록을 조회합니다.")
@GetMapping("/payment")
public ResponseEntity<Page<AdminMemberResponse>> getMembersByPaymentStatus(
MemberQueryRequest queryRequest,
MemberQueryOption queryOption,
@RequestParam(name = "status", required = false) RequirementStatus paymentStatus,
Pageable pageable) {
Page<AdminMemberResponse> response =
adminMemberService.getMembersByPaymentStatus(queryRequest, paymentStatus, pageable);
adminMemberService.getMembersByPaymentStatus(queryOption, paymentStatus, pageable);
return ResponseEntity.ok().body(response);
}

Expand All @@ -102,8 +102,8 @@ public ResponseEntity<Void> updatePayment(
@Operation(summary = "승인된 회원 전체 조회", description = "승인된 회원 전체를 조회합니다.")
@GetMapping("/granted")
public ResponseEntity<Page<AdminMemberResponse>> getGrantedMembers(
MemberQueryRequest queryRequest, Pageable pageable) {
Page<AdminMemberResponse> response = adminMemberService.findAllGrantedMembers(queryRequest, pageable);
MemberQueryOption queryOption, Pageable pageable) {
Page<AdminMemberResponse> response = adminMemberService.findAllGrantedMembers(queryOption, pageable);
return ResponseEntity.ok().body(response);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.gdschongik.gdsc.domain.member.domain.RequirementStatus;
import com.gdschongik.gdsc.domain.member.dto.request.MemberGrantRequest;
import com.gdschongik.gdsc.domain.member.dto.request.MemberPaymentRequest;
import com.gdschongik.gdsc.domain.member.dto.request.MemberQueryRequest;
import com.gdschongik.gdsc.domain.member.dto.request.MemberQueryOption;
import com.gdschongik.gdsc.domain.member.dto.request.MemberUpdateRequest;
import com.gdschongik.gdsc.domain.member.dto.response.AdminMemberResponse;
import com.gdschongik.gdsc.domain.member.dto.response.MemberGrantResponse;
Expand All @@ -32,8 +32,8 @@ public class AdminMemberService {
private final MemberRepository memberRepository;
private final ExcelUtil excelUtil;

public Page<AdminMemberResponse> findAll(MemberQueryRequest queryRequest, Pageable pageable) {
Page<Member> members = memberRepository.findAllByRole(queryRequest, pageable, null);
public Page<AdminMemberResponse> findAll(MemberQueryOption queryOption, Pageable pageable) {
Page<Member> members = memberRepository.findAllByRole(queryOption, pageable, null);
return members.map(AdminMemberResponse::from);
}

Expand All @@ -57,8 +57,8 @@ public void updateMember(Long memberId, MemberUpdateRequest request) {
request.nickname());
}

public Page<AdminMemberResponse> findAllPendingMembers(MemberQueryRequest queryRequest, Pageable pageable) {
Page<Member> members = memberRepository.findAllByRole(queryRequest, pageable, GUEST);
public Page<AdminMemberResponse> findAllPendingMembers(MemberQueryOption queryOption, Pageable pageable) {
Page<Member> members = memberRepository.findAllByRole(queryOption, pageable, GUEST);
return members.map(AdminMemberResponse::from);
}

Expand All @@ -70,14 +70,14 @@ public MemberGrantResponse grantMember(MemberGrantRequest request) {
return MemberGrantResponse.from(classifiedMember);
}

public Page<AdminMemberResponse> getGrantableMembers(MemberQueryRequest queryRequest, Pageable pageable) {
Page<Member> members = memberRepository.findAllGrantable(queryRequest, pageable);
public Page<AdminMemberResponse> getGrantableMembers(MemberQueryOption queryOption, Pageable pageable) {
Page<Member> members = memberRepository.findAllGrantable(queryOption, pageable);
return members.map(AdminMemberResponse::from);
}

public Page<AdminMemberResponse> getMembersByPaymentStatus(
MemberQueryRequest queryRequest, RequirementStatus paymentStatus, Pageable pageable) {
Page<Member> members = memberRepository.findAllByPaymentStatus(queryRequest, paymentStatus, pageable);
MemberQueryOption queryOption, RequirementStatus paymentStatus, Pageable pageable) {
Page<Member> members = memberRepository.findAllByPaymentStatus(queryOption, paymentStatus, pageable);
return members.map(AdminMemberResponse::from);
}

Expand All @@ -87,8 +87,8 @@ public void updatePaymentStatus(Long memberId, MemberPaymentRequest request) {
member.updatePaymentStatus(request.status());
}

public Page<AdminMemberResponse> findAllGrantedMembers(MemberQueryRequest queryRequest, Pageable pageable) {
Page<Member> members = memberRepository.findAllByRole(queryRequest, pageable, USER);
public Page<AdminMemberResponse> findAllGrantedMembers(MemberQueryOption queryOption, Pageable pageable) {
Page<Member> members = memberRepository.findAllByRole(queryOption, pageable, USER);
return members.map(AdminMemberResponse::from);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package com.gdschongik.gdsc.domain.member.application;

import static com.gdschongik.gdsc.global.exception.ErrorCode.*;

import com.gdschongik.gdsc.domain.member.dao.MemberRepository;
import com.gdschongik.gdsc.domain.member.domain.Member;
import com.gdschongik.gdsc.domain.member.dto.request.MemberSignupRequest;
import com.gdschongik.gdsc.domain.member.dto.request.OnboardingMemberUpdateRequest;
import com.gdschongik.gdsc.domain.member.dto.response.MemberInfoResponse;
import com.gdschongik.gdsc.domain.member.dto.response.MemberUnivStatusResponse;
import com.gdschongik.gdsc.global.exception.CustomException;
import com.gdschongik.gdsc.global.exception.ErrorCode;
import com.gdschongik.gdsc.global.util.MemberUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
Expand Down Expand Up @@ -38,12 +39,15 @@ public void updateMember(OnboardingMemberUpdateRequest request) {

private void validateDiscordUsernameDuplicate(Member member) {
if (memberRepository.existsByDiscordUsername(member.getDiscordUsername())) {
throw new CustomException(ErrorCode.MEMBER_DISCORD_USERNAME_DUPLICATE);
throw new CustomException(MEMBER_DISCORD_USERNAME_DUPLICATE);
}
}

public MemberInfoResponse getMemberInfo() {
Member currentMember = memberUtil.getCurrentMember();
if (!currentMember.isApplied()) {
throw new CustomException(MEMBER_NOT_APPLIED);
}
return MemberInfoResponse.of(currentMember);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.gdschongik.gdsc.domain.member.domain.Member;
import com.gdschongik.gdsc.domain.member.domain.MemberRole;
import com.gdschongik.gdsc.domain.member.domain.RequirementStatus;
import com.gdschongik.gdsc.domain.member.dto.request.MemberQueryRequest;
import com.gdschongik.gdsc.domain.member.dto.request.MemberQueryOption;
import jakarta.annotation.Nullable;
import java.util.List;
import java.util.Map;
Expand All @@ -14,12 +14,12 @@
public interface MemberCustomRepository {
Optional<Member> findNormalByOauthId(String oauthId);

Page<Member> findAllGrantable(MemberQueryRequest queryRequest, Pageable pageable);
Page<Member> findAllGrantable(MemberQueryOption queryOption, Pageable pageable);

Page<Member> findAllByRole(MemberQueryRequest queryRequest, Pageable pageable, @Nullable MemberRole role);
Page<Member> findAllByRole(MemberQueryOption queryOption, Pageable pageable, @Nullable MemberRole role);

Page<Member> findAllByPaymentStatus(
MemberQueryRequest queryRequest, RequirementStatus paymentStatus, Pageable pageable);
MemberQueryOption queryOption, RequirementStatus paymentStatus, Pageable pageable);

Map<Boolean, List<Member>> groupByVerified(List<Long> memberIdList);

Expand Down
Loading
Loading