package entity import "gopkg.in/guregu/null.v3" type City struct { Id int `db:"id"` Name string `db:"name"` AreaCode string `db:"area_code"` IsOpen int `db:"is_open"` Countys []County `db:"-"` } type County struct { Id int `db:"id" json:"id"` CityId int `db:"city_id" json:"city_id"` Name string `db:"name" json:"name"` PostCode string `db:"post_code" json:"post_code"` } type City2 struct { Id int `db:"id"` Name string `db:"name"` Counties []County2 `db:"-" json:"children"` } type CityNode struct { Id int `db:"id" json:"id"` Name string `db:"name" json:"name"` PId int `db:"province_id" json:"pid"` PName null.String `db:"province" json:"pname"` Counties []CountyNode `db:"-" json:"children"` } type CountyNode struct { Id int `db:"id" json:"id"` Name string `db:"name" json:"name"` PId int `db:"_" json:"pid"` PName null.String `db:"_" json:"pname"` } type County2 struct { Id int `db:"id" json:"id"` Name string `db:"name" json:"name"` } type Province struct { Id int `db:"id"` Name string `db:"name"` Cities []City2 `db:"-" json:"children"` } type CityAll struct { ProvinceId int `db:"province_id"` Province string `db:"province"` CityId int `db:"city_id"` City string `db:"city"` CountryId int `db:"country_id"` Country string `db:"country"` }