init push

This commit is contained in:
2026-05-21 19:52:45 +08:00
commit e3f75311ab
1280 changed files with 179173 additions and 0 deletions

28
backend/domain/json.go Normal file
View File

@@ -0,0 +1,28 @@
package domain
import (
"database/sql/driver"
"encoding/json"
"fmt"
)
type MapStrInt64 map[string]int64
func (m *MapStrInt64) Value() (driver.Value, error) {
if m == nil {
return []byte("{}"), nil
}
return json.Marshal(m)
}
func (m *MapStrInt64) Scan(value interface{}) error {
if value == nil {
*m = MapStrInt64{}
return nil
}
bytes, ok := value.([]byte)
if !ok {
return fmt.Errorf("MapStrInt64: Scan source is not []byte")
}
return json.Unmarshal(bytes, m)
}