gin 报错unsupported Scan, storing driver.Value type []uint8 into type *time.Time
背景:报错:[2019-06-20 17:46:55]sql: Scan error on column index 5, name "last_time": unsupported Scan, storing driver.Value type []uint8 into type *time.Time源码:模型type Bigdata_Task_Project struct ...
·
背景:
报错:
[2019-06-20 17:46:55] sql: Scan error on column index 5, name "last_time": unsupported Scan, storing driver.Value type []uint8 into type *time.Time
源码:
模型
type Bigdata_Task_Project struct {
ID int64 `gorm:"primary_key";json:"id"`//
Name string`gorm:"type:varchar(64)";json:"name"`//负责人名字
Title string `gorm:"type:varchar(64)"json:"title"`//任务标题
Runtime string `gorm:"type:varchar(255)";json:"runtime"`//一次性任务或者定时任务
LastTime time.Time `json:"last_time"`//上一次执行时间
Dingmachine string `gorm:"default:https://oapi.dingtalk.com/robot/send?access_token=d3fa3d0d867838f9c99f5c5710b42eb988f6b9e9e7039144a7b235b855074a66";json:"dingmachine"`//钉钉机器人
Filename string`json:"filename"`//文件名字
Ossaddress string`json:"ossaddress"`//oss地址
UpdateTime time.Time`json:"update_time"` //更新时间
CreateTime time.Time `gorm:"type:datetime";json:"create_time"`//创建时间
IsDelete int `gorm:"default:0";json:"is_delete"`//是否删除
Used int`json:"used";gorm:"default:0"` //是否激活
Type int `json:"type"`
}
数据库字段
solution:
数据库连接时设置
charset=utf8&parseTime=true`
更多推荐
所有评论(0)