You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/astaxie/beego/orm"
|
|
|
|
|
"time"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type NmcCity struct {
|
|
|
|
|
Code string `json:"code" orm:"pk;column(code);size(255)"`
|
|
|
|
|
City string `json:"city" orm:"column(city);size(255)"`
|
|
|
|
|
Province string `json:"province" orm:"column(province);size(255)"`
|
|
|
|
|
Url string `json:"url" orm:"column(url);size(255)"`
|
|
|
|
|
CreateDate time.Time `json:"createDate" orm:"column(create_date);auto_now_add;type(datetime)"`
|
|
|
|
|
LastUpdateDate time.Time `json:"lastUpdateDate" orm:"column(last_update_date);auto_now;type(datetime)"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
orm.RegisterModel(new(NmcCity))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func GetNmcCityList() []*NmcCity {
|
|
|
|
|
items := make([]*NmcCity, 0)
|
|
|
|
|
orm.NewOrm().QueryTable(new(NmcCity)).All(&items)
|
|
|
|
|
return items
|
|
|
|
|
}
|
|
|
|
|
|