You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.9 KiB
54 lines
1.9 KiB
2 months ago
|
syntax = "proto3";
|
||
|
package comment;
|
||
|
option go_package = "comment";
|
||
|
|
||
|
import "user.proto";
|
||
|
|
||
|
message douyin_comment_action_request {
|
||
|
int64 user_id = 1; // 用户id
|
||
|
int64 video_id = 2; // 视频id
|
||
|
int32 action_type = 3; // 1-发布评论,2-删除评论
|
||
|
string comment_text = 4; // 用户填写的评论内容,在action_type=1的时候使用
|
||
|
int64 comment_id = 5; // 要删除的评论id,在action_type=2的时候使用
|
||
|
}
|
||
|
|
||
|
message douyin_comment_action_response {
|
||
|
int32 status_code = 1; // 状态码,0-成功,其他值-失败
|
||
|
string status_msg = 2; // 返回状态描述
|
||
|
Comment comment = 3; // 评论成功返回评论内容,不需要重新拉取整个列表
|
||
|
}
|
||
|
|
||
|
message douyin_comment_list_request {
|
||
|
int64 video_id = 1; // 视频id
|
||
|
}
|
||
|
|
||
|
message douyin_comment_list_response {
|
||
|
int32 status_code = 1; // 状态码,0-成功,其他值-失败
|
||
|
string status_msg = 2; // 返回状态描述
|
||
|
repeated Comment comment_list = 3; // 评论列表
|
||
|
}
|
||
|
|
||
|
message Comment {
|
||
|
int64 id = 1; // 视频评论id
|
||
|
user.User user =2; // 评论用户信息
|
||
|
string content = 3; // 评论内容
|
||
|
string create_date = 4; // 评论发布日期,格式 mm-dd
|
||
|
int64 like_count = 5; // 该评论的点赞数
|
||
|
int64 tease_count = 6; // 该评论diss数量
|
||
|
}
|
||
|
|
||
|
message douyin_comment_count_request {
|
||
|
repeated int64 video_id_list = 1; // 视频id所组成的列表
|
||
|
}
|
||
|
|
||
|
message douyin_comment_count_response {
|
||
|
int32 status_code = 1;
|
||
|
string status_msg = 2;
|
||
|
map<int64, int64> result = 3; // key为视频的id,value为该视频的评论数
|
||
|
}
|
||
|
|
||
|
service CommentService{
|
||
|
rpc CommentAction(douyin_comment_action_request) returns (douyin_comment_action_response); //评论操作
|
||
|
rpc CommentList(douyin_comment_list_request) returns (douyin_comment_list_response); //返回评论列表
|
||
|
rpc CommentCount(douyin_comment_count_request) returns (douyin_comment_count_response); // 返回一个视频列表中各自的评论数量
|
||
|
}
|