mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-30 01:46:37 +08:00
字段中的blob和JSON类型映射为[]byte和dbs.JSON
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
package nameservers
|
||||
|
||||
import "github.com/iwind/TeaGo/dbs"
|
||||
|
||||
// NSDomain DNS域名
|
||||
type NSDomain struct {
|
||||
Id uint32 `field:"id"` // ID
|
||||
ClusterId uint32 `field:"clusterId"` // 集群ID
|
||||
UserId uint32 `field:"userId"` // 用户ID
|
||||
IsOn uint8 `field:"isOn"` // 是否启用
|
||||
Name string `field:"name"` // 域名
|
||||
CreatedAt uint64 `field:"createdAt"` // 创建时间
|
||||
Version uint64 `field:"version"` // 版本
|
||||
State uint8 `field:"state"` // 状态
|
||||
Tsig string `field:"tsig"` // TSIG配置
|
||||
Id uint32 `field:"id"` // ID
|
||||
ClusterId uint32 `field:"clusterId"` // 集群ID
|
||||
UserId uint32 `field:"userId"` // 用户ID
|
||||
IsOn uint8 `field:"isOn"` // 是否启用
|
||||
Name string `field:"name"` // 域名
|
||||
CreatedAt uint64 `field:"createdAt"` // 创建时间
|
||||
Version uint64 `field:"version"` // 版本
|
||||
State uint8 `field:"state"` // 状态
|
||||
Tsig dbs.JSON `field:"tsig"` // TSIG配置
|
||||
}
|
||||
|
||||
type NSDomainOperator struct {
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package nameservers
|
||||
|
||||
import "github.com/iwind/TeaGo/dbs"
|
||||
|
||||
// NSQuestionOption DNS请求选项
|
||||
type NSQuestionOption struct {
|
||||
Id uint64 `field:"id"` // ID
|
||||
Name string `field:"name"` // 选项名
|
||||
Values string `field:"values"` // 选项值
|
||||
CreatedAt uint64 `field:"createdAt"` // 创建时间
|
||||
Id uint64 `field:"id"` // ID
|
||||
Name string `field:"name"` // 选项名
|
||||
Values dbs.JSON `field:"values"` // 选项值
|
||||
CreatedAt uint64 `field:"createdAt"` // 创建时间
|
||||
}
|
||||
|
||||
type NSQuestionOptionOperator struct {
|
||||
|
||||
@@ -13,17 +13,17 @@ func TestNSRecord_DecodeRouteIds(t *testing.T) {
|
||||
}
|
||||
|
||||
{
|
||||
record := &NSRecord{RouteIds: "[]"}
|
||||
record := &NSRecord{RouteIds: []byte("[]")}
|
||||
t.Log(record.DecodeRouteIds())
|
||||
}
|
||||
|
||||
{
|
||||
record := &NSRecord{RouteIds: "[1, 2, 3]"}
|
||||
record := &NSRecord{RouteIds: []byte("[1, 2, 3]")}
|
||||
t.Log(record.DecodeRouteIds())
|
||||
}
|
||||
|
||||
{
|
||||
record := &NSRecord{RouteIds: `["id:1", "id:2", "isp:liantong"]`}
|
||||
record := &NSRecord{RouteIds: []byte(`["id:1", "id:2", "isp:liantong"]`)}
|
||||
t.Log(record.DecodeRouteIds())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,22 @@
|
||||
package nameservers
|
||||
|
||||
import "github.com/iwind/TeaGo/dbs"
|
||||
|
||||
// NSRecord DNS记录
|
||||
type NSRecord struct {
|
||||
Id uint64 `field:"id"` // ID
|
||||
DomainId uint32 `field:"domainId"` // 域名ID
|
||||
IsOn uint8 `field:"isOn"` // 是否启用
|
||||
Description string `field:"description"` // 备注
|
||||
Name string `field:"name"` // 记录名
|
||||
Type string `field:"type"` // 类型
|
||||
Value string `field:"value"` // 值
|
||||
Ttl uint32 `field:"ttl"` // TTL(秒)
|
||||
Weight uint32 `field:"weight"` // 权重
|
||||
RouteIds string `field:"routeIds"` // 线路
|
||||
CreatedAt uint64 `field:"createdAt"` // 创建时间
|
||||
Version uint64 `field:"version"` //
|
||||
State uint8 `field:"state"` // 状态
|
||||
Id uint64 `field:"id"` // ID
|
||||
DomainId uint32 `field:"domainId"` // 域名ID
|
||||
IsOn uint8 `field:"isOn"` // 是否启用
|
||||
Description string `field:"description"` // 备注
|
||||
Name string `field:"name"` // 记录名
|
||||
Type string `field:"type"` // 类型
|
||||
Value string `field:"value"` // 值
|
||||
Ttl uint32 `field:"ttl"` // TTL(秒)
|
||||
Weight uint32 `field:"weight"` // 权重
|
||||
RouteIds dbs.JSON `field:"routeIds"` // 线路
|
||||
CreatedAt uint64 `field:"createdAt"` // 创建时间
|
||||
Version uint64 `field:"version"` //
|
||||
State uint8 `field:"state"` // 状态
|
||||
}
|
||||
|
||||
type NSRecordOperator struct {
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
package nameservers
|
||||
|
||||
import "github.com/iwind/TeaGo/dbs"
|
||||
|
||||
// NSRoute DNS线路
|
||||
type NSRoute struct {
|
||||
Id uint32 `field:"id"` // ID
|
||||
IsOn uint8 `field:"isOn"` // 是否启用
|
||||
ClusterId uint32 `field:"clusterId"` // 集群ID
|
||||
DomainId uint32 `field:"domainId"` // 域名ID
|
||||
UserId uint32 `field:"userId"` // 用户ID
|
||||
Name string `field:"name"` // 名称
|
||||
Ranges string `field:"ranges"` // 范围
|
||||
Order uint32 `field:"order"` // 排序
|
||||
Version uint64 `field:"version"` // 版本号
|
||||
Code string `field:"code"` // 代号
|
||||
State uint8 `field:"state"` // 状态
|
||||
Id uint32 `field:"id"` // ID
|
||||
IsOn uint8 `field:"isOn"` // 是否启用
|
||||
ClusterId uint32 `field:"clusterId"` // 集群ID
|
||||
DomainId uint32 `field:"domainId"` // 域名ID
|
||||
UserId uint32 `field:"userId"` // 用户ID
|
||||
Name string `field:"name"` // 名称
|
||||
Ranges dbs.JSON `field:"ranges"` // 范围
|
||||
Order uint32 `field:"order"` // 排序
|
||||
Version uint64 `field:"version"` // 版本号
|
||||
Code string `field:"code"` // 代号
|
||||
State uint8 `field:"state"` // 状态
|
||||
}
|
||||
|
||||
type NSRouteOperator struct {
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package nameservers
|
||||
|
||||
import "github.com/iwind/TeaGo/dbs"
|
||||
|
||||
// NSZone 域名子域
|
||||
type NSZone struct {
|
||||
Id uint64 `field:"id"` // ID
|
||||
DomainId uint64 `field:"domainId"` // 域名ID
|
||||
IsOn uint8 `field:"isOn"` // 是否启用
|
||||
Order uint32 `field:"order"` // 排序
|
||||
Version uint64 `field:"version"` // 版本
|
||||
Tsig string `field:"tsig"` // TSIG配置
|
||||
State uint8 `field:"state"` // 状态
|
||||
Id uint64 `field:"id"` // ID
|
||||
DomainId uint64 `field:"domainId"` // 域名ID
|
||||
IsOn uint8 `field:"isOn"` // 是否启用
|
||||
Order uint32 `field:"order"` // 排序
|
||||
Version uint64 `field:"version"` // 版本
|
||||
Tsig dbs.JSON `field:"tsig"` // TSIG配置
|
||||
State uint8 `field:"state"` // 状态
|
||||
}
|
||||
|
||||
type NSZoneOperator struct {
|
||||
|
||||
Reference in New Issue
Block a user