enhance(model):加入行政区划数据结构。

This commit is contained in:
徐涛 2022-08-11 15:29:14 +08:00
parent f45716d941
commit 25a70aff86
2 changed files with 13 additions and 0 deletions

View File

@ -26,6 +26,7 @@ func init() {
log.Println("Main Database connected!") log.Println("Main Database connected!")
err = global.DBConn.Sync( err = global.DBConn.Sync(
&model.Region{},
&model.User{}, &model.User{},
&model.UserDetail{}, &model.UserDetail{},
&model.UserCharge{}, &model.UserCharge{},

12
model/region.go Normal file
View File

@ -0,0 +1,12 @@
package model
type Region struct {
Code string `xorm:"varchar(15) pk not null" json:"code"`
Name string `xorm:"varchar(50) not null" json:"name"`
Level int8 `xorm:"smallint not null default 0" json:"level"`
Parent string `xorm:"varchar(15) not null default '0'" json:"parent"`
}
func (Region) TableName() string {
return "region"
}