upvote and feedback list
This commit is contained in:
@@ -11,23 +11,32 @@ type Feedback struct {
|
||||
ProjectID string `gorm:"type:varchar(255)"`
|
||||
|
||||
SessionUUID string `gorm:"type:varchar(255)"`
|
||||
SessionName string `gorm:"type:varchar(255)"`
|
||||
|
||||
Type string `gorm:"type:varchar(255)"`
|
||||
Text string `gorm:"type:varchar(300)"`
|
||||
Type FeedbackType `gorm:"type:varchar(255)"`
|
||||
Text string `gorm:"type:varchar(300)"`
|
||||
|
||||
Upvote []Upvote `gorm:"foreignKey:FeedbackUUID;references:UUID"`
|
||||
|
||||
CreatedAt time.Time `gorm:"type:timestamp"`
|
||||
UpdatedAt time.Time `gorm:"type:timestamp"`
|
||||
}
|
||||
|
||||
func NewFeedback(userUUID, sessionUUID, ticketType, text, projectID string) *Feedback {
|
||||
type FeedbackType string
|
||||
|
||||
const (
|
||||
FeedbackTypeFeature FeedbackType = "feature"
|
||||
FeedbackTypeFeedback FeedbackType = "feedback"
|
||||
FeedbackTypeSupport FeedbackType = "support"
|
||||
)
|
||||
|
||||
func NewFeedback(userUUID, sessionUUID, text, projectID string, feedbackType FeedbackType) *Feedback {
|
||||
return &Feedback{
|
||||
UUID: uuid.New().String(),
|
||||
UserID: userUUID,
|
||||
SessionUUID: sessionUUID,
|
||||
ProjectID: projectID,
|
||||
|
||||
Type: ticketType,
|
||||
Type: feedbackType,
|
||||
Text: text,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user