Skip to content
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

refactor : Hive Entity, DTO 에 주소값 입력하는 컬럼 추가 #126

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@ public class CreateHiveRequestDTO {

private String subCategoryName;

private String fullAddress;

private String roadAddress;

public Hive toEntity(User createdBy,MajorCategory majorCategory,SubCategory subCategory) {
return Hive.builder()
.title(title)
.majorCategory(majorCategory)
.subCategory(subCategory)
.fullAddress(fullAddress)
.roadAddress(roadAddress)
.creatorId(createdBy.getId())
.introduction("내용을 넣어주세요")
.user(createdBy)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ public class HiveResponseDTO {

private String subCategory;

private String fullAddress;

private String roadAddress;

private String introduction;

private Long hostId;
Expand All @@ -47,6 +51,8 @@ public static HiveResponseDTO of(Hive hive) {
.title(hive.getTitle())
.majorCategory(majorName)
.subCategory(subName)
.fullAddress(hive.getFullAddress())
.roadAddress(hive.getRoadAddress())
.introduction(hive.getIntroduction())
.hostId(hive.getCreatorId())
.hostName(hive.getUser().getUsername())
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/HHive/hhive/domain/hive/entity/Hive.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ public class Hive extends BaseTimeEntity {
@Enumerated(EnumType.STRING)
private SubCategory subCategory;

@Column
private String fullAddress;

@Column
private String roadAddress;

@Column
private String introduction;

Expand Down
Loading