添加模板
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
package model
|
package model
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
type PrintMsg struct {
|
type PrintMsg struct {
|
||||||
ModelIDCULD
|
ModelIDCULD
|
||||||
|
|
||||||
@@ -28,3 +30,19 @@ type Printer struct {
|
|||||||
OfflineCount int `json:"offlineCount" db:"offline_count"` //掉线次数
|
OfflineCount int `json:"offlineCount" db:"offline_count"` //掉线次数
|
||||||
UserId string `json:"user_id" db:"user_id"` //打印机所属用户
|
UserId string `json:"user_id" db:"user_id"` //打印机所属用户
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type SystemTemp struct {
|
||||||
|
ID int `json:"id" db:"id"`
|
||||||
|
CreatedAt *time.Time `json:"created_at" db:"created_at"`
|
||||||
|
UpdatedAt *time.Time `json:"updated_at" db:"updated_at"`
|
||||||
|
LastOperator string `json:"last_operator" db:"last_operator"`
|
||||||
|
DeletedAt *time.Time `json:"deleted_at" db:"deleted_at"`
|
||||||
|
TempName string `json:"temp_name" db:"temp_name"` // 模板名称
|
||||||
|
TempRank string `orm:"type(text)" json:"temp_rank" db:"temp_rank"` // 模板顺序
|
||||||
|
Temp string `orm:"type(text)" json:"temp" db:"temp"` // 模板
|
||||||
|
UserId string `json:"user_id" db:"user_id"` // 所属用户
|
||||||
|
TempType string `json:"temp_type" db:"temp_type"` // 模板类型
|
||||||
|
TempSize string `json:"temp_size" db:"temp_size"` // 模板尺寸 big/medium/small
|
||||||
|
PrintSn string `json:"print_sn" db:"print_sn"` // 模板所属打印机
|
||||||
|
IsUse int `json:"is_use" db:"is_use"` // 默认使用 1-使用/2-不使用
|
||||||
|
}
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ func Init() {
|
|||||||
// 打印机,迁移至api做
|
// 打印机,迁移至api做
|
||||||
orm.RegisterModel(&model.PrintMsg{})
|
orm.RegisterModel(&model.PrintMsg{})
|
||||||
orm.RegisterModel(&model.Printer{})
|
orm.RegisterModel(&model.Printer{})
|
||||||
|
orm.RegisterModel(&model.SystemTemp{})
|
||||||
}
|
}
|
||||||
// create table
|
// create table
|
||||||
orm.RunSyncdb("default", false, true)
|
orm.RunSyncdb("default", false, true)
|
||||||
|
|||||||
Reference in New Issue
Block a user