aa
This commit is contained in:
@@ -89,8 +89,8 @@ func checkPrinterInfo(printNo, name, sound, sim string, volume int) (err error)
|
||||
}
|
||||
}
|
||||
if volume != 0 {
|
||||
if volume < 0 || volume > 5 {
|
||||
return fmt.Errorf("请输入正确的音量!print_no : %v ", printNo)
|
||||
if volume <= 0 || volume > 5 {
|
||||
return fmt.Errorf("请输入正确的音量1-5!print_no : %v ", printNo)
|
||||
}
|
||||
}
|
||||
if sound != "" {
|
||||
@@ -170,10 +170,8 @@ func UpdatePrinter(appID int, printNo string, name, sim, sound *string, volume *
|
||||
}
|
||||
}
|
||||
if volume != nil {
|
||||
if *volume != 0 {
|
||||
if *volume < 0 || *volume > 5 {
|
||||
return fmt.Errorf("请输入正确的音量!print_no : %v ", printNo)
|
||||
}
|
||||
if *volume <= 0 || *volume > 5 {
|
||||
return fmt.Errorf("请输入正确的音量 1-5!print_no : %v ", printNo)
|
||||
}
|
||||
if printers[0].Volume != *volume {
|
||||
printers[0].Volume = *volume
|
||||
|
||||
Reference in New Issue
Block a user