Files
tp/main_dc/yalarba/api_yal/internal/models/feedback.go
T
valitovgaziz c0734f50e8 modified: main_dc/yalarba/api_yal/internal/database/psql_db.go
new file:   main_dc/yalarba/api_yal/internal/models/comment.go
	modified:   main_dc/yalarba/api_yal/internal/models/feedback.go
add comment into models
add comment into feedback
add comment into autoMigrate psql_db.go
2026-02-22 14:04:55 +05:00

30 lines
825 B
Go

package models
import ()
type Feedback struct {
/*ID, CreatedAt, UpdatedAt, DeletedAt (Update's history)*/
Base Base `gorm:"embedded"`
// owner account ID
OwnerID uint `gorm:"not null;index" json:"owner_id"`
Owner Account `gorm:"foreignKey:OwnerID;references:ID" json:"owner,omitempty"`
// object IO
ObjectID uint `gorm:"not null;index" json:"object_id"`
Object Object `gorm:"foreignKey:ObjectID;references:ID" json:"object,omitempty"`
// enterprener / tourist
Platform PlatformType `json:"platform"`
// 1 - 5
Score int `json:"score"`
// Связь с комментариями
Comments []Comment `gorm:"foreignKey:FeedbackID" json:"comments,omitempty"`
CommentCount int `gorm:"default:0" json:"comment_count"`
// Основная информация
Text string `json:"text"`
}