Skip to content

Commit

Permalink
Hotfix/memo content 타입 수정, 인증코드 및 미인증 유저 삭제 문제 수정 (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
kih00 authored Jan 29, 2025
1 parent 3829015 commit 2e6bded
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package com.wafflestudio.toyproject.memoWithTags

import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.scheduling.annotation.EnableScheduling

@SpringBootApplication
@EnableScheduling
class MemoWithTagsApplication

fun main(args: Array<String>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import jakarta.persistence.GeneratedValue
import jakarta.persistence.GenerationType
import jakarta.persistence.Id
import jakarta.persistence.JoinColumn
import jakarta.persistence.Lob
import jakarta.persistence.ManyToOne
import jakarta.persistence.OneToMany
import java.time.Instant
Expand All @@ -17,7 +18,8 @@ class MemoEntity(
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
val id: Long? = null,
@Column(name = "content", nullable = false, columnDefinition = "LONGTEXT")
@Lob
@Column(name = "content", nullable = false)
var content: String,
@Column(name = "locked", nullable = false)
var locked: Boolean = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class AdminController(
@Operation(summary = "유저 계정 생성")
@PostMapping("/admin/user")
fun createUser(@AuthUser user: User, @RequestBody request: CreateUserRequest): User {
adminService.isAdmin(user.id)
adminService.assertAdminRole(user.id)
return userService.register(request.email, request.password, request.nickname)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class UserService(
* 메일 정오에 만료된 인증 코드 엔티티를 삭제하는 함수
*/
@Transactional
@Scheduled(cron = "0 0 0 * * ?") // 매일 정오에 만료 코드 삭제
@Scheduled(cron = "0 0 0 * * ?", zone = "Asia/Seoul") // 매일 정오에 만료 코드 삭제
fun deleteExpiredVerificationCode() {
emailVerificationRepository.deleteByExpiryTimeBefore(LocalDateTime.now())
}
Expand All @@ -228,7 +228,7 @@ class UserService(
* 매일 정오에 메일 인증이 되지 않은 유저를 삭제하는 함수
*/
@Transactional
@Scheduled(cron = "0 0 0 * * ?") // 매일 정오에 미인증 사용자 삭제
@Scheduled(cron = "0 0 0 * * ?", zone = "Asia/Seoul") // 매일 정오에 미인증 사용자 삭제
fun deleteUnverifiedUser() {
userRepository.deleteByVerified(false)
}
Expand Down

0 comments on commit 2e6bded

Please sign in to comment.