Skip to content

Commit

Permalink
Refactor: #107 tab size 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
tinon1004 committed May 2, 2024
1 parent 0877191 commit 6467a48
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.ajou.hertz.domain.practice_room.dto.request.CreateNewPracticeRoomRequest;
import com.ajou.hertz.domain.practice_room.dto.response.PracticeRoomResponse;
import com.ajou.hertz.domain.practice_room.service.PracticeRoomCommandService;
import com.ajou.hertz.domain.practice_room.service.PracticeRoomQueryService;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
Expand All @@ -35,6 +36,7 @@
public class PracticeRoomController {

private final PracticeRoomCommandService practiceRoomCommandService;
private final PracticeRoomQueryService practiceRoomQueryService;

@Operation(
summary = "합주실 매물 등록",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ public class CreateNewPracticeRoomRequest {
@Schema(description = "해시태그(각 해시태그마다 최대 10글자)", example = "[\"밴드\", \"\"]")
private List<@NotBlank @Length(max = 10) String> hashtags;

public PracticeRoom toEntity(User seller) {
return PracticeRoom.create(seller, getTitle(), getTradeAddress().toEntity(), getCoordinate().toEntity(),
getHasSoundEquipment(), getHasInstrument(), getPricePerDay(), getPricePerHour(), getPricePerMonth(),
getCapacity(), getSize(), getHasParkingLot(), getDescription());
}

public CreateNewPracticeRoomRequest(
String title,
FullAddressRequest tradeAddress,
Expand Down Expand Up @@ -118,5 +112,11 @@ public CreateNewPracticeRoomRequest(
this.hashtags = hashtags;
}

public PracticeRoom toEntity(User seller) {
return PracticeRoom.create(seller, getTitle(), getTradeAddress().toEntity(), getCoordinate().toEntity(),
getHasSoundEquipment(), getHasInstrument(), getPricePerDay(), getPricePerHour(), getPricePerMonth(),
getCapacity(), getSize(), getHasParkingLot(), getDescription());
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -26,57 +26,42 @@
@Entity
public class PracticeRoom extends TimeTrackedBaseEntity {

@Embedded
private final PracticeRoomImages images = new PracticeRoomImages();
@Embedded
private final PracticeRoomHashtags hashtags = new PracticeRoomHashtags();
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "practice_room_id", nullable = false)
private Long id;

@JoinColumn(name = "seller_id", nullable = false)
@ManyToOne(fetch = FetchType.LAZY)
private User seller;

@Column(nullable = false)
private String title;

@Embedded
private FullAddress tradeAddress;

@Column(nullable = false)
private Boolean hasSoundEquipment;

@Column(nullable = false)
private Boolean hasInstrument;

@Column(nullable = false)
private Integer pricePerDay;

@Column(nullable = false)
private Integer pricePerHour;

@Column(nullable = false)
private Integer pricePerMonth;

@Column(nullable = false)
private Short capacity;

@Column(nullable = false)
private String size;

@Column(nullable = false)
private Boolean hasParkingLot;

@Embedded
private PracticeRoomDescription description;

@Embedded
private Coordinate coordinate;

@Embedded
private final PracticeRoomImages images = new PracticeRoomImages();

@Embedded
private final PracticeRoomHashtags hashtags = new PracticeRoomHashtags();

protected PracticeRoom(
Long id,
User seller,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ private PracticeRoomImage(Long id, PracticeRoom practiceRoom, String originalNam

public static PracticeRoomImage create(PracticeRoom practiceRoom, String originalName, String storedName,
String url) {
return new PracticeRoomImage(
null,
practiceRoom,
originalName,
storedName,
url
);
return new PracticeRoomImage(null, practiceRoom, originalName, storedName, url);
}
}

0 comments on commit 6467a48

Please sign in to comment.