enhance(model):加入行政区划数据结构。
This commit is contained in:
parent
f45716d941
commit
25a70aff86
1
main.go
1
main.go
|
@ -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
12
model/region.go
Normal 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"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user