f304f982c0
modified: main_dc/yalarba/api_yal/go.sum modified: main_dc/yalarba/api_yal/internal/domain/account/dto.go modified: main_dc/yalarba/api_yal/internal/models/account.go modified: main_dc/yalarba/api_yal/internal/models/appeal.go modified: main_dc/yalarba/api_yal/internal/models/comment.go modified: main_dc/yalarba/api_yal/internal/models/feedback.go modified: main_dc/yalarba/api_yal/internal/models/password_reset.go modified: main_dc/yalarba/api_yal/internal/models/rating.go modified: "main_dc/yalarba/api_yal/internal/models/\320\276bject.go" set embedded base model anonimus as realy embedded struct without set name for field base
30 lines
820 B
Go
30 lines
820 B
Go
package models
|
|
|
|
import ()
|
|
|
|
type Feedback struct {
|
|
/*ID, CreatedAt, UpdatedAt, DeletedAt (Update's history)*/
|
|
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"`
|
|
}
|