Files
old-backend/models/company.go

39 lines
774 B
Go
Raw Normal View History

2023-09-06 11:58:33 +02:00
package models
2023-10-06 10:47:26 +02:00
import (
"time"
2023-09-06 11:58:33 +02:00
2023-10-06 10:47:26 +02:00
"github.com/jinzhu/gorm"
)
type BaseModel struct {
ID uint `json:"id" gorm:"primaryKey"`
CreatedAt time.Time `json:"createdAt" gorm:"autoCreateTime"`
UpdatedAt time.Time `json:"updatedAt" gorm:"autoUpdateTime"`
}
2023-09-06 11:58:33 +02:00
type Company struct {
gorm.Model
2023-10-06 10:47:26 +02:00
Name string `json:"name"`
Address string `json:"address"`
Email string `json:"email"`
Phone string `json:"phone"`
Users []User `json:"users"`
Devices []Device `json:"devices"`
2023-09-06 11:58:33 +02:00
}
2023-10-03 18:26:57 +02:00
type CompanyShortResponse struct {
2023-10-06 10:47:26 +02:00
ID int `json:"id"`
Name string `json:"name"`
2023-10-03 18:26:57 +02:00
}
2023-09-06 11:58:33 +02:00
2023-09-18 12:27:40 +02:00
func (Company) Update() (bool, error) {
2023-09-06 11:58:33 +02:00
return false, nil
}
2023-09-18 12:27:40 +02:00
func (Company) Create() (bool, error) {
2023-09-06 11:58:33 +02:00
return false, nil
}
2023-09-18 12:27:40 +02:00
func (Company) Delete() (bool, error) {
2023-09-06 11:58:33 +02:00
return false, nil
}