45 lines
3.4 KiB
Go
45 lines
3.4 KiB
Go
package models
|
|
|
|
import "gorm.io/datatypes"
|
|
|
|
// ProductLog 商品表
|
|
type ProductLog struct {
|
|
ID int64 `json:"id" gorm:"primarykey;comment:商品ID"`
|
|
Barcode string `json:"barcode" gorm:"size:100;not null;default:'';index;comment:条码(可唯一,视业务而定)"`
|
|
Md5Data string `json:"md5_data" gorm:"size:100;not null;default:'';comment:md5"`
|
|
OldName string `json:"old_name" gorm:"size:100;not null;default:'';comment:老书名"`
|
|
NewName string `json:"new_name" gorm:"size:100;not null;default:'';comment:新书名"`
|
|
OldPublisher string `json:"old_publisher" gorm:"size:100;not null;default:'';comment:老出版社"`
|
|
NewPublisher string `json:"new_publisher" gorm:"size:100;not null;default:'';comment:新出版社"`
|
|
OldAuthor string `json:"old_author" gorm:"size:100;not null;default:'';comment:老作者"`
|
|
NewAuthor string `json:"new_author" gorm:"size:100;not null;default:'';comment:新作者"`
|
|
OldPublicationTime int64 `json:"old_publication_time" gorm:"not null;default:0;comment:老出版时间"`
|
|
NewPublicationTime int64 `json:"new_publication_time" gorm:"not null;default:0;comment:新出版时间"`
|
|
OldPrice int64 `json:"old_price" gorm:"not null;default:0;comment:老价格"`
|
|
NewPrice int64 `json:"new_price" gorm:"not null;default:0;comment:新价格"`
|
|
OldBindingLayout string `json:"old_binding_layout" gorm:"size:20;not null;default:'';comment:老装帧"`
|
|
NewBindingLayout string `json:"new_binding_layout" gorm:"size:20;not null;default:'';comment:新装帧"`
|
|
OldPageCount int64 `json:"old_page_count" gorm:"not null;default:0;comment:老页数"`
|
|
NewPageCount int64 `json:"new_page_count" gorm:"not null;default:0;comment:新页数"`
|
|
OldWordCount int64 `json:"old_word_count" gorm:"not null;default:0;comment:老字数"`
|
|
NewWordCount int64 `json:"new_word_count" gorm:"not null;default:0;comment:新字数"`
|
|
OldLiveImage datatypes.JSON `json:"old_live_image" gorm:"type:json;not null;comment:老实拍图json"`
|
|
NewLiveImage datatypes.JSON `json:"new_live_image" gorm:"type:json;not null;comment:新实拍图json"`
|
|
OldIsSuit int8 `json:"old_is_suit" gorm:"type:tinyint(1);not null;default:0;comment:老是否是套装书(0:否,1:是)"`
|
|
NewIsSuit int8 `json:"new_is_suit" gorm:"type:tinyint(1);not null;default:0;comment:新是否是套装书(0:否,1:是)"`
|
|
Status int8 `json:"status" gorm:"type:tinyint(1);not null;default:0;comment:状态(0:审核中,1:通过 2:驳回)"`
|
|
CreateBy int64 `json:"create_by" gorm:"not null;default:0;comment:创建人"`
|
|
AuditBy int64 `json:"audit_by" gorm:"not null;default:0;comment:审核人"`
|
|
CreatedAt int64 `json:"created_at" gorm:"type:bigint;not null;default:0;comment:创建时间戳"`
|
|
UpdatedAt int64 `json:"updated_at" gorm:"type:bigint;not null;default:0;comment:更新时间戳"`
|
|
IsDel int8 `json:"is_del" gorm:"not null;default:0;comment:逻辑删除"`
|
|
}
|
|
|
|
func (ProductLog) TableName() string {
|
|
return "product_log"
|
|
}
|
|
|
|
func (ProductLog) TableOptions() string {
|
|
return "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商品日志表'"
|
|
}
|