From f9bcd11bddc9d9eb0e83b6ab4d00011ce8b4941d Mon Sep 17 00:00:00 2001 From: kokodak Date: Sat, 30 Sep 2023 22:33:47 +0900 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=EA=B2=80=EC=88=98=EA=B0=80=20?= =?UTF-8?q?=ED=95=84=EC=9A=94=ED=95=9C=20=EC=9E=A5=EC=86=8C=20=EC=97=94?= =?UTF-8?q?=ED=8B=B0=ED=8B=B0=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../temporaryplace/domain/TemporaryPlace.java | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 backend/src/main/java/com/now/naaga/temporaryplace/domain/TemporaryPlace.java diff --git a/backend/src/main/java/com/now/naaga/temporaryplace/domain/TemporaryPlace.java b/backend/src/main/java/com/now/naaga/temporaryplace/domain/TemporaryPlace.java new file mode 100644 index 000000000..ac27689a2 --- /dev/null +++ b/backend/src/main/java/com/now/naaga/temporaryplace/domain/TemporaryPlace.java @@ -0,0 +1,112 @@ +package com.now.naaga.temporaryplace.domain; + +import com.now.naaga.common.domain.BaseEntity; +import com.now.naaga.place.domain.Position; +import com.now.naaga.player.domain.Player; +import jakarta.persistence.Embedded; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import java.util.Objects; + +@Entity +public class TemporaryPlace extends BaseEntity { + + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Id + private Long id; + + private String name; + + private String description; + + @Embedded + private Position position; + + private String imageUrl; + + @ManyToOne + @JoinColumn(name = "player_id") + private Player registeredPlayer; + + protected TemporaryPlace() { + } + + public TemporaryPlace(final String name, + final String description, + final Position position, + final String imageUrl, + final Player registeredPlayer) { + this(null, name, description, position, imageUrl, registeredPlayer); + } + + public TemporaryPlace(final Long id, + final String name, + final String description, + final Position position, + final String imageUrl, + final Player registeredPlayer) { + this.id = id; + this.name = name; + this.description = description; + this.position = position; + this.imageUrl = imageUrl; + this.registeredPlayer = registeredPlayer; + } + + public Long getId() { + return id; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public Position getPosition() { + return position; + } + + public String getImageUrl() { + return imageUrl; + } + + public Player getRegisteredPlayer() { + return registeredPlayer; + } + + @Override + public boolean equals(final Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final TemporaryPlace that = (TemporaryPlace) o; + return Objects.equals(id, that.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + return "TemporaryPlace{" + + "id=" + id + + ", name='" + name + '\'' + + ", description='" + description + '\'' + + ", position=" + position + + ", imageUrl='" + imageUrl + '\'' + + ", registeredPlayerId=" + registeredPlayer.getId() + + '}'; + } +} From 14f156d5a86f6a930d1069d5896547c725ce6434 Mon Sep 17 00:00:00 2001 From: kokodak Date: Sat, 30 Sep 2023 22:49:06 +0900 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=EC=9E=A5=EC=86=8C=20=EA=B2=80?= =?UTF-8?q?=EC=88=98=20=EC=BB=A8=ED=8A=B8=EB=A1=A4=EB=9F=AC=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/TemporaryPlaceController.java | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 backend/src/main/java/com/now/naaga/temporaryplace/presentation/TemporaryPlaceController.java diff --git a/backend/src/main/java/com/now/naaga/temporaryplace/presentation/TemporaryPlaceController.java b/backend/src/main/java/com/now/naaga/temporaryplace/presentation/TemporaryPlaceController.java new file mode 100644 index 000000000..366087565 --- /dev/null +++ b/backend/src/main/java/com/now/naaga/temporaryplace/presentation/TemporaryPlaceController.java @@ -0,0 +1,9 @@ +package com.now.naaga.temporaryplace.presentation; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RequestMapping("/temporary-places") +@RestController +public class TemporaryPlaceController { +} From ff109d3a1ac8fbcd7fbe07b9b4a6733fd06005bd Mon Sep 17 00:00:00 2001 From: kokodak Date: Sat, 30 Sep 2023 22:49:28 +0900 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=EC=9E=A5=EC=86=8C=20=EA=B2=80?= =?UTF-8?q?=EC=88=98=20Repository=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/TemporaryPlaceRepository.java | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 backend/src/main/java/com/now/naaga/temporaryplace/repository/TemporaryPlaceRepository.java diff --git a/backend/src/main/java/com/now/naaga/temporaryplace/repository/TemporaryPlaceRepository.java b/backend/src/main/java/com/now/naaga/temporaryplace/repository/TemporaryPlaceRepository.java new file mode 100644 index 000000000..6616c94a4 --- /dev/null +++ b/backend/src/main/java/com/now/naaga/temporaryplace/repository/TemporaryPlaceRepository.java @@ -0,0 +1,8 @@ +package com.now.naaga.temporaryplace.repository; + + +import com.now.naaga.temporaryplace.domain.TemporaryPlace; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface TemporaryPlaceRepository extends JpaRepository { +}