refactor:将request结构体写到entity
This commit is contained in:
@@ -4,7 +4,15 @@ import "time"
|
|||||||
|
|
||||||
type Like struct {
|
type Like struct {
|
||||||
ID uint `gorm:"primaryKey"`
|
ID uint `gorm:"primaryKey"`
|
||||||
VideoID uint `gorm:"index, not null"`
|
VideoID uint `gorm:"index;not null"`
|
||||||
AccountID uint `gorm:"index, not null"`
|
AccountID uint `gorm:"index;not null"`
|
||||||
CreatedAt time.Time
|
CreatedAt time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type LikeRequest struct {
|
||||||
|
VideoID uint `json:"video_id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type LikeHandler struct {
|
||||||
|
service *LikeService
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,14 +6,6 @@ import (
|
|||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
type LikeRequest struct {
|
|
||||||
VideoID uint `json:"video_id"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type LikeHandler struct {
|
|
||||||
service *LikeService
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewLikeHandler(service *LikeService) *LikeHandler {
|
func NewLikeHandler(service *LikeService) *LikeHandler {
|
||||||
return &LikeHandler{service: service}
|
return &LikeHandler{service: service}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user