init
This commit is contained in:
32
Backend/internal/controller/forum/forum_v1_forum_comments.go
Normal file
32
Backend/internal/controller/forum/forum_v1_forum_comments.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package forum
|
||||
|
||||
import (
|
||||
"context"
|
||||
v1 "leke/api/forum/v1"
|
||||
"leke/internal/service"
|
||||
)
|
||||
|
||||
// ForumCommentsCreate 创建评论
|
||||
func (c *ControllerV1) ForumCommentsCreate(ctx context.Context, req *v1.ForumCommentsCreateReq) (res *v1.ForumCommentsCreateRes, err error) {
|
||||
return service.ForumComments().Create(ctx, req)
|
||||
}
|
||||
|
||||
// ForumCommentsUpdate 更新评论
|
||||
func (c *ControllerV1) ForumCommentsUpdate(ctx context.Context, req *v1.ForumCommentsUpdateReq) (res *v1.ForumCommentsUpdateRes, err error) {
|
||||
return service.ForumComments().Update(ctx, req)
|
||||
}
|
||||
|
||||
// ForumCommentsDelete 删除评论
|
||||
func (c *ControllerV1) ForumCommentsDelete(ctx context.Context, req *v1.ForumCommentsDeleteReq) (res *v1.ForumCommentsDeleteRes, err error) {
|
||||
return service.ForumComments().Delete(ctx, req)
|
||||
}
|
||||
|
||||
// ForumCommentsView 查看评论详情
|
||||
func (c *ControllerV1) ForumCommentsView(ctx context.Context, req *v1.ForumCommentsViewReq) (res *v1.ForumCommentsViewRes, err error) {
|
||||
return service.ForumComments().View(ctx, req)
|
||||
}
|
||||
|
||||
// ForumCommentsList 获取评论列表
|
||||
func (c *ControllerV1) ForumCommentsList(ctx context.Context, req *v1.ForumCommentsListReq) (res *v1.ForumCommentsListRes, err error) {
|
||||
return service.ForumComments().List(ctx, req)
|
||||
}
|
||||
38
Backend/internal/controller/forum/forum_v1_forum_posts.go
Normal file
38
Backend/internal/controller/forum/forum_v1_forum_posts.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package forum
|
||||
|
||||
import (
|
||||
"context"
|
||||
v1 "leke/api/forum/v1"
|
||||
"leke/internal/service"
|
||||
)
|
||||
|
||||
type ControllerV1 struct{}
|
||||
|
||||
func NewV1() *ControllerV1 {
|
||||
return &ControllerV1{}
|
||||
}
|
||||
|
||||
// ForumPostsCreate 创建帖子
|
||||
func (c *ControllerV1) Create(ctx context.Context, req *v1.ForumPostsCreateReq) (res *v1.ForumPostsCreateRes, err error) {
|
||||
return service.ForumPosts().Create(ctx, req)
|
||||
}
|
||||
|
||||
// ForumPostsUpdate 更新帖子
|
||||
func (c *ControllerV1) Update(ctx context.Context, req *v1.ForumPostsUpdateReq) (res *v1.ForumPostsUpdateRes, err error) {
|
||||
return service.ForumPosts().Update(ctx, req)
|
||||
}
|
||||
|
||||
// ForumPostsDelete 删除帖子
|
||||
func (c *ControllerV1) Delete(ctx context.Context, req *v1.ForumPostsDeleteReq) (res *v1.ForumPostsDeleteRes, err error) {
|
||||
return service.ForumPosts().Delete(ctx, req)
|
||||
}
|
||||
|
||||
// ForumPostsView 查看帖子详情
|
||||
func (c *ControllerV1) View(ctx context.Context, req *v1.ForumPostsViewReq) (res *v1.ForumPostsViewRes, err error) {
|
||||
return service.ForumPosts().View(ctx, req)
|
||||
}
|
||||
|
||||
// ForumPostsList 获取帖子列表
|
||||
func (c *ControllerV1) List(ctx context.Context, req *v1.ForumPostsListReq) (res *v1.ForumPostsListRes, err error) {
|
||||
return service.ForumPosts().List(ctx, req)
|
||||
}
|
||||
Reference in New Issue
Block a user