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 favorite;
|
||
|
option go_package = "favorite";
|
||
|
|
||
|
import "feed.proto";
|
||
|
|
||
|
message douyin_favorite_action_request {
|
||
|
int64 user_id = 1; // 用户id
|
||
|
int64 video_id = 2; // 视频id
|
||
|
int32 action_type = 3; // 1-点赞,2-取消点赞
|
||
|
}
|
||
|
|
||
|
message douyin_favorite_action_response {
|
||
|
int32 status_code = 1; // 状态码,0-成功,其他值-失败
|
||
|
string status_msg = 2; // 返回状态描述
|
||
|
}
|
||
|
|
||
|
message douyin_favorite_list_request {
|
||
|
int64 user_id = 1; // 用户id
|
||
|
}
|
||
|
|
||
|
message douyin_favorite_list_response {
|
||
|
int32 status_code = 1; // 状态码,0-成功,其他值-失败
|
||
|
string status_msg = 2; // 返回状态描述
|
||
|
repeated feed.Video video_list = 3; // 用户点赞视频列表
|
||
|
}
|
||
|
|
||
|
message douyin_is_favorite_request {
|
||
|
int64 user_id = 1; // 要判断的主要用户
|
||
|
repeated int64 video_id_list = 2; // 要判断的视频列表
|
||
|
}
|
||
|
|
||
|
message douyin_is_favorite_response {
|
||
|
int32 status_code = 1;
|
||
|
string status_msg = 2;
|
||
|
map<int64, bool> result = 3; // key为视频id,value为是否存在喜欢关系
|
||
|
}
|
||
|
|
||
|
message douyin_favorite_count_request {
|
||
|
repeated int64 video_id_list = 1; // 视频id所组成的列表
|
||
|
}
|
||
|
|
||
|
message douyin_favorite_count_response {
|
||
|
int32 status_code = 1;
|
||
|
string status_msg = 2;
|
||
|
map<int64, int64> result = 3; // key为视频的id,value为该视频的点赞数
|
||
|
}
|
||
|
|
||
|
service FavoriteService{
|
||
|
rpc FavoriteAction(douyin_favorite_action_request) returns (douyin_favorite_action_response); //点赞或取消点赞
|
||
|
rpc FavoriteList(douyin_favorite_list_request) returns (douyin_favorite_list_response); // 返回点赞视频列表
|
||
|
rpc IsFavorite(douyin_is_favorite_request) returns (douyin_is_favorite_response); // 判断用户对视频是否有喜欢关系
|
||
|
rpc FavoriteCount(douyin_favorite_count_request) returns (douyin_favorite_count_response); // 返回一个视频列表中每个视频的点赞数
|
||
|
}
|