aa
This commit is contained in:
@@ -135,6 +135,8 @@ type Printer struct {
|
|||||||
Status int `json:"status"` //打印机状态
|
Status int `json:"status"` //打印机状态
|
||||||
IsOnline int `json:"is_online" db:"is_online"` //1在线,0离线
|
IsOnline int `json:"is_online" db:"is_online"` //1在线,0离线
|
||||||
SIM string `json:"sim" db:"sim"` //sim卡号
|
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 {
|
type PrintMsg struct {
|
||||||
|
|||||||
@@ -11,6 +11,16 @@ import (
|
|||||||
"time"
|
"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) {
|
func AddPrinters(c *gin.Context, tokenInfo *model.TokenInfo, appID int, printInfos []*model.PrintInfo) (err error) {
|
||||||
var (
|
var (
|
||||||
db = globals.GetDB()
|
db = globals.GetDB()
|
||||||
@@ -44,6 +54,8 @@ func AddPrinters(c *gin.Context, tokenInfo *model.TokenInfo, appID int, printInf
|
|||||||
SIM: v.SIM,
|
SIM: v.SIM,
|
||||||
Status: model.PrinterStatusNormal,
|
Status: model.PrinterStatusNormal,
|
||||||
IsOnline: model.PrinterOffline,
|
IsOnline: model.PrinterOffline,
|
||||||
|
Sound: sounda,
|
||||||
|
Volume: 4,
|
||||||
}
|
}
|
||||||
if err = dao.Insert(db, printer); err != nil {
|
if err = dao.Insert(db, printer); err != nil {
|
||||||
errs = append(errs, err)
|
errs = append(errs, err)
|
||||||
|
|||||||
Reference in New Issue
Block a user