ProductMode.go 708 B

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