优化通道处理

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