-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 리뷰 추천 도메인 추가 * feat: 리뷰 추천 로직 추가 * feat: 리뷰 추천 API 추가 * docs: Swagger docs 추가 * docs: Swagger 인증 정보 추가
- Loading branch information
1 parent
e47b962
commit fb07730
Showing
12 changed files
with
332 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/kotlin/com/petqua/domain/product/review/ProductReviewRecommendation.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.petqua.domain.product.review | ||
|
||
import com.petqua.common.domain.BaseEntity | ||
import jakarta.persistence.Column | ||
import jakarta.persistence.Entity | ||
import jakarta.persistence.GeneratedValue | ||
import jakarta.persistence.GenerationType | ||
import jakarta.persistence.Id | ||
|
||
@Entity | ||
class ProductReviewRecommendation( | ||
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
val id: Long = 0L, | ||
|
||
@Column(nullable = false) | ||
val productReviewId: Long, | ||
|
||
@Column(nullable = false) | ||
val memberId: Long, | ||
) : BaseEntity() { | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/kotlin/com/petqua/domain/product/review/ProductReviewRecommendationRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.petqua.domain.product.review | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository | ||
|
||
interface ProductReviewRecommendationRepository : JpaRepository<ProductReviewRecommendation, Long> { | ||
|
||
fun findByProductReviewIdAndMemberId(productReviewId: Long, memberId: Long): ProductReviewRecommendation? | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/kotlin/com/petqua/exception/product/review/ProductReviewException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.petqua.exception.product.review | ||
|
||
import com.petqua.common.exception.BaseException | ||
import com.petqua.common.exception.BaseExceptionType | ||
|
||
class ProductReviewException( | ||
private val exceptionType: ProductReviewExceptionType, | ||
) : BaseException() { | ||
|
||
override fun exceptionType(): BaseExceptionType { | ||
return exceptionType | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/kotlin/com/petqua/exception/product/review/ProductReviewExceptionType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.petqua.exception.product.review | ||
|
||
import com.petqua.common.exception.BaseExceptionType | ||
import org.springframework.http.HttpStatus | ||
import org.springframework.http.HttpStatus.NOT_FOUND | ||
|
||
enum class ProductReviewExceptionType( | ||
private val httpStatus: HttpStatus, | ||
private val code: String, | ||
private val errorMessage: String, | ||
) : BaseExceptionType { | ||
|
||
NOT_FOUND_PRODUCT_REVIEW(NOT_FOUND, "PR01", "존재하지 않는 리뷰입니다."), | ||
; | ||
|
||
override fun httpStatus(): HttpStatus { | ||
return httpStatus | ||
} | ||
|
||
override fun code(): String { | ||
return code | ||
} | ||
|
||
override fun errorMessage(): String { | ||
return errorMessage | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.