ExpiryDatesManager/server/model/company.go
2018-12-20 20:50:01 +01:00

26 lines
335 B
Go

package model
import (
"github.com/jinzhu/gorm"
)
type Company struct {
gorm.Model
Name string
}
func GetCompanies() ([]*Company) {
comapnies := make([]*Company, 0)
GetDB().Find(&comapnies)
return comapnies
}
func (company *Company) Create() (*Company) {
GetDB().Create(company)
GetDB().Save(company)
return company;
}