Skip to content

Commit

Permalink
Merge pull request #24 from MEOGO-DSM/22-post
Browse files Browse the repository at this point in the history
🏄 :: (Meogo-22) post
  • Loading branch information
meltapplee authored Sep 9, 2024
2 parents e0f82de + 6350f74 commit 8dc6d8a
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 14 deletions.
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

0 comments on commit 8dc6d8a

Please sign in to comment.