-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 장소 검수 기능 뼈대코드 설계 및 구현 #373
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
112 changes: 112 additions & 0 deletions
112
backend/src/main/java/com/now/naaga/temporaryplace/domain/TemporaryPlace.java
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,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() + | ||
'}'; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...end/src/main/java/com/now/naaga/temporaryplace/presentation/TemporaryPlaceController.java
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,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 { | ||
} |
8 changes: 8 additions & 0 deletions
8
backend/src/main/java/com/now/naaga/temporaryplace/repository/TemporaryPlaceRepository.java
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,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<TemporaryPlace, Long> { | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P5:
생명주기가 완전히 달라서 다른 패키지를 둔 것에 매우 동의합니다.
Place와 TemporaryPlace는 도메인 제약조건이 매우 깊은 연관 관계를 갖고 있는 것 같긴하지만, 앞으로 구현해나가면서 판단하면 될 것 같습니다.