fonchain-artistinfo/cmd/model/contract.go
2023-03-23 11:52:18 +08:00

49 lines
3.4 KiB
Go

package model
import "gorm.io/plugin/soft_delete"
// Contract 用户模型
type Contract struct {
ID int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
Uid string `gorm:"column:uid;type:varchar(100);comment:合同表的唯一表示;NOT NULL" json:"uid"`
ArtistUid string `gorm:"column:artist_uid;type:varchar(100);comment:画家uid;NOT NULL" json:"artist_uid"`
ArtworkUid string `gorm:"column:artwork_uid;type:varchar(1000);comment:画作uid" json:"artwork_uid"`
ContractId string `gorm:"column:contract_id;type:varchar(300);comment:合同id" json:"contract_id"`
TransactionId string `gorm:"column:transaction_id;type:varchar(300);comment:交易id" json:"transaction_id"`
Type int32 `gorm:"column:type;type:int(1);comment:合同类型 (1);NOT NULL" json:"type"`
ViewUrl string `gorm:"column:view_url;type:varchar(500);comment:在线查看合同链接" json:"view_url"`
DownloadUrl string `gorm:"column:download_url;type:varchar(500);comment:合同下载链接" json:"download_url"`
State int32 `gorm:"column:state;type:int(1);comment:合同状态,1:未签署2:已签署;NOT NULL" json:"state"` //1 未签署 2 已签署
Status int32 `gorm:"column:status;default:2;comment:2=锁定 3=解锁" json:"status" ` //跟随用户的锁定和解锁状态,用于控制数据的展示
LockTime string `gorm:"column:lock_time;comment:锁定时间" json:"lockTime"`
SignTime string `gorm:"column:sign_time;comment:签署时间" json:"sign_time"`
BatchName string `gorm:"column:batch_name;comment:批次名" json:"batch_name"`
StType int32 `gorm:"column:st_type;unqiueIndex:sttype_uid_batchtime_idx;comment:对账单类型 1=版权 2=物权;"`
ArtworkInfo []ArtworkTxDetail `gorm:"foreignKey:Uid;references:BatchUid"` //当前批次的物权委托单详情
CreatedAt int32 `gorm:"column:created_at;autoCreateTime"`
UpdatedAt int32 `gorm:"column:updated_at;autoCreateTime"`
DeletedAt soft_delete.DeletedAt
}
// 对账单画作物权委托详情
type ArtworkTxDetail struct {
ID int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
Uid string `gorm:"column:uid;type:varchar(100);comment:对账单画作物权详情表的唯一表示;NOT NULL" json:"uid"`
BatchUid int64 `gorm:"column:batch_id;unqiueIndex:batchid_tfnum_idx;comment:批次id;"`
TfNum string `gorm:"column:tf_num;unqiueIndex:batchid_tfnum_idx;comment:"泰丰画作编号"`
ArtworkName string `gorm:"column:artwork_name;comment:画作名称"`
Ruler string `gorm:"column:ruler;comment:平尺"`
SaleNo string `gorm:"column:sale_no;comment:销售单号"`
CompleteDate string `gorm:"column:complete_date;comment:成交日期"`
MinPrice float32 `gorm:"column:min_price;comment:委托销售底价"`
SalePrice float32 `gorm:"column:sale_price;comment:画作售价"`
GuaranteePrice float32 `gorm:"column:guarantee_price;comment:已收取保证金;"`
CreatedAt int32 `gorm:"column:created_at;autoCreateTime"`
UpdatedAt int32 `gorm:"column:updated_at;autoCreateTime"`
DeletedAt soft_delete.DeletedAt
}
func (ArtworkTxDetail) TableName() string {
return "artwork_tx_detail"
}