34 lines
731 B
Protocol Buffer
34 lines
731 B
Protocol Buffer
syntax = "proto3";
|
|
package invite;
|
|
option go_package = "git.techease.ru/Smart-search/smart-search-back/pkg/pb/invite";
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
service InviteService {
|
|
rpc Generate(GenerateRequest) returns (GenerateResponse);
|
|
rpc GetInfo(GetInfoRequest) returns (GetInfoResponse);
|
|
}
|
|
|
|
message GenerateRequest {
|
|
int64 user_id = 1;
|
|
int32 ttl_days = 2;
|
|
int32 max_uses = 3;
|
|
}
|
|
|
|
message GenerateResponse {
|
|
string code = 1;
|
|
int32 max_uses = 2;
|
|
google.protobuf.Timestamp expires_at = 3;
|
|
}
|
|
|
|
message GetInfoRequest {
|
|
int64 user_id = 1;
|
|
}
|
|
|
|
message GetInfoResponse {
|
|
string code = 1;
|
|
int32 can_be_used_count = 2;
|
|
google.protobuf.Timestamp expires_at = 3;
|
|
google.protobuf.Timestamp created_at = 4;
|
|
}
|