易联云打印机添加GetOrderPagingList
This commit is contained in:
@@ -56,6 +56,15 @@ type TokenInfo struct {
|
||||
MachineCode string `json:"machine_code"`
|
||||
}
|
||||
|
||||
type PrinterOrderResult struct {
|
||||
Content string `json:"content"`
|
||||
ID string `json:"id"`
|
||||
OriginID string `json:"origin_id"`
|
||||
PrintTime string `json:"print_time"`
|
||||
ReceivingTime string `json:"receiving_time"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
||||
func New(clientID, clientSecret string, config ...*platformapi.APIConfig) *API {
|
||||
curConfig := platformapi.DefAPIConfig
|
||||
if len(config) > 0 {
|
||||
@@ -256,3 +265,16 @@ func (a *API) CancelAll(machineCode, token string) (err error) {
|
||||
func (a *API) PlayText(machineCode, orderID, text, token string) (err error) {
|
||||
return a.printMsg(machineCode, orderID, fmt.Sprintf("<audio>%s,9,0</audio>", strings.Replace(text, ",", ".", -1)), token)
|
||||
}
|
||||
|
||||
// pageIndex从1开始,pageSize最大为100
|
||||
func (a *API) GetOrderPagingList(machineCode, token string, pageIndex, pageSize int) (orderResultList []*PrinterOrderResult, err error) {
|
||||
result, err := a.AccessAPI("printer/getorderpaginglist", map[string]interface{}{
|
||||
"machine_code": machineCode,
|
||||
"page_index": pageIndex,
|
||||
"page_size": pageSize,
|
||||
}, token)
|
||||
if err != nil {
|
||||
err = utils.Map2StructByJson(result, &orderResultList, false)
|
||||
}
|
||||
return orderResultList, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user