
syntax = "proto3";
package hello;

import "google/protobuf/empty.proto";
import "google/api/annotations.proto";

enum Status {
    UNKNOWN = 0;
    // 新创建
    NEW = 1;
  }

message InfoReq {
    int32 id = 1 [proto3_optional = true]; // id
    string user_name = 2 ; //  optional
}
message InfoResp {
    int32 ret_code = 1 [json_name = "retCode"];
    string ret_msg = 2  [json_name = "retMsg"];
    Status status = 3;
}

service API {
    rpc GetDemo(google.protobuf.Empty) returns (google.protobuf.Empty) {
        option (google.api.http) = {
            get: "/get"
            body: "*"
          };
    }
    rpc PostDemo(InfoReq) returns (InfoResp) {
        option (google.api.http) = {
            post: "/post"
        };
    }
    
}


message GetRequest {
    int64 id = 1;
    int64 external_id = 2;
    int32 external_type = 3;
  }

service API2 {
    // @method get
    // @redirect api/get-game
    rpc GetGame(GetRequest) returns (InfoResp);
    rpc BatchGetGame(GetRequest) returns (InfoResp);
}  