From b4df74b60e13948967d5ba935da1a59baec8c9ac Mon Sep 17 00:00:00 2001 From: workabee <2950914812@qq.com> Date: Tue, 10 Sep 2024 11:11:02 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/model/register.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/model/register.go b/internal/model/register.go index 4c7a7c8..6833cd7 100644 --- a/internal/model/register.go +++ b/internal/model/register.go @@ -10,10 +10,10 @@ type RegisterRecord struct { Gender int32 `json:"gender" gorm:"column:gender;type:int;comment:性别1男2女"` PhoneNum string `json:"phone_num" gorm:"column:phone_num;type:varchar(255);not null;comment:手机号"` IdCard string `json:"id_card" gorm:"column:id_card;type:varchar(255);not null;comment:身份证号"` - Address string `json:"address" gorm:"column:address;type:varchar(6000);not null;comment:通讯地址"` - Address1 string `json:"address1" gorm:"column:address1;type:varchar(2000);not null;comment:详细地址"` - IdCardPhoto string `json:"id_card_photo" gorm:"column:id_card_photo;type:varchar(2000);not null;comment:身份证照片"` - IdCardBackPhoto string `json:"id_card_back_photo" gorm:"column:id_card_back_photo;type:varchar(2000);not null;comment:身份证照片背面"` - ArtistPhoto string `json:"artist_photo" gorm:"column:artist_photo;type:varchar(2000);not null;comment:画家本人近照"` - ArtworkFile string `json:"artwork_file" gorm:"column:artwork_file;type:varchar(2000);comment:作品文件"` + Address string `json:"address" gorm:"column:address;type:varchar(2000);not null;comment:通讯地址"` + Address1 string `json:"address1" gorm:"column:address1;type:varchar(1000);not null;comment:详细地址"` + IdCardPhoto string `json:"id_card_photo" gorm:"column:id_card_photo;type:varchar(1000);not null;comment:身份证照片"` + IdCardBackPhoto string `json:"id_card_back_photo" gorm:"column:id_card_back_photo;type:varchar(1000);not null;comment:身份证照片背面"` + ArtistPhoto string `json:"artist_photo" gorm:"column:artist_photo;type:varchar(1000);not null;comment:画家本人近照"` + ArtworkFile string `json:"artwork_file" gorm:"column:artwork_file;type:varchar(1000);comment:作品文件"` } From 4206bfef40b1f5d9c36da0cc0b035428b03ac99a Mon Sep 17 00:00:00 2001 From: workabee <2950914812@qq.com> Date: Tue, 10 Sep 2024 11:17:44 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/db/mysql.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/db/mysql.go b/pkg/db/mysql.go index f8f6837..d99b2b2 100644 --- a/pkg/db/mysql.go +++ b/pkg/db/mysql.go @@ -38,7 +38,7 @@ func loadMysqlConn(conn string) *gorm.DB { sqlDB.SetMaxIdleConns(20) //设置连接池,空闲 sqlDB.SetMaxOpenConns(100) //打开 sqlDB.SetConnMaxLifetime(time.Second * 30) - err = db.AutoMigrate(model.RegisterRecord{}) //自迁移 + err = db.AutoMigrate(&model.RegisterRecord{}) //自迁移 if err != nil { return nil From 0d10dd98d1579318382d4a66f13eeb452608d528 Mon Sep 17 00:00:00 2001 From: workabee <2950914812@qq.com> Date: Tue, 10 Sep 2024 11:25:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/model/register.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/model/register.go b/internal/model/register.go index 6833cd7..0d6cdce 100644 --- a/internal/model/register.go +++ b/internal/model/register.go @@ -10,7 +10,7 @@ type RegisterRecord struct { Gender int32 `json:"gender" gorm:"column:gender;type:int;comment:性别1男2女"` PhoneNum string `json:"phone_num" gorm:"column:phone_num;type:varchar(255);not null;comment:手机号"` IdCard string `json:"id_card" gorm:"column:id_card;type:varchar(255);not null;comment:身份证号"` - Address string `json:"address" gorm:"column:address;type:varchar(2000);not null;comment:通讯地址"` + Address string `json:"address" gorm:"column:address;type:text;not null;comment:通讯地址"` Address1 string `json:"address1" gorm:"column:address1;type:varchar(1000);not null;comment:详细地址"` IdCardPhoto string `json:"id_card_photo" gorm:"column:id_card_photo;type:varchar(1000);not null;comment:身份证照片"` IdCardBackPhoto string `json:"id_card_back_photo" gorm:"column:id_card_back_photo;type:varchar(1000);not null;comment:身份证照片背面"`