-
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.
Merge branch 'dev' into feature/YS-37
- Loading branch information
Showing
15 changed files
with
624 additions
and
21 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
15 changes: 0 additions & 15 deletions
15
src/main/kotlin/com/dobby/backend/infrastructure/database/entity/AuditingEntity.kt
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
src/main/kotlin/com/dobby/backend/infrastructure/database/entity/Member.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,42 @@ | ||
package com.dobby.backend.infrastructure.database.entity | ||
|
||
import AuditingEntity | ||
import com.dobby.backend.infrastructure.database.entity.enum.MemberStatus | ||
import com.dobby.backend.infrastructure.database.entity.enum.ProviderType | ||
import com.dobby.backend.infrastructure.database.entity.enum.RoleType | ||
import jakarta.persistence.* | ||
import java.time.LocalDate | ||
|
||
@Entity(name = "member") | ||
@Inheritance(strategy = InheritanceType.JOINED) | ||
@DiscriminatorColumn(name = "role_type") | ||
open class Member ( | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "id") | ||
val id: Long, | ||
|
||
@Column(name = "oauth_email", length = 100, nullable = false, unique = true) | ||
val oauthEmail : String, | ||
|
||
@Column(name = "oauth_provider", nullable = false) | ||
@Enumerated(EnumType.STRING) | ||
val provider : ProviderType, | ||
|
||
@Column(nullable = false) | ||
@Enumerated(EnumType.STRING) | ||
var status: MemberStatus = MemberStatus.HOLD, | ||
|
||
@Column(name = "role", nullable = true) | ||
@Enumerated(EnumType.STRING) | ||
val role: RoleType, | ||
|
||
@Column(name = "contact_email", length = 100, nullable = false) | ||
val contactEmail : String, | ||
|
||
@Column(name = "name", length = 10, nullable = false) | ||
val name : String, | ||
|
||
@Column(name = "birth_date", nullable = false) | ||
val birthDate : LocalDate, | ||
) : AuditingEntity() |
58 changes: 58 additions & 0 deletions
58
src/main/kotlin/com/dobby/backend/infrastructure/database/entity/Participant.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,58 @@ | ||
package com.dobby.backend.infrastructure.database.entity | ||
|
||
import com.dobby.backend.infrastructure.database.entity.enum.GenderType | ||
import com.dobby.backend.infrastructure.database.entity.enum.MatchType | ||
import com.dobby.backend.infrastructure.database.entity.enum.ProviderType | ||
import com.dobby.backend.infrastructure.database.entity.enum.RoleType | ||
import com.dobby.backend.infrastructure.database.entity.enum.areaInfo.Area | ||
import com.dobby.backend.infrastructure.database.entity.enum.areaInfo.Region | ||
import jakarta.persistence.Column | ||
import jakarta.persistence.DiscriminatorValue | ||
import jakarta.persistence.Entity | ||
import jakarta.persistence.EnumType | ||
import jakarta.persistence.Enumerated | ||
import java.time.LocalDate | ||
|
||
@Entity(name = "participant") | ||
@DiscriminatorValue("PARTICIPANT") | ||
class Participant ( | ||
@Column(name = "gender", nullable = false) | ||
@Enumerated(EnumType.STRING) | ||
val gender: GenderType, | ||
|
||
@Column(name = "basic_region", nullable = false) | ||
@Enumerated(EnumType.STRING) | ||
var basicRegion: Region, | ||
|
||
@Column(name = "basic_area", nullable = false) | ||
@Enumerated(EnumType.STRING) | ||
var basicArea : Area, | ||
|
||
@Column(name = "optional_region", nullable = true) | ||
@Enumerated(EnumType.STRING) | ||
var optionalRegion: Region, | ||
|
||
@Column(name = "optional_area", nullable = true) | ||
@Enumerated(EnumType.STRING) | ||
var optionalArea: Area, | ||
|
||
@Column(name = "prefer_type", nullable = true) | ||
@Enumerated(EnumType.STRING) | ||
var preferType: MatchType, | ||
|
||
id: Long, | ||
oauthEmail: String, | ||
provider: ProviderType, | ||
contactEmail: String, | ||
name: String, | ||
birthDate: LocalDate | ||
) : Member( | ||
id= id, | ||
oauthEmail = oauthEmail, | ||
provider = provider, | ||
contactEmail= contactEmail, | ||
role = RoleType.PARTICIPANT, | ||
name = name, | ||
birthDate = birthDate | ||
) | ||
|
42 changes: 42 additions & 0 deletions
42
src/main/kotlin/com/dobby/backend/infrastructure/database/entity/Researcher.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,42 @@ | ||
package com.dobby.backend.infrastructure.database.entity | ||
|
||
import com.dobby.backend.infrastructure.database.entity.enum.ProviderType | ||
import com.dobby.backend.infrastructure.database.entity.enum.RoleType | ||
import jakarta.persistence.Column | ||
import jakarta.persistence.DiscriminatorValue | ||
import jakarta.persistence.Entity | ||
import java.time.LocalDate | ||
|
||
@Entity(name = "researcher") | ||
@DiscriminatorValue("RESEARCHER") | ||
class Researcher ( | ||
@Column(name = "univ_email", length = 100, nullable = false) | ||
val univEmail : String, | ||
|
||
@Column(name = "email_verified", nullable = false) | ||
var emailVerified: Boolean = false, | ||
|
||
@Column(name = "univ_name", length = 100, nullable = false) | ||
val univName : String, | ||
|
||
@Column(name = "major", length = 10, nullable = false) | ||
val major : String, | ||
|
||
@Column(name = "lab_info", length = 100, nullable = true) | ||
val labInfo : String, | ||
|
||
id: Long, | ||
oauthEmail: String, | ||
provider: ProviderType, | ||
contactEmail: String, | ||
name: String, | ||
birthDate: LocalDate | ||
) : Member( | ||
id= id, | ||
oauthEmail = oauthEmail, | ||
provider = provider, | ||
contactEmail= contactEmail, | ||
role = RoleType.RESEARCHER, | ||
name = name, | ||
birthDate = birthDate | ||
) |
19 changes: 19 additions & 0 deletions
19
src/main/kotlin/com/dobby/backend/infrastructure/database/entity/common/AuditingEntity.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,19 @@ | ||
import jakarta.persistence.Column | ||
import jakarta.persistence.EntityListeners | ||
import jakarta.persistence.MappedSuperclass | ||
import org.springframework.data.annotation.CreatedDate | ||
import org.springframework.data.annotation.LastModifiedDate | ||
import org.springframework.data.jpa.domain.support.AuditingEntityListener | ||
import java.time.LocalDateTime | ||
|
||
@MappedSuperclass | ||
@EntityListeners(AuditingEntityListener::class) | ||
abstract class AuditingEntity { | ||
@CreatedDate | ||
@Column(name = "created_at", nullable = false, updatable = false) | ||
lateinit var createdAt: LocalDateTime | ||
|
||
@LastModifiedDate | ||
@Column(name = "updated_at", nullable = false) | ||
lateinit var updatedAt: LocalDateTime | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/kotlin/com/dobby/backend/infrastructure/database/entity/enum/GenderType.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,5 @@ | ||
package com.dobby.backend.infrastructure.database.entity.enum | ||
|
||
enum class GenderType { | ||
MALE, FEMALE, SECRET | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/kotlin/com/dobby/backend/infrastructure/database/entity/enum/MatchType.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,5 @@ | ||
package com.dobby.backend.infrastructure.database.entity.enum | ||
|
||
enum class MatchType { | ||
OFFLINE, ONLINE, HYBRID | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/kotlin/com/dobby/backend/infrastructure/database/entity/enum/MemberStatus.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,6 @@ | ||
package com.dobby.backend.infrastructure.database.entity.enum | ||
|
||
enum class MemberStatus { | ||
HOLD, | ||
ACTIVE | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/kotlin/com/dobby/backend/infrastructure/database/entity/enum/ProviderType.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,5 @@ | ||
package com.dobby.backend.infrastructure.database.entity.enum | ||
|
||
enum class ProviderType { | ||
NAVER, GOOGLE | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/kotlin/com/dobby/backend/infrastructure/database/entity/enum/RoleType.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,5 @@ | ||
package com.dobby.backend.infrastructure.database.entity.enum | ||
|
||
enum class RoleType { | ||
RESEARCHER, PARTICIPANT | ||
} |
Oops, something went wrong.