mirror of
https://gitee.com/lucinox/dsapi_pub.git
synced 2026-12-07 02:55:00 +08:00
public_version_261205
This commit is contained in:
@@ -0,0 +1,127 @@
|
||||
package com.dsapi.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.PrePersist;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* API 调用扣费日志表 log_api_call。
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "log_api_call")
|
||||
public class LogApiCall {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@Column(name = "user_id", nullable = false)
|
||||
private Long userId;
|
||||
|
||||
@Column(name = "api_key_id")
|
||||
private Long apiKeyId;
|
||||
|
||||
@Column(name = "unit_price", nullable = false, precision = 12, scale = 2)
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
@Column(name = "balance_after", precision = 12, scale = 2)
|
||||
private BigDecimal balanceAfter;
|
||||
|
||||
@Column(name = "request_id")
|
||||
private String requestId;
|
||||
|
||||
@Column(name = "success_flag", nullable = false)
|
||||
private Integer successFlag = 1;
|
||||
|
||||
@Column(name = "error_msg")
|
||||
private String errorMsg;
|
||||
|
||||
@Column(name = "create_time", nullable = false)
|
||||
private String createTime;
|
||||
|
||||
@PrePersist
|
||||
public void prePersist() {
|
||||
if (createTime == null) {
|
||||
createTime = LocalDateTime.now().format(BaseEntity.TIME_FMT);
|
||||
}
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getApiKeyId() {
|
||||
return apiKeyId;
|
||||
}
|
||||
|
||||
public void setApiKeyId(Long apiKeyId) {
|
||||
this.apiKeyId = apiKeyId;
|
||||
}
|
||||
|
||||
public BigDecimal getUnitPrice() {
|
||||
return unitPrice;
|
||||
}
|
||||
|
||||
public void setUnitPrice(BigDecimal unitPrice) {
|
||||
this.unitPrice = unitPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getBalanceAfter() {
|
||||
return balanceAfter;
|
||||
}
|
||||
|
||||
public void setBalanceAfter(BigDecimal balanceAfter) {
|
||||
this.balanceAfter = balanceAfter;
|
||||
}
|
||||
|
||||
public String getRequestId() {
|
||||
return requestId;
|
||||
}
|
||||
|
||||
public void setRequestId(String requestId) {
|
||||
this.requestId = requestId;
|
||||
}
|
||||
|
||||
public Integer getSuccessFlag() {
|
||||
return successFlag;
|
||||
}
|
||||
|
||||
public void setSuccessFlag(Integer successFlag) {
|
||||
this.successFlag = successFlag;
|
||||
}
|
||||
|
||||
public String getErrorMsg() {
|
||||
return errorMsg;
|
||||
}
|
||||
|
||||
public void setErrorMsg(String errorMsg) {
|
||||
this.errorMsg = errorMsg;
|
||||
}
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user