1
This commit is contained in:
@@ -184,3 +184,42 @@ func (a *API) DoPrint(printNo, content string, orderNo int) (msgID string, err e
|
||||
}
|
||||
return msgID, err
|
||||
}
|
||||
|
||||
func (a *API) GetPrintList(printNo, printKey string, status, isOnline int, page, size int) ([]*PrintList, error) {
|
||||
result, err := a.AccessAPI("QueryPrintList", map[string]interface{}{
|
||||
"print_no": printNo,
|
||||
"print_key": printKey,
|
||||
"status": status,
|
||||
"is_online": isOnline,
|
||||
"page": page,
|
||||
"size": size,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
printList := make([]*PrintList, 0, 0)
|
||||
if err = utils.Map2StructByJson(result["data"].([]interface{}), &printList, false); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return printList, nil
|
||||
}
|
||||
|
||||
type PrintList struct {
|
||||
ID int `orm:"column(id)" json:"id"`
|
||||
CreatedAt string `orm:"auto_now_add;type(datetime)" json:"createdAt"`
|
||||
UpdatedAt string `orm:"auto_now;type(datetime)" json:"updatedAt"`
|
||||
DeletedAt string `orm:"type(datetime);null" json:"deletedAt"`
|
||||
LastOperator string `orm:"size(32)" json:"lastOperator"` // 最后操作员
|
||||
AppID int `orm:"column(app_id)" json:"app_id" db:"app_id"` //应用编号
|
||||
PrintNo string `json:"print_no" db:"print_no"` //打印机编号
|
||||
PrintKey string `json:"print_key" db:"print_key"` //打印机识别码
|
||||
Name string `json:"name" db:"name"` //打印机备注名
|
||||
Status int `json:"status" db:"status"` //打印机状态
|
||||
IsOnline int `json:"is_online" db:"is_online"` //1在线,0离线
|
||||
IccID string `orm:"column(icc_id)" json:"iccid" db:"icc_id"` //sim卡号
|
||||
Sound string `json:"sound" db:"sound"` //声音类型 sounda ,b,c,d,e,f,g
|
||||
Volume int `json:"volume" db:"volume"` //音量,1-5 ,对应打印机2-10
|
||||
FlowFlag int `json:"flowFlag" db:"flow_flag"` //是否超流量了,1表示超了
|
||||
OfflineCount int `json:"offlineCount" db:"offline_count"` //掉线次数
|
||||
UserId string `json:"user_id" db:"user_id"` //打印机所属用户
|
||||
}
|
||||
|
||||
@@ -107,3 +107,7 @@ func TestDoPrint(t *testing.T) {
|
||||
}
|
||||
t.Log(result)
|
||||
}
|
||||
|
||||
func TestGetPrintList(t *testing.T) {
|
||||
api.GetPrintList("", "", -9, -9, 0, 30)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user