feat: post api

This commit is contained in:
Blizzard
2026-02-06 17:28:42 +08:00
parent 3115b58cb2
commit 87c31f119f
14 changed files with 420 additions and 6 deletions
+2
View File
@@ -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
)
+17
View File
@@ -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) // 取消评论
}
}