Upstream sync

This commit is contained in:
Senad Uka
2023-10-13 11:48:14 +02:00
parent 7369739bdd
commit d01c1a0232
29 changed files with 563 additions and 444 deletions

View File

@@ -1,23 +1,24 @@
package models
import (
"database/sql"
"time"
"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"`
ID uint `json:"id" gorm:"primaryKey"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DeletedAt sql.NullTime `json:"deletedAt,omitempty" gorm:"index"`
}
type Company struct {
gorm.Model
Name string `json:"name"`
Address string `json:"address"`
Email string `json:"email"`
Phone string `json:"phone"`
Users []User `json:"users"`
BaseModel
Name string `json:"name"`
Address string `json:"address"`
Email string `json:"email"`
Phone string `json:"phone"`
Users []User `json:"users"`
Devices []Device `json:"devices"`
}
@@ -26,7 +27,6 @@ type CompanyShortResponse struct {
Name string `json:"name"`
}
func (Company) Update() (bool, error) {
return false, nil
}