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.

30 lines
850 B
Go

9 months ago
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
}
9 months ago
9 months ago
func NmcCityAdd(item *NmcCity) (int64, error) {
return orm.NewOrm().Insert(item)
}