Library/models/status.go

20 lines
467 B
Go
Raw Normal View History

2017-11-15 15:13:47 +00:00
package models
// Status holds a status
type Status struct {
2017-11-15 15:16:44 +00:00
ID int64 `xorm:"int(11) autoincr not null unique pk"`
2017-11-15 15:13:47 +00:00
Name string `xorm:"varchar(250)"`
}
2017-11-15 15:16:44 +00:00
// GetStatusList returns an array with all status
func GetStatusList() (status []Status, err error) {
2017-11-15 15:13:47 +00:00
err = x.Find(&status)
2017-11-30 14:48:03 +00:00
return
2017-11-15 15:13:47 +00:00
}
2017-11-15 15:16:44 +00:00
// GetStatusByID returns a status object with all its infos
2017-11-15 15:13:47 +00:00
func GetStatusByID(id int64) (status Status, err error) {
_, err = x.Where("id = ?", id).Get(&status)
2017-11-30 14:48:03 +00:00
return
2017-11-15 15:16:44 +00:00
}