fix
This commit is contained in:
@@ -31,6 +31,7 @@ func RegisterControllers(group *ghttp.RouterGroup) {
|
||||
containment.NewV1(),
|
||||
room.NewV1(),
|
||||
forum.NewV1(),
|
||||
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
35
Backend/internal/controller/forum/boards.go
Normal file
35
Backend/internal/controller/forum/boards.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package forum
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "TrangleAgent/api/forum/v1"
|
||||
"TrangleAgent/internal/service"
|
||||
)
|
||||
|
||||
|
||||
|
||||
// ForumBoardsCreate 创建版块
|
||||
func (c *ControllerV1) ForumBoardsCreate(ctx context.Context, req *v1.ForumBoardsCreateReq) (res *v1.ForumBoardsCreateRes, err error) {
|
||||
return service.ForumBoards().Create(ctx, req)
|
||||
}
|
||||
|
||||
// ForumBoardsUpdate 更新版块
|
||||
func (c *ControllerV1) ForumBoardsUpdate(ctx context.Context, req *v1.ForumBoardsUpdateReq) (res *v1.ForumBoardsUpdateRes, err error) {
|
||||
return service.ForumBoards().Update(ctx, req)
|
||||
}
|
||||
|
||||
// ForumBoardsDelete 删除版块
|
||||
func (c *ControllerV1) ForumBoardsDelete(ctx context.Context, req *v1.ForumBoardsDeleteReq) (res *v1.ForumBoardsDeleteRes, err error) {
|
||||
return service.ForumBoards().Delete(ctx, req)
|
||||
}
|
||||
|
||||
// ForumBoardsView 查看版块
|
||||
func (c *ControllerV1) ForumBoardsView(ctx context.Context, req *v1.ForumBoardsViewReq) (res *v1.ForumBoardsViewRes, err error) {
|
||||
return service.ForumBoards().View(ctx, req)
|
||||
}
|
||||
|
||||
// ForumBoardsList 获取版块列表
|
||||
func (c *ControllerV1) ForumBoardsList(ctx context.Context, req *v1.ForumBoardsListReq) (res *v1.ForumBoardsListRes, err error) {
|
||||
return service.ForumBoards().List(ctx, req)
|
||||
}
|
||||
11
Backend/internal/controller/forum/forum.go
Normal file
11
Backend/internal/controller/forum/forum.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package forum
|
||||
|
||||
import (
|
||||
"TrangleAgent/api/forum"
|
||||
)
|
||||
|
||||
type ControllerV1 struct{}
|
||||
|
||||
func NewV1() forum.IForumV1 {
|
||||
return &ControllerV1{}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package forum
|
||||
|
||||
import (
|
||||
v1 "TrangleAgent/api/forum/v1"
|
||||
"TrangleAgent/internal/service"
|
||||
"context"
|
||||
)
|
||||
|
||||
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)
|
||||
}
|
||||
28
Backend/internal/controller/forum/posts.go
Normal file
28
Backend/internal/controller/forum/posts.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package forum
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1 "TrangleAgent/api/forum/v1"
|
||||
"TrangleAgent/internal/service"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) ForumPostsCreate(ctx context.Context, req *v1.ForumPostsCreateReq) (res *v1.ForumPostsCreateRes, err error) {
|
||||
return service.ForumPosts().Create(ctx, req)
|
||||
}
|
||||
|
||||
func (c *ControllerV1) ForumPostsUpdate(ctx context.Context, req *v1.ForumPostsUpdateReq) (res *v1.ForumPostsUpdateRes, err error) {
|
||||
return service.ForumPosts().Update(ctx, req)
|
||||
}
|
||||
|
||||
func (c *ControllerV1) ForumPostsDelete(ctx context.Context, req *v1.ForumPostsDeleteReq) (res *v1.ForumPostsDeleteRes, err error) {
|
||||
return service.ForumPosts().Delete(ctx, req)
|
||||
}
|
||||
|
||||
func (c *ControllerV1) ForumPostsView(ctx context.Context, req *v1.ForumPostsViewReq) (res *v1.ForumPostsViewRes, err error) {
|
||||
return service.ForumPosts().View(ctx, req)
|
||||
}
|
||||
|
||||
func (c *ControllerV1) ForumPostsList(ctx context.Context, req *v1.ForumPostsListReq) (res *v1.ForumPostsListRes, err error) {
|
||||
return service.ForumPosts().List(ctx, req)
|
||||
}
|
||||
Reference in New Issue
Block a user