You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
348 B

package model
const (
AreaLevelProvince = 1 // 省
AreaLevelCity = 2 // 市
AreaLevelArea = 3 // 区
)
type Area struct {
Id uint `gorm:"primaryKey"`
Name string // 名称
Code string // 编码
Level uint // 等级 1=省 2=市 3=区
ParentId uint // 上级id
Parent *Area `gorm:"foreignKey:ParentId"`
}