syntax = "proto3"; package crabs.evening_detective_server; import "google/api/annotations.proto"; import "google/protobuf/timestamp.proto"; import "protoc-gen-openapiv2/options/annotations.proto"; option go_package = "pkg/proto"; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { info: { title : "Документация сервиса \"Вечерний детектив\""; version: "v0.1.0"; }; security_definitions: { security: { key : "BearerAuth"; value: { type : TYPE_API_KEY; in : IN_HEADER; name : "Authorization"; description: "Authentication token, prefixed by Bearer: Bearer "; } } } security: { security_requirement: { key : "BearerAuth"; value: {}; } } }; service EveningDetectiveServer { rpc Ping(PingReq) returns (PingRsp) { option (google.api.http) = { get: "/api/ping" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { security: { security_requirement: {} } }; } rpc Echo(EchoReq) returns (EchoRsp) { option (google.api.http) = { post: "/api/echo" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { security: { security_requirement: {} } }; } rpc Signup(SignupReq) returns (SignupRsp) { option (google.api.http) = { post: "/api/signup" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { security: { security_requirement: {} } }; } rpc RefreshPassword(RefreshPasswordReq) returns (RefreshPasswordRsp) { option (google.api.http) = { post: "/api/refresh-password" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { security: { security_requirement: {} } }; } rpc Login(LoginReq) returns (LoginRsp) { option (google.api.http) = { post: "/api/login" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { security: { security_requirement: {} } }; } rpc Refresh(RefreshReq) returns (RefreshRsp) { option (google.api.http) = { post: "/api/refresh" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { security: { security_requirement: {} } }; } rpc GetUsers(GetUsersReq) returns (GetUsersRsp) { option (google.api.http) = { get: "/api/users" }; } } message PingReq {} message PingRsp {} message EchoReq { string text = 1; } message EchoRsp { string text = 1; } message SignupReq { string username = 1; string email = 2; } message SignupRsp { string error = 1; } message RefreshPasswordReq { string email = 1; } message RefreshPasswordRsp { string error = 1; } message LoginReq { string email = 1; string password = 2; } message LoginRsp { string error = 1; string accessToken = 2; string refreshToken = 3; } message RefreshReq { string refreshToken = 1; } message RefreshRsp { string error = 1; string accessToken = 2; string refreshToken = 3; } message GetUsersReq {} message GetUsersRsp { string error = 1; repeated User users = 2; } message User { int32 id = 1; string username = 2; string email = 3; repeated string roles = 4; bool is_active = 5; google.protobuf.Timestamp created_at = 6; }