44 lines
1.2 KiB
Go
44 lines
1.2 KiB
Go
package radio
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type InteractionRouter struct{}
|
|
|
|
func (r *InteractionRouter) InitInteractionRouter(Router *gin.RouterGroup) {
|
|
// 收听历史
|
|
historyRouter := Router.Group("history")
|
|
{
|
|
historyRouter.POST("list", interactionApi.GetHistoryList)
|
|
historyRouter.POST("add", interactionApi.AddHistory)
|
|
historyRouter.POST("delete", interactionApi.DeleteHistory)
|
|
historyRouter.GET("deleteAll", interactionApi.DeleteAllHistory)
|
|
}
|
|
|
|
// 点赞
|
|
likeRouter := Router.Group("like")
|
|
{
|
|
likeRouter.POST("toggle", interactionApi.ToggleLike)
|
|
likeRouter.POST("list", interactionApi.GetLikeList)
|
|
likeRouter.GET("removeAll", interactionApi.RemoveAllLike)
|
|
}
|
|
|
|
// 收藏
|
|
favoriteRouter := Router.Group("favorite")
|
|
{
|
|
favoriteRouter.POST("list", interactionApi.GetFavoriteList)
|
|
favoriteRouter.POST("add", interactionApi.AddFavorite)
|
|
favoriteRouter.POST("remove", interactionApi.RemoveFavorite)
|
|
favoriteRouter.GET("removeAll", interactionApi.RemoveAllFavorite)
|
|
}
|
|
|
|
// 评论
|
|
commentRouter := Router.Group("comment")
|
|
{
|
|
commentRouter.POST("list", interactionApi.GetCommentList)
|
|
commentRouter.POST("add", interactionApi.AddComment)
|
|
commentRouter.POST("delete", interactionApi.DeleteComment)
|
|
}
|
|
}
|