Files
tp/main_dc/yalarba/api_yal/internal/models/feedback.go
T
valitovgaziz 63d486f48d On branch main
modified:   main_dc/yalarba/api_yal/internal/domain/appeal/router.go
	modified:   main_dc/yalarba/api_yal/internal/domain/feetback/dto.go
	modified:   main_dc/yalarba/api_yal/internal/domain/feetback/handler.go
	modified:   main_dc/yalarba/api_yal/internal/domain/feetback/router.go
	modified:   main_dc/yalarba/api_yal/internal/domain/feetback/service.go
	modified:   main_dc/yalarba/api_yal/internal/models/feedback.go
	modified:   main_dc/yalarba/api_yal/internal/repository/comment_repository.go
	modified:   main_dc/yalarba/api_yal/internal/repository/feedback_repository.go
	modified:   main_dc/yalarba/api_yal/internal/repository/feedback_repository_impl.go
	modified:   main_dc/yalarba/api_yal/internal/router/router.go
craete routerRegister, service, hander, dto for feedback
2026-05-19 15:01:57 +05:00

30 lines
800 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"`
// object IO
ObjectID uint `gorm:"not null;index" json:"object_id"`
Object Object `gorm:"foreignKey:ObjectID;references:ID" json:"object"`
// 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"`
}