Library/models/publisher.go

19 lines
428 B
Go

package models
type Publisher struct {
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"`
}
func (Publisher) TableName() string {
return "publishers"
}
func GetPublisherByID(id int64) (publisher Publisher, exists bool, err error) {
has, err := x.Id(id).Get(&publisher)
return publisher, has, err
}