-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from lotteon2/LF1-306-payment-config
초기 설정 및 Entity 생성
- Loading branch information
Showing
13 changed files
with
272 additions
and
16 deletions.
There are no files selected for viewing
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,25 @@ | ||
name: PR build | ||
|
||
|
||
on: | ||
pull_request: | ||
branches: [ develop ] # develop branch에 PR을 보낼 때 실행 | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
|
||
# Gradle wrapper 파일 실행 권한주기 | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
# Gradle test를 실행한다 | ||
- name: build gradle | ||
run: ./gradlew clean build |
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
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
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,15 @@ | ||
package kr.bb.payment.entity; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum OrderType { | ||
ORDER_DELIVERY("주문 배송"), | ||
ORDER_PICKUP("주문 픽업"); | ||
|
||
private final String message; | ||
|
||
OrderType(String message) { | ||
this.message = message; | ||
} | ||
} |
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,51 @@ | ||
package kr.bb.payment.entity; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.EnumType; | ||
import javax.persistence.Enumerated; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
import kr.bb.payment.entity.common.BaseEntity; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Table(name = "payment") | ||
@AllArgsConstructor(access = AccessLevel.PROTECTED) | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class Payment extends BaseEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "payment_id") | ||
private Long paymentId; | ||
|
||
@Column(name = "user_id", unique = true, nullable = false) | ||
private Long userId; | ||
|
||
@Column(name = "order_id", unique = true, nullable = false) | ||
private Long orderId; | ||
|
||
@Enumerated(EnumType.STRING) | ||
@Column(name = "orderType", nullable = false) | ||
private String orderType; | ||
|
||
@Column(name = "payment_cid", nullable = false) | ||
private String paymentCid; | ||
|
||
@Column(name = "payment_tid", nullable = false) | ||
private String paymentTid; | ||
|
||
@Column(name = "payment_actual_amount", nullable = false) | ||
private String paymentActualAmount; | ||
|
||
@Column(name = "payment_type", nullable = false) | ||
private String paymentType; | ||
|
||
@Column(name = "payment_status", nullable = false) | ||
private String paymentStatus; | ||
} |
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,43 @@ | ||
package kr.bb.payment.entity; | ||
|
||
import static javax.persistence.GenerationType.IDENTITY; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.Id; | ||
import javax.persistence.JoinColumn; | ||
import javax.persistence.OneToOne; | ||
import javax.persistence.Table; | ||
import kr.bb.payment.entity.common.BaseEntity; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Table(name="payment_cancel") | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class PaymentCancel extends BaseEntity { | ||
@Id | ||
@GeneratedValue(strategy = IDENTITY) | ||
@Column(name ="payment_cancel_id") | ||
private Long paymentCancelId; | ||
|
||
@OneToOne | ||
@JoinColumn(name = "payment_id") | ||
private Payment paymentId; | ||
|
||
@Column(name = "payment_cancel_quantity", unique = true, nullable = false) | ||
private Long paymentCancelQuantity; | ||
|
||
@Column(name = "payment_cancel_amount", unique = true, nullable = false) | ||
private Long paymentCancelAmount; | ||
|
||
@Column(name = "payment_cancel_reason", unique = true, nullable = false) | ||
private Long paymentCancelReason; | ||
|
||
@Column(name = "payment_cancel_status", unique = true, nullable = false) | ||
private Long paymentCancelStatus; | ||
} | ||
|
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,52 @@ | ||
package kr.bb.payment.entity; | ||
|
||
import java.util.Date; | ||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
import kr.bb.payment.entity.common.BaseEntity; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Table(name = "subscription") | ||
@AllArgsConstructor(access = AccessLevel.PROTECTED) | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class Subscription extends BaseEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "subscription_id") | ||
private Long subscriptionId; | ||
|
||
@Column(name = "order_subscription_id", unique = true, nullable = false) | ||
private Long orderSubscriptionId; | ||
|
||
@Column(name = "subscription_cid", nullable = false) | ||
private String subscriptionCid; | ||
|
||
@Column(name = "subscription_tid", unique = true, nullable = false) | ||
private String subscriptionTid; | ||
|
||
@Column(name = "subscription_sid", unique = true, nullable = false) | ||
private String subscriptionSid; | ||
|
||
@Column(name = "subscription_quantity", unique = true, nullable = false) | ||
private Long subscriptionQuantity; | ||
|
||
@Column(name = "subscription_total_amount", unique = true, nullable = false) | ||
private Long subscriptionTotalAmount; | ||
|
||
@Column(name = "payment_day", unique = true, nullable = false) | ||
private String paymentDay; | ||
|
||
@Column(name = "start_date", unique = true, nullable = false) | ||
private Date startDate; | ||
|
||
@Column(name = "end_date", unique = true, nullable = true) | ||
private Date endDate; | ||
} |
39 changes: 39 additions & 0 deletions
39
src/main/java/kr/bb/payment/entity/SubscriptionRecords.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,39 @@ | ||
package kr.bb.payment.entity; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.FetchType; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.JoinColumn; | ||
import javax.persistence.ManyToOne; | ||
import javax.persistence.Table; | ||
import kr.bb.payment.entity.common.BaseEntity; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Table(name = "subscription_records") | ||
@AllArgsConstructor(access = AccessLevel.PROTECTED) | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class SubscriptionRecords extends BaseEntity { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "subscription_records_id") | ||
private Long subscriptionRecordsId; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "subcription_id") | ||
private Subscription subscriptionId; | ||
|
||
@Column(name = "delivery_id", unique = true, nullable = false) | ||
private Long deliveryId; | ||
|
||
@Column(name = "subscription_total_amount", unique = true, nullable = false) | ||
private Long subscriptionTotalAmount; | ||
|
||
@Column(name = "subscription_status", unique = true, nullable = false) | ||
private String subscriptionStatus; | ||
} |
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,27 @@ | ||
package kr.bb.payment.entity.common; | ||
|
||
import java.time.LocalDateTime; | ||
import javax.persistence.Column; | ||
import javax.persistence.EntityListeners; | ||
import javax.persistence.MappedSuperclass; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
import org.springframework.data.annotation.CreatedDate; | ||
import org.springframework.data.annotation.LastModifiedDate; | ||
import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
|
||
@MappedSuperclass | ||
@EntityListeners(AuditingEntityListener.class) | ||
public class BaseEntity { | ||
@CreatedDate | ||
@Column(name = "created_at") | ||
private LocalDateTime createdAt; | ||
|
||
@LastModifiedDate | ||
@Column(name = "updated_at") | ||
private LocalDateTime updatedAt; | ||
|
||
@Column(name = "is_deleted") | ||
private Boolean isDeleted; | ||
} | ||
|
6 changes: 6 additions & 0 deletions
6
src/main/java/kr/bb/payment/repository/PaymentRepository.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,6 @@ | ||
package kr.bb.payment.repository; | ||
|
||
import kr.bb.payment.entity.Payment; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface PaymentRepository extends JpaRepository<Long, Payment> {} |
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,6 @@ | ||
package kr.bb.payment.service; | ||
|
||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class PaymentService {} |
Empty file.
13 changes: 0 additions & 13 deletions
13
src/test/java/kr/bb/payment/PaymentServiceApplicationTests.java
This file was deleted.
Oops, something went wrong.