modified: "main_dc/yalarba/api_yal/internal/models/\320\276bject.go"
upgare object.go 1
This commit is contained in:
@@ -8,17 +8,44 @@ type Object struct {
|
|||||||
|
|
||||||
// owner account ID
|
// owner account ID
|
||||||
OwnerID uint `json:"owner_id"`
|
OwnerID uint `json:"owner_id"`
|
||||||
Owner Account `gorm:"foreignKey:OwnerID;references:ID" json:"owner"`
|
Owner Account `gorm:"foreignKey:OwnerID;references:ID" json:"owner"`
|
||||||
|
|
||||||
// Основная информация
|
// Основная информация
|
||||||
ShortName string `gorm:"not null" json:"short_name"`
|
// короткое название
|
||||||
LongName string `json:"long_name"`
|
ShortName string `gorm:"not null" json:"short_name"`
|
||||||
Type string `json:"type"`
|
// длинное название
|
||||||
Phone string `json:"phone"`
|
LongName string `json:"long_name"`
|
||||||
Email string `json:"email"`
|
// тип места отдыха
|
||||||
Site string `json:"site"`
|
Type string `json:"type"`
|
||||||
Description string `json:"description"`
|
|
||||||
Address string `json:"address"`
|
|
||||||
|
|
||||||
RatingID uint `json:"rating_id"`
|
// контактные данные
|
||||||
|
Phone string `json:"phone"`
|
||||||
|
Email string `json:"email"`
|
||||||
|
|
||||||
|
// ссылка на сайт
|
||||||
|
Site string `json:"site"`
|
||||||
|
// короткое описание
|
||||||
|
ShortDescription string `json:"short_description"`
|
||||||
|
// полное описание
|
||||||
|
Description string `json:"description"`
|
||||||
|
// адресс
|
||||||
|
Address string `json:"address"`
|
||||||
|
// Геолокация долгота и широта
|
||||||
|
Latitude float64 `json:"latitude"`
|
||||||
|
Longitude float64 `json:"longitude"`
|
||||||
|
|
||||||
|
// Статус объекта
|
||||||
|
IsActive bool `gorm:"default:true;index" json:"is_active"`
|
||||||
|
IsVerified bool `gorm:"default:false" json:"is_verified"`
|
||||||
|
|
||||||
|
// Связи с рейтингами (для разных платформ)
|
||||||
|
TouristRating *Rating `gorm:"foreignKey:ObjectID;references:ID;where:platform='tourist'" json:"tourist_rating,omitempty"`
|
||||||
|
EntrepreneurRating *Rating `gorm:"foreignKey:ObjectID;references:ID;where:platform='entrepreneur'" json:"entrepreneur_rating,omitempty"`
|
||||||
|
|
||||||
|
// Все рейтинги объекта (если нужно получить оба сразу)
|
||||||
|
Ratings []Rating `gorm:"foreignKey:ObjectID" json:"ratings,omitempty"`
|
||||||
|
|
||||||
|
// Связи с отзывами
|
||||||
|
Feedbacks []Feedback `gorm:"foreignKey:ObjectID" json:"feedbacks,omitempty"`
|
||||||
|
FeedbackCount int `gorm:"default:0" json:"feedback_count"`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user