12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- package sandbox
- import (
- "time"
- )
- // Sandbox 沙盘推演主表
- type Sandbox struct {
- SandboxID uint32 `gorm:"primaryKey;column:sandbox_id;type:int(9) unsigned;not null" json:"-"` // 沙盘id
- Name string `gorm:"index:idx_name;column:name;type:varchar(64);not null;default:''" json:"name"` // 沙盘名称
- ChartPermissionID uint32 `gorm:"column:chart_permission_id;type:int(9) unsigned;not null;default:0" json:"chartPermissionId"` // 品种id
- ChartPermissionName string `gorm:"index:idx_chart_permission_name;column:chart_permission_name;type:varchar(32);not null;default:''" json:"chartPermissionName"` // 品种名称(冗余字段,避免列表页查询时再去关联表查询)
- CurrVersion uint32 `gorm:"column:curr_version;type:int(9) unsigned;not null;default:0" json:"currVersion"` // 当前版本
- Code string `gorm:"column:code;type:varchar(255);not null" json:"code"` // 沙盘code
- Content string `gorm:"column:content;type:text;not null" json:"content"` // 沙盘内容
- PicURL string `gorm:"column:pic_url;type:varchar(255);not null;default:''" json:"picUrl"` // 沙盘图片
- OpUserID uint32 `gorm:"column:op_user_id;type:int(10) unsigned;not null;default:0" json:"opUserId"` // 最近一次编辑操作的用户id
- OpUserName string `gorm:"index:idx_op_user_name;column:op_user_name;type:varchar(32);not null;default:''" json:"opUserName"` // 最近一次编辑的用户名称(冗余字段,避免查表)
- IsDelete uint8 `gorm:"column:is_delete;type:tinyint(9) unsigned;not null;default:0" json:"isDelete"` // 是否删除,0:未删除,1:已删除
- ModifyTime time.Time `gorm:"column:modify_time;type:timestamp;default:CURRENT_TIMESTAMP" json:"modifyTime"` // 最近一次更新时间
- CreateTime time.Time `gorm:"column:create_time;type:timestamp;default:CURRENT_TIMESTAMP" json:"createTime"` // 沙盘创建时间
- }
- // TableName get sql table name.获取数据库表名
- func (m *Sandbox) TableName() string {
- return "sandbox"
- }
- // SandboxColumns get sql column name.获取数据库列名
- var SandboxColumns = struct {
- SandboxID string
- Name string
- ChartPermissionID string
- ChartPermissionName string
- CurrVersion string
- Code string
- Content string
- PicURL string
- OpUserID string
- OpUserName string
- IsDelete string
- ModifyTime string
- CreateTime string
- }{
- SandboxID: "sandbox_id",
- Name: "name",
- ChartPermissionID: "chart_permission_id",
- ChartPermissionName: "chart_permission_name",
- CurrVersion: "curr_version",
- Code: "code",
- Content: "content",
- PicURL: "pic_url",
- OpUserID: "op_user_id",
- OpUserName: "op_user_name",
- IsDelete: "is_delete",
- ModifyTime: "modify_time",
- CreateTime: "create_time",
- }
|