修改打印机增加sound
This commit is contained in:
@@ -106,7 +106,7 @@ func DelPrinters(c *gin.Context, appID int, tokenInfo *model.TokenInfo, printNos
|
||||
return err
|
||||
}
|
||||
|
||||
func UpdatePrinter(c *gin.Context, appID int, tokenInfo *model.TokenInfo, printNo, name, sim string) (err error) {
|
||||
func UpdatePrinter(c *gin.Context, appID int, tokenInfo *model.TokenInfo, printNo, name, sim, sound string, volume int) (err error) {
|
||||
var (
|
||||
db = globals.GetDB()
|
||||
now = time.Now()
|
||||
@@ -129,6 +129,14 @@ func UpdatePrinter(c *gin.Context, appID int, tokenInfo *model.TokenInfo, printN
|
||||
printer.SIM = sim
|
||||
fields = append(fields, "sim")
|
||||
}
|
||||
if sound != printer.Sound {
|
||||
printer.Sound = sound
|
||||
fields = append(fields, "sound")
|
||||
}
|
||||
if volume != printer.Volume {
|
||||
printer.Volume = volume
|
||||
fields = append(fields, "volume")
|
||||
}
|
||||
printer.DeletedAt = &now
|
||||
printer.LastOperator = tokenInfo.User.Name
|
||||
fields = append(fields, model.FieldLastOperator, model.FieldDeletedAt)
|
||||
|
||||
Reference in New Issue
Block a user