Files
zmkgC/api/v1/system/comments.go
2025-07-07 20:11:59 +08:00

116 lines
4.0 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// ==========================================================================
// GFast自动生成api操作代码。
// 生成日期2024-04-23 14:47:24
// 生成路径: api/v1/system/comments.go
// 生成人gfast
// desc:App通知公告评论相关参数
// company:云南奇讯科技有限公司
// ==========================================================================
package system
import (
"github.com/gogf/gf/v2/frame/g"
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"
"github.com/tiger1103/gfast/v3/internal/app/system/model"
)
// CommentsSearchReq 分页请求参数
type CommentsSearchReq struct {
g.Meta `path:"/list" tags:"App通知公告评论" method:"get" summary:"App通知公告评论列表"`
Id string `p:"id"` // 主键
NotificationId string `p:"notificationId" v:"notificationId@integer#关联的通知ID需为整数"` // 关联的通知ID
CommentText string `p:"commentText"` // 评论内容
CommentId string `p:"commentId"` // 用户ID
CreatedAt string `p:"createdAt" v:"createdAt@datetime#需为YYYY-MM-DD hh:mm:ss格式"` //
commonApi.PageReq
commonApi.Author
}
// CommentsSearchRes 列表返回结果
type CommentsSearchRes struct {
g.Meta `mime:"application/json"`
commonApi.ListRes
List []*model.CommentsInfoRes `json:"list"`
}
// CommentsAddReq 添加操作请求参数
type CommentsAddReq struct {
g.Meta `path:"/add" tags:"App通知公告评论" method:"post" summary:"App通知公告评论添加"`
commonApi.Author
NotificationId int `p:"notificationId" `
CommentText string `p:"commentText" `
CommentId string `p:"commentId" `
}
// CommentsAddRes 添加操作返回结果
type CommentsAddRes struct {
commonApi.EmptyRes
}
// CommentsEditReq 修改操作请求参数
type CommentsEditReq struct {
g.Meta `path:"/edit" tags:"App通知公告评论" method:"put" summary:"App通知公告评论修改"`
commonApi.Author
Id uint `p:"id" v:"required#主键ID不能为空"`
NotificationId int `p:"notificationId" `
CommentText string `p:"commentText" `
CommentId string `p:"commentId" `
}
// CommentsEditRes 修改操作返回结果
type CommentsEditRes struct {
commonApi.EmptyRes
}
// CommentsGetReq 获取一条数据请求
type CommentsGetReq struct {
g.Meta `path:"/get" tags:"App通知公告评论" method:"get" summary:"获取App通知公告评论信息"`
commonApi.Author
Id uint `p:"id" v:"required#主键必须"` // 通过主键获取
}
// CommentsGetRes 获取一条数据结果
type CommentsGetRes struct {
g.Meta `mime:"application/json"`
*model.CommentsInfoRes
}
// CommentsDeleteReq 删除数据请求
type CommentsDeleteReq struct {
g.Meta `path:"/delete" tags:"App通知公告评论" method:"delete" summary:"删除App通知公告评论"`
commonApi.Author
Ids []uint `p:"ids" v:"required#主键必须"` // 通过主键删除
}
// CommentsDeleteRes 删除数据返回
type CommentsDeleteRes struct {
commonApi.EmptyRes
}
// CommentsPublishReq 发布一条评论
type CommentsPublishReq struct {
g.Meta `path:"/publish" tags:"App" method:"post" summary:"发布App通知公告评论"`
commonApi.Author
NotificationId int `p:"notificationId" v:"required#公告ID不能为空" dc:"通知的ID"` // 通知ID
CommentText string `p:"commentText" dc:"评论的正文内容"` // 评论内容
}
type CommentsPublishRes struct {
commonApi.EmptyRes
}
// 获取一个指定通知公告的评论列表
type CommentsGetListByNotificationIdReq struct {
g.Meta `path:"/getByNotificationId" tags:"App" method:"get" summary:"获取指定通知公告下的评论列表"`
commonApi.Author
commonApi.PageReq
NotificationId int `p:"notificationId" v:"required#通知ID不能为空" dc:"通知公告的ID"` // 通知ID
}
type CommentsGetListByNotificationIdRes struct {
g.Meta `mime:"application/json"`
commonApi.ListRes
List []*model.CommentsListRes `json:"list"`
}