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
914 B
Go

9 months ago
package models
import (
"github.com/astaxie/beego/orm"
"time"
)
type NmcNowWeather struct {
Id int64 `json:"id" orm:"pk;auto;column(id);size(20)"`
Code string `json:"code" orm:"column(code);size(255)"`
Weather string `json:"weather" orm:"column(weather);type(text)"`
WeatherDate string `json:"weatherDate" orm:"column(weather_date);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(NmcNowWeather))
}
func AddNmcNowWeather(item *NmcNowWeather) (int64, error) {
return orm.NewOrm().Insert(item)
}
func GetNmcNowWeatherList() []*NmcNowWeather {
items := make([]*NmcNowWeather, 0)
orm.NewOrm().QueryTable(new(NmcNowWeather)).All(&items)
return items
}