mirror of
https://github.com/aykhans/slash-e.git
synced 2025-06-15 12:27:49 +00:00
feat: add subscription service
This commit is contained in:
51
proto/api/v2/subscription_service.proto
Normal file
51
proto/api/v2/subscription_service.proto
Normal file
@ -0,0 +1,51 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package slash.api.v2;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/field_behavior.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
option go_package = "gen/api/v2";
|
||||
|
||||
service SubscriptionService {
|
||||
rpc GetSubscription(GetSubscriptionRequest) returns (GetSubscriptionResponse) {
|
||||
option (google.api.http) = {get: "/v1/subscription"};
|
||||
}
|
||||
rpc UpdateSubscription(UpdateSubscriptionRequest) returns (UpdateSubscriptionResponse) {
|
||||
option (google.api.http) = {
|
||||
patch: "/v1/subscription"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message Subscription {
|
||||
PlanType plan = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
|
||||
google.protobuf.Timestamp started_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
|
||||
google.protobuf.Timestamp expires_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
|
||||
}
|
||||
|
||||
enum PlanType {
|
||||
PLAN_TYPE_UNSPECIFIED = 0;
|
||||
|
||||
FREE = 1;
|
||||
|
||||
PRO = 2;
|
||||
}
|
||||
|
||||
message GetSubscriptionRequest {}
|
||||
|
||||
message GetSubscriptionResponse {
|
||||
Subscription subscription = 1;
|
||||
}
|
||||
|
||||
message UpdateSubscriptionRequest {
|
||||
string license_key = 1 [(google.api.field_behavior) = REQUIRED];
|
||||
}
|
||||
|
||||
message UpdateSubscriptionResponse {
|
||||
Subscription subscription = 1;
|
||||
}
|
Reference in New Issue
Block a user