syntax = "proto3";

import "google/protobuf/any.proto";
import "com/tzld/piaoquan/recommend/server/common.proto";

option java_multiple_files = true;
option java_package = "com.tzld.piaoquan.recommend.server.gen.recommend";
option java_generic_services = true;


message RecommendRequest {
  string request_id = 1;
  string mid = 2;
  string uid = 3;
  int32 size = 4; // default 4
  int32 app_type = 5; // default 4
  string city_code = 6;
  string province_code = 7;
  repeated string ab_exp_code = 8;
  map<string, string> event_id = 9;
  int32 version_audit_status = 10; // default 2
  string recommend_trace_id = 11;
  int64 video_id = 12;
  string city = 13;
  string province = 14;
  MachineInfoProto machine_info = 15;
  string new_exp_group = 16;
  string session_id = 17;
  string sub_session_id = 18;
  string page_source = 19;
  string category_id = 20;
  int64 hot_scene_type = 21;
  string client_ip = 22;
  int32 version_code = 23;
  string root_source_id = 24;
  int32 userShareDepth = 25; // default -1
  int32 pageNum = 26;
  string rootSessionId = 27;
  repeated VideoActionInfoProto share_list = 28;
  int64 request_video_id = 29;
  string current_page_source = 30;
  string openGId = 31;
  string union_id = 32;
}

message MachineInfoProto {
  string brand = 1;
  // NZA-AL00
  string model = 2;
  // android
  string platform = 3;
  // 3.2.4
  string sdk_version = 4;
  // Android 10
  string system = 5;
  // 8.0.43
  string wechat_version = 6;
}

// https://sls.console.aliyun.com/lognext/project/rov-server/logsearch/info
message RecommendResponse {
  Result result = 1;
  repeated VideoProto video = 2;
}

// RecommendRovVideoDTO
message VideoProto{
  int64 video_id = 1;
  double rov_score = 2;
  string push_from = 3;
  string ab_code = 4;
  double sort_score = 5;
  int32 position = 6;
  string flow_pool = 7;
  int32 is_in_flow_pool = 8;
  double rand = 9;
  repeated PushFromIndex push_from_index = 10;
}

message PushFromIndex {
  string push_from = 1;
  repeated string index = 2;
}

message VideoActionInfoProto{
  int64 video_id = 1;
  int64 ts = 2;
}

service RecommendService {
  // 首页推荐和tab分类 /applet/video/homepage/recommend
  rpc HomepageRecommend (RecommendRequest) returns (RecommendResponse);
  rpc RelevantRecommend (RecommendRequest) returns (RecommendResponse);

}