Files
TrangleAgent/Backend/api/forum/v1/forum_comments.go

69 lines
2.1 KiB
Go
Raw Normal View History

2026-01-18 18:20:40 +08:00
package v1
import (
2026-02-05 21:35:42 +08:00
"TrangleAgent/internal/model"
2026-01-18 19:07:41 +08:00
"TrangleAgent/internal/model/response"
2026-02-05 21:35:42 +08:00
"github.com/gogf/gf/v2/frame/g"
2026-01-18 18:20:40 +08:00
)
// ForumCommentsCreateReq 创建评论请求
type ForumCommentsCreateReq struct {
2026-02-05 21:35:42 +08:00
g.Meta `path:"/forum/comments/create" method:"post" tags:"论坛评论" summary:"创建评论"`
model.ForumComment
2026-01-18 18:20:40 +08:00
}
// ForumCommentsCreateRes 创建评论响应
type ForumCommentsCreateRes struct {
Id uint64 `json:"id" description:"评论ID"`
}
// ForumCommentsUpdateReq 更新评论请求
type ForumCommentsUpdateReq struct {
2026-02-05 21:35:42 +08:00
g.Meta `path:"/forum/comments/update" method:"put" tags:"论坛评论" summary:"更新评论"`
Id uint64 `json:"id" description:"评论ID"`
model.ForumComment
2026-01-18 18:20:40 +08:00
}
// 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 {
2026-02-05 21:35:42 +08:00
model.ForumCommentViewParams
2026-01-18 18:20:40 +08:00
}
// ForumCommentsListReq 评论列表请求
type ForumCommentsListReq struct {
response.PageResult
g.Meta `path:"/forum/comments/list" method:"get" tags:"论坛评论" summary:"评论列表"`
2026-02-05 21:35:42 +08:00
UserId uint64 `json:"userId,omitempty" description:"评论发布者ID"`
PostId uint64 `json:"postId,omitempty" description:"所属帖子ID"`
2026-01-18 18:20:40 +08:00
ParentId uint64 `json:"parentId,omitempty" description:"父评论ID"`
Status string `json:"status,omitempty" description:"评论状态"`
}
// ForumCommentsListRes 评论列表响应
type ForumCommentsListRes struct {
response.PageResult
2026-02-05 21:35:42 +08:00
List []*model.ForumCommentViewParams `json:"list" description:"评论列表"`
2026-01-18 18:20:40 +08:00
}