Skip to content

Commit e5f8240

Browse files
023-devfivedragon5
andauthored
release: production 배포 (#417)
* feat: JWT 인증 필터에서 검증 토큰 처리 로직 개선 및 쿠키 삭제 기능 추가 * feat: JWT 인증 필터에서 검증 토큰 쿠키에 보안 속성 추가 * feat: JWT 인증 필터에서 검증 토큰 처리 로직 개선 * feat: JWT 인증 필터에서 검증 토큰 처리 로직 간소화 * feat: JWT 인증 필터에서 액세스 토큰 및 검증 토큰 처리 로직 개선 * feat: 관리자 로그인 및 서포터 토큰 발급 이벤트를 발행하도록 알림 시스템을 이벤트 기반으로 리팩토링 (#405) * feat: 미니 스터디 설명 필드 추가 (#408) * feat: MiniStudy 엔티티에 tag 필드 추가 * feat: MiniStudyResponse에 tag 필드 추가 * feat: MiniStudyQueryRepository에 tag 필드 추가 * test: MiniStudyQueryRepositoryTest에 tag 필드 관련 테스트 추가 * feat: mini_study 테이블에 tag 컬럼 추가 * feat: 관리자 지원서 조회 API에 기수 파라미터 추가 (#409) * feat: 임시 지원서 목록 조회 API에 semesterId 필터 추가 * feat: 제출된 지원서 조회 API에 semesterId 필터 추가 * feat: 제출된 지원서 조회 API에 semesterId 파라미터 추가 * feat: 임시 지원서 조회 API에 semesterId 파라미터 추가 * feat: 지원서 조회 쿼리에 semesterId 파라미터 추가 및 필터링 로직 구현 * test: 지원서 조회 테스트에 semesterId 필터링 테스트 추가 * feat: Jectalk 엔티티 스펙 변경 (#412) * feat: ContentType enum 추가하여 콘텐츠 유형 정의 * feat: Jectalk 엔티티 및 DTO 구조 변경 * feat: JectalkQueryRepository 반환 필드 수정 * test: JectalkQueryRepositoryTest 수정으로 반환 필드 검증 업데이트 * feat: Jectalk 테이블 구조 변경 및 데이터 마이그레이션으로 인한 Flyway migration 추 * feat: Jectalk 테이블 content_type 컬럼 기본값 추가 * feat: Category 필드 및 필터링 추가 * feat: n8n에 지원서 제출 이벤트 발행 기능 추가 (#415) --------- Co-authored-by: fad <ojy9406@naver.com>
1 parent 22aaa25 commit e5f8240

41 files changed

Lines changed: 626 additions & 247 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/main/java/org/ject/support/domain/admin/controller/AdminTempApplyApiSpec.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public interface AdminTempApplyApiSpec {
3737
)
3838
Page<TempSavedApplyResponse> getTempApplies(
3939
@RequestParam(required = false) JobFamily jobFamily,
40+
@RequestParam(required = false) final Long semesterId,
4041
@PageableDefault(size = 15) final Pageable pageable
4142
);
4243
}

src/main/java/org/ject/support/domain/admin/controller/AdminTempApplyController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ public void deleteTempApply(@PathVariable final Long tempApplyId) {
4040

4141
@GetMapping()
4242
public Page<TempSavedApplyResponse> getTempApplies(@RequestParam(required = false) JobFamily jobFamily,
43+
@RequestParam(required = false) final Long semesterId,
4344
@PageableDefault(size = 15) Pageable pageable) {
44-
return adminTempApplyService.getTempApplies(jobFamily, pageable);
45+
return adminTempApplyService.getTempApplies(jobFamily, semesterId, pageable);
4546
}
4647
}

src/main/java/org/ject/support/domain/admin/controller/SubmittedApplyApiSpec.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public interface SubmittedApplyApiSpec {
2828
summary = "제출된 지원서 목록 조회",
2929
description = "제출된 지원서들의 목록을 조회합니다.")
3030
Page<SubmittedApplyResponse> findSubmittedApplies(@RequestParam(required = false) final JobFamily jobFamily,
31+
@RequestParam(required = false) final Long semesterId,
3132
@PageableDefault(size = 15) final Pageable pageable);
3233

3334
@Operation(

src/main/java/org/ject/support/domain/admin/controller/SubmittedApplyController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ public SubmittedApplyCountResponse getSubmittedApplyCount() {
3737
@Override
3838
@GetMapping
3939
public Page<SubmittedApplyResponse> findSubmittedApplies(@RequestParam(required = false) final JobFamily jobFamily,
40+
@RequestParam(required = false) final Long semesterId,
4041
@PageableDefault(size = 15) final Pageable pageable) {
41-
return submittedApplyService.findSubmittedApplies(jobFamily, pageable);
42+
return submittedApplyService.findSubmittedApplies(jobFamily, semesterId, pageable);
4243
}
4344

4445
@Override

src/main/java/org/ject/support/domain/admin/service/AdminAuthService.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
import org.ject.support.domain.admin.exception.AdminException;
1010
import org.ject.support.domain.member.MemberStatus;
1111
import org.ject.support.domain.member.entity.Member;
12-
import org.ject.support.external.discord.DiscordComponent;
1312
import org.ject.support.external.infrastructure.DiscordRateLimiter;
13+
import org.ject.support.external.notification.event.AdminLoginNotificationEvent;
14+
import org.springframework.context.ApplicationEventPublisher;
1415
import org.springframework.data.redis.core.RedisTemplate;
1516
import org.springframework.security.core.Authentication;
1617
import org.springframework.stereotype.Service;
@@ -24,10 +25,10 @@
2425
@Transactional(readOnly = true)
2526
public class AdminAuthService {
2627

28+
private final ApplicationEventPublisher applicationEventPublisher;
2729
private final RedisTemplate<String, String> redisTemplate;
2830
private final AdminMemberComponent adminMemberComponent;
2931
private final DiscordRateLimiter discordRateLimiter;
30-
private final DiscordComponent discordComponent;
3132
private final JwtTokenProvider jwtTokenProvider;
3233

3334
private static final String ADMIN_LOGIN_AUTH_CODE_KEY_PREFIX = "admin-login:";
@@ -46,9 +47,9 @@ public String sendAdminAuthCode(String email) {
4647

4748
if (discordRateLimiter.tryConsume(1)) {
4849
redisTemplate.opsForValue().set(key, authCode, Duration.ofSeconds(ADMIN_LOGIN_AUTH_CODE_EXPIRATION));
49-
discordComponent.sendAdminLoginMessage(member.getEmail(), authCode)
50-
.doOnError(e -> log.error("Discord 전송 실패: {}", member.getEmail(), e))
51-
.subscribe();
50+
51+
applicationEventPublisher
52+
.publishEvent(new AdminLoginNotificationEvent(email, authCode));
5253
} else {
5354
throw new AdminException(AdminErrorCode.TOO_MANY_REQUESTS);
5455
}

src/main/java/org/ject/support/domain/admin/service/AdminTempApplyService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ public void deleteTempApply(Long applyId) {
5656
applyRepository.delete(apply);
5757
}
5858

59-
public Page<TempSavedApplyResponse> getTempApplies(JobFamily jobFamily, Pageable pageable) {
59+
public Page<TempSavedApplyResponse> getTempApplies(JobFamily jobFamily, Long semesterId, Pageable pageable) {
6060
Apply.Status tempSavedStatus = Apply.Status.TEMP_SAVED;
61-
Page<Apply> applyPage = applyRepository.findAppliesByStatus(jobFamily, tempSavedStatus, pageable);
61+
Page<Apply> applyPage = applyRepository.findAppliesByStatus(jobFamily, tempSavedStatus, semesterId, pageable);
6262

6363
List<TempSavedApplyResponse> content = applyPage.getContent().stream()
6464
.map(this::toTempSavedApplyResponse)

src/main/java/org/ject/support/domain/admin/service/SubmittedApplyService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ public class SubmittedApplyService {
4141

4242
@Transactional(readOnly = true)
4343
public Page<SubmittedApplyResponse> findSubmittedApplies(final JobFamily jobFamily,
44+
final Long semesterId,
4445
final Pageable pageable) {
45-
Page<Apply> applyPage = applyRepository.findAppliesByStatus(jobFamily, Status.SUBMITTED, pageable);
46+
Page<Apply> applyPage = applyRepository.findAppliesByStatus(jobFamily, Status.SUBMITTED, semesterId, pageable);
4647

4748
List<SubmittedApplyResponse> content = applyPage.getContent().stream()
4849
.map(this::toSubmittedApplyResponse)

src/main/java/org/ject/support/domain/apply/repository/ApplyQueryRepository.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
public interface ApplyQueryRepository {
99
Page<Apply> findAppliesByStatus(final JobFamily jobFamily,
1010
final Apply.Status status,
11+
final Long semesterId,
1112
final Pageable pageable);
1213
}

src/main/java/org/ject/support/domain/apply/repository/ApplyQueryRepositoryImpl.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ public class ApplyQueryRepositoryImpl implements ApplyQueryRepository {
2626

2727
@Override
2828
public Page<Apply> findAppliesByStatus(final JobFamily jobFamily,
29-
final Apply.Status status, final Pageable pageable) {
29+
final Apply.Status status,
30+
final Long semesterId,
31+
final Pageable pageable) {
3032

3133
List<Apply> content = queryFactory
3234
.selectFrom(apply)
@@ -37,7 +39,8 @@ public Page<Apply> findAppliesByStatus(final JobFamily jobFamily,
3739
.where(
3840
apply.member.isDeleted.eq(false),
3941
eqJobFamily(jobFamily),
40-
eqApplyStatus(status)
42+
eqApplyStatus(status),
43+
eqSemesterId(semesterId)
4144
)
4245
.orderBy(apply.createdAt.desc())
4346
.offset(pageable.getOffset())
@@ -51,7 +54,8 @@ public Page<Apply> findAppliesByStatus(final JobFamily jobFamily,
5154
.where(
5255
apply.member.isDeleted.eq(false),
5356
eqJobFamily(jobFamily),
54-
eqApplyStatus(status)
57+
eqApplyStatus(status),
58+
eqSemesterId(semesterId)
5559
).fetchOne();
5660

5761
return PageResponse.from(content, pageable, total);
@@ -67,4 +71,10 @@ private BooleanExpression eqApplyStatus(final Apply.Status status) {
6771
.map(apply.status::eq)
6872
.orElse(null);
6973
}
74+
75+
private BooleanExpression eqSemesterId(final Long semesterId) {
76+
return Optional.ofNullable(semesterId)
77+
.map(apply.recruit.semester.id::eq)
78+
.orElse(null);
79+
}
7080
}

src/main/java/org/ject/support/domain/auth/service/AuthSupporterTokenService.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
import org.ject.support.domain.member.Role;
1212
import org.ject.support.domain.member.entity.Member;
1313
import org.ject.support.domain.member.repository.MemberRepository;
14-
import org.ject.support.external.discord.DiscordComponent;
14+
import org.ject.support.external.notification.event.SupporterTokenIssuedEvent;
15+
import org.springframework.context.ApplicationEventPublisher;
1516
import org.springframework.security.crypto.password.PasswordEncoder;
1617
import org.springframework.stereotype.Service;
1718
import org.springframework.transaction.annotation.Transactional;
@@ -28,10 +29,10 @@ public class AuthSupporterTokenService {
2829

2930
private final long TOKEN_EXPIRATION_MILLIS = 24 * 60 * 60 * 1000; // 1일
3031

32+
private final ApplicationEventPublisher applicationEventPublisher;
3133
private final JwtTokenProvider jwtTokenProvider;
3234
private final MemberRepository memberRepository;
3335
private final PasswordEncoder passwordEncoder;
34-
private final DiscordComponent discordComponent;
3536

3637
public void issueReadOnlyToken(String email, String pin) {
3738
Member member = memberRepository.findByEmailAndRole(email, Role.ADMIN)
@@ -50,10 +51,7 @@ public void issueReadOnlyToken(String email, String pin) {
5051

5152
String token = jwtTokenProvider.createToken(claims, TOKEN_EXPIRATION_MILLIS);
5253

53-
discordComponent.sendSupporterTokenIssueMessage(email, token)
54-
.doOnError(e -> {
55-
log.error("지원자 토큰 전송 실패: {}", email, e);
56-
})
57-
.subscribe();
54+
applicationEventPublisher
55+
.publishEvent(new SupporterTokenIssuedEvent(email, token));
5856
}
5957
}

0 commit comments

Comments
 (0)