Documentation ¶
Index ¶
- type AccessToken
- type ClearResponse
- type Client
- func (this *Client) Device(deviceNo string) (*Device, error)
- func (this *Client) DeviceBind(deviceNo string) error
- func (this *Client) DeviceClear(deviceNo string) (int, error)
- func (this *Client) DeviceUnbind(deviceNo string) error
- func (this *Client) Devices() ([]Device, error)
- func (this *Client) Member(uid string) (*Member, error)
- func (this *Client) Members() ([]Member, error)
- func (this *Client) MsgCancel(msgNo string) error
- func (this *Client) MsgStatus(msgNo string) (*MsgStatus, error)
- func (this *Client) Print(deviceNo string, content string, templateId string, ...) (string, error)
- func (this *Client) Template(templateId string) (*Template, error)
- func (this *Client) TemplateAdd(name string, content string, catalog string, desc string) (string, error)
- func (this *Client) TemplateEdit(templateId string, name string, content string, catalog string, desc string) error
- func (this *Client) Templates() ([]Template, error)
- type Device
- type Member
- type MemberDevice
- type MsgStatus
- type PrintResponse
- type ResponseError
- type Template
- type TemplateAddResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessToken ¶
type AccessToken struct { ResponseError AccessToken string `json:"access_token"` Appid string `json:"appid"` ExpiresIn int `json:"expires_in"` }
type ClearResponse ¶
type ClearResponse struct { ResponseError ClearCnt int `json:"clear_cnt"` }
type Client ¶
type Client struct { MemberCode string Appid string Secret string ApiBase string AccessToken string Cache *redis.Client }
func (*Client) DeviceBind ¶
本接口为重要接口,出于安全性考虑,这个接口只能对开发者自己名下的设备进行操作。
func (*Client) DeviceUnbind ¶
本接口为重要接口,出于安全性考虑,这个接口只能对开发者自己名下的设备进行操作。
func (*Client) TemplateAdd ¶
func (*Client) TemplateEdit ¶
type Device ¶
type Device struct { DeviceNo string `json:"device_no"` //设备编码 Since string `json:"since"` //打印机激活时间 Status string `json:"status"` //打印机的连接状态,包括:online 在线 offline 离线 overheat 打印头过热 error 打印机系统故障 PaperStatus string `json:"paper_status"` //打印纸张的状态,包括:nomal 正常 lack 缺纸 LastConnectedAt string `json:"last_connected_at"` //最近连接时间 }
type Member ¶
type Member struct { ResponseError Uid string `json:"uid"` Name string `json:"name"` CreatedAt string `json:"created_at,omitempty"` Devices []MemberDevice `json:"devices,omitempty"` }
type MemberDevice ¶
type MsgStatus ¶
type MsgStatus struct { ResponseError MsgNo string `json:"msg_no"` Status string `json:"status"` MsgTime string `json:"msg_time"` PrintTime string `json:"print_time"` }
type PrintResponse ¶
type PrintResponse struct { ResponseError MsgNo string `json:"msg_no"` }
type ResponseError ¶
type TemplateAddResponse ¶
type TemplateAddResponse struct { ResponseError TemplateId string `json:"template_id"` }
Click to show internal directories.
Click to hide internal directories.