下載圖像
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"database/sql/driver"
|
||||
"encoding/json"
|
||||
"main/configs"
|
||||
"time"
|
||||
)
|
||||
@@ -25,3 +27,13 @@ type Image struct {
|
||||
func init() {
|
||||
configs.ORMDB().AutoMigrate(&Image{})
|
||||
}
|
||||
|
||||
type ImageList []string
|
||||
|
||||
func (list *ImageList) Scan(value interface{}) error {
|
||||
return json.Unmarshal(value.([]byte), list)
|
||||
}
|
||||
|
||||
func (list ImageList) Value() (driver.Value, error) {
|
||||
return json.Marshal(list)
|
||||
}
|
||||
|
Reference in New Issue
Block a user