feat: 添加了评论功能并注册

This commit is contained in:
Leon
2025-12-16 18:51:50 +08:00
parent ef47d5e2de
commit b9fe48a328
6 changed files with 236 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
package video
import "time"
type Comment struct {
ID uint `gorm:"primaryKey" json:"id"`
Username string `gorm:"index" json:"username"`
VideoID uint `gorm:"index" json:"video_id"`
AuthorID uint `gorm:"index" json:"author_id"`
Content string `gorm:"type:text" json:"content"`
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
}
type PublishCommentRequest struct {
VideoID uint `json:"video_id"`
Content string `json:"content"`
}
type DeleteCommentRequest struct {
CommentID uint `json:"comment_id"`
}
type GetAllCommentsRequest struct {
VideoID uint `json:"video_id"`
}