init
This commit is contained in:
24
Backend/api/forum/forum.if.go
Normal file
24
Backend/api/forum/forum.if.go
Normal file
@@ -0,0 +1,24 @@
|
||||
// =================================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// =================================================================================
|
||||
|
||||
package forum
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"leke/api/forum/v1"
|
||||
)
|
||||
|
||||
type IForumV1 interface {
|
||||
ForumCommentsCreate(ctx context.Context, req *v1.ForumCommentsCreateReq) (res *v1.ForumCommentsCreateRes, err error)
|
||||
ForumCommentsUpdate(ctx context.Context, req *v1.ForumCommentsUpdateReq) (res *v1.ForumCommentsUpdateRes, err error)
|
||||
ForumCommentsDelete(ctx context.Context, req *v1.ForumCommentsDeleteReq) (res *v1.ForumCommentsDeleteRes, err error)
|
||||
ForumCommentsView(ctx context.Context, req *v1.ForumCommentsViewReq) (res *v1.ForumCommentsViewRes, err error)
|
||||
ForumCommentsList(ctx context.Context, req *v1.ForumCommentsListReq) (res *v1.ForumCommentsListRes, err error)
|
||||
ForumPostsCreate(ctx context.Context, req *v1.ForumPostsCreateReq) (res *v1.ForumPostsCreateRes, err error)
|
||||
ForumPostsUpdate(ctx context.Context, req *v1.ForumPostsUpdateReq) (res *v1.ForumPostsUpdateRes, err error)
|
||||
ForumPostsDelete(ctx context.Context, req *v1.ForumPostsDeleteReq) (res *v1.ForumPostsDeleteRes, err error)
|
||||
ForumPostsView(ctx context.Context, req *v1.ForumPostsViewReq) (res *v1.ForumPostsViewRes, err error)
|
||||
ForumPostsList(ctx context.Context, req *v1.ForumPostsListReq) (res *v1.ForumPostsListRes, err error)
|
||||
}
|
||||
84
Backend/api/forum/v1/forum_comments.go
Normal file
84
Backend/api/forum/v1/forum_comments.go
Normal file
@@ -0,0 +1,84 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"leke/internal/model/response"
|
||||
)
|
||||
|
||||
// ForumCommentsCreateReq 创建评论请求
|
||||
type ForumCommentsCreateReq struct {
|
||||
g.Meta `path:"/forum/comments/create" method:"post" tags:"论坛评论" summary:"创建评论"`
|
||||
UserId uint64 `json:"userId" description:"评论发布者ID"`
|
||||
PostId uint64 `json:"postId" description:"所属帖子ID"`
|
||||
ParentId uint64 `json:"parentId" description:"父评论ID"`
|
||||
Content string `json:"content" description:"评论内容"`
|
||||
Status string `json:"status" description:"评论状态"`
|
||||
}
|
||||
|
||||
// ForumCommentsCreateRes 创建评论响应
|
||||
type ForumCommentsCreateRes struct {
|
||||
Id uint64 `json:"id" description:"评论ID"`
|
||||
}
|
||||
|
||||
// ForumCommentsUpdateReq 更新评论请求
|
||||
type ForumCommentsUpdateReq struct {
|
||||
g.Meta `path:"/forum/comments/update" method:"put" tags:"论坛评论" summary:"更新评论"`
|
||||
Id uint64 `json:"id" description:"评论ID"`
|
||||
UserId uint64 `json:"userId,omitempty" description:"评论发布者ID"`
|
||||
PostId uint64 `json:"postId,omitempty" description:"所属帖子ID"`
|
||||
ParentId uint64 `json:"parentId,omitempty" description:"父评论ID"`
|
||||
Content string `json:"content,omitempty" description:"评论内容"`
|
||||
Status string `json:"status,omitempty" description:"评论状态"`
|
||||
}
|
||||
|
||||
// ForumCommentsUpdateRes 更新评论响应
|
||||
type ForumCommentsUpdateRes struct {
|
||||
Id uint64 `json:"id" description:"评论ID"`
|
||||
}
|
||||
|
||||
// ForumCommentsDeleteReq 删除评论请求
|
||||
type ForumCommentsDeleteReq struct {
|
||||
g.Meta `path:"/forum/comments/delete" method:"delete" tags:"论坛评论" summary:"删除评论"`
|
||||
Id uint64 `json:"id" description:"评论ID"`
|
||||
}
|
||||
|
||||
// ForumCommentsDeleteRes 删除评论响应
|
||||
type ForumCommentsDeleteRes struct {
|
||||
}
|
||||
|
||||
// ForumCommentsViewReq 查看评论请求
|
||||
type ForumCommentsViewReq struct {
|
||||
g.Meta `path:"/forum/comments/view" method:"get" tags:"论坛评论" summary:"查看评论"`
|
||||
Id uint64 `json:"id" description:"评论ID"`
|
||||
}
|
||||
|
||||
// ForumCommentsViewRes 查看评论响应
|
||||
type ForumCommentsViewRes struct {
|
||||
Id uint64 `json:"id" description:"评论ID"`
|
||||
UserId uint64 `json:"userId" description:"评论发布者ID"`
|
||||
PostId uint64 `json:"postId" description:"所属帖子ID"`
|
||||
ParentId uint64 `json:"parentId" description:"父评论ID"`
|
||||
Content string `json:"content" description:"评论内容"`
|
||||
Status string `json:"status" description:"评论状态"`
|
||||
LikeCount uint `json:"likeCount" description:"点赞数"`
|
||||
ReplyCount uint `json:"replyCount" description:"回复数"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" description:"评论创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" description:"评论更新时间"`
|
||||
}
|
||||
|
||||
// ForumCommentsListReq 评论列表请求
|
||||
type ForumCommentsListReq struct {
|
||||
response.PageResult
|
||||
g.Meta `path:"/forum/comments/list" method:"get" tags:"论坛评论" summary:"评论列表"`
|
||||
UserId uint64 `json:"userId,omitempty" description:"评论发布者ID"`
|
||||
PostId uint64 `json:"postId,omitempty" description:"所属帖子ID"`
|
||||
ParentId uint64 `json:"parentId,omitempty" description:"父评论ID"`
|
||||
Status string `json:"status,omitempty" description:"评论状态"`
|
||||
}
|
||||
|
||||
// ForumCommentsListRes 评论列表响应
|
||||
type ForumCommentsListRes struct {
|
||||
response.PageResult
|
||||
List []*ForumCommentsViewRes `json:"list" description:"评论列表"`
|
||||
}
|
||||
84
Backend/api/forum/v1/forum_posts.go
Normal file
84
Backend/api/forum/v1/forum_posts.go
Normal file
@@ -0,0 +1,84 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"leke/internal/model/response"
|
||||
)
|
||||
|
||||
// ForumPostsCreateReq 创建帖子请求
|
||||
type ForumPostsCreateReq struct {
|
||||
g.Meta `path:"/forum/posts/create" method:"post" tags:"论坛帖子" summary:"创建帖子"`
|
||||
UserId uint64 `json:"userId" description:"发帖用户ID"`
|
||||
Title string `json:"title" description:"帖子标题"`
|
||||
Content string `json:"content" description:"帖子正文"`
|
||||
CoverImage string `json:"coverImage" description:"帖子封面图URL"`
|
||||
Status string `json:"status" description:"帖子状态"`
|
||||
}
|
||||
|
||||
// ForumPostsCreateRes 创建帖子响应
|
||||
type ForumPostsCreateRes struct {
|
||||
Id uint64 `json:"id" description:"帖子ID"`
|
||||
}
|
||||
|
||||
// ForumPostsUpdateReq 更新帖子请求
|
||||
type ForumPostsUpdateReq struct {
|
||||
g.Meta `path:"/forum/posts/update" method:"put" tags:"论坛帖子" summary:"更新帖子"`
|
||||
Id uint64 `json:"id" description:"帖子ID"`
|
||||
UserId uint64 `json:"userId,omitempty" description:"发帖用户ID"`
|
||||
Title string `json:"title,omitempty" description:"帖子标题"`
|
||||
Content string `json:"content,omitempty" description:"帖子正文"`
|
||||
CoverImage string `json:"coverImage,omitempty" description:"帖子封面图URL"`
|
||||
Status string `json:"status,omitempty" description:"帖子状态"`
|
||||
}
|
||||
|
||||
// ForumPostsUpdateRes 更新帖子响应
|
||||
type ForumPostsUpdateRes struct {
|
||||
Id uint64 `json:"id" description:"帖子ID"`
|
||||
}
|
||||
|
||||
// ForumPostsDeleteReq 删除帖子请求
|
||||
type ForumPostsDeleteReq struct {
|
||||
g.Meta `path:"/forum/posts/delete" method:"delete" tags:"论坛帖子" summary:"删除帖子"`
|
||||
Id uint64 `json:"id" description:"帖子ID"`
|
||||
}
|
||||
|
||||
// ForumPostsDeleteRes 删除帖子响应
|
||||
type ForumPostsDeleteRes struct {
|
||||
}
|
||||
|
||||
// ForumPostsViewReq 查看帖子请求
|
||||
type ForumPostsViewReq struct {
|
||||
g.Meta `path:"/forum/posts/view" method:"get" tags:"论坛帖子" summary:"查看帖子"`
|
||||
Id uint64 `json:"id" description:"帖子ID"`
|
||||
}
|
||||
|
||||
// ForumPostsViewRes 查看帖子响应
|
||||
type ForumPostsViewRes struct {
|
||||
Id uint64 `json:"id" description:"帖子ID"`
|
||||
UserId uint64 `json:"userId" description:"发帖用户ID"`
|
||||
Title string `json:"title" description:"帖子标题"`
|
||||
Content string `json:"content" description:"帖子正文"`
|
||||
CoverImage string `json:"coverImage" description:"帖子封面图URL"`
|
||||
Status string `json:"status" description:"帖子状态"`
|
||||
ViewCount uint `json:"viewCount" description:"浏览量"`
|
||||
LikeCount uint `json:"likeCount" description:"点赞数"`
|
||||
CommentCount uint `json:"commentCount" description:"评论数"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" description:"发帖时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" description:"更新时间"`
|
||||
}
|
||||
|
||||
// ForumPostsListReq 帖子列表请求
|
||||
type ForumPostsListReq struct {
|
||||
response.PageResult
|
||||
g.Meta `path:"/forum/posts/list" method:"get" tags:"论坛帖子" summary:"帖子列表"`
|
||||
UserId uint64 `json:"userId,omitempty" description:"发帖用户ID"`
|
||||
Title string `json:"title,omitempty" description:"帖子标题"`
|
||||
Status string `json:"status,omitempty" description:"帖子状态"`
|
||||
}
|
||||
|
||||
// ForumPostsListRes 帖子列表响应
|
||||
type ForumPostsListRes struct {
|
||||
response.PageResult
|
||||
List []*ForumPostsViewRes `json:"list" description:"帖子列表"`
|
||||
}
|
||||
Reference in New Issue
Block a user