打印机添加查询接口

This commit is contained in:
邹宗楠
2025-12-23 14:30:54 +08:00
parent 1380b581bc
commit 505e347939
3 changed files with 82 additions and 0 deletions

View File

@@ -218,6 +218,54 @@ func (c *ApiController) AddPrinter(dataMap map[string]interface{}) (data, errCod
return "", errCode, err
}
type QueryPrintList struct {
}
func (c *ApiController) QueryPrintList(dataMap map[string]interface{}) (data []*model.Printer, errCode string, err error) {
var (
printNo string
printKey string
status int
isOnline int
page int
size int
)
globals.SugarLogger.Debugf("-----QueryPrintList := %s", utils.Format4Output(dataMap, false))
if printNoParam, ok := dataMap["print_no"].(string); !ok {
printNo = ""
} else {
printNo = printNoParam
}
if key, ok := dataMap["print_key"].(string); !ok {
printKey = ""
} else {
printKey = key
}
if s, ok := dataMap["status"].(int); !ok {
status = model.PrintMsgAll
} else {
status = s
}
if online, ok := dataMap["is_online"].(int); !ok {
isOnline = model.PrintMsgAll
} else {
isOnline = online
}
if p, ok := dataMap["page"].(int); !ok {
page = 0
} else {
page = p
}
if s, ok := dataMap["size"].(int); !ok {
size = 20
} else {
size = s
}
data, err = cms.QueryPrintList(printNo, printKey, status, isOnline, page, size)
return
}
//删除打印机绑定
func (c *ApiController) DelPrinter(dataMap map[string]interface{}) (data, errCode string, err error) {
var (