This commit is contained in:
suyl
2021-07-09 11:13:04 +08:00
parent b7ed047e7c
commit 44f36f7547
2 changed files with 14 additions and 0 deletions

View File

@@ -135,6 +135,8 @@ type Printer struct {
Status int `json:"status"` //打印机状态
IsOnline int `json:"is_online" db:"is_online"` //1在线0离线
SIM string `json:"sim" db:"sim"` //sim卡号
Sound string `json:"sound"` //声音类型 sounda ,b,c,d,e,f,g
Volume int `json:"volume"` //音量1-5 对应打印机2-10
}
type PrintMsg struct {

View File

@@ -11,6 +11,16 @@ import (
"time"
)
const (
sounda = "sounda" //提示音a
soundb = "soundb" //提示音b
soundc = "soundc" //提示音c
soundd = "soundd" //提示音d
sounde = "sounde" //报警音e
soundf = "soundf" //报警音f
soundg = "soundg" //报警音g
)
func AddPrinters(c *gin.Context, tokenInfo *model.TokenInfo, appID int, printInfos []*model.PrintInfo) (err error) {
var (
db = globals.GetDB()
@@ -44,6 +54,8 @@ func AddPrinters(c *gin.Context, tokenInfo *model.TokenInfo, appID int, printInf
SIM: v.SIM,
Status: model.PrinterStatusNormal,
IsOnline: model.PrinterOffline,
Sound: sounda,
Volume: 4,
}
if err = dao.Insert(db, printer); err != nil {
errs = append(errs, err)