Skip to content

Commit

Permalink
Chore: (develop) etc 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
alsdl0629 committed Nov 22, 2023
1 parent c34fc62 commit 6238f4a
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import jakarta.validation.constraints.NotNull
import java.io.Serializable

@Entity
class Closure(
class ClosureEntity(
@EmbeddedId
val closureId: ClosureId,

@field:NotNull
@Column(columnDefinition = "TINYINT UNSIGNED")
val depth: Int
val depth: Int,
)

@Embeddable
Expand All @@ -23,5 +23,5 @@ data class ClosureId(
val ancestorId: Long,

@Column(columnDefinition = "INT UNSIGNED")
val descendantId: Long
val descendantId: Long,
) : Serializable
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package team.sfe.server.domain.closure.domain.repository

import org.springframework.data.repository.CrudRepository
import team.sfe.server.domain.closure.domain.Closure
import team.sfe.server.domain.closure.domain.ClosureEntity
import team.sfe.server.domain.closure.domain.ClosureId

interface ClosureRepository : CrudRepository<Closure, ClosureId>
interface ClosureRepository : CrudRepository<ClosureEntity, ClosureId>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import team.sfe.server.domain.element.domain.type.Type
import team.sfe.server.global.entity.BaseIdEntity

@Entity
class Element(
class ElementEntity(
override val id: Long = 0L,

@field:NotNull
Expand All @@ -20,6 +20,5 @@ class Element(

@field:NotNull
@Column(columnDefinition = "CHAR(10)")
val type: Type

val type: Type,
) : BaseIdEntity(id)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package team.sfe.server.domain.element.domain.repository

import org.springframework.data.repository.CrudRepository
import team.sfe.server.domain.element.domain.Element
import team.sfe.server.domain.element.domain.ElementEntity

interface ElementRepository : CrudRepository<Element, Long>
interface ElementRepository : CrudRepository<ElementEntity, Long>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import team.sfe.server.global.entity.BaseIdEntity

@Entity
class DiseaseEntity(
override val id: Long = 0L,
id: Long = 0L,

@field:NotNull
@MapsId
Expand All @@ -31,7 +31,7 @@ class DiseaseEntity(

@field:NotNull
@Column(columnDefinition = "FLOAT")
val infectPower: Float
val infectPower: Float,
) : BaseIdEntity(id) {

fun toDiseaseDto() = Disease(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import team.sfe.server.global.entity.BaseIdEntity

@Entity
class GameInfoEntity(
override val id: Long = 0L,
id: Long = 0L,

@field:NotNull
@MapsId
Expand Down Expand Up @@ -42,5 +42,9 @@ class GameInfoEntity(

@field:NotNull
@Column(columnDefinition = "TINYINT(1)")
val vaccineEnded: Boolean
val vaccineEnded: Boolean,

@field:NotNull
@Column(columnDefinition = "TEXT")
val etc: String,
) : BaseIdEntity(id)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import team.sfe.server.global.entity.BaseIdEntity

@Entity
class PersonEntity(
override val id: Long = 0L,
id: Long = 0L,

@field:NotNull
@MapsId
Expand All @@ -35,7 +35,7 @@ class PersonEntity(

@field:NotNull
@Column(columnDefinition = "INT")
val infectedPerson: Int
val infectedPerson: Int,
) : BaseIdEntity(id) {

fun toPersonDto() = Person(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ data class GetProgressResponse(
val kitEnabled: Boolean,
val kitChance: Int,
val vaccineResearch: Boolean,
val vaccineEnded: Boolean
val vaccineEnded: Boolean,
val etc: String,
) {

companion object {
Expand All @@ -27,7 +28,8 @@ data class GetProgressResponse(
kitEnabled = vo.gameInfoEntity.kitEnabled,
kitChance = vo.gameInfoEntity.kitChance,
vaccineResearch = vo.gameInfoEntity.vaccineResearch,
vaccineEnded = vo.gameInfoEntity.vaccineEnded
vaccineEnded = vo.gameInfoEntity.vaccineEnded,
etc = vo.gameInfoEntity.etc,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ data class SaveProgressRequest(
val kitEnabled: Boolean,
val kitChance: Int,
val vaccineResearch: Boolean,
val vaccineEnded: Boolean
val vaccineEnded: Boolean,
val etc: String,
) {

fun toGameInfoEntity(userEntity: UserEntity) = GameInfoEntity(
Expand All @@ -26,7 +27,8 @@ data class SaveProgressRequest(
kitEnabled = this.kitEnabled,
kitChance = this.kitChance,
vaccineResearch = this.vaccineResearch,
vaccineEnded = this.vaccineEnded
vaccineEnded = this.vaccineEnded,
etc = etc,
)

fun toPersonData(userEntity: UserEntity) = persons.map {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@ class GetProgressServiceImpl(
return GetProgressResponse(
disease = diseaseEntity.toDiseaseDto(),
person = personEntity.toPersonDto(),
persons = personData.map {
it.toPersonDataDto()
},
persons = personData.map { it.toPersonDataDto() },
diseaseEnabled = gameInfoEntity.diseaseEnabled,
pcrEnabled = gameInfoEntity.pcrEnabled,
kitEnabled = gameInfoEntity.kitEnabled,
kitChance = gameInfoEntity.kitChance,
vaccineResearch = gameInfoEntity.vaccineResearch,
vaccineEnded = gameInfoEntity.vaccineEnded
vaccineEnded = gameInfoEntity.vaccineEnded,
etc = gameInfoEntity.etc,
)
}
}

0 comments on commit 6238f4a

Please sign in to comment.