Skip to content

Commit

Permalink
Merge pull request #126 from readyvery/test
Browse files Browse the repository at this point in the history
배포 전 마지막
  • Loading branch information
marinesnow34 authored Dec 3, 2023
2 parents 9b7ed09 + ecfc3ad commit 0aff5e4
Show file tree
Hide file tree
Showing 69 changed files with 1,294 additions and 186 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/test_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ jobs:
- name: remove plain.jar
run: rm -rf build/libs/*plain.jar

- name: file copy
uses: actions/upload-artifact@v3
with:
name: libs
path: build/libs
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: file download
uses: actions/download-artifact@v3
with:
name: libs
path: libs
# - name: file copy
# uses: actions/upload-artifact@v3
# with:
# name: libs
# path: build/libs
# deploy:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - name: file download
# uses: actions/download-artifact@v3
# with:
# name: libs
# path: libs
- name: Upload to Cloudflare
env:
AWS_ACCESS_KEY_ID: ${{ secrets.CF_ACCESS_KEY_ID }}
Expand All @@ -51,7 +51,7 @@ jobs:
BUCKET_NAME: ${{ secrets.CF_BUCKET_NAME }}
ENDPOINT_URL: ${{ secrets.CF_ENDPOINT_URL }}
run: |
aws s3 sync libs/ s3://$BUCKET_NAME/java/main/test \
aws s3 sync build/libs/ s3://$BUCKET_NAME/java/main/test \
--endpoint-url $ENDPOINT_URL --delete --exact-timestamps
- name: SSH and deploy
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/com/readyvery/readyverydemo/domain/Cart.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.OneToMany;
import jakarta.persistence.OneToOne;
import jakarta.persistence.Table;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
Expand All @@ -38,6 +37,9 @@ public class Cart extends BaseTimeEntity {
@Column(name = "cart_idx")
private Long id;

@Column(nullable = false)
private Long inOut;

// 장바구니 유저 연관관계 매핑

@ManyToOne(fetch = FetchType.LAZY)
Expand All @@ -57,8 +59,9 @@ public class Cart extends BaseTimeEntity {
@Builder.Default
private Boolean isDeleted = false;

@OneToOne(mappedBy = "cart")
private Order order;
@Builder.Default
@OneToMany(mappedBy = "cart")
private List<Order> orders = new ArrayList<Order>();

// 장바구니 장바구니 아이템 연관관계 매핑
@Builder.Default
Expand Down
17 changes: 5 additions & 12 deletions src/main/java/com/readyvery/readyverydemo/domain/CeoInfo.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package com.readyvery.readyverydemo.domain;

import static jakarta.persistence.FetchType.*;

import java.time.LocalDateTime;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.OneToOne;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
Expand Down Expand Up @@ -45,14 +45,6 @@ public class CeoInfo extends BaseTimeEntity {
@Column(nullable = false, columnDefinition = "TEXT")
private String imageUrl;

// 연령대
@Column
private String age;

// 생일
@Column(nullable = false)
private String birth;

// 전화번호
@Column(nullable = false)
private String phone;
Expand Down Expand Up @@ -87,7 +79,8 @@ public class CeoInfo extends BaseTimeEntity {
private LocalDateTime lastLoginDate;

// 사장님 가게 연관관계 매핑
@OneToOne(mappedBy = "ceoInfo", fetch = LAZY)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "store_idx")
private Store store;

}
19 changes: 12 additions & 7 deletions src/main/java/com/readyvery/readyverydemo/domain/Coupon.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.readyvery.readyverydemo.domain;

import java.util.ArrayList;
import java.util.List;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
Expand All @@ -8,15 +11,18 @@
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.OneToOne;
import jakarta.persistence.OneToMany;
import jakarta.persistence.Table;
import jakarta.persistence.Version;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

@Getter
@Setter
@Entity
@Builder
@Table(name = "COUPON")
Expand All @@ -42,11 +48,10 @@ public class Coupon extends BaseTimeEntity {
@JoinColumn(name = "user_idx")
private UserInfo userInfo;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "store_idx")
private Store store;

@OneToOne(mappedBy = "coupon", fetch = FetchType.LAZY)
private Order order;
@Version
private Long version;

@Builder.Default
@OneToMany(mappedBy = "coupon", fetch = FetchType.LAZY)
private List<Order> orders = new ArrayList<Order>();
}
31 changes: 24 additions & 7 deletions src/main/java/com/readyvery/readyverydemo/domain/CouponDetail.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,34 @@ public class CouponDetail extends BaseTimeEntity {
@Column
private LocalDateTime expire;

// 발행처 레디베리 발행(0) / 사장님 발행(ceo_idx)
// 쿠폰 코드
@Column(name = "coupon_code")
private String couponCode;

// 발급 갯수
@Column(name = "coupon_count")
private Long couponCount;

// 쿠폰 설명
@Column
private Long publisher;
private String description;

// 이벤트 진행 여부
@Column(name = "is_active")
private boolean isActive;

// 배너 이미지 url
@Column(name = "banner_img")
private String bannerImg;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "event_idx")
private Event event;
@JoinColumn(name = "foodie_idx")
private Foodie foodie;

@Builder.Default
@OneToMany(mappedBy = "couponDetail", cascade = CascadeType.ALL)
private List<CouponMenu> couponMenus = new ArrayList<CouponMenu>();
// 발행처 레디베리 발행(null) / 사장님 발행(store_idx)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "store_idx")
private Store store;

@Builder.Default
@OneToMany(mappedBy = "couponDetail", cascade = CascadeType.ALL)
Expand Down
39 changes: 0 additions & 39 deletions src/main/java/com/readyvery/readyverydemo/domain/CouponMenu.java

This file was deleted.

18 changes: 6 additions & 12 deletions src/main/java/com/readyvery/readyverydemo/domain/Event.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
package com.readyvery.readyverydemo.domain;

import java.util.ArrayList;
import java.util.List;

import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.OneToMany;
import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
Expand All @@ -31,16 +26,15 @@ public class Event extends BaseTimeEntity {
@Column(name = "event_idx")
private Long id;

// 이벤트 베너 이미지 url
@Column(name = "banner_img")
private String bannerImg;

// 이벤트 메인 이미지 url
@Column(name = "main_img")
private String mainImg;

@Builder.Default
@OneToMany(mappedBy = "event", cascade = CascadeType.ALL)
private List<CouponDetail> coupons = new ArrayList<CouponDetail>();
// 이벤트 리다이렉트 url
@Column(name = "redirect_url")
private String redirectUrl;

// 이벤트 진행 여부
@Column(name = "is_active")
private boolean isActive;
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class Foodie extends BaseTimeEntity {
private List<CartItem> cartItems = new ArrayList<CartItem>();

@OneToMany(mappedBy = "foodie", cascade = CascadeType.ALL)
private List<CouponMenu> couponMenus = new ArrayList<CouponMenu>();
private List<CouponDetail> couponDetails = new ArrayList<CouponDetail>();

@OneToMany(mappedBy = "foodie", cascade = CascadeType.ALL)
private List<OrderItem> orderItems = new ArrayList<OrderItem>();
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/com/readyvery/readyverydemo/domain/Order.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ public class Order extends BaseTimeEntity {
@Column
private LocalDateTime estimatedTime;

@Column
private Long inOut;

// 가게 아이템 연관 관계
// @OneToMany(mappedBy = "order")
// @Builder.Default
Expand All @@ -90,11 +93,11 @@ public class Order extends BaseTimeEntity {
@JoinColumn(name = "user_idx")
private UserInfo userInfo;

@OneToOne(fetch = FetchType.LAZY)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "cart_idx")
private Cart cart;

@OneToOne(fetch = FetchType.LAZY)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "coupon_idx")
private Coupon coupon;

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/readyvery/readyverydemo/domain/Receipt.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

@Getter
@Setter
@Entity
@Builder
@Table(name = "RECEIPT")
Expand Down
20 changes: 14 additions & 6 deletions src/main/java/com/readyvery/readyverydemo/domain/Store.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.OneToMany;
import jakarta.persistence.OneToOne;
import jakarta.persistence.Table;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
Expand Down Expand Up @@ -63,15 +60,26 @@ public class Store extends BaseTimeEntity {
@Column
private String engName;

// 가게 서브 이름
@Column
private String subName;

// 가게 이벤트 메세지
@Column
private String eventMessage;

// 가게 테이크 아웃 이벤트 메시지
@Column
private String takeOutEventMessage;

//가게 등급
@Column
@Enumerated(EnumType.STRING)
private Grade grade;

//가게 사장님 연관관계 매핑
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "ceo_idx")
private CeoInfo ceoInfo;
@OneToMany(mappedBy = "store")
private List<CeoInfo> ceoInfos = new ArrayList<CeoInfo>();

//가게 메뉴 카테고리 연관관계 매핑
@OneToMany(mappedBy = "store", cascade = CascadeType.ALL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,13 @@ public class UserInfo extends BaseTimeEntity {
public void updateRefresh(String updateRefreshToken) {
this.refreshToken = updateRefreshToken;
}

public void updateRemoveUserDate() {
this.status = true;
this.deleteDate = LocalDateTime.now();
}

public void updateStatus(boolean status) {
this.status = status;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
import com.readyvery.readyverydemo.domain.UserInfo;

public interface CartRepository extends JpaRepository<Cart, Long> {
Optional<Cart> findByUserInfoAndIsDeletedFalse(UserInfo userInfo);
Optional<Cart> findByUserInfoAndIsDeletedFalseAndIsOrderedFalse(UserInfo userInfo);

}
Loading

0 comments on commit 0aff5e4

Please sign in to comment.