upvote and feedback list
This commit is contained in:
21
internal/models/upvote.go
Normal file
21
internal/models/upvote.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Upvote struct {
|
||||
UUID string `gorm:"primaryKey"`
|
||||
SessionUUID string `gorm:"type:varchar(255);unique"`
|
||||
FeedbackUUID string `gorm:"type:varchar(255)"`
|
||||
CreatedAt time.Time `gorm:"type:timestamp"`
|
||||
}
|
||||
|
||||
func NewUpvote(sessionUUID, feedbackUUID string) *Upvote {
|
||||
return &Upvote{
|
||||
UUID: uuid.New().String(),
|
||||
SessionUUID: sessionUUID,
|
||||
FeedbackUUID: feedbackUUID,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user