Skip to content

Commit

Permalink
Merge branch 'develop' into feature/get-rooms
Browse files Browse the repository at this point in the history
  • Loading branch information
jo0oy committed Dec 5, 2023
2 parents 043b103 + b585550 commit 1f489af
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,4 @@
>
> `Star API Docs`
> ![](src/main/resources/image/star-docs.png)
>
>
11 changes: 7 additions & 4 deletions src/main/java/com/fc/shimpyo_be/domain/cart/entity/Cart.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Comment;

@Entity
@NoArgsConstructor(access = AccessLevel.PROTECTED)
Expand All @@ -23,22 +24,24 @@ public class Cart {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Comment(value = "장바구니 식별자")
private Long id;

@Comment(value = "회원 식별자")
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "member_id", nullable = false)
private Member member;

@Comment(value = "객실 식별자")
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "room_id", nullable = false)
private Room room;
@Comment(value = "총 이용 금액")
@Column(nullable = false)
private Long price;


@Comment(value = "숙박 시작일")
@Column(nullable = false)
private LocalDate startDate;

@Comment(value = "숙박 마지막일")
@Column(nullable = false)
private LocalDate endDate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Comment;

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
Expand All @@ -21,16 +22,22 @@ public class Member extends BaseTimeEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Comment("회원 식별자")
private Long id;
@Column(unique = true, nullable = false, length = 30)
@Comment("회원 이메일")
private String email;
@Column(nullable = false, length = 30)
@Comment("회원 이름")
private String name;
@Column(nullable = false)
@Comment("암호화된 비밀번호")
private String password;
@Column(nullable = false, columnDefinition = "TEXT")
@Comment("프로필 사진 URL")
private String photoUrl;
@Enumerated(EnumType.STRING)
@Comment("권한")
private Authority authority;

@Builder
Expand All @@ -50,7 +57,7 @@ public void update(UpdateMemberRequestDto updateMemberRequestDto) {
}
}

public void changePassword(String password){
public void changePassword(String password) {
this.password = password;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
public class RefreshToken {

@Id
@Comment("member_id")
@Comment("Refresh 토큰 식별자(회원 식별자)")
private Long id;
@Comment("Refresh 토큰")
private String token;

@Builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.Comment;

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
Expand All @@ -26,19 +27,26 @@ public class Product {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Comment("숙소 식별자")
private Long id;
@Column(nullable = false)
@Comment("숙소 이름")
private String name;
@Column(nullable = false)
@Comment("숙소 위치")
private String address;
@Column(nullable = false)
@Convert(converter = CategoryConverter.class)
@Comment("숙소 카테고리")
private Category category;
@Column(columnDefinition = "TEXT", nullable = false)
@Comment("숙소 설명")
private String description;
@ColumnDefault("0")
@Comment("숙소 평점")
private float starAvg;
@Column(columnDefinition = "TEXT", nullable = false)
@Comment("숙소 대표 이미지 URL")
private String thumbnail;
@OneToMany(mappedBy = "product", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)
private List<ProductImage> photoUrls = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Comment;


@Getter
Expand All @@ -21,11 +22,14 @@ public class ProductImage {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Comment("숙소 이미지 식별자")
private Long id;
@Column(nullable = false, columnDefinition = "TEXT")
@Comment("숙소 사진 URL")
private String photoUrl;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(nullable = false, name = "product_id")
@Comment("숙소 식별자")
private Product product;

@Builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Comment;
import org.springframework.util.ObjectUtils;

import java.util.ArrayList;
Expand All @@ -20,13 +21,17 @@ public class Reservation extends BaseTimeEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Comment(value = "예약 식별자")
private Long id;
@Comment(value = "예약 회원 식별자")
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "member_id")
private Member member;
@Comment(value = "결제 수단")
@Column(nullable = false)
@Enumerated(value = EnumType.STRING)
private PayMethod payMethod;
@Comment(value = "총 결제 금액")
@Column(nullable = false)
private int totalPrice;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Comment;

import java.time.LocalDate;
import java.time.LocalDateTime;
Expand All @@ -19,20 +20,28 @@ public class ReservationProduct extends BaseTimeEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Comment(value = "예약 상품 식별자")
private Long id;
@Comment(value = "예약 주문 식별자")
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "reservation_id")
private Reservation reservation;
@Comment(value = "예약 객실 식별자")
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "room_id")
private Room room;
@Comment(value = "총 이용 금액")
@Column(nullable = false)
private int price;
@Comment(value = "숙박 시작일")
@Column(nullable = false)
private LocalDate startDate;
@Comment(value = "숙박 마지막일")
@Column(nullable = false)
private LocalDate endDate;
@Comment(value = "방문자명")
private String visitorName;
@Comment(value = "방문자 전화번호")
private String visitorPhone;

@Builder
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/fc/shimpyo_be/domain/room/entity/Room.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Comment;

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
Expand All @@ -22,23 +23,32 @@ public class Room {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Comment("객실 식별자")
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "product_id")
@Comment("숙소 식별자")
private Product product;
@Column(length = 30)
@Comment("객실 이름")
private String name;
@Column(nullable = false)
@Comment("객실 설명")
private String description;
@Column(columnDefinition = "TINYINT")
@Comment("객실 기준인원")
private int standard;
@Column(columnDefinition = "TINYINT")
@Comment("객실 최대인원")
private int capacity;
@Column(columnDefinition = "TIME")
@Comment("객실 체크인 시간")
private LocalTime checkIn;
@Column(columnDefinition = "TIME")
@Comment("객실 체크아웃 시간")
private LocalTime checkOut;
@Column(nullable = false)
@Comment("객실 가격")
private int price;

@Builder
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/fc/shimpyo_be/domain/star/entity/Star.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Comment;

@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
Expand All @@ -22,13 +23,17 @@ public class Star {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Comment(value = "별점 식별자")
private Long id;
@Comment(value = "회원 식별자")
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "member_id")
private Member member;
@Comment(value = "별점 등록 상품 식별자")
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "product_id")
private Product product;
@Comment(value = "별점 점수")
@Column(nullable = false)
private float score;

Expand Down

0 comments on commit 1f489af

Please sign in to comment.