syntax = "proto3";

package com.vng.zlb.scribelog.grpc.lib;

option java_multiple_files = true;
option java_package = "com.vng.zlb.scribelog.grpc.lib";
option java_outer_classname = "ScribeLogProto";

// The greeting service definition.

service ScribeLogService {
  rpc sendLog (LogEntryRequest) returns (LogEntryResult) {
  }

  rpc sendMultiLog(ListOfEntryRequest) returns (LogEntryResult) {
  }

  rpc sendActionLog(ActionLogRequest) returns (LogEntryResult) {
  }

  rpc sendMultiActionLog(ListOfActionLogRequest) returns (LogEntryResult) {
  }
  
  rpc sendMultiLogV2(ListOfEntryRequest) returns (LogEntryResult) {
  }

  rpc pingPong(Ping) returns (Pong) {}
}

message Ping {
  int64 count = 1;
}

message Pong {
  int64 count = 1;
}

message ListOfEntryRequest {
  repeated LogEntryRequest logEntryRequest = 1;
}

message ListOfActionLogRequest {
  repeated ActionLogRequest actionLogRequest = 1;
}

message ActionLogRequest {
  int64 timestamp = 1;
  string json_param = 2;
}

// The request message containing the user's name.
message LogEntryRequest {
  int64 timestamp = 1;
  string category = 2;
  string app_name = 3;
  string app_prop = 4;
  LogEntry log_entry = 5;
}

// The response message containing the greetings
message LogEntryResult {
  int32 error = 1;
  string error_message = 2;
}

message LogEntry {
  string ip = 1;
  int32 src_id = 2;
  int32 des_id = 3;
  uint32 command = 4;
  uint32 sub_command = 5;
  int32 result = 6;
  int64 start_time = 7;
  int64 execute_time = 8;
  string json_param = 9;
  string json_ext_param = 10;

  uint32 client_type = 11;
  int32 client_version = 12;
  uint32 type = 13;

  string dp_log = 14;
  string dp_cate = 15;
}
