2017-10-10 09:20:16 +00:00
|
|
|
package models
|
|
|
|
|
|
|
|
type Publisher struct {
|
2017-11-07 15:35:10 +00:00
|
|
|
ID int64 `xorm:"int(11) autoincr not null unique pk"`
|
|
|
|
Name string `xorm:"varchar(250) not null"`
|
|
|
|
Created int64 `xorm:"created"`
|
|
|
|
Updated int64 `xorm:"updated"`
|
2017-10-10 09:20:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (Publisher) TableName() string {
|
|
|
|
return "publishers"
|
2017-10-10 16:23:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func GetPublisherByID(id int64) (publisher Publisher, exists bool, err error) {
|
|
|
|
has, err := x.Id(id).Get(&publisher)
|
|
|
|
|
|
|
|
return publisher, has, err
|
2017-11-07 15:35:10 +00:00
|
|
|
}
|