erDiagram
review }|--|| app_user : user_id
review ||--o| star : review_id
review ||--o{ comment : review_id
comment ||--o| star : comment_id
comment ||--|{ app_user : user_id
comment ||--|{ reaction : comment_id
app_user ||--o{ follow : user_id
app_user ||--o{ report : user_id
app_user ||--o| star : user_id
app_user ||--o| reaction : user_id
review{
id BIGINT PK
game_name TEXT
title TEXT
description TEXT
is_deleted BOOLEAN
created_at TIMESTAMP
updated_at TIMESTAMP
deleted_at TIMESTAMP
}
comment{
id BIGINT PK
user_id BIGINT FK
review_id BIGINT FK
content TEXT
is_deleted BOOLEAN
created_at TIMESTAMP
updated_at TIMESTAMP
deleted_at TIMESTAMP
}
app_user{
id BIGINT PK
email VARCHAR(255)
password VARCHAR(255)
nickname VARCHAR(255)
about_summary VARCHAR(255)
profile_user_image TEXT
created_at TIMESTAMP
updated_at TIMESTAMP
last_signin_at TIMESTAMP
}
report{
id BIGINT PK
user_id BIGINT FK
entity_id BIGINT
entity_type ENUM
description TEXT
created_at TIMESTAMP
}
star{
user_id BIGINT FK
review_id BIGINT FK
comment_id BIGINT FK
score FLOAT
}
follow{
user_id BIGINT FK
following_user_id BIGINT
}
reaction{
user_id BIGINT FK
comment_id BIGINT FK
reaction ENUM
}
@ColumnName(name=””, nullable=(false/true))
User Domain
에 대한 전체 적인 로직 작성Review Domain
에 대한 전체 적인 로직 작성Review
및 Comment
신고 하기 기능 구현Comment Domain
에 대한 전체 적인 로직 작성classDiagram
ReviewDto <--> ReviewController
ReviewServiceImpl <.. ReviewService
ReviewServiceImpl <--> ReviewDto
ReviewRepository <-- ReviewServiceImpl
ReviewRepository ..> ReviewRepositoryImpl
ReviewServiceImpl <-- ReviewRepositoryImpl
ReviewJpaRepository <--> ReviewRepository
classDiagram
CommentDto <--> CommentController
CommentService <--> CommentDto
CommentRepository <-- CommentService
CommentRepository ..> CommentRepositoryImpl
CommentService <-- CommentRepositoryImpl
CommentJpaRepository <--> CommentRepository
classDiagram
UserDto <--> UserController
UserServiceImpl <.. UserService
UserServiceImpl <--> UserDto
UserRepository <-- UserServiceImpl
UserRepository ..> UserRepositoryImpl
UserServiceImpl <-- UserRepositoryImpl
UserJpaRepository <--> UserRepository
classDiagram
ReactionDto <--> commentController
ReactionService <--> ReactionDto
ReactionRepository <-- ReactionService
ReactionRepository ..> ReactionRepositoryImpl
ReactionService <-- ReactionRepositoryImpl
ReactionJpaRepository <--> ReactionRepository
StarScoreDto <--> commentController
StarScoreService <--> StarScoreDto
StarScoreRepository <--> StarScoreService
StarScoreJpaRepository <--> StarScoreRepository
classDiagram
ReportDto <--> commentController
ReportDto <--> ReviewController
ReportService <--> ReportDto
ReportRepository <-- ReportService
ReportRepository ..> ReportRepositoryImpl
ReportService <-- ReportRepositoryImpl
ReportJpaRepository <--> ReportRepository
classDiagram
FollowDto <--> FollowController
FollowServiceImpl <.. FollowService
FollowServiceImpl <--> FollowDto
FollowRepository <-- FollowServiceImpl
FollowRepository ..> FollowRepositoryImpl
FollowServiceImpl <-- FollowRepositoryImpl
FollowJpaRepository <--> FollowRepository
FATAL: Max client connections reached
애러 발생application.yml
spring:
datasource:
url: jdbc:URL/postgres?user=USER&password=PASSWORD
spring:
datasource:
url: jdbc:URL/postgres?user=USER&password=PASSWORD&pgbouncer=true&connection_limit=1000
pgbouncer=true&connection_limit=1000
해당 값을 붙여서 최대 클라이언트 값을 증가 시켜 주면 정상적 으로 작동 되는 걸 확인할 수 있습니다
이후 supabase 에 접속해서 요청 개수를 늘려 주면서 애러 해결을 하였습니다
Integer
-> Long
으로 받아 들여서 문제가 생기는 이슈가 발생 하였습니다Long
타입 으로 타입 캐스팅이 안되서 생기는 현상 으로 확인 됩니다return jwtPlugin.validateToken(token).getOrNull()?.payload?.get("userId") as? Long ?: throw RuntimeException("User id is invalid")
return (jwtPlugin.validateToken(token).getOrNull()?.payload?.get("userId") as Int).toLong()
EntityNotFoundException unable to find with id 0
애러 발생@NotFound
Annotation 을 사용 하여 해당 현상을 해결 하였습니다user
가 foreign Key가 들어가 있어야 하는데 primary key 로 들어가 있는 부분 확인 하였습니다user
가 primary key로 들어가 있는 부분 확인 하고 제외 처리 후에 foreign Key 로 재설정 완료 했습니다null
을 할당하려고 시도comment
가 create 하는 과정에서 동시에 star_score
도 create 가 되는 로직 에서 comment
가 create 이후에 star_score
도 create 이후에 comment
데이터 에도 null
값이 할당 되는 문제 발생
cascodetype.MERGE
를 사용하여 부모 Entity가 생성을 시도 할 때 자식 Entity 도 병합 하여 생성 시도 할 수 있게 끔 조치 하였습니다개발 언어 : Kotlin 1.9.23, JDK 21
IDE : IntelliJ IDEA 2024.2
Build tool : Gradle.kts
FrameWork : Spring Boot 3.3.0
Library : Springdoc 2.5.0
DataBase : PostgresQL 14.1 with Supabase
JWT : jjwt 0.12.5