Files
2026-10-26 16:28:14 +08:00

65 lines
2.8 KiB
Go

package proto
import (
"time"
"videoweb/pub/common/response"
"videoweb/pub/pubdef"
)
type CommentListReq struct {
ObjectId int64 `form:"objectId" json:"objectId"` // 对象ID
ObjectType pubdef.CommentObjectType `form:"objectType" json:"objectType"` // 对象类型 0=视频 4=短剧 11=短剧剧集
SortOrder int64 `form:"sortOrder" json:"sortOrder"` // 排序 1=热门 2=最新 默认最新
pubdef.Page
}
type CommentListResp struct {
response.BasePageResp
}
type GetCommentListReq struct {
ObjectId int64 `form:"objectId" json:"objectId"` // 对象ID
ParentsId int64 `json:"parentsId" bson:"parentsId"` // 上级评论ID
pubdef.Page
}
type GetCommentListResp struct {
ObjectId int64 `json:"objectId" bson:"objectId"`
Total int64 `json:"total" bson:"total"` // 总数量
List []CommentInfo `json:"list" bson:"list"` // 数据
}
type CommentSendReq struct {
ObjectId int64 `json:"objectId" bson:"objectId"` // 对象ID
ObjectType pubdef.CommentObjectType `json:"objectType" bson:"objectType"` // 对象类型 0=视频 4=短剧 11=短剧剧集
ParentsId int64 `json:"parentsId" bson:"parentsId"` // 上级评论ID
Text string `json:"text" bson:"text"` // 评论内容
}
type CommentInfo struct {
Id int64 `json:"id" bson:"_id,omitempty"` // 评论ID
ObjectId int64 `json:"objectId" bson:"objectId"` // 对象ID
UserName string `json:"userName" bson:"userName"` // 用户名称
Avatar string `json:"avatar" bson:"avatar"` // 用户头像
Level int64 `json:"level" bson:"level"` // 评论级别
ParentsId int64 `json:"parentsId" bson:"parentsId"` // 上级评论ID
ReplyUserName string `json:"replyUserName" bson:"replyUserName"` // 回复名称
Text string `json:"text" bson:"text"` // 评论内容
CommentCount int64 `json:"commentCount" bson:"commentCount"` // 该评论回复数量
CountLike int64 `json:"countLike" bson:"countLike"` // 点赞数
IsLike bool `json:"isLike" bson:"-"` // 当前用户是否点赞
SubComment []CommentInfo `json:"subComment" bson:"subComment"` // 子评论
CreatedAt time.Time `bson:"createdAt" json:"createdAt"` // 创建时间
}
type CommentLikeSetReq struct {
CommentId int64 `json:"commentId" binding:"required"` // 评论ID
IsLike *bool `json:"isLike" binding:"required"` // 是否点赞
}
type CommentLikeSetResp struct {
CommentId int64 `json:"commentId"` // 评论ID
IsLike bool `json:"isLike"` // 当前点赞状态
CountLike int64 `json:"countLike"` // 点赞数
}