优化表结构,重构模型,重新实现基于白银网关的提取节点流程

This commit is contained in:
2025-11-24 18:44:06 +08:00
parent 9a574f55cb
commit cb2a963a37
142 changed files with 6528 additions and 5808 deletions

32
web/globals/orm/inet.go Normal file
View File

@@ -0,0 +1,32 @@
package orm
import (
"database/sql/driver"
"fmt"
"net/netip"
)
type Inet struct {
netip.Addr
}
func (inet Inet) Value() (driver.Value, error) {
return inet.MarshalBinary()
}
func (inet *Inet) Scan(value any) (err error) {
switch value := value.(type) {
case []byte:
return inet.UnmarshalBinary(value)
default:
return fmt.Errorf("不支持的类型: %T", value)
}
}
func ParseInet(ip string) (*Inet, error) {
addr, err := netip.ParseAddr(ip)
if err != nil {
return nil, err
}
return &Inet{addr}, nil
}