/
types.go
30 lines (25 loc) · 834 Bytes
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package broker
import (
"github.com/zgwit/iot-master/v4/db"
"time"
)
func init() {
db.Register(new(Broker), new(Gateway))
}
type Broker struct {
Id string `json:"id" xorm:"pk"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Port int `json:"port,omitempty"` //TODO 添加TLS证书
Disabled bool `json:"disabled,omitempty"`
Created time.Time `json:"created,omitempty" xorm:"created"`
}
type Gateway struct {
Id string `json:"id" xorm:"pk"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Disabled bool `json:"disabled,omitempty"`
Created time.Time `json:"created,omitempty" xorm:"created"`
}