mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-04 00:10:25 +08:00
refactor: 标签资源重构
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user