feat: post api
This commit is contained in:
+1
-1
@@ -10,5 +10,5 @@ var GroupApp = new(Group)
|
||||
// Group 路由组
|
||||
type Group struct {
|
||||
System system.SysRouterGroup
|
||||
Plant plant.MyPlantRouter
|
||||
Plant plant.RouterGroup
|
||||
}
|
||||
|
||||
@@ -4,9 +4,11 @@ import v1 "sundynix-go/api/v1"
|
||||
|
||||
type RouterGroup struct {
|
||||
MyPlantRouter
|
||||
PostRouter
|
||||
}
|
||||
|
||||
// 初始化路由
|
||||
var (
|
||||
myPlantApi = v1.ApiGroupApp.PlantApiGroup.MyPlantApi
|
||||
postApi = v1.ApiGroupApp.PlantApiGroup.PostApi
|
||||
)
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package plant
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
type PostRouter struct{}
|
||||
|
||||
func (p *PostRouter) InitPostRouter(Router *gin.RouterGroup) {
|
||||
postRouter := Router.Group("post")
|
||||
{
|
||||
postRouter.POST("publish", postApi.PublishPost) // 发布帖子
|
||||
postRouter.POST("page", postApi.PostPage) // 帖子列表
|
||||
postRouter.GET("like", postApi.LikePost) // 点赞或者取消点赞
|
||||
postRouter.POST("comment", postApi.CommentPost) // 评论
|
||||
//postRouter.POST("deleteComment", postApi.delementComment) // 取消评论
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user