优化通道处理

This commit is contained in:
2026-06-09 16:30:19 +08:00
parent c5453557ae
commit dd482dd6b0
10 changed files with 454 additions and 614 deletions

View File

@@ -35,6 +35,7 @@ func newEdge(db *gorm.DB, opts ...gen.DOOption) edge {
_edge.Version = field.NewInt32(tableName, "version")
_edge.Mac = field.NewString(tableName, "mac")
_edge.IP = field.NewField(tableName, "ip")
_edge.Port = field.NewUint16(tableName, "port")
_edge.ISP = field.NewInt(tableName, "isp")
_edge.Prov = field.NewString(tableName, "prov")
_edge.City = field.NewString(tableName, "city")
@@ -59,6 +60,7 @@ type edge struct {
Version field.Int32
Mac field.String
IP field.Field
Port field.Uint16
ISP field.Int
Prov field.String
City field.String
@@ -89,6 +91,7 @@ func (e *edge) updateTableName(table string) *edge {
e.Version = field.NewInt32(table, "version")
e.Mac = field.NewString(table, "mac")
e.IP = field.NewField(table, "ip")
e.Port = field.NewUint16(table, "port")
e.ISP = field.NewInt(table, "isp")
e.Prov = field.NewString(table, "prov")
e.City = field.NewString(table, "city")
@@ -111,7 +114,7 @@ func (e *edge) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
}
func (e *edge) fillFieldMap() {
e.fieldMap = make(map[string]field.Expr, 14)
e.fieldMap = make(map[string]field.Expr, 15)
e.fieldMap["id"] = e.ID
e.fieldMap["created_at"] = e.CreatedAt
e.fieldMap["updated_at"] = e.UpdatedAt
@@ -120,6 +123,7 @@ func (e *edge) fillFieldMap() {
e.fieldMap["version"] = e.Version
e.fieldMap["mac"] = e.Mac
e.fieldMap["ip"] = e.IP
e.fieldMap["port"] = e.Port
e.fieldMap["isp"] = e.ISP
e.fieldMap["prov"] = e.Prov
e.fieldMap["city"] = e.City

View File

@@ -35,6 +35,7 @@ func newProxy(db *gorm.DB, opts ...gen.DOOption) proxy {
_proxy.Mac = field.NewString(tableName, "mac")
_proxy.IP = field.NewField(tableName, "ip")
_proxy.Host = field.NewString(tableName, "host")
_proxy.Port = field.NewInt(tableName, "port")
_proxy.Secret = field.NewString(tableName, "secret")
_proxy.Type = field.NewInt(tableName, "type")
_proxy.Status = field.NewInt(tableName, "status")
@@ -283,6 +284,7 @@ type proxy struct {
Mac field.String
IP field.Field
Host field.String
Port field.Int
Secret field.String
Type field.Int
Status field.Int
@@ -312,6 +314,7 @@ func (p *proxy) updateTableName(table string) *proxy {
p.Mac = field.NewString(table, "mac")
p.IP = field.NewField(table, "ip")
p.Host = field.NewString(table, "host")
p.Port = field.NewInt(table, "port")
p.Secret = field.NewString(table, "secret")
p.Type = field.NewInt(table, "type")
p.Status = field.NewInt(table, "status")
@@ -332,7 +335,7 @@ func (p *proxy) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
}
func (p *proxy) fillFieldMap() {
p.fieldMap = make(map[string]field.Expr, 13)
p.fieldMap = make(map[string]field.Expr, 14)
p.fieldMap["id"] = p.ID
p.fieldMap["created_at"] = p.CreatedAt
p.fieldMap["updated_at"] = p.UpdatedAt
@@ -341,6 +344,7 @@ func (p *proxy) fillFieldMap() {
p.fieldMap["mac"] = p.Mac
p.fieldMap["ip"] = p.IP
p.fieldMap["host"] = p.Host
p.fieldMap["port"] = p.Port
p.fieldMap["secret"] = p.Secret
p.fieldMap["type"] = p.Type
p.fieldMap["status"] = p.Status