初始化v1
This commit is contained in:
49
internal/controller/user/user_collect.go
Normal file
49
internal/controller/user/user_collect.go
Normal file
@@ -0,0 +1,49 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"nl-video-api/internal/service"
|
||||
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
)
|
||||
|
||||
// UserCollectController 用户收藏控制器
|
||||
type UserCollectController struct{}
|
||||
|
||||
var UserCollect = &UserCollectController{}
|
||||
|
||||
// Add 添加收藏
|
||||
func (c *UserCollectController) Add(r *ghttp.Request) {
|
||||
service.UserCollect.Add(r)
|
||||
}
|
||||
|
||||
// Remove 取消收藏
|
||||
func (c *UserCollectController) Remove(r *ghttp.Request) {
|
||||
service.UserCollect.Remove(r)
|
||||
}
|
||||
|
||||
// GetList 获取收藏列表
|
||||
func (c *UserCollectController) GetList(r *ghttp.Request) {
|
||||
service.NewUserCollectService().GetList(r)
|
||||
}
|
||||
|
||||
// List 获取收藏列表(别名方法)
|
||||
func (c *UserCollectController) List(r *ghttp.Request) {
|
||||
c.GetList(r)
|
||||
}
|
||||
|
||||
// Check 检查收藏状态
|
||||
func (c *UserCollectController) Check(r *ghttp.Request) {
|
||||
// TODO: 实现检查收藏状态逻辑
|
||||
r.Response.WriteJson(map[string]interface{}{
|
||||
"code": 0,
|
||||
"message": "检查成功",
|
||||
"data": map[string]interface{}{
|
||||
"is_collected": false,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// CheckCollect 检查是否已收藏
|
||||
func (c *UserCollectController) CheckCollect(r *ghttp.Request) {
|
||||
service.UserCollect.CheckCollect(r)
|
||||
}
|
||||
Reference in New Issue
Block a user