1234567891011121314151617181920212223242526 |
- package Product
- // 产品协议 1:Mqtt 2:tcp 3:CoAP 6:http 7:https 8:websocket
- type ProductMode struct {
- Id int `json:"Id"`
- T_name string `json:"T_name"` // 协议名称 Mqtt
- T_address string `json:"T_address"` //接入地址 bj-3-mqtt.iot-api.com:1883
- T_describe string `json:"T_describe"` // 描述内容
- T_state int `json:"T_state"` //状态
- }
- var ProductModeList = []*ProductMode{}
- // ---------------- 方法 -------------------
- // 添加
- func (t *ProductMode) Add() {
- ProductModeList = append(ProductModeList, t)
- }
- // 获取列表
- func ProductModeLists() (r []*ProductMode, Total int64) {
- return ProductModeList, int64(len(ProductModeList))
- }
|