增加打印机声音设置

This commit is contained in:
苏尹岚
2020-04-21 14:12:53 +08:00
parent 5393e8a291
commit 0877eaa4f4
5 changed files with 95 additions and 1 deletions

View File

@@ -278,3 +278,13 @@ func (a *API) GetOrderPagingList(machineCode, token string, pageIndex, pageSize
}
return orderResultList, err
}
// 设置打印机声音
func (a *API) SetSound(machineCode, voice string) (err error) {
_, err = a.AccessAPI("printer/setsound", map[string]interface{}{
"machine_code": machineCode,
"response_type": "horn", //蜂鸣器buzzer或喇叭易连云默认喇叭
"voice": voice,
}, "")
return err
}

View File

@@ -21,7 +21,7 @@ func init() {
// 自有应用
api = New("1039586024", "4885d07c2997b661102e4b6099c0bf3b")
api.SetToken("3a38e3cec7974b459a6f0a381c9b0312")
api.SetToken("852dd259dc244c579e2a987857932606")
// 开放应用
// api = New("1098307169", "d5eedb40c99e6691b1ca2ba82a363d6a")
@@ -103,3 +103,8 @@ func TestGetOrderPagingList(t *testing.T) {
handleError(t, err)
t.Log(utils.Format4Output(result, true))
}
func TestSetSound(t *testing.T) {
err := api.SetSound("4004617180", "2")
handleError(t, err)
}