Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

๐Ÿ„ :: (Meogo-22) post #24

Merged
merged 3 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions src/main/kotlin/org/meogo/domain/post/domain/Post.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package org.meogo.domain.post.domain

import java.time.LocalDateTime
import java.util.UUID
import javax.persistence.Column
import javax.persistence.Entity
import javax.persistence.GeneratedValue
import javax.persistence.GenerationType
import javax.persistence.Id

@Entity
class Post(

@GeneratedValue(strategy = GenerationType.IDENTITY)
@Id
val id: Long = 0,

@Column(nullable = false)
val title: String,

@Column(nullable = false)
val content: String,

@Column(name = "user_id", columnDefinition = "BINARY(16)")
val userId: UUID,

@Column(nullable = false)
var good: Int = 0,

@Column(nullable = false)
val date: LocalDateTime,

@Column(name = "school_id")
val schoolId: Int?,

@Column(name = "key_word")
val keyWord: String?
) {
fun addGood() {
this.good += 1
}
}
10 changes: 10 additions & 0 deletions src/main/kotlin/org/meogo/domain/post/domain/PostRepository.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.meogo.domain.post.domain

import org.springframework.data.repository.Repository

interface PostRepository : Repository<Post, Long> {

fun save(post: Post)

fun findAll(): List<Post>
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.meogo.domain.review.repository
package org.meogo.domain.review.domain

import org.meogo.domain.review.domain.Review
import org.springframework.data.repository.Repository
import java.util.UUID

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.meogo.domain.review.service

import org.meogo.domain.review.domain.Review
import org.meogo.domain.review.domain.ReviewRepository
import org.meogo.domain.review.presentation.dto.request.ReviewRequest
import org.meogo.domain.review.repository.ReviewRepository
import org.meogo.domain.user.exception.UserNotFoundException
import org.meogo.domain.user.facade.UserFacade
import org.springframework.stereotype.Service
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.meogo.domain.review.service

import org.meogo.domain.review.domain.ReviewRepository
import org.meogo.domain.review.exception.ReviewNotFoundException
import org.meogo.domain.review.repository.ReviewRepository
import org.meogo.domain.user.domain.UserRepository
import org.meogo.domain.user.exception.UserMisMatchException
import org.meogo.domain.user.exception.UserNotFoundException
import org.meogo.domain.user.facade.UserFacade
import org.meogo.domain.user.repository.UserRepository
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Transactional

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.meogo.domain.review.service

import org.meogo.domain.review.domain.ReviewRepository
import org.meogo.domain.review.exception.ReviewNotFoundException
import org.meogo.domain.review.presentation.dto.request.ModifyReviewRequest
import org.meogo.domain.review.repository.ReviewRepository
import org.meogo.domain.user.exception.UserMisMatchException
import org.meogo.domain.user.exception.UserNotFoundException
import org.meogo.domain.user.facade.UserFacade
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.meogo.domain.review.service

import org.meogo.domain.review.domain.ReviewRepository
import org.meogo.domain.review.presentation.dto.response.ReviewResponse
import org.meogo.domain.review.repository.ReviewRepository
import org.meogo.domain.user.facade.UserFacade
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Transactional
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.meogo.domain.review.service

import org.meogo.domain.review.domain.ReviewRepository
import org.meogo.domain.review.presentation.dto.response.ReviewPictureResponse
import org.meogo.domain.review.repository.ReviewRepository
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Transactional

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.meogo.domain.user.repository
package org.meogo.domain.user.domain

import org.meogo.domain.user.domain.User
import org.springframework.data.jpa.repository.JpaRepository
import java.util.UUID

Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/org/meogo/domain/user/facade/UserFacade.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.meogo.domain.user.facade

import org.meogo.domain.user.domain.User
import org.meogo.domain.user.domain.UserRepository
import org.meogo.domain.user.exception.UserNotFoundException
import org.meogo.domain.user.repository.UserRepository
import org.springframework.security.core.context.SecurityContextHolder
import org.springframework.stereotype.Component
import java.util.UUID
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.meogo.domain.user.service

import org.meogo.domain.user.domain.UserRepository
import org.meogo.domain.user.presentation.dto.request.UserCheckRequest
import org.meogo.domain.user.repository.UserRepository
import org.springframework.stereotype.Service

@Service
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.meogo.domain.user.service

import org.meogo.domain.user.domain.UserRepository
import org.meogo.domain.user.exception.PasswordMismatchException
import org.meogo.domain.user.exception.UserNotFoundException
import org.meogo.domain.user.presentation.dto.request.UserSignInRequest
import org.meogo.domain.user.repository.UserRepository
import org.meogo.global.jwt.JwtTokenProvider
import org.meogo.global.jwt.dto.TokenResponse
import org.springframework.security.crypto.password.PasswordEncoder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.meogo.domain.user.service

import org.meogo.domain.user.domain.User
import org.meogo.domain.user.domain.UserRepository
import org.meogo.domain.user.domain.UserRole
import org.meogo.domain.user.presentation.dto.request.UserSignUpRequest
import org.meogo.domain.user.repository.UserRepository
import org.meogo.global.jwt.JwtTokenProvider
import org.meogo.global.jwt.dto.TokenResponse
import org.springframework.security.crypto.password.PasswordEncoder
Expand Down
Loading