device

package
v0.0.0-...-5652a87 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(clt *mp.Client, para *AddParameters) (err error)

添加设备

func Delete

func Delete(clt *mp.Client, bssid string) (err error)

删除设备

Types

type AddParameters

type AddParameters struct {
	ShopId   int64  `json:"shop_id"`  // 必须, 门店ID
	SSID     string `json:"ssid"`     // 必须, 无线网络设备的ssid。非认证公众号添加的ssid必需是“WX”开头(“WX”为大写字母),认证公众号和第三方平台无此限制;所有ssid均不能包含中文字符
	Password string `json:"password"` // 必须, 无线网络设备的密码,大于8个字符,不能包含中文字符
	BSSID    string `json:"bssid"`    // 必须, 无线网络设备无线mac地址,格式冒号分隔,字符长度17个,并且字母小写,例如:00:1f:7a:ad:5c:a8
}

type Device

type Device struct {
	ShopId int64  `json:"shop_id"` // 门店ID
	SSID   string `json:"ssid"`    // 连网设备ssid
	BSSID  string `json:"bssid"`   // 无线MAC地址
}

type DeviceIterator

type DeviceIterator struct {
	// contains filtered or unexported fields
}

DeviceIterator

iter, err := NewDeviceIterator(*mp.Client, *SearchQuery)
if err != nil {
    // TODO: 增加你的代码
}

for iter.HasNext() {
    items, err := iter.NextPage()
    if err != nil {
        // TODO: 增加你的代码
    }
    // TODO: 增加你的代码
}

func NewDeviceIterator

func NewDeviceIterator(clt *mp.Client, query *SearchQuery) (iter *DeviceIterator, err error)

func (*DeviceIterator) HasNext

func (iter *DeviceIterator) HasNext() bool

func (*DeviceIterator) NextPage

func (iter *DeviceIterator) NextPage() (records []Device, err error)

func (*DeviceIterator) TotalCount

func (iter *DeviceIterator) TotalCount() int

type ListResult

type ListResult struct {
	PageIndex int `json:"pageindex"` // 分页下标
	PageCount int `json:"pagecount"` // 分页页数

	TotalCount int `json:"totalcount"` // 总数
	ItemCount  int `json:"itemcount"`  // 当前页列表大小

	Records []Device `json:"records"` // 当前页列表数组
}

func List

func List(clt *mp.Client, query *SearchQuery) (rslt *ListResult, err error)

查询设备.

type SearchQuery

type SearchQuery struct {
	ShopId    *int64 `json:"shop_id,omitempty"`   // 根据门店id查询
	PageIndex int    `json:"pageindex,omitempty"` // 分页下标,默认从1开始
	PageSize  int    `json:"pagesize,omitempty"`  // 每页的个数,默认10个,最大20个
}

func NewSearchQuery1

func NewSearchQuery1(PageIndex, PageSize int) *SearchQuery

func NewSearchQuery2

func NewSearchQuery2(ShopId int64, PageIndex, PageSize int) *SearchQuery

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL