diff --git a/core/src/main/kotlin/com/wespot/message/port/in/MessageUseCase.kt b/core/src/main/kotlin/com/wespot/message/port/in/MessageUseCase.kt new file mode 100644 index 00000000..b7ae1496 --- /dev/null +++ b/core/src/main/kotlin/com/wespot/message/port/in/MessageUseCase.kt @@ -0,0 +1,7 @@ +package com.wespot.message.port.`in` + +import org.springframework.stereotype.Service + +@Service +interface MessageUseCase { +} \ No newline at end of file diff --git a/core/src/main/kotlin/com/wespot/message/port/out/MessageStatePort.kt b/core/src/main/kotlin/com/wespot/message/port/out/MessageStatePort.kt new file mode 100644 index 00000000..220b8c91 --- /dev/null +++ b/core/src/main/kotlin/com/wespot/message/port/out/MessageStatePort.kt @@ -0,0 +1,4 @@ +package com.wespot.message.port.out + +interface MessageStatePort { +} \ No newline at end of file diff --git a/core/src/main/kotlin/com/wespot/message/service/MessageService.kt b/core/src/main/kotlin/com/wespot/message/service/MessageService.kt new file mode 100644 index 00000000..294ed897 --- /dev/null +++ b/core/src/main/kotlin/com/wespot/message/service/MessageService.kt @@ -0,0 +1,9 @@ +package com.wespot.message.service + +import com.wespot.message.port.`in`.MessageUseCase +import com.wespot.message.port.out.MessageStatePort + +class MessageService( + private val messageStatePort: MessageStatePort +) : MessageUseCase { +} \ No newline at end of file diff --git a/core/src/main/kotlin/com/wespot/notification/port/in/NotificationUseCase.kt b/core/src/main/kotlin/com/wespot/notification/port/in/NotificationUseCase.kt new file mode 100644 index 00000000..ee75f8bf --- /dev/null +++ b/core/src/main/kotlin/com/wespot/notification/port/in/NotificationUseCase.kt @@ -0,0 +1,7 @@ +package com.wespot.notification.port.`in` + +import org.springframework.stereotype.Service + +@Service +interface NotificationUseCase { +} \ No newline at end of file diff --git a/core/src/main/kotlin/com/wespot/notification/port/out/NotificationStatePort.kt b/core/src/main/kotlin/com/wespot/notification/port/out/NotificationStatePort.kt new file mode 100644 index 00000000..2a2f6772 --- /dev/null +++ b/core/src/main/kotlin/com/wespot/notification/port/out/NotificationStatePort.kt @@ -0,0 +1,4 @@ +package com.wespot.notification.port.out + +interface NotificationStatePort { +} \ No newline at end of file diff --git a/core/src/main/kotlin/com/wespot/notification/service/NotificationService.kt b/core/src/main/kotlin/com/wespot/notification/service/NotificationService.kt new file mode 100644 index 00000000..cfd019a6 --- /dev/null +++ b/core/src/main/kotlin/com/wespot/notification/service/NotificationService.kt @@ -0,0 +1,9 @@ +package com.wespot.notification.service + +import com.wespot.notification.port.`in`.NotificationUseCase +import com.wespot.notification.port.out.NotificationStatePort + +class NotificationService( + private val notificationStatic: NotificationStatePort +) : NotificationUseCase { +} \ No newline at end of file diff --git a/core/src/main/kotlin/com/wespot/report/port/in/ReportUseCase.kt b/core/src/main/kotlin/com/wespot/report/port/in/ReportUseCase.kt new file mode 100644 index 00000000..3cf70732 --- /dev/null +++ b/core/src/main/kotlin/com/wespot/report/port/in/ReportUseCase.kt @@ -0,0 +1,7 @@ +package com.wespot.report.port.`in` + +import org.springframework.stereotype.Service + +@Service +interface ReportUseCase { +} \ No newline at end of file diff --git a/core/src/main/kotlin/com/wespot/report/port/out/ReportStatePort.kt b/core/src/main/kotlin/com/wespot/report/port/out/ReportStatePort.kt new file mode 100644 index 00000000..600f224a --- /dev/null +++ b/core/src/main/kotlin/com/wespot/report/port/out/ReportStatePort.kt @@ -0,0 +1,4 @@ +package com.wespot.report.port.out + +interface ReportStatePort { +} \ No newline at end of file diff --git a/core/src/main/kotlin/com/wespot/report/service/ReportService.kt b/core/src/main/kotlin/com/wespot/report/service/ReportService.kt new file mode 100644 index 00000000..3346fa35 --- /dev/null +++ b/core/src/main/kotlin/com/wespot/report/service/ReportService.kt @@ -0,0 +1,8 @@ +package com.wespot.report.service + +import com.wespot.report.port.`in`.ReportUseCase + +class ReportService( + private val reportUseCase: ReportUseCase +) : ReportUseCase { +} \ No newline at end of file diff --git a/core/src/main/kotlin/com/wespot/user/port/in/UserUseCase.kt b/core/src/main/kotlin/com/wespot/user/port/in/UserUseCase.kt new file mode 100644 index 00000000..3976e4ee --- /dev/null +++ b/core/src/main/kotlin/com/wespot/user/port/in/UserUseCase.kt @@ -0,0 +1,7 @@ +package com.wespot.user.port.`in` + +import org.springframework.stereotype.Service + +@Service +interface UserUseCase { +} \ No newline at end of file diff --git a/core/src/main/kotlin/com/wespot/user/port/out/UserStatePort.kt b/core/src/main/kotlin/com/wespot/user/port/out/UserStatePort.kt new file mode 100644 index 00000000..b483318e --- /dev/null +++ b/core/src/main/kotlin/com/wespot/user/port/out/UserStatePort.kt @@ -0,0 +1,7 @@ +package com.wespot.user.port.out + +import org.springframework.stereotype.Repository + +@Repository +interface UserStatePort { +} \ No newline at end of file diff --git a/core/src/main/kotlin/com/wespot/user/service/UserService.kt b/core/src/main/kotlin/com/wespot/user/service/UserService.kt new file mode 100644 index 00000000..550dcc71 --- /dev/null +++ b/core/src/main/kotlin/com/wespot/user/service/UserService.kt @@ -0,0 +1,9 @@ +package com.wespot.user.service + +import com.wespot.user.port.`in`.UserUseCase +import com.wespot.user.port.out.UserStatePort + +class UserService( + private val userStatePort: UserStatePort +) : UserUseCase { +} \ No newline at end of file diff --git a/core/src/main/kotlin/com/wespot/vote/port/in/VoteUseCase.kt b/core/src/main/kotlin/com/wespot/vote/port/in/VoteUseCase.kt new file mode 100644 index 00000000..f6ed04c1 --- /dev/null +++ b/core/src/main/kotlin/com/wespot/vote/port/in/VoteUseCase.kt @@ -0,0 +1,7 @@ +package com.wespot.vote.port.`in` + +import org.springframework.stereotype.Service + +@Service +interface VoteUseCase { +} \ No newline at end of file diff --git a/core/src/main/kotlin/com/wespot/vote/port/out/VoteStatePort.kt b/core/src/main/kotlin/com/wespot/vote/port/out/VoteStatePort.kt new file mode 100644 index 00000000..bf2923d2 --- /dev/null +++ b/core/src/main/kotlin/com/wespot/vote/port/out/VoteStatePort.kt @@ -0,0 +1,4 @@ +package com.wespot.vote.port.out + +interface VoteStatePort { +} \ No newline at end of file diff --git a/core/src/main/kotlin/com/wespot/vote/service/VoteService.kt b/core/src/main/kotlin/com/wespot/vote/service/VoteService.kt new file mode 100644 index 00000000..fc366bdc --- /dev/null +++ b/core/src/main/kotlin/com/wespot/vote/service/VoteService.kt @@ -0,0 +1,8 @@ +package com.wespot.vote.service + +import com.wespot.vote.port.`in`.VoteUseCase + +class VoteService( + private val voteUseCase: VoteUseCase +) : VoteUseCase { +} \ No newline at end of file diff --git a/domain/src/main/kotlin/com/wespot/message/Message.kt b/domain/src/main/kotlin/com/wespot/message/Message.kt new file mode 100644 index 00000000..58ea15d3 --- /dev/null +++ b/domain/src/main/kotlin/com/wespot/message/Message.kt @@ -0,0 +1,19 @@ +package com.wespot.message + +import com.wespot.user.User +import java.time.LocalDateTime + +data class Message( + val id: Long, + val content: String, + val sender: User, + val receiver: User, + val isReceiverRead: Boolean, + val readAt: LocalDateTime, + val isSent: Boolean, + val sentAt: LocalDateTime, + val createdAt: LocalDateTime, + val updatedAt: LocalDateTime, + val receivedAt: LocalDateTime, +) { +} \ No newline at end of file diff --git a/domain/src/main/kotlin/com/wespot/notification/Notification.kt b/domain/src/main/kotlin/com/wespot/notification/Notification.kt new file mode 100644 index 00000000..677ec706 --- /dev/null +++ b/domain/src/main/kotlin/com/wespot/notification/Notification.kt @@ -0,0 +1,17 @@ +package com.wespot.notification + +import com.wespot.user.User +import java.time.LocalDateTime + +data class Notification( + val id: Long, + val user: User, + val type: NotificationType, + val targetId: Long, + val content: String, + val isRead: Boolean, + val readAt: LocalDateTime, + val isEnabled: Boolean, + val createdAt: LocalDateTime, +) { +} \ No newline at end of file diff --git a/domain/src/main/kotlin/com/wespot/notification/NotificationType.kt b/domain/src/main/kotlin/com/wespot/notification/NotificationType.kt new file mode 100644 index 00000000..e3726825 --- /dev/null +++ b/domain/src/main/kotlin/com/wespot/notification/NotificationType.kt @@ -0,0 +1,5 @@ +package com.wespot.notification + +enum class NotificationType { + MESSAGE, VOTE +} \ No newline at end of file diff --git a/domain/src/main/kotlin/com/wespot/report/Report.kt b/domain/src/main/kotlin/com/wespot/report/Report.kt new file mode 100644 index 00000000..28576c15 --- /dev/null +++ b/domain/src/main/kotlin/com/wespot/report/Report.kt @@ -0,0 +1,13 @@ +package com.wespot.report + +import com.wespot.user.User + +data class Report( + val id: Long, + val type: ReportType, + val reporter: User, + val reported: User, + val isApprove: Boolean +) { + +} diff --git a/domain/src/main/kotlin/com/wespot/report/ReportType.kt b/domain/src/main/kotlin/com/wespot/report/ReportType.kt new file mode 100644 index 00000000..af6abb42 --- /dev/null +++ b/domain/src/main/kotlin/com/wespot/report/ReportType.kt @@ -0,0 +1,5 @@ +package com.wespot.report + +enum class ReportType { + MESSAGE, VOTE +} \ No newline at end of file diff --git a/domain/src/main/kotlin/com/wespot/school/EstType.kt b/domain/src/main/kotlin/com/wespot/school/EstType.kt new file mode 100644 index 00000000..2e245296 --- /dev/null +++ b/domain/src/main/kotlin/com/wespot/school/EstType.kt @@ -0,0 +1,4 @@ +package com.wespot.school + +enum class EstType { // TODO : 이 부분은 같이 이야기하면서 구체화 해나가 보시죠! +} \ No newline at end of file diff --git a/domain/src/main/kotlin/com/wespot/school/School.kt b/domain/src/main/kotlin/com/wespot/school/School.kt new file mode 100644 index 00000000..1a0d30ec --- /dev/null +++ b/domain/src/main/kotlin/com/wespot/school/School.kt @@ -0,0 +1,12 @@ +package com.wespot.school + +data class School( + val id: Long, + val name: String, + val category: SchoolCategory, + val schoolType: SchoolType, + val estType: EstType, + val region: String, + val address: String, +) { +} \ No newline at end of file diff --git a/domain/src/main/kotlin/com/wespot/school/SchoolCategory.kt b/domain/src/main/kotlin/com/wespot/school/SchoolCategory.kt new file mode 100644 index 00000000..e9d3184f --- /dev/null +++ b/domain/src/main/kotlin/com/wespot/school/SchoolCategory.kt @@ -0,0 +1,6 @@ +package com.wespot.school + +enum class SchoolCategory { + MIDDLE, + HIGH, +} \ No newline at end of file diff --git a/domain/src/main/kotlin/com/wespot/school/SchoolType.kt b/domain/src/main/kotlin/com/wespot/school/SchoolType.kt new file mode 100644 index 00000000..93d883ee --- /dev/null +++ b/domain/src/main/kotlin/com/wespot/school/SchoolType.kt @@ -0,0 +1,4 @@ +package com.wespot.school + +enum class SchoolType { // TODO : 이 부분은 같이 이야기하면서 구체화 해나가 보시죠! +} \ No newline at end of file diff --git a/domain/src/main/kotlin/com/wespot/user/FCM.kt b/domain/src/main/kotlin/com/wespot/user/FCM.kt new file mode 100644 index 00000000..40168a5d --- /dev/null +++ b/domain/src/main/kotlin/com/wespot/user/FCM.kt @@ -0,0 +1,10 @@ +package com.wespot.user + +import java.time.LocalDateTime + +data class FCM( + val id: Long, + val fcmToken: String, + val createdAt: LocalDateTime, +) { +} \ No newline at end of file diff --git a/domain/src/main/kotlin/com/wespot/user/Profile.kt b/domain/src/main/kotlin/com/wespot/user/Profile.kt new file mode 100644 index 00000000..b932098c --- /dev/null +++ b/domain/src/main/kotlin/com/wespot/user/Profile.kt @@ -0,0 +1,7 @@ +package com.wespot.user + +data class Profile( + val backgroundColor: String, + val iconUrl: String, +) { +} \ No newline at end of file diff --git a/domain/src/main/kotlin/com/wespot/user/Setting.kt b/domain/src/main/kotlin/com/wespot/user/Setting.kt new file mode 100644 index 00000000..d6b9b8e7 --- /dev/null +++ b/domain/src/main/kotlin/com/wespot/user/Setting.kt @@ -0,0 +1,6 @@ +package com.wespot.user + +data class Setting( + val isEnableNotification: Boolean, +) { +} \ No newline at end of file diff --git a/domain/src/main/kotlin/com/wespot/user/Social.kt b/domain/src/main/kotlin/com/wespot/user/Social.kt new file mode 100644 index 00000000..aa232c76 --- /dev/null +++ b/domain/src/main/kotlin/com/wespot/user/Social.kt @@ -0,0 +1,7 @@ +package com.wespot.user + +data class Social( + val socialType: SocialType, + val socialId: Long, +) { +} \ No newline at end of file diff --git a/domain/src/main/kotlin/com/wespot/user/SocialType.kt b/domain/src/main/kotlin/com/wespot/user/SocialType.kt new file mode 100644 index 00000000..88019126 --- /dev/null +++ b/domain/src/main/kotlin/com/wespot/user/SocialType.kt @@ -0,0 +1,5 @@ +package com.wespot.user + +enum class SocialType { + APPLE, KAKAO +} \ No newline at end of file diff --git a/domain/src/main/kotlin/com/wespot/user/User.kt b/domain/src/main/kotlin/com/wespot/user/User.kt new file mode 100644 index 00000000..d086518d --- /dev/null +++ b/domain/src/main/kotlin/com/wespot/user/User.kt @@ -0,0 +1,19 @@ +package com.wespot.user + +import com.wespot.school.School +import java.time.LocalDateTime + +data class User( + val id: Long, + val school: School, + val grade: Int, + val group: Int, + val setting: Setting, + val profile: Profile, + val fcm: FCM, + val social: Social, + val createdAt: LocalDateTime, + val updatedAt: LocalDateTime, + val withdrawAt: LocalDateTime, +) { +} \ No newline at end of file diff --git a/domain/src/main/kotlin/com/wespot/vote/Ballot.kt b/domain/src/main/kotlin/com/wespot/vote/Ballot.kt new file mode 100644 index 00000000..4a62ba58 --- /dev/null +++ b/domain/src/main/kotlin/com/wespot/vote/Ballot.kt @@ -0,0 +1,15 @@ +package com.wespot.vote + +import com.wespot.user.User +import com.wespot.voteoption.VoteOption +import java.time.LocalDateTime + +data class Ballot( + val id: Long, + val voteOption: VoteOption, + val sender: User, + val receiver: User, + val createdAt: LocalDateTime, + val isReceiverRead: Boolean, +) { +} \ No newline at end of file diff --git a/domain/src/main/kotlin/com/wespot/vote/Vote.kt b/domain/src/main/kotlin/com/wespot/vote/Vote.kt new file mode 100644 index 00000000..4ed7c7aa --- /dev/null +++ b/domain/src/main/kotlin/com/wespot/vote/Vote.kt @@ -0,0 +1,13 @@ +package com.wespot.vote + +import java.time.LocalDateTime + +data class Vote( + val id: Long, + val schoolName: String, + val grade: Int, + val group: Int, + val date: LocalDateTime, + val ballots: List +) { +} \ No newline at end of file diff --git a/domain/src/main/kotlin/com/wespot/voteoption/VoteOption.kt b/domain/src/main/kotlin/com/wespot/voteoption/VoteOption.kt new file mode 100644 index 00000000..1ba223c1 --- /dev/null +++ b/domain/src/main/kotlin/com/wespot/voteoption/VoteOption.kt @@ -0,0 +1,11 @@ +package com.wespot.voteoption + +import java.time.LocalDateTime + +data class VoteOption( + val id: Long, + val content: String, + val createdAt: LocalDateTime, + val updatedAt: LocalDateTime, +) { +} \ No newline at end of file diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/common/BaseEntity.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/common/BaseEntity.kt new file mode 100644 index 00000000..c67510fa --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/common/BaseEntity.kt @@ -0,0 +1,23 @@ +package com.wespot.common + +import jakarta.persistence.Column +import jakarta.persistence.Embeddable +import jakarta.persistence.EntityListeners +import org.springframework.data.annotation.CreatedDate +import org.springframework.data.annotation.LastModifiedDate +import org.springframework.data.jpa.domain.support.AuditingEntityListener +import java.time.LocalDateTime + +@EntityListeners(AuditingEntityListener::class) +@Embeddable +class BaseEntity { + + @CreatedDate + @Column(updatable = false, nullable = false) + val createdAt: LocalDateTime? = null + + @LastModifiedDate + @Column(nullable = false) + val updatedAt: LocalDateTime? = null + +} \ No newline at end of file diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/message/MessageJpaEntity.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/message/MessageJpaEntity.kt new file mode 100644 index 00000000..eec3d852 --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/message/MessageJpaEntity.kt @@ -0,0 +1,40 @@ +package com.wespot.message + +import com.wespot.common.BaseEntity +import jakarta.persistence.* +import org.jetbrains.annotations.NotNull +import java.time.LocalDateTime + +@Entity +@Table(name = "message") +class MessageJpaEntity( + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + val id: Long, + + @field: NotNull + val content: String, + + @field: NotNull + val senderId: Long, + + @field: NotNull + val receiverId: Long, + + val isReceiverRead: Boolean, + + val readAt: LocalDateTime, + + @field: NotNull + val isSent: Boolean, + + val sentAt: LocalDateTime, + + val receivedAt: LocalDateTime, + + @Embedded + @field: NotNull + val baseEntity: BaseEntity + +) \ No newline at end of file diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/message/MessageJpaRepository.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/message/MessageJpaRepository.kt new file mode 100644 index 00000000..fc99eaf8 --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/message/MessageJpaRepository.kt @@ -0,0 +1,6 @@ +package com.wespot.message + +import org.springframework.data.jpa.repository.JpaRepository + +interface MessageJpaRepository : JpaRepository { +} \ No newline at end of file diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/message/MessagePersistenceAdapter.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/message/MessagePersistenceAdapter.kt new file mode 100644 index 00000000..c3932a25 --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/message/MessagePersistenceAdapter.kt @@ -0,0 +1,9 @@ +package com.wespot.message + +import org.springframework.stereotype.Repository + +@Repository +class MessagePersistenceAdapter( + val messageJpaRepository: MessageJpaRepository +) { +} \ No newline at end of file diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/notification/NotificationJpaEntity.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/notification/NotificationJpaEntity.kt new file mode 100644 index 00000000..bc9d68f3 --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/notification/NotificationJpaEntity.kt @@ -0,0 +1,39 @@ +package com.wespot.notification + +import com.wespot.common.BaseEntity +import jakarta.persistence.* +import org.jetbrains.annotations.NotNull +import java.time.LocalDateTime + +@Entity +@Table(name = "notification") +class NotificationJpaEntity( + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + val id: Long, + + @field: NotNull + val userId: Long, + + @Enumerated(value = EnumType.STRING) + val type: NotificationType, + + @field: NotNull + val targetId: Long, + + @field: NotNull + val content: String, + + @field: NotNull + val isRead: Boolean, + + val readAt: LocalDateTime, + + @field: NotNull + val isEnabled: Boolean, + + @Embedded + val baseEntity: BaseEntity + +) diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/notification/NotificationJpaRepository.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/notification/NotificationJpaRepository.kt new file mode 100644 index 00000000..21ab9e69 --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/notification/NotificationJpaRepository.kt @@ -0,0 +1,6 @@ +package com.wespot.notification + +import org.springframework.data.jpa.repository.JpaRepository + +interface NotificationJpaRepository : JpaRepository { +} \ No newline at end of file diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/notification/NotificationPersistenceAdapter.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/notification/NotificationPersistenceAdapter.kt new file mode 100644 index 00000000..2aef6e71 --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/notification/NotificationPersistenceAdapter.kt @@ -0,0 +1,10 @@ +package com.wespot.notification + +import com.wespot.notification.port.out.NotificationStatePort +import org.springframework.stereotype.Repository + +@Repository +class NotificationPersistenceAdapter( + private val notificationJpaRepository: NotificationJpaRepository +) : NotificationStatePort { +} \ No newline at end of file diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/report/ReportJpaEntity.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/report/ReportJpaEntity.kt new file mode 100644 index 00000000..0ba2f950 --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/report/ReportJpaEntity.kt @@ -0,0 +1,28 @@ +package com.wespot.report + +import jakarta.persistence.* +import org.jetbrains.annotations.NotNull + +@Entity +@Table(name = "report") +class ReportJpaEntity( + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @field:NotNull + val id: Long, + + @Enumerated(value = EnumType.STRING) + @field:NotNull + val type: ReportType, + + @field:NotNull + val reporterId: Long, + + @field:NotNull + val reportedId: Long, + + @field:NotNull + val isApprove: Boolean + +) diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/report/ReportJpaRepository.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/report/ReportJpaRepository.kt new file mode 100644 index 00000000..dea4b284 --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/report/ReportJpaRepository.kt @@ -0,0 +1,6 @@ +package com.wespot.report + +import org.springframework.data.jpa.repository.JpaRepository + +interface ReportJpaRepository:JpaRepository { +} \ No newline at end of file diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/report/ReportPersistenceAdapter.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/report/ReportPersistenceAdapter.kt new file mode 100644 index 00000000..0159c979 --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/report/ReportPersistenceAdapter.kt @@ -0,0 +1,8 @@ +package com.wespot.report + +import com.wespot.report.port.out.ReportStatePort + +class ReportPersistenceAdapter( + private val reportJpaRepository: ReportJpaRepository +) : ReportStatePort { +} \ No newline at end of file diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/school/SchoolJpaEntity.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/school/SchoolJpaEntity.kt new file mode 100644 index 00000000..ee9f263f --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/school/SchoolJpaEntity.kt @@ -0,0 +1,26 @@ +package com.wespot.school + +import jakarta.persistence.* +import org.jetbrains.annotations.NotNull + +@Entity +@Table(name = "school") +class SchoolJpaEntity( + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + val id: Long, + + @field:NotNull + val name: String, + + @field:NotNull + val category: SchoolCategory, + + @field:NotNull + val region: String, + + @field:NotNull + val address: String + +) diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/school/SchoolJpaRepository.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/school/SchoolJpaRepository.kt new file mode 100644 index 00000000..4b0611e0 --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/school/SchoolJpaRepository.kt @@ -0,0 +1,6 @@ +package com.wespot.school + +import org.springframework.data.jpa.repository.JpaRepository + +interface SchoolJpaRepository : JpaRepository { +} \ No newline at end of file diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/user/FCMJpaEntity.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/user/FCMJpaEntity.kt new file mode 100644 index 00000000..81ed8c57 --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/user/FCMJpaEntity.kt @@ -0,0 +1,21 @@ +package com.wespot.user + +import com.wespot.common.BaseEntity +import jakarta.persistence.* +import org.jetbrains.annotations.NotNull + +@Entity +class FCMJpaEntity( + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + val id: Long, + + @field: NotNull + val fcmToken: String, + + @Embedded + @field: NotNull + val baseEntity: BaseEntity + +) diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/user/ProfileJpaEntity.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/user/ProfileJpaEntity.kt new file mode 100644 index 00000000..31774776 --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/user/ProfileJpaEntity.kt @@ -0,0 +1,25 @@ +package com.wespot.user + +import jakarta.persistence.Entity +import jakarta.persistence.GeneratedValue +import jakarta.persistence.GenerationType +import jakarta.persistence.Id +import org.jetbrains.annotations.NotNull + +@Entity +class ProfileJpaEntity( + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + val id: Long, + + @field: NotNull + val userId: Long, + + @field: NotNull + val backgroundColor: String, + + @field: NotNull + val imageUrl: String + +) diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/user/SettingJpaEntity.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/user/SettingJpaEntity.kt new file mode 100644 index 00000000..ca5b43fb --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/user/SettingJpaEntity.kt @@ -0,0 +1,22 @@ +package com.wespot.user + +import jakarta.persistence.Entity +import jakarta.persistence.GeneratedValue +import jakarta.persistence.GenerationType +import jakarta.persistence.Id +import org.jetbrains.annotations.NotNull + +@Entity +class SettingJpaEntity( + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + val id: Long, + + @field: NotNull + val userId: Long, + + @field: NotNull + val isEnableNotification: Boolean + +) \ No newline at end of file diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/user/SocialJpaEntity.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/user/SocialJpaEntity.kt new file mode 100644 index 00000000..eb8267c3 --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/user/SocialJpaEntity.kt @@ -0,0 +1,18 @@ +package com.wespot.user + +import jakarta.persistence.Embeddable +import org.jetbrains.annotations.NotNull + +@Embeddable +class SocialJpaEntity( + + @field: NotNull + val socialId: Long, + + @field: NotNull + val socialType: Long, + + @field: NotNull + val socialRefreshToken: String + +) \ No newline at end of file diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/user/UserJpaEntity.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/user/UserJpaEntity.kt new file mode 100644 index 00000000..b42aaa0c --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/user/UserJpaEntity.kt @@ -0,0 +1,57 @@ +package com.wespot.user + +import com.wespot.common.BaseEntity +import jakarta.persistence.* +import org.jetbrains.annotations.NotNull +import java.time.LocalDateTime + +@Entity +@Table(name = "user") +class UserJpaEntity( + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + val id: Long, + + @field: NotNull + val schoolId: Long, + + @field: NotNull + val grade: Int, + + @field: NotNull + val group: Int, + + @OneToOne(fetch = FetchType.LAZY) + @JoinColumn( + name = "setting_id", foreignKey = ForeignKey(name = "fk_user_setting_id") + ) + @field: NotNull + val setting: SettingJpaEntity, + + @OneToOne(fetch = FetchType.LAZY) + @JoinColumn( + name = "profile_id", foreignKey = ForeignKey(name = "fk_user_profile_id") + ) + @field: NotNull + val profile: ProfileJpaEntity, + + @OneToOne(fetch = FetchType.LAZY) + @JoinColumn( + name = "fcm_id", foreignKey = ForeignKey(name = "fk_user_fcm_id") + ) + val fcm: FCMJpaEntity, + + @Embedded + @field: NotNull + val social: SocialJpaEntity, + + @Embedded + @field: NotNull + val baseEntity: BaseEntity, + + val withdrawAt: LocalDateTime + +) { + +} diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/user/UserJpaRepository.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/user/UserJpaRepository.kt new file mode 100644 index 00000000..bdff76b0 --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/user/UserJpaRepository.kt @@ -0,0 +1,6 @@ +package com.wespot.user + +import org.springframework.data.jpa.repository.JpaRepository + +interface UserJpaRepository : JpaRepository { +} \ No newline at end of file diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/user/UserPersistenceAdapter.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/user/UserPersistenceAdapter.kt new file mode 100644 index 00000000..a9f01cd9 --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/user/UserPersistenceAdapter.kt @@ -0,0 +1,10 @@ +package com.wespot.user + +import com.wespot.user.port.out.UserStatePort +import org.springframework.stereotype.Repository + +@Repository +class UserPersistenceAdapter( + private val userJpaRepository: UserJpaRepository +) : UserStatePort { +} \ No newline at end of file diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/vote/BallotJpaEntity.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/vote/BallotJpaEntity.kt new file mode 100644 index 00000000..7b49bb32 --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/vote/BallotJpaEntity.kt @@ -0,0 +1,31 @@ +package com.wespot.vote + +import com.wespot.common.BaseEntity +import jakarta.persistence.* +import org.jetbrains.annotations.NotNull + +@Entity +@Table(name = "ballot") +class BallotJpaEntity( + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + val id: Long, + + @field: NotNull + val voteId: Long, + + @field: NotNull + val senderId: Long, + + @field: NotNull + val receiverId: Long, + + @field: NotNull + @Embedded + val baseEntity: BaseEntity, + + @field: NotNull + val isReceiverRead: Boolean + +) diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/vote/VoteJpaEntity.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/vote/VoteJpaEntity.kt new file mode 100644 index 00000000..abd9d872 --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/vote/VoteJpaEntity.kt @@ -0,0 +1,32 @@ +package com.wespot.vote + +import jakarta.persistence.* +import org.jetbrains.annotations.NotNull +import java.time.LocalDateTime + +@Entity +@Table(name = "vote") +class VoteJpaEntity( + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + val id: Long, + + @field: NotNull + val schoolName: String, + + @field: NotNull + val grade: Int, + + @field: NotNull + val group: Int, + + @field: NotNull + val date: LocalDateTime, + + @field: NotNull + @OneToMany(mappedBy = "vote", cascade = [CascadeType.PERSIST]) + val ballots: List + +) + diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/vote/VoteJpaRepository.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/vote/VoteJpaRepository.kt new file mode 100644 index 00000000..cbc5293e --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/vote/VoteJpaRepository.kt @@ -0,0 +1,6 @@ +package com.wespot.vote + +import org.springframework.data.jpa.repository.JpaRepository + +interface VoteJpaRepository : JpaRepository { +} \ No newline at end of file diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/vote/VotePersistenceAdapter.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/vote/VotePersistenceAdapter.kt new file mode 100644 index 00000000..f19807ee --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/vote/VotePersistenceAdapter.kt @@ -0,0 +1,10 @@ +package com.wespot.vote + +import com.wespot.vote.port.out.VoteStatePort +import org.springframework.stereotype.Repository + +@Repository +class VotePersistenceAdapter( + private val voteJpaRepository: VoteJpaRepository +) : VoteStatePort { +} \ No newline at end of file diff --git a/infrastructure/mysql/src/main/kotlin/com/wespot/voteoption/VoteOptionJpaEntity.kt b/infrastructure/mysql/src/main/kotlin/com/wespot/voteoption/VoteOptionJpaEntity.kt new file mode 100644 index 00000000..196533f8 --- /dev/null +++ b/infrastructure/mysql/src/main/kotlin/com/wespot/voteoption/VoteOptionJpaEntity.kt @@ -0,0 +1,22 @@ +package com.wespot.voteoption + +import com.wespot.common.BaseEntity +import jakarta.persistence.* +import org.jetbrains.annotations.NotNull + +@Entity +@Table(name = "vote_option") +class VoteOptionJpaEntity( + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + val id: Long, + + @field: NotNull + val content: String, + + @field: NotNull + @Embedded + val baseEntity: BaseEntity + +) \ No newline at end of file