diff --git a/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/tag/presentation/TagController.kt b/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/tag/presentation/TagController.kt index 33126e48..5fc5d884 100644 --- a/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/tag/presentation/TagController.kt +++ b/Api-Module/src/main/kotlin/com/bamyanggang/apimodule/domain/tag/presentation/TagController.kt @@ -70,7 +70,6 @@ class TagController( @DeleteMapping(TagApi.TAG_PATH_VARIABLE_URL) fun deleteTag( @PathVariable("tagId") tagId: UUID) { - tagDeleteService.deleteTag(tagId) } } diff --git a/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/aggregate/Experience.kt b/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/aggregate/Experience.kt index 6cd2cff4..641a0c16 100644 --- a/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/aggregate/Experience.kt +++ b/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/aggregate/Experience.kt @@ -69,33 +69,5 @@ data class Experience( updatedAt = LocalDateTime.now(), ) } - - fun toDomain( - id: UUID, - userId: UUID, - title: String, - parentTagId: UUID, - childTagId: UUID, - contents: List, - experienceStrongPoints: List, - startedAt: LocalDateTime, - endedAt: LocalDateTime, - createdAt: LocalDateTime, - updatedAt: LocalDateTime, - ): Experience { - return Experience( - id = id, - userId = userId, - title = title, - parentTagId = parentTagId, - childTagId = childTagId, - contents = contents, - strongPoints = experienceStrongPoints, - startedAt = startedAt, - endedAt = endedAt, - createdAt = createdAt, - updatedAt = updatedAt, - ) - } } } diff --git a/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/aggregate/ExperienceStrongPoint.kt b/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/aggregate/ExperienceStrongPoint.kt index 850bdd80..0acfa20b 100644 --- a/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/aggregate/ExperienceStrongPoint.kt +++ b/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/experience/aggregate/ExperienceStrongPoint.kt @@ -13,9 +13,5 @@ data class ExperienceStrongPoint( fun create(strongPointId: UUID): ExperienceStrongPoint { return ExperienceStrongPoint(strongPointId = strongPointId) } - - fun toDomain(id: UUID, strongPointId: UUID): ExperienceStrongPoint { - return ExperienceStrongPoint(id, strongPointId) - } } } diff --git a/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/strongpoint/aggregate/StrongPoint.kt b/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/strongpoint/aggregate/StrongPoint.kt index 5996ad4f..3afaef73 100644 --- a/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/strongpoint/aggregate/StrongPoint.kt +++ b/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/strongpoint/aggregate/StrongPoint.kt @@ -22,9 +22,5 @@ data class StrongPoint( fun create(name: String, userId: UUID): StrongPoint { return StrongPoint(name = name, userId = userId) } - - fun toDomain(id: UUID, name: String, userId: UUID): StrongPoint { - return StrongPoint(id, name, userId) - } } } diff --git a/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/tag/aggregate/Tag.kt b/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/tag/aggregate/Tag.kt index f02294fc..f1fd5746 100644 --- a/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/tag/aggregate/Tag.kt +++ b/Domain-Module/src/main/kotlin/com/bamyanggang/domainmodule/domain/tag/aggregate/Tag.kt @@ -21,9 +21,5 @@ data class Tag( userId = userId ) } - - fun toDomain(id : UUID, name: String, parentTagId: UUID?, userId: UUID): Tag { - return Tag(id, name, parentTagId, userId) - } } } diff --git a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/experience/mapper/ExperienceMapper.java b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/experience/mapper/ExperienceMapper.java index b2cfc33d..b1373737 100644 --- a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/experience/mapper/ExperienceMapper.java +++ b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/experience/mapper/ExperienceMapper.java @@ -39,14 +39,14 @@ public Experience toExperienceDomainEntity(ExperienceJpaEntity experienceJpaEnti List experienceStrongPoints = experienceJpaEntity.getStrongPointInfos().stream() .map(this::toExperienceStrongPointDomainEntity).toList(); - return Experience.Companion.toDomain( + return new Experience( experienceJpaEntity.getExperienceId(), - experienceJpaEntity.getUserId(), experienceJpaEntity.getTitle(), + experienceJpaEntity.getUserId(), experienceJpaEntity.getParentTagId(), experienceJpaEntity.getChildTagId(), - contents, experienceStrongPoints, + contents, experienceJpaEntity.getStartedAt(), experienceJpaEntity.getEndedAt(), experienceJpaEntity.getCreatedAt(), @@ -63,7 +63,7 @@ public ExperienceContentJpaEntity toExperienceContentJpaEntity(ExperienceContent } public ExperienceContent toExperienceContentDomainEntity(ExperienceContentJpaEntity experienceContentJpaEntity) { - return ExperienceContent.Companion.toDomain( + return new ExperienceContent( experienceContentJpaEntity.getExperienceContentId(), experienceContentJpaEntity.getQuestion(), experienceContentJpaEntity.getAnswer() @@ -75,7 +75,7 @@ public ExperienceStrongPointJpaEntity toExperienceStrongPointJpaEntity(Experienc } public ExperienceStrongPoint toExperienceStrongPointDomainEntity(ExperienceStrongPointJpaEntity experienceStrongPointJpaEntity) { - return ExperienceStrongPoint.Companion.toDomain( + return new ExperienceStrongPoint( experienceStrongPointJpaEntity.getExperienceStrongPointId(), experienceStrongPointJpaEntity.getStrongPointId() ); diff --git a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/strongpoint/jpa/entity/StrongPointJpaEntity.java b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/strongpoint/jpa/entity/StrongPointJpaEntity.java index 523f68f0..2a7b4c2a 100644 --- a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/strongpoint/jpa/entity/StrongPointJpaEntity.java +++ b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/strongpoint/jpa/entity/StrongPointJpaEntity.java @@ -8,14 +8,12 @@ import jakarta.persistence.Table; import java.util.UUID; import lombok.AccessLevel; -import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; @Entity @Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) -@AllArgsConstructor(access = AccessLevel.PRIVATE) @Table(name = "strong_point") public class StrongPointJpaEntity { @Id @@ -29,7 +27,9 @@ public class StrongPointJpaEntity { @Convert(converter = UUIDBinaryConverter.class) private UUID userId; - public static StrongPointJpaEntity of(UUID id, String name, UUID userId) { - return new StrongPointJpaEntity(id, name, userId); + public StrongPointJpaEntity (UUID id, String name, UUID userId) { + this.strongPointId = id; + this.name = name; + this.userId = userId; } } diff --git a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/strongpoint/mapper/StrongPointMapper.java b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/strongpoint/mapper/StrongPointMapper.java index 62cac55c..79cb71af 100644 --- a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/strongpoint/mapper/StrongPointMapper.java +++ b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/strongpoint/mapper/StrongPointMapper.java @@ -7,7 +7,7 @@ @Component public class StrongPointMapper { public StrongPointJpaEntity toJpaEntity(StrongPoint strongPoint) { - return StrongPointJpaEntity.of( + return new StrongPointJpaEntity( strongPoint.getId(), strongPoint.getName(), strongPoint.getUserId() @@ -15,7 +15,7 @@ public StrongPointJpaEntity toJpaEntity(StrongPoint strongPoint) { } public StrongPoint toDomainEntity(StrongPointJpaEntity strongPointJpaEntity) { - return StrongPoint.Companion.toDomain( + return new StrongPoint( strongPointJpaEntity.getStrongPointId(), strongPointJpaEntity.getName(), strongPointJpaEntity.getUserId() diff --git a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/tag/mapper/TagMapper.java b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/tag/mapper/TagMapper.java index 39c9bd9e..18039161 100644 --- a/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/tag/mapper/TagMapper.java +++ b/Infrastructure-Module/persistence/src/main/java/com/bamyanggang/persistence/tag/mapper/TagMapper.java @@ -11,7 +11,7 @@ public TagJpaEntity toJpaEntity(Tag tag) { } public Tag toDomainEntity(TagJpaEntity tagJpaEntity) { - return Tag.Companion.toDomain(tagJpaEntity.getTagId(), + return new Tag(tagJpaEntity.getTagId(), tagJpaEntity.getName(), tagJpaEntity.getParentTagId(), tagJpaEntity.getUserId()