Files
2026-11-07 10:47:32 +08:00

66 lines
3.3 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.
package proto
import (
"time"
"videoweb/pub/pubdef"
)
// GetCommentListReq 评论列表请求
type GetCommentListReq struct {
ObjectId int64 `form:"objectId" json:"objectId" binding:"required"` // 对象ID(短剧id 短剧剧集id 视频id)
ObjectType int64 `form:"objectType" json:"objectType" binding:"required"` // 对象类型 10-短剧 11-短剧剧集 20-视频
SortOrder int64 `form:"sortOrder" json:"sortOrder"` // 排序 1-热门,按点赞数倒序 2-最新,按创建时间倒序
pubdef.Page
}
// GetCommentListResp 评论列表响应
type GetCommentListResp struct {
ObjectId int64 `json:"objectId"` // 对象ID
TotalCount int64 `json:"totalCount"` // 总数量
PageSize int `json:"pageSize"` // 每页数
PageNum int `json:"pageNum"` // 页数
List []CommentInfo `json:"list"` // 数据
}
// CommentSendReq 评论发布请求
type CommentSendReq struct {
ObjectId int64 `json:"objectId"` // 对象ID,短剧评论传短剧ID,剧集评论传剧集ID,视频评论传视频ID
ObjectType int64 `json:"objectType"` // 对象类型 10-短剧 11-短剧剧集 20-视频
ParentsId int64 `json:"parentsId"` // 一级评论ID,0-发布一级评论,大于0-发布二级评论
ReplyCommentId int64 `json:"replyCommentId"` // 被回复评论ID,0时默认回复parentsId
Text string `json:"text"` // 评论内容
}
// CommentLikeSetReq 评论点赞设置请求
type CommentLikeSetReq struct {
CommentId int64 `json:"commentId" binding:"required"` // 评论ID
IsLike *bool `json:"isLike" binding:"required"` // 是否点赞,true-点赞,false-取消点赞
}
// CommentLikeSetResp 评论点赞设置响应
type CommentLikeSetResp struct {
CommentId int64 `json:"commentId"` // 评论ID
IsLike int64 `json:"isLike"` // 点赞状态 1-已点赞 2-未点赞
CountLike int64 `json:"countLike"` // 评论点赞数
}
// CommentInfo 评论信息
type CommentInfo struct {
Id int64 `json:"id"` // 评论ID
ObjectId int64 `json:"objectId"` // 对象ID
ObjectType int64 `json:"objectType"` // 对象类型 10-短剧 11-短剧剧集 20-视频
UserId int64 `json:"userId"` // 评论用户ID
UserName string `json:"userName"` // 用户名称
UserAvatar string `json:"userAvatar"` // 用户头像,已拼接图片域名
Text string `json:"text"` // 评论内容
Level int64 `json:"level"` // 评论级别 1-一级评论 2-二级评论
ParentsId int64 `json:"parentsId"` // 父评论ID,一级评论为0
ReplyCommentId int64 `json:"replyCommentId"` // 被回复评论ID,一级评论为0
ReplyUserName string `json:"replyUserName"` // 被回复用户昵称
CommentCount int64 `json:"commentCount"` // 二级评论数量
CountLike int64 `json:"countLike"` // 评论点赞数
IsLike int64 `json:"isLike"` // 当前用户点赞状态 1-已点赞 2-未点赞
CreatedAt time.Time `json:"createdAt"` // 创建时间
Children []CommentInfo `json:"children"` // 二级评论列表
}