字段中的blob和JSON类型映射为[]byte和dbs.JSON

This commit is contained in:
GoEdgeLab
2022-03-21 21:39:36 +08:00
parent a2cf2e5b03
commit 31599bee13
105 changed files with 1537 additions and 1156 deletions

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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())
}
}

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {