6cc9354cce
modified: main_dc/yalarba/api_yal/internal/models/account.go new file: main_dc/yalarba/api_yal/internal/models/rating.go modified: "main_dc/yalarba/api_yal/internal/models/\320\276bject.go" add rating objects, mogration for them
25 lines
685 B
Go
25 lines
685 B
Go
package models
|
|
|
|
import ()
|
|
|
|
type Object struct {
|
|
/*ID, CreatedAt, UpdatedAt, DeletedAt (Update's history)*/
|
|
Base Base `gorm:"embedded"`
|
|
|
|
// owner account ID
|
|
OwnerID uint `json:"owner_id"`
|
|
Owner Account `gorm:"foreignKey:OwnerID;references:ID" json:"owner"`
|
|
|
|
// Основная информация
|
|
ShortName string `gorm:"not null" json:"short_name"`
|
|
LongName string `json:"long_name"`
|
|
Type string `json:"type"`
|
|
Phone string `json:"phone"`
|
|
Email string `json:"email"`
|
|
Site string `json:"site"`
|
|
Description string `json:"description"`
|
|
Address string `json:"address"`
|
|
|
|
Rating Rating `gorm:"foreigenKey:ObjectID" json:"rating"`
|
|
}
|