訓練進度測試

This commit is contained in:
2023-05-27 14:40:11 +08:00
parent d847933337
commit 788f166909
4 changed files with 101 additions and 4 deletions

View File

@@ -1,6 +1,8 @@
package models
import (
"database/sql/driver"
"encoding/json"
"main/configs"
"time"
)
@@ -15,3 +17,13 @@ type Tag struct {
func init() {
configs.ORMDB().AutoMigrate(&Tag{})
}
type TagList []string
func (list *TagList) Scan(value interface{}) error {
return json.Unmarshal(value.([]byte), list)
}
func (list TagList) Value() (driver.Value, error) {
return json.Marshal(list)
}