摘要:
package main import ( "fmt" "gorm.io/driver/mysql" "gorm.io/gorm" "time" ) type User struct { ID int Name string CreatedTime time.Time } func main() { 阅读全文
摘要:
一、增 单:传入实例即可 user := &User{Name: "XX"} db.Create(user) 列表: users := []User{{Name: "xx"},{Name: "XX1"},{Name: "XX2"}} db.Create(&users) 字典 db.Model(&Us 阅读全文