modified: "main_dc/yalarba/api_yal/internal/models/\320\276bject.go"
upgare object.go 1
This commit is contained in:
@@ -11,14 +11,41 @@ type Object struct {
|
||||
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"`
|
||||
|
||||
RatingID uint `json:"rating_id"`
|
||||
// ссылка на сайт
|
||||
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