下載圖像

This commit is contained in:
2023-05-27 16:40:04 +08:00
parent 788f166909
commit 0966a3c83e
7 changed files with 203 additions and 62 deletions

View File

@@ -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)
}