1 Star 0 Fork 0

NilOrganization / outbox

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
model.go 1.80 KB
一键复制 编辑 原始数据 按行查看 历史
Keng 提交于 2020-09-10 15:45 . add tableName
package outbox
import "time"
const (
// PublishedTableName ...
PublishedTableName = "outbox_published"
// ReceivedTableName ...
ReceivedTableName = "outbox_received"
)
// Published ...
type Published struct {
ID int64 `json:"id" gorm:"column:id;primaryKey;type:BIGINT(20)"`
Version string `json:"version" gorm:"column:version;type:VARCHAR(20)"`
Topic string `json:"topic" gorm:"column:topic;type:VARCHAR(200);not null"`
Value string `json:"value" gorm:"column:value;type:LONGTEXT"`
Retries int `json:"retries" gorm:"column:retries;type:INT(11)"`
CreatedAt time.Time `json:"created_at" gorm:"column:created_at;type:DATETIME;not null"`
ExpiresAt *time.Time `json:"expires_at" gorm:"column:expires_at;type:DATETIME"`
StatusName string `json:"status_name" gorm:"index;column:status_name;type:VARCHAR(40);not null"`
}
// TableName ...
func (Published) TableName() string {
return PublishedTableName
}
// Received ...
type Received struct {
ID int64 `json:"id" gorm:"column:id;primaryKey;type:BIGINT(20)"`
Version string `json:"version" gorm:"column:version;type:VARCHAR(20)"`
Topic string `json:"name" gorm:"column:name;type:VARCHAR(200);not null"`
Group string `json:"group" gorm:"column:group;type:VARCHAR(200);not null"`
Value string `json:"value" gorm:"column:value;type:LONGTEXT"`
Retries int `json:"retries" gorm:"column:retries;type:INT(11)"`
CreatedAt time.Time `json:"created_at" gorm:"column:created_at;type:DATETIME;not null"`
ExpiresAt *time.Time `json:"expires_at" gorm:"column:expires_at;type:DATETIME"`
StatusName string `json:"status_name" gorm:"index;column:status_name;type:VARCHAR(40);not null"`
}
// TableName ...
func (Received) TableName() string {
return ReceivedTableName
}
Go
1
https://gitee.com/nilorg/outbox.git
git@gitee.com:nilorg/outbox.git
nilorg
outbox
outbox
master

搜索帮助