This commit is contained in:
邹宗楠
2022-07-28 17:12:02 +08:00
parent 32e4c45ef1
commit 5fd9ff5093

View File

@@ -66,11 +66,15 @@ func AddPrinter(appID int, printers []*model.Printer) (err error) {
IccID: v.IccID,
Status: model.PrinterStatusOffline,
Sound: v.Sound,
UserId: "system",
}
if v.Volume == 0 {
printer.Volume = 4
}
if v.UserId == "" {
printer.UserId = "system"
} else {
printer.UserId = v.UserId
}
dao.WrapAddIDCULDEntity(printer, "")
if err = dao.CreateEntity(db, printer); err != nil {
errs = append(errs, err)