Skip to content

Commit aeb4eda

Browse files
authored
POST /api/mail/verify 에 중복 메일 검증 추가 & Post 기본 정렬 공고 생성순(과거순) 변경 (#222)
* check duplicate when /api/mail/verify * sort by createdAt * desc to asc
1 parent e1ed481 commit aeb4eda

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/main/kotlin/com/wafflestudio/internhasha/auth/service/AuthService.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,12 @@ class AuthService(
220220

221221
// Email verification
222222
fun sendSnuMailVerification(request: SnuMailRequest) {
223+
if (userRepository.existsByEmail(request.snuMail)) {
224+
throw UserDuplicateSnuMailException(
225+
details = mapOf("email" to request.snuMail),
226+
)
227+
}
228+
223229
val emailCode = (100000..999999).random().toString()
224230
val encryptedEmailCode = BCrypt.hashpw(emailCode, BCrypt.gensalt())
225231

src/main/kotlin/com/wafflestudio/internhasha/post/persistence/PositionSpecification.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ class PositionSpecification {
177177
orderList.add(criteriaBuilder.desc(closedSort)) // 마감된 건 내림차순
178178
}
179179
else -> {
180-
// 최신순 정렬 (updatedAt 기준)
181-
orderList.add(criteriaBuilder.desc(root.get<LocalDateTime>("updatedAt")))
180+
// 공고 생성순 정렬 (createdAt 기준)
181+
orderList.add(criteriaBuilder.asc(root.get<LocalDateTime>("createdAt")))
182182
}
183183
}
184184

0 commit comments

Comments
 (0)