refactor: 标签资源重构

This commit is contained in:
meilin.huang
2024-04-06 18:19:17 +08:00
parent 582d879a77
commit 408bac09a1
52 changed files with 476 additions and 347 deletions

View File

@@ -1,6 +1,8 @@
package model
import (
"database/sql/driver"
"encoding/json"
"time"
)
@@ -125,3 +127,14 @@ func GetIdByGenType(genType IdGenType) uint64 {
}
return 0
}
type Map[K comparable, V any] map[K]V
func (m *Map[K, V]) Scan(value any) error {
return json.Unmarshal(value.([]byte), m)
}
func (m Map[K, V]) Value() (driver.Value, error) {
return json.Marshal(m)
}