모델 생

This commit is contained in:
byung eun park 2019-10-14 20:34:58 +09:00
parent afe38108ad
commit 30a61204b9
11 changed files with 158 additions and 22 deletions

View File

@ -0,0 +1,59 @@
package com.totopia.server.modules.game.entity;
import com.totopia.server.commons.data.entity.DateAuditEntity;
import com.totopia.server.modules.game.type.BettingResultName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import javax.persistence.*;
@Entity
@Table(name = "bet_history")
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class BettingHistoryEntity extends DateAuditEntity {
@Id
@GeneratedValue(generator = "bet_history_generator")
@SequenceGenerator(name = "bet_history_generator", sequenceName = "bet_history_sequence", initialValue = 1)
private Long id;
@Basic
@Column(name = "league_id", nullable = false)
private Long league;
@Basic
@Column(name = "sports_event_id", nullable = false)
private Long sportsEvent;
@Basic
@Column(name = "user_id", nullable = false)
private Long user;
@Basic
@Column(name = "money_log_id", nullable = false)
private Long moneyLog;
@Basic
@Column(name = "betting_money", nullable = false)
private Integer bettingMoney;
@Basic
@Column(name = "predict_money", nullable = false)
private Integer predictMoney;
@Basic
@Column(name = "real_money", nullable = true)
private Integer realMoney;
@Basic
@Column(name = "betting_result", nullable = false, length = 100)
private BettingResultName bettingResult;
}

View File

@ -0,0 +1,7 @@
package com.totopia.server.modules.game.type;
public enum BettingResultName {
BETTING_RESULT_WINNING, // 당첨
BETTING_RESULT_FAILURE, // 실패
BETTING_RESULT_INVALIDITY // 무효
}

View File

@ -0,0 +1,53 @@
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 = "popup_config")
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class PopupConfig extends UserDateAuditEntity {
@Id
@GeneratedValue(generator = "bet_history_generator")
@SequenceGenerator(name = "bet_history_generator", sequenceName = "bet_history_sequence", initialValue = 1)
private Long id;
@Column(name = "thumbnail", nullable = true, length = 200)
private String thumbnail;
@Column(name = "title", nullable = true, length = 200)
private String title;
@Basic
@Column(name = "img_width", nullable = false)
private Short imgWidth;
@Basic
@Column(name = "img_height", nullable = false)
private Short imgHeight;
@Basic
@Column(name = "img_x", nullable = false)
private Short imgX;
@Basic
@Column(name = "img_y", nullable = false)
private Short imgY;
@Basic
@Column(name = "open_status", nullable = false)
private Boolean openStatus = false;
}

View File

@ -0,0 +1,10 @@
package com.totopia.server.modules.info.type;
public enum EffectName {
EFFECT_LIFT_TO_RIGHT,
EFFECT_RIGHT_TO_LEFT,
EFFECT_TOP_TO_BOTTOM,
EFFECT_BOTTOM_TO_TOP,
EFFECT_COUNTERCLOCKWISE,
EFFECT_CLOCKWISE,
}

View File

@ -27,17 +27,13 @@ public class BankEntity extends DateAuditEntity {
@Column(name = "user_id", nullable = false)
private Long userId;
@Basic
@Column(name = "bank_account_id", nullable = false)
private Long bankAccountId;
@Basic
@Column(name = "name", nullable = false, length = 100)
private String name;
@Basic
@Column(name = "number", nullable = false, length = 100)
private String number;
@Column(name = "account_number", nullable = false, length = 100)
private String accountNumber;
@Basic
@Column(name = "holder", nullable = false, length = 100)
@ -51,6 +47,7 @@ public class BankEntity extends DateAuditEntity {
@Column(name = "status", nullable = false, length = 100)
private StatusName status;
@Basic
@Column(name = "descriptions", nullable = true, length = 1000)
private String descriptions;
}

View File

@ -37,8 +37,8 @@ public class DepositEntity extends DateAuditEntity implements Serializable {
private Long bank;
@Basic
@Column(name = "bank_account", nullable = false)
private Short bankAccount;
@Column(name = "deposit_account", nullable = false)
private String depositAccount;
@Basic
@Enumerated(EnumType.STRING)

View File

@ -5,6 +5,7 @@ import lombok.*;
import lombok.experimental.SuperBuilder;
import javax.persistence.*;
import java.util.Date;
@Entity(name = "pay_done")
@Data
@ -28,4 +29,17 @@ public class PayDoneEntity extends UserDateAuditEntity {
@Column(name = "settle_user_id", nullable = false)
private Long settleUser;
@Basic
@Column(name = "price", nullable = false)
private Integer price;
@Basic
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "start_date", nullable = false)
private Date startDate;
@Basic
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "end_date", nullable = false)
private Date endDate;
}

View File

@ -35,10 +35,6 @@ public class WithdrawEntity extends DateAuditEntity implements Serializable {
@Column(name = "bank_id", nullable = false)
private Long bank;
@Basic
@Column(name = "bank_account", nullable = false)
private Short bankAccount;
@Basic
@Enumerated(EnumType.STRING)
@Column(name = "status", length = 60)

View File

@ -50,17 +50,17 @@ public class BankRepositoryTest {
case 0:
bankAccount.setName("국민은행");
bankAccount.setHolder("예금주1");
bankAccount.setNumber("123-422-23112");
bankAccount.setAccountNumber("123-422-23112");
break;
case 1:
bankAccount.setName("우리은행");
bankAccount.setHolder("예금주2");
bankAccount.setNumber("321-555-3312-21");
bankAccount.setAccountNumber("321-555-3312-21");
break;
case 2:
bankAccount.setName("기업은행");
bankAccount.setHolder("예금주3");
bankAccount.setNumber("832-2392-2392-29829");
bankAccount.setAccountNumber("832-2392-2392-29829");
break;
}
idx++;
@ -81,17 +81,17 @@ public class BankRepositoryTest {
case 0:
account.setName("국민은행");
account.setHolder("예금주1");
account.setNumber("123-422-23112");
account.setAccountNumber("123-422-23112");
break;
case 1:
account.setName("우리은행");
account.setHolder("예금주2");
account.setNumber("321-555-3312-21");
account.setAccountNumber("321-555-3312-21");
break;
case 2:
account.setName("기업은행");
account.setHolder("예금주3");
account.setNumber("832-2392-2392-29829");
account.setAccountNumber("832-2392-2392-29829");
break;
}
idx++;

View File

@ -40,7 +40,7 @@ public class DepositRepositoryTest {
public void insertTest() throws Exception {
DepositEntity en = DepositEntity.builder()
.price(10000)
.bankAccount((short) 1)
.depositAccount("192-921-021-22")
.approveUser(accounts.get(0).getId())
.bank(accounts.get(2).getId())
.status(BankingName.BANKING_WAITING)

View File

@ -37,7 +37,7 @@ public class WithdrawRepositoryTest {
public void insertTest() throws Exception {
WithdrawEntity en = WithdrawEntity.builder()
.price(10000)
.bankAccount((short) 2)
.approveUser(accounts.get(0).getId())
.bank(accounts.get(2).getId())
.status(BankingName.BANKING_WAITING)