From 2a8504e63a55990149de248b1bc24138071097de Mon Sep 17 00:00:00 2001 From: byung eun park Date: Fri, 18 Oct 2019 18:38:35 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=85=EC=B6=9C=EA=B8=88=20=ED=8C=A8?= =?UTF-8?q?=ED=82=A4=EC=A7=80=20=EB=AA=A8=EB=8D=B8=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/info/entity/ReplyEntity.java | 36 +++++++++++++++++++ .../{user => moneys}/entity/BankEntity.java | 2 +- .../entity/DepositEntity.java | 19 ++++++---- .../entity/PayDoneEntity.java | 2 +- .../{user => moneys}/entity/PayEntity.java | 4 +-- .../entity/WithdrawEntity.java | 16 ++++----- .../repository/BankRepository.java | 4 +-- .../repository/DepositRepository.java | 4 +-- .../repository/WithdrawRepository.java | 4 +-- .../{user => moneys}/type/BankingName.java | 2 +- .../modules/user/type/CommissionName.java | 6 ++-- .../user/repository/BankRepositoryTest.java | 3 +- .../repository/DepositRepositoryTest.java | 8 +++-- .../repository/WithdrawRepositoryTest.java | 8 +++-- 14 files changed, 82 insertions(+), 36 deletions(-) create mode 100644 src/main/java/com/totopia/server/modules/info/entity/ReplyEntity.java rename src/main/java/com/totopia/server/modules/{user => moneys}/entity/BankEntity.java (96%) rename src/main/java/com/totopia/server/modules/{user => moneys}/entity/DepositEntity.java (56%) rename src/main/java/com/totopia/server/modules/{user => moneys}/entity/PayDoneEntity.java (95%) rename src/main/java/com/totopia/server/modules/{user => moneys}/entity/PayEntity.java (89%) rename src/main/java/com/totopia/server/modules/{user => moneys}/entity/WithdrawEntity.java (61%) rename src/main/java/com/totopia/server/modules/{user => moneys}/repository/BankRepository.java (55%) rename src/main/java/com/totopia/server/modules/{user => moneys}/repository/DepositRepository.java (55%) rename src/main/java/com/totopia/server/modules/{user => moneys}/repository/WithdrawRepository.java (55%) rename src/main/java/com/totopia/server/modules/{user => moneys}/type/BankingName.java (70%) diff --git a/src/main/java/com/totopia/server/modules/info/entity/ReplyEntity.java b/src/main/java/com/totopia/server/modules/info/entity/ReplyEntity.java new file mode 100644 index 0000000..211a375 --- /dev/null +++ b/src/main/java/com/totopia/server/modules/info/entity/ReplyEntity.java @@ -0,0 +1,36 @@ +package com.totopia.server.modules.info.entity; + +import com.totopia.server.commons.data.entity.UserDateAuditEntity; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import javax.persistence.*; + +@Entity +@Table(name = "reply") +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class ReplyEntity extends UserDateAuditEntity { + @Id + @GeneratedValue(generator = "reply_generator") + @SequenceGenerator(name = "reply_generator", sequenceName = "reply_sequence", initialValue = 1) + private Long id; + + @Basic + @Column(name = "free_board_id", nullable = false) + private Long freeBoard; + + @Basic + @Column(name = "title", nullable = true, length = 200) + private String title; + + @Basic + @Column(name = "contents", nullable = true, length = 2000) + private String contents; +} diff --git a/src/main/java/com/totopia/server/modules/user/entity/BankEntity.java b/src/main/java/com/totopia/server/modules/moneys/entity/BankEntity.java similarity index 96% rename from src/main/java/com/totopia/server/modules/user/entity/BankEntity.java rename to src/main/java/com/totopia/server/modules/moneys/entity/BankEntity.java index 0fe4b6a..a546228 100644 --- a/src/main/java/com/totopia/server/modules/user/entity/BankEntity.java +++ b/src/main/java/com/totopia/server/modules/moneys/entity/BankEntity.java @@ -1,4 +1,4 @@ -package com.totopia.server.modules.user.entity; +package com.totopia.server.modules.moneys.entity; import com.totopia.server.commons.data.entity.DateAuditEntity; import com.totopia.server.modules.user.type.StatusName; diff --git a/src/main/java/com/totopia/server/modules/user/entity/DepositEntity.java b/src/main/java/com/totopia/server/modules/moneys/entity/DepositEntity.java similarity index 56% rename from src/main/java/com/totopia/server/modules/user/entity/DepositEntity.java rename to src/main/java/com/totopia/server/modules/moneys/entity/DepositEntity.java index 513f142..a3f9ee2 100644 --- a/src/main/java/com/totopia/server/modules/user/entity/DepositEntity.java +++ b/src/main/java/com/totopia/server/modules/moneys/entity/DepositEntity.java @@ -1,7 +1,8 @@ -package com.totopia.server.modules.user.entity; +package com.totopia.server.modules.moneys.entity; import com.totopia.server.commons.data.entity.DateAuditEntity; -import com.totopia.server.modules.user.type.BankingName; +import com.totopia.server.commons.data.entity.UserDateAuditEntity; +import com.totopia.server.modules.moneys.type.BankingName; import lombok.*; import lombok.experimental.SuperBuilder; @@ -17,7 +18,11 @@ import java.io.Serializable; @ToString @Data @Builder -public class DepositEntity extends DateAuditEntity implements Serializable { +@AttributeOverrides({ + @AttributeOverride(name = "updatedBy", column = @Column(name = "approve_admin_id")), + @AttributeOverride(name = "updatedAt", column = @Column(name = "confirm_date")), +}) +public class DepositEntity extends UserDateAuditEntity implements Serializable { @Id @GeneratedValue(generator = "deposit_generator") @@ -29,16 +34,16 @@ public class DepositEntity extends DateAuditEntity implements Serializable { private Integer price; @Basic - @Column(name = "approve_user_id", nullable = false) - private Long approveUser; + @Column(name = "bonus", nullable = false) + private Integer bonus; @Basic @Column(name = "bank_id", nullable = false) private Long bank; @Basic - @Column(name = "deposit_account", nullable = false) - private String depositAccount; + @Column(name = "bank_accounts_id", nullable = false) + private Short bankAccounts; @Basic @Enumerated(EnumType.STRING) diff --git a/src/main/java/com/totopia/server/modules/user/entity/PayDoneEntity.java b/src/main/java/com/totopia/server/modules/moneys/entity/PayDoneEntity.java similarity index 95% rename from src/main/java/com/totopia/server/modules/user/entity/PayDoneEntity.java rename to src/main/java/com/totopia/server/modules/moneys/entity/PayDoneEntity.java index 2c2e5bf..7be0008 100644 --- a/src/main/java/com/totopia/server/modules/user/entity/PayDoneEntity.java +++ b/src/main/java/com/totopia/server/modules/moneys/entity/PayDoneEntity.java @@ -1,4 +1,4 @@ -package com.totopia.server.modules.user.entity; +package com.totopia.server.modules.moneys.entity; import com.totopia.server.commons.data.entity.UserDateAuditEntity; import lombok.*; diff --git a/src/main/java/com/totopia/server/modules/user/entity/PayEntity.java b/src/main/java/com/totopia/server/modules/moneys/entity/PayEntity.java similarity index 89% rename from src/main/java/com/totopia/server/modules/user/entity/PayEntity.java rename to src/main/java/com/totopia/server/modules/moneys/entity/PayEntity.java index 93e0d6b..d3dc3d0 100644 --- a/src/main/java/com/totopia/server/modules/user/entity/PayEntity.java +++ b/src/main/java/com/totopia/server/modules/moneys/entity/PayEntity.java @@ -1,7 +1,7 @@ -package com.totopia.server.modules.user.entity; +package com.totopia.server.modules.moneys.entity; import com.totopia.server.commons.data.entity.UserDateAuditEntity; -import com.totopia.server.modules.user.type.BankingName; +import com.totopia.server.modules.moneys.type.BankingName; import lombok.*; import lombok.experimental.SuperBuilder; diff --git a/src/main/java/com/totopia/server/modules/user/entity/WithdrawEntity.java b/src/main/java/com/totopia/server/modules/moneys/entity/WithdrawEntity.java similarity index 61% rename from src/main/java/com/totopia/server/modules/user/entity/WithdrawEntity.java rename to src/main/java/com/totopia/server/modules/moneys/entity/WithdrawEntity.java index 8c54fd1..5c8b158 100644 --- a/src/main/java/com/totopia/server/modules/user/entity/WithdrawEntity.java +++ b/src/main/java/com/totopia/server/modules/moneys/entity/WithdrawEntity.java @@ -1,7 +1,7 @@ -package com.totopia.server.modules.user.entity; +package com.totopia.server.modules.moneys.entity; -import com.totopia.server.commons.data.entity.DateAuditEntity; -import com.totopia.server.modules.user.type.BankingName; +import com.totopia.server.commons.data.entity.UserDateAuditEntity; +import com.totopia.server.modules.moneys.type.BankingName; import lombok.*; import lombok.experimental.SuperBuilder; @@ -17,7 +17,11 @@ import java.io.Serializable; @ToString @Data @Builder -public class WithdrawEntity extends DateAuditEntity implements Serializable { +@AttributeOverrides({ + @AttributeOverride(name = "updatedBy", column = @Column(name = "approve_admin_id")), + @AttributeOverride(name = "updatedAt", column = @Column(name = "confirm_date")), +}) +public class WithdrawEntity extends UserDateAuditEntity implements Serializable { @Id @GeneratedValue(generator = "withdraw_generator") @SequenceGenerator(name = "withdraw_generator", sequenceName = "withdraw_sequence", initialValue = 1) @@ -27,10 +31,6 @@ public class WithdrawEntity extends DateAuditEntity implements Serializable { @Column(name = "price", nullable = false) private Integer price; - @Basic - @Column(name = "approve_user_id", nullable = false) - private Long approveUser; - @Basic @Column(name = "bank_id", nullable = false) private Long bank; diff --git a/src/main/java/com/totopia/server/modules/user/repository/BankRepository.java b/src/main/java/com/totopia/server/modules/moneys/repository/BankRepository.java similarity index 55% rename from src/main/java/com/totopia/server/modules/user/repository/BankRepository.java rename to src/main/java/com/totopia/server/modules/moneys/repository/BankRepository.java index 7f8eaab..31d0eff 100644 --- a/src/main/java/com/totopia/server/modules/user/repository/BankRepository.java +++ b/src/main/java/com/totopia/server/modules/moneys/repository/BankRepository.java @@ -1,6 +1,6 @@ -package com.totopia.server.modules.user.repository; +package com.totopia.server.modules.moneys.repository; -import com.totopia.server.modules.user.entity.BankEntity; +import com.totopia.server.modules.moneys.entity.BankEntity; import org.springframework.data.jpa.repository.JpaRepository; public interface BankRepository extends JpaRepository { diff --git a/src/main/java/com/totopia/server/modules/user/repository/DepositRepository.java b/src/main/java/com/totopia/server/modules/moneys/repository/DepositRepository.java similarity index 55% rename from src/main/java/com/totopia/server/modules/user/repository/DepositRepository.java rename to src/main/java/com/totopia/server/modules/moneys/repository/DepositRepository.java index ae74a45..e6a1132 100644 --- a/src/main/java/com/totopia/server/modules/user/repository/DepositRepository.java +++ b/src/main/java/com/totopia/server/modules/moneys/repository/DepositRepository.java @@ -1,6 +1,6 @@ -package com.totopia.server.modules.user.repository; +package com.totopia.server.modules.moneys.repository; -import com.totopia.server.modules.user.entity.DepositEntity; +import com.totopia.server.modules.moneys.entity.DepositEntity; import org.springframework.data.jpa.repository.JpaRepository; public interface DepositRepository extends JpaRepository { diff --git a/src/main/java/com/totopia/server/modules/user/repository/WithdrawRepository.java b/src/main/java/com/totopia/server/modules/moneys/repository/WithdrawRepository.java similarity index 55% rename from src/main/java/com/totopia/server/modules/user/repository/WithdrawRepository.java rename to src/main/java/com/totopia/server/modules/moneys/repository/WithdrawRepository.java index a901f30..c1b1d7f 100644 --- a/src/main/java/com/totopia/server/modules/user/repository/WithdrawRepository.java +++ b/src/main/java/com/totopia/server/modules/moneys/repository/WithdrawRepository.java @@ -1,6 +1,6 @@ -package com.totopia.server.modules.user.repository; +package com.totopia.server.modules.moneys.repository; -import com.totopia.server.modules.user.entity.WithdrawEntity; +import com.totopia.server.modules.moneys.entity.WithdrawEntity; import org.springframework.data.jpa.repository.JpaRepository; public interface WithdrawRepository extends JpaRepository { diff --git a/src/main/java/com/totopia/server/modules/user/type/BankingName.java b/src/main/java/com/totopia/server/modules/moneys/type/BankingName.java similarity index 70% rename from src/main/java/com/totopia/server/modules/user/type/BankingName.java rename to src/main/java/com/totopia/server/modules/moneys/type/BankingName.java index 56ab675..6b0a097 100644 --- a/src/main/java/com/totopia/server/modules/user/type/BankingName.java +++ b/src/main/java/com/totopia/server/modules/moneys/type/BankingName.java @@ -1,4 +1,4 @@ -package com.totopia.server.modules.user.type; +package com.totopia.server.modules.moneys.type; public enum BankingName { BANKING_WAITING, BANKING_HOLD, BANKING_COMPLETE, BANKING_DEPOSIT, BANKING_WITHDRAW diff --git a/src/main/java/com/totopia/server/modules/user/type/CommissionName.java b/src/main/java/com/totopia/server/modules/user/type/CommissionName.java index aa21a59..dd1a655 100644 --- a/src/main/java/com/totopia/server/modules/user/type/CommissionName.java +++ b/src/main/java/com/totopia/server/modules/user/type/CommissionName.java @@ -1,7 +1,7 @@ package com.totopia.server.modules.user.type; public enum CommissionName { - COMMISSION_BANKING, // 충환 방식 - COMMISSION_BETTING, // 베팅 방식 - COMMISSION_RAFFLE // 낙첨 방식 + BANKING, // 충환 방식 + BETTING, // 베팅 방식 + RAFFLE // 낙첨 방식 } diff --git a/src/test/java/com/totopia/server/modules/user/repository/BankRepositoryTest.java b/src/test/java/com/totopia/server/modules/user/repository/BankRepositoryTest.java index a562e25..b69a9f2 100644 --- a/src/test/java/com/totopia/server/modules/user/repository/BankRepositoryTest.java +++ b/src/test/java/com/totopia/server/modules/user/repository/BankRepositoryTest.java @@ -1,6 +1,7 @@ package com.totopia.server.modules.user.repository; -import com.totopia.server.modules.user.entity.BankEntity; +import com.totopia.server.modules.moneys.entity.BankEntity; +import com.totopia.server.modules.moneys.repository.BankRepository; import com.totopia.server.modules.user.entity.UserEntity; import org.junit.Before; import org.junit.Ignore; diff --git a/src/test/java/com/totopia/server/modules/user/repository/DepositRepositoryTest.java b/src/test/java/com/totopia/server/modules/user/repository/DepositRepositoryTest.java index 337e9c4..1924d37 100644 --- a/src/test/java/com/totopia/server/modules/user/repository/DepositRepositoryTest.java +++ b/src/test/java/com/totopia/server/modules/user/repository/DepositRepositoryTest.java @@ -1,9 +1,11 @@ package com.totopia.server.modules.user.repository; -import com.totopia.server.modules.user.entity.BankEntity; -import com.totopia.server.modules.user.entity.DepositEntity; +import com.totopia.server.modules.moneys.entity.BankEntity; +import com.totopia.server.modules.moneys.entity.DepositEntity; +import com.totopia.server.modules.moneys.repository.BankRepository; +import com.totopia.server.modules.moneys.repository.DepositRepository; import com.totopia.server.modules.user.entity.UserEntity; -import com.totopia.server.modules.user.type.BankingName; +import com.totopia.server.modules.moneys.type.BankingName; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; diff --git a/src/test/java/com/totopia/server/modules/user/repository/WithdrawRepositoryTest.java b/src/test/java/com/totopia/server/modules/user/repository/WithdrawRepositoryTest.java index f6e2485..e06fa8f 100644 --- a/src/test/java/com/totopia/server/modules/user/repository/WithdrawRepositoryTest.java +++ b/src/test/java/com/totopia/server/modules/user/repository/WithdrawRepositoryTest.java @@ -1,9 +1,11 @@ package com.totopia.server.modules.user.repository; -import com.totopia.server.modules.user.entity.BankEntity; +import com.totopia.server.modules.moneys.entity.BankEntity; +import com.totopia.server.modules.moneys.repository.BankRepository; +import com.totopia.server.modules.moneys.repository.WithdrawRepository; import com.totopia.server.modules.user.entity.UserEntity; -import com.totopia.server.modules.user.entity.WithdrawEntity; -import com.totopia.server.modules.user.type.BankingName; +import com.totopia.server.modules.moneys.entity.WithdrawEntity; +import com.totopia.server.modules.moneys.type.BankingName; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith;