draft grpc
This commit is contained in:
104
proto/app/v1/account.proto
Normal file
104
proto/app/v1/account.proto
Normal file
@@ -0,0 +1,104 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package stream.app.v1;
|
||||
|
||||
option go_package = "stream.api/internal/gen/proto/app/v1;appv1";
|
||||
|
||||
import "app/v1/common.proto";
|
||||
|
||||
service AccountService {
|
||||
rpc GetMe(GetMeRequest) returns (GetMeResponse);
|
||||
rpc UpdateMe(UpdateMeRequest) returns (UpdateMeResponse);
|
||||
rpc DeleteMe(DeleteMeRequest) returns (MessageResponse);
|
||||
rpc ClearMyData(ClearMyDataRequest) returns (MessageResponse);
|
||||
}
|
||||
|
||||
service PreferencesService {
|
||||
rpc GetPreferences(GetPreferencesRequest) returns (GetPreferencesResponse);
|
||||
rpc UpdatePreferences(UpdatePreferencesRequest) returns (UpdatePreferencesResponse);
|
||||
}
|
||||
|
||||
service UsageService {
|
||||
rpc GetUsage(GetUsageRequest) returns (GetUsageResponse);
|
||||
}
|
||||
|
||||
service NotificationsService {
|
||||
rpc ListNotifications(ListNotificationsRequest) returns (ListNotificationsResponse);
|
||||
rpc MarkNotificationRead(MarkNotificationReadRequest) returns (MessageResponse);
|
||||
rpc MarkAllNotificationsRead(MarkAllNotificationsReadRequest) returns (MessageResponse);
|
||||
rpc DeleteNotification(DeleteNotificationRequest) returns (MessageResponse);
|
||||
rpc ClearNotifications(ClearNotificationsRequest) returns (MessageResponse);
|
||||
}
|
||||
|
||||
message GetMeRequest {}
|
||||
|
||||
message GetMeResponse {
|
||||
User user = 1;
|
||||
}
|
||||
|
||||
message UpdateMeRequest {
|
||||
optional string username = 1;
|
||||
optional string email = 2;
|
||||
optional string language = 3;
|
||||
optional string locale = 4;
|
||||
}
|
||||
|
||||
message UpdateMeResponse {
|
||||
User user = 1;
|
||||
}
|
||||
|
||||
message DeleteMeRequest {}
|
||||
|
||||
message ClearMyDataRequest {}
|
||||
|
||||
message GetPreferencesRequest {}
|
||||
|
||||
message GetPreferencesResponse {
|
||||
Preferences preferences = 1;
|
||||
}
|
||||
|
||||
message UpdatePreferencesRequest {
|
||||
optional bool email_notifications = 1;
|
||||
optional bool push_notifications = 2;
|
||||
optional bool marketing_notifications = 3;
|
||||
optional bool telegram_notifications = 4;
|
||||
optional bool autoplay = 5;
|
||||
optional bool loop = 6;
|
||||
optional bool muted = 7;
|
||||
optional bool show_controls = 8;
|
||||
optional bool pip = 9;
|
||||
optional bool airplay = 10;
|
||||
optional bool chromecast = 11;
|
||||
optional string language = 12;
|
||||
optional string locale = 13;
|
||||
}
|
||||
|
||||
message UpdatePreferencesResponse {
|
||||
Preferences preferences = 1;
|
||||
}
|
||||
|
||||
message GetUsageRequest {}
|
||||
|
||||
message GetUsageResponse {
|
||||
string user_id = 1;
|
||||
int64 total_videos = 2;
|
||||
int64 total_storage = 3;
|
||||
}
|
||||
|
||||
message ListNotificationsRequest {}
|
||||
|
||||
message ListNotificationsResponse {
|
||||
repeated Notification notifications = 1;
|
||||
}
|
||||
|
||||
message MarkNotificationReadRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message MarkAllNotificationsReadRequest {}
|
||||
|
||||
message DeleteNotificationRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message ClearNotificationsRequest {}
|
||||
399
proto/app/v1/admin.proto
Normal file
399
proto/app/v1/admin.proto
Normal file
@@ -0,0 +1,399 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package stream.app.v1;
|
||||
|
||||
option go_package = "stream.api/internal/gen/proto/app/v1;appv1";
|
||||
|
||||
import "app/v1/common.proto";
|
||||
|
||||
service AdminService {
|
||||
rpc GetAdminDashboard(GetAdminDashboardRequest) returns (GetAdminDashboardResponse);
|
||||
rpc ListAdminUsers(ListAdminUsersRequest) returns (ListAdminUsersResponse);
|
||||
rpc GetAdminUser(GetAdminUserRequest) returns (GetAdminUserResponse);
|
||||
rpc CreateAdminUser(CreateAdminUserRequest) returns (CreateAdminUserResponse);
|
||||
rpc UpdateAdminUser(UpdateAdminUserRequest) returns (UpdateAdminUserResponse);
|
||||
rpc UpdateAdminUserRole(UpdateAdminUserRoleRequest) returns (UpdateAdminUserRoleResponse);
|
||||
rpc DeleteAdminUser(DeleteAdminUserRequest) returns (MessageResponse);
|
||||
rpc ListAdminVideos(ListAdminVideosRequest) returns (ListAdminVideosResponse);
|
||||
rpc GetAdminVideo(GetAdminVideoRequest) returns (GetAdminVideoResponse);
|
||||
rpc CreateAdminVideo(CreateAdminVideoRequest) returns (CreateAdminVideoResponse);
|
||||
rpc UpdateAdminVideo(UpdateAdminVideoRequest) returns (UpdateAdminVideoResponse);
|
||||
rpc DeleteAdminVideo(DeleteAdminVideoRequest) returns (MessageResponse);
|
||||
rpc ListAdminPayments(ListAdminPaymentsRequest) returns (ListAdminPaymentsResponse);
|
||||
rpc GetAdminPayment(GetAdminPaymentRequest) returns (GetAdminPaymentResponse);
|
||||
rpc CreateAdminPayment(CreateAdminPaymentRequest) returns (CreateAdminPaymentResponse);
|
||||
rpc UpdateAdminPayment(UpdateAdminPaymentRequest) returns (UpdateAdminPaymentResponse);
|
||||
rpc ListAdminPlans(ListAdminPlansRequest) returns (ListAdminPlansResponse);
|
||||
rpc CreateAdminPlan(CreateAdminPlanRequest) returns (CreateAdminPlanResponse);
|
||||
rpc UpdateAdminPlan(UpdateAdminPlanRequest) returns (UpdateAdminPlanResponse);
|
||||
rpc DeleteAdminPlan(DeleteAdminPlanRequest) returns (DeleteAdminPlanResponse);
|
||||
rpc ListAdminAdTemplates(ListAdminAdTemplatesRequest) returns (ListAdminAdTemplatesResponse);
|
||||
rpc GetAdminAdTemplate(GetAdminAdTemplateRequest) returns (GetAdminAdTemplateResponse);
|
||||
rpc CreateAdminAdTemplate(CreateAdminAdTemplateRequest) returns (CreateAdminAdTemplateResponse);
|
||||
rpc UpdateAdminAdTemplate(UpdateAdminAdTemplateRequest) returns (UpdateAdminAdTemplateResponse);
|
||||
rpc DeleteAdminAdTemplate(DeleteAdminAdTemplateRequest) returns (MessageResponse);
|
||||
rpc ListAdminJobs(ListAdminJobsRequest) returns (ListAdminJobsResponse);
|
||||
rpc GetAdminJob(GetAdminJobRequest) returns (GetAdminJobResponse);
|
||||
rpc GetAdminJobLogs(GetAdminJobLogsRequest) returns (GetAdminJobLogsResponse);
|
||||
rpc CreateAdminJob(CreateAdminJobRequest) returns (CreateAdminJobResponse);
|
||||
rpc CancelAdminJob(CancelAdminJobRequest) returns (CancelAdminJobResponse);
|
||||
rpc RetryAdminJob(RetryAdminJobRequest) returns (RetryAdminJobResponse);
|
||||
rpc ListAdminAgents(ListAdminAgentsRequest) returns (ListAdminAgentsResponse);
|
||||
rpc RestartAdminAgent(RestartAdminAgentRequest) returns (AdminAgentCommandResponse);
|
||||
rpc UpdateAdminAgent(UpdateAdminAgentRequest) returns (AdminAgentCommandResponse);
|
||||
}
|
||||
|
||||
message GetAdminDashboardRequest {}
|
||||
|
||||
message GetAdminDashboardResponse {
|
||||
AdminDashboard dashboard = 1;
|
||||
}
|
||||
|
||||
message ListAdminUsersRequest {
|
||||
int32 page = 1;
|
||||
int32 limit = 2;
|
||||
optional string search = 3;
|
||||
optional string role = 4;
|
||||
}
|
||||
|
||||
message ListAdminUsersResponse {
|
||||
repeated AdminUser users = 1;
|
||||
int64 total = 2;
|
||||
int32 page = 3;
|
||||
int32 limit = 4;
|
||||
}
|
||||
|
||||
message GetAdminUserRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message GetAdminUserResponse {
|
||||
AdminUserDetail user = 1;
|
||||
}
|
||||
|
||||
message CreateAdminUserRequest {
|
||||
string email = 1;
|
||||
optional string username = 2;
|
||||
string password = 3;
|
||||
optional string role = 4;
|
||||
optional string plan_id = 5;
|
||||
}
|
||||
|
||||
message CreateAdminUserResponse {
|
||||
AdminUser user = 1;
|
||||
}
|
||||
|
||||
message UpdateAdminUserRequest {
|
||||
string id = 1;
|
||||
optional string email = 2;
|
||||
optional string username = 3;
|
||||
optional string password = 4;
|
||||
optional string role = 5;
|
||||
optional string plan_id = 6;
|
||||
}
|
||||
|
||||
message UpdateAdminUserResponse {
|
||||
AdminUser user = 1;
|
||||
}
|
||||
|
||||
message UpdateAdminUserRoleRequest {
|
||||
string id = 1;
|
||||
string role = 2;
|
||||
}
|
||||
|
||||
message UpdateAdminUserRoleResponse {
|
||||
string message = 1;
|
||||
string role = 2;
|
||||
}
|
||||
|
||||
message DeleteAdminUserRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message ListAdminVideosRequest {
|
||||
int32 page = 1;
|
||||
int32 limit = 2;
|
||||
optional string search = 3;
|
||||
optional string user_id = 4;
|
||||
optional string status = 5;
|
||||
}
|
||||
|
||||
message ListAdminVideosResponse {
|
||||
repeated AdminVideo videos = 1;
|
||||
int64 total = 2;
|
||||
int32 page = 3;
|
||||
int32 limit = 4;
|
||||
}
|
||||
|
||||
message GetAdminVideoRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message GetAdminVideoResponse {
|
||||
AdminVideo video = 1;
|
||||
}
|
||||
|
||||
message CreateAdminVideoRequest {
|
||||
string user_id = 1;
|
||||
string title = 2;
|
||||
optional string description = 3;
|
||||
string url = 4;
|
||||
int64 size = 5;
|
||||
int32 duration = 6;
|
||||
optional string format = 7;
|
||||
optional string status = 8;
|
||||
optional string ad_template_id = 9;
|
||||
}
|
||||
|
||||
message CreateAdminVideoResponse {
|
||||
AdminVideo video = 1;
|
||||
}
|
||||
|
||||
message UpdateAdminVideoRequest {
|
||||
string id = 1;
|
||||
string user_id = 2;
|
||||
string title = 3;
|
||||
optional string description = 4;
|
||||
string url = 5;
|
||||
int64 size = 6;
|
||||
int32 duration = 7;
|
||||
optional string format = 8;
|
||||
optional string status = 9;
|
||||
optional string ad_template_id = 10;
|
||||
}
|
||||
|
||||
message UpdateAdminVideoResponse {
|
||||
AdminVideo video = 1;
|
||||
}
|
||||
|
||||
message DeleteAdminVideoRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message ListAdminPaymentsRequest {
|
||||
int32 page = 1;
|
||||
int32 limit = 2;
|
||||
optional string user_id = 3;
|
||||
optional string status = 4;
|
||||
}
|
||||
|
||||
message ListAdminPaymentsResponse {
|
||||
repeated AdminPayment payments = 1;
|
||||
int64 total = 2;
|
||||
int32 page = 3;
|
||||
int32 limit = 4;
|
||||
}
|
||||
|
||||
message GetAdminPaymentRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message GetAdminPaymentResponse {
|
||||
AdminPayment payment = 1;
|
||||
}
|
||||
|
||||
message CreateAdminPaymentRequest {
|
||||
string user_id = 1;
|
||||
string plan_id = 2;
|
||||
int32 term_months = 3;
|
||||
string payment_method = 4;
|
||||
optional double topup_amount = 5;
|
||||
}
|
||||
|
||||
message CreateAdminPaymentResponse {
|
||||
AdminPayment payment = 1;
|
||||
PlanSubscription subscription = 2;
|
||||
double wallet_balance = 3;
|
||||
string invoice_id = 4;
|
||||
}
|
||||
|
||||
message UpdateAdminPaymentRequest {
|
||||
string id = 1;
|
||||
string status = 2;
|
||||
}
|
||||
|
||||
message UpdateAdminPaymentResponse {
|
||||
AdminPayment payment = 1;
|
||||
}
|
||||
|
||||
message ListAdminPlansRequest {}
|
||||
|
||||
message ListAdminPlansResponse {
|
||||
repeated AdminPlan plans = 1;
|
||||
}
|
||||
|
||||
message CreateAdminPlanRequest {
|
||||
string name = 1;
|
||||
optional string description = 2;
|
||||
repeated string features = 3;
|
||||
double price = 4;
|
||||
string cycle = 5;
|
||||
int64 storage_limit = 6;
|
||||
int32 upload_limit = 7;
|
||||
optional bool is_active = 8;
|
||||
}
|
||||
|
||||
message CreateAdminPlanResponse {
|
||||
AdminPlan plan = 1;
|
||||
}
|
||||
|
||||
message UpdateAdminPlanRequest {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
optional string description = 3;
|
||||
repeated string features = 4;
|
||||
double price = 5;
|
||||
string cycle = 6;
|
||||
int64 storage_limit = 7;
|
||||
int32 upload_limit = 8;
|
||||
optional bool is_active = 9;
|
||||
}
|
||||
|
||||
message UpdateAdminPlanResponse {
|
||||
AdminPlan plan = 1;
|
||||
}
|
||||
|
||||
message DeleteAdminPlanRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message DeleteAdminPlanResponse {
|
||||
string message = 1;
|
||||
string mode = 2;
|
||||
}
|
||||
|
||||
message ListAdminAdTemplatesRequest {
|
||||
int32 page = 1;
|
||||
int32 limit = 2;
|
||||
optional string user_id = 3;
|
||||
optional string search = 4;
|
||||
}
|
||||
|
||||
message ListAdminAdTemplatesResponse {
|
||||
repeated AdminAdTemplate templates = 1;
|
||||
int64 total = 2;
|
||||
int32 page = 3;
|
||||
int32 limit = 4;
|
||||
}
|
||||
|
||||
message GetAdminAdTemplateRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message GetAdminAdTemplateResponse {
|
||||
AdminAdTemplate template = 1;
|
||||
}
|
||||
|
||||
message CreateAdminAdTemplateRequest {
|
||||
string user_id = 1;
|
||||
string name = 2;
|
||||
optional string description = 3;
|
||||
string vast_tag_url = 4;
|
||||
optional string ad_format = 5;
|
||||
optional int64 duration = 6;
|
||||
optional bool is_active = 7;
|
||||
optional bool is_default = 8;
|
||||
}
|
||||
|
||||
message CreateAdminAdTemplateResponse {
|
||||
AdminAdTemplate template = 1;
|
||||
}
|
||||
|
||||
message UpdateAdminAdTemplateRequest {
|
||||
string id = 1;
|
||||
string user_id = 2;
|
||||
string name = 3;
|
||||
optional string description = 4;
|
||||
string vast_tag_url = 5;
|
||||
optional string ad_format = 6;
|
||||
optional int64 duration = 7;
|
||||
optional bool is_active = 8;
|
||||
optional bool is_default = 9;
|
||||
}
|
||||
|
||||
message UpdateAdminAdTemplateResponse {
|
||||
AdminAdTemplate template = 1;
|
||||
}
|
||||
|
||||
message DeleteAdminAdTemplateRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message ListAdminJobsRequest {
|
||||
int32 offset = 1;
|
||||
int32 limit = 2;
|
||||
optional string agent_id = 3;
|
||||
}
|
||||
|
||||
message ListAdminJobsResponse {
|
||||
repeated AdminJob jobs = 1;
|
||||
int64 total = 2;
|
||||
int32 offset = 3;
|
||||
int32 limit = 4;
|
||||
bool has_more = 5;
|
||||
}
|
||||
|
||||
message GetAdminJobRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message GetAdminJobResponse {
|
||||
AdminJob job = 1;
|
||||
}
|
||||
|
||||
message GetAdminJobLogsRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message GetAdminJobLogsResponse {
|
||||
string logs = 1;
|
||||
}
|
||||
|
||||
message CreateAdminJobRequest {
|
||||
string command = 1;
|
||||
optional string image = 2;
|
||||
map<string, string> env = 3;
|
||||
int32 priority = 4;
|
||||
optional string user_id = 5;
|
||||
optional string name = 6;
|
||||
int64 time_limit = 7;
|
||||
}
|
||||
|
||||
message CreateAdminJobResponse {
|
||||
AdminJob job = 1;
|
||||
}
|
||||
|
||||
message CancelAdminJobRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message CancelAdminJobResponse {
|
||||
string status = 1;
|
||||
string job_id = 2;
|
||||
}
|
||||
|
||||
message RetryAdminJobRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message RetryAdminJobResponse {
|
||||
AdminJob job = 1;
|
||||
}
|
||||
|
||||
message ListAdminAgentsRequest {}
|
||||
|
||||
message ListAdminAgentsResponse {
|
||||
repeated AdminAgent agents = 1;
|
||||
}
|
||||
|
||||
message RestartAdminAgentRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message UpdateAdminAgentRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message AdminAgentCommandResponse {
|
||||
string status = 1;
|
||||
}
|
||||
67
proto/app/v1/auth.proto
Normal file
67
proto/app/v1/auth.proto
Normal file
@@ -0,0 +1,67 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package stream.app.v1;
|
||||
|
||||
option go_package = "stream.api/internal/gen/proto/app/v1;appv1";
|
||||
|
||||
import "app/v1/common.proto";
|
||||
|
||||
service AuthService {
|
||||
rpc Login(LoginRequest) returns (LoginResponse);
|
||||
rpc Register(RegisterRequest) returns (RegisterResponse);
|
||||
rpc Logout(LogoutRequest) returns (MessageResponse);
|
||||
rpc ChangePassword(ChangePasswordRequest) returns (MessageResponse);
|
||||
rpc ForgotPassword(ForgotPasswordRequest) returns (MessageResponse);
|
||||
rpc ResetPassword(ResetPasswordRequest) returns (MessageResponse);
|
||||
rpc GetGoogleLoginUrl(GetGoogleLoginUrlRequest) returns (GetGoogleLoginUrlResponse);
|
||||
rpc CompleteGoogleLogin(CompleteGoogleLoginRequest) returns (CompleteGoogleLoginResponse);
|
||||
}
|
||||
|
||||
message LoginRequest {
|
||||
string email = 1;
|
||||
string password = 2;
|
||||
}
|
||||
|
||||
message LoginResponse {
|
||||
User user = 1;
|
||||
}
|
||||
|
||||
message RegisterRequest {
|
||||
string username = 1;
|
||||
string email = 2;
|
||||
string password = 3;
|
||||
}
|
||||
|
||||
message RegisterResponse {
|
||||
User user = 1;
|
||||
}
|
||||
|
||||
message LogoutRequest {}
|
||||
|
||||
message ChangePasswordRequest {
|
||||
string current_password = 1;
|
||||
string new_password = 2;
|
||||
}
|
||||
|
||||
message ForgotPasswordRequest {
|
||||
string email = 1;
|
||||
}
|
||||
|
||||
message ResetPasswordRequest {
|
||||
string token = 1;
|
||||
string new_password = 2;
|
||||
}
|
||||
|
||||
message GetGoogleLoginUrlRequest {}
|
||||
|
||||
message GetGoogleLoginUrlResponse {
|
||||
string url = 1;
|
||||
}
|
||||
|
||||
message CompleteGoogleLoginRequest {
|
||||
string code = 1;
|
||||
}
|
||||
|
||||
message CompleteGoogleLoginResponse {
|
||||
User user = 1;
|
||||
}
|
||||
87
proto/app/v1/catalog.proto
Normal file
87
proto/app/v1/catalog.proto
Normal file
@@ -0,0 +1,87 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package stream.app.v1;
|
||||
|
||||
option go_package = "stream.api/internal/gen/proto/app/v1;appv1";
|
||||
|
||||
import "app/v1/common.proto";
|
||||
|
||||
service DomainsService {
|
||||
rpc ListDomains(ListDomainsRequest) returns (ListDomainsResponse);
|
||||
rpc CreateDomain(CreateDomainRequest) returns (CreateDomainResponse);
|
||||
rpc DeleteDomain(DeleteDomainRequest) returns (MessageResponse);
|
||||
}
|
||||
|
||||
service AdTemplatesService {
|
||||
rpc ListAdTemplates(ListAdTemplatesRequest) returns (ListAdTemplatesResponse);
|
||||
rpc CreateAdTemplate(CreateAdTemplateRequest) returns (CreateAdTemplateResponse);
|
||||
rpc UpdateAdTemplate(UpdateAdTemplateRequest) returns (UpdateAdTemplateResponse);
|
||||
rpc DeleteAdTemplate(DeleteAdTemplateRequest) returns (MessageResponse);
|
||||
}
|
||||
|
||||
service PlansService {
|
||||
rpc ListPlans(ListPlansRequest) returns (ListPlansResponse);
|
||||
}
|
||||
|
||||
message ListDomainsRequest {}
|
||||
|
||||
message ListDomainsResponse {
|
||||
repeated Domain domains = 1;
|
||||
}
|
||||
|
||||
message CreateDomainRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message CreateDomainResponse {
|
||||
Domain domain = 1;
|
||||
}
|
||||
|
||||
message DeleteDomainRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message ListAdTemplatesRequest {}
|
||||
|
||||
message ListAdTemplatesResponse {
|
||||
repeated AdTemplate templates = 1;
|
||||
}
|
||||
|
||||
message CreateAdTemplateRequest {
|
||||
string name = 1;
|
||||
optional string description = 2;
|
||||
string vast_tag_url = 3;
|
||||
optional string ad_format = 4;
|
||||
optional int32 duration = 5;
|
||||
optional bool is_active = 6;
|
||||
optional bool is_default = 7;
|
||||
}
|
||||
|
||||
message CreateAdTemplateResponse {
|
||||
AdTemplate template = 1;
|
||||
}
|
||||
|
||||
message UpdateAdTemplateRequest {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
optional string description = 3;
|
||||
string vast_tag_url = 4;
|
||||
optional string ad_format = 5;
|
||||
optional int32 duration = 6;
|
||||
optional bool is_active = 7;
|
||||
optional bool is_default = 8;
|
||||
}
|
||||
|
||||
message UpdateAdTemplateResponse {
|
||||
AdTemplate template = 1;
|
||||
}
|
||||
|
||||
message DeleteAdTemplateRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message ListPlansRequest {}
|
||||
|
||||
message ListPlansResponse {
|
||||
repeated Plan plans = 1;
|
||||
}
|
||||
306
proto/app/v1/common.proto
Normal file
306
proto/app/v1/common.proto
Normal file
@@ -0,0 +1,306 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package stream.app.v1;
|
||||
|
||||
option go_package = "stream.api/internal/gen/proto/app/v1;appv1";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
message MessageResponse {
|
||||
string message = 1;
|
||||
}
|
||||
|
||||
message User {
|
||||
string id = 1;
|
||||
string email = 2;
|
||||
optional string username = 3;
|
||||
optional string avatar = 4;
|
||||
optional string role = 5;
|
||||
optional string google_id = 6;
|
||||
int64 storage_used = 7;
|
||||
optional string plan_id = 8;
|
||||
google.protobuf.Timestamp plan_started_at = 9;
|
||||
google.protobuf.Timestamp plan_expires_at = 10;
|
||||
optional int32 plan_term_months = 11;
|
||||
optional string plan_payment_method = 12;
|
||||
bool plan_expiring_soon = 13;
|
||||
double wallet_balance = 14;
|
||||
string language = 15;
|
||||
string locale = 16;
|
||||
google.protobuf.Timestamp created_at = 17;
|
||||
google.protobuf.Timestamp updated_at = 18;
|
||||
}
|
||||
|
||||
message Preferences {
|
||||
bool email_notifications = 1;
|
||||
bool push_notifications = 2;
|
||||
bool marketing_notifications = 3;
|
||||
bool telegram_notifications = 4;
|
||||
bool autoplay = 5;
|
||||
bool loop = 6;
|
||||
bool muted = 7;
|
||||
bool show_controls = 8;
|
||||
bool pip = 9;
|
||||
bool airplay = 10;
|
||||
bool chromecast = 11;
|
||||
string language = 12;
|
||||
string locale = 13;
|
||||
}
|
||||
|
||||
message Notification {
|
||||
string id = 1;
|
||||
string type = 2;
|
||||
string title = 3;
|
||||
string message = 4;
|
||||
bool read = 5;
|
||||
optional string action_url = 6;
|
||||
optional string action_label = 7;
|
||||
google.protobuf.Timestamp created_at = 8;
|
||||
}
|
||||
|
||||
message Domain {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
google.protobuf.Timestamp created_at = 3;
|
||||
google.protobuf.Timestamp updated_at = 4;
|
||||
}
|
||||
|
||||
message AdTemplate {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
optional string description = 3;
|
||||
string vast_tag_url = 4;
|
||||
string ad_format = 5;
|
||||
optional int32 duration = 6;
|
||||
bool is_active = 7;
|
||||
bool is_default = 8;
|
||||
google.protobuf.Timestamp created_at = 9;
|
||||
google.protobuf.Timestamp updated_at = 10;
|
||||
}
|
||||
|
||||
message Plan {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
optional string description = 3;
|
||||
double price = 4;
|
||||
string cycle = 5;
|
||||
int64 storage_limit = 6;
|
||||
int32 upload_limit = 7;
|
||||
int32 duration_limit = 8;
|
||||
string quality_limit = 9;
|
||||
repeated string features = 10;
|
||||
bool is_active = 11;
|
||||
}
|
||||
|
||||
message Payment {
|
||||
string id = 1;
|
||||
string user_id = 2;
|
||||
optional string plan_id = 3;
|
||||
double amount = 4;
|
||||
string currency = 5;
|
||||
string status = 6;
|
||||
string provider = 7;
|
||||
optional string transaction_id = 8;
|
||||
google.protobuf.Timestamp created_at = 9;
|
||||
google.protobuf.Timestamp updated_at = 10;
|
||||
}
|
||||
|
||||
message PlanSubscription {
|
||||
string id = 1;
|
||||
string user_id = 2;
|
||||
string payment_id = 3;
|
||||
string plan_id = 4;
|
||||
int32 term_months = 5;
|
||||
string payment_method = 6;
|
||||
double wallet_amount = 7;
|
||||
double topup_amount = 8;
|
||||
google.protobuf.Timestamp started_at = 9;
|
||||
google.protobuf.Timestamp expires_at = 10;
|
||||
google.protobuf.Timestamp created_at = 11;
|
||||
google.protobuf.Timestamp updated_at = 12;
|
||||
}
|
||||
|
||||
message WalletTransaction {
|
||||
string id = 1;
|
||||
string user_id = 2;
|
||||
string type = 3;
|
||||
double amount = 4;
|
||||
string currency = 5;
|
||||
optional string note = 6;
|
||||
optional string payment_id = 7;
|
||||
optional string plan_id = 8;
|
||||
optional int32 term_months = 9;
|
||||
google.protobuf.Timestamp created_at = 10;
|
||||
google.protobuf.Timestamp updated_at = 11;
|
||||
}
|
||||
|
||||
message PaymentHistoryItem {
|
||||
string id = 1;
|
||||
double amount = 2;
|
||||
string currency = 3;
|
||||
string status = 4;
|
||||
optional string plan_id = 5;
|
||||
optional string plan_name = 6;
|
||||
string invoice_id = 7;
|
||||
string kind = 8;
|
||||
optional int32 term_months = 9;
|
||||
optional string payment_method = 10;
|
||||
google.protobuf.Timestamp expires_at = 11;
|
||||
google.protobuf.Timestamp created_at = 12;
|
||||
}
|
||||
|
||||
message Video {
|
||||
string id = 1;
|
||||
string user_id = 2;
|
||||
string title = 3;
|
||||
optional string description = 4;
|
||||
string url = 5;
|
||||
string status = 6;
|
||||
int64 size = 7;
|
||||
int32 duration = 8;
|
||||
string format = 9;
|
||||
optional string thumbnail = 10;
|
||||
optional string processing_status = 11;
|
||||
optional string storage_type = 12;
|
||||
google.protobuf.Timestamp created_at = 13;
|
||||
google.protobuf.Timestamp updated_at = 14;
|
||||
}
|
||||
|
||||
message AdminDashboard {
|
||||
int64 total_users = 1;
|
||||
int64 total_videos = 2;
|
||||
int64 total_storage_used = 3;
|
||||
int64 total_payments = 4;
|
||||
double total_revenue = 5;
|
||||
int64 active_subscriptions = 6;
|
||||
int64 total_ad_templates = 7;
|
||||
int64 new_users_today = 8;
|
||||
int64 new_videos_today = 9;
|
||||
}
|
||||
|
||||
message AdminUser {
|
||||
string id = 1;
|
||||
string email = 2;
|
||||
optional string username = 3;
|
||||
optional string avatar = 4;
|
||||
optional string role = 5;
|
||||
optional string plan_id = 6;
|
||||
optional string plan_name = 7;
|
||||
int64 storage_used = 8;
|
||||
int64 video_count = 9;
|
||||
double wallet_balance = 10;
|
||||
google.protobuf.Timestamp created_at = 11;
|
||||
google.protobuf.Timestamp updated_at = 12;
|
||||
}
|
||||
|
||||
message AdminUserDetail {
|
||||
AdminUser user = 1;
|
||||
optional PlanSubscription subscription = 2;
|
||||
}
|
||||
|
||||
message AdminVideo {
|
||||
string id = 1;
|
||||
string user_id = 2;
|
||||
string title = 3;
|
||||
optional string description = 4;
|
||||
string url = 5;
|
||||
string status = 6;
|
||||
int64 size = 7;
|
||||
int32 duration = 8;
|
||||
string format = 9;
|
||||
optional string owner_email = 10;
|
||||
optional string ad_template_id = 11;
|
||||
optional string ad_template_name = 12;
|
||||
google.protobuf.Timestamp created_at = 13;
|
||||
google.protobuf.Timestamp updated_at = 14;
|
||||
}
|
||||
|
||||
message AdminPayment {
|
||||
string id = 1;
|
||||
string user_id = 2;
|
||||
optional string plan_id = 3;
|
||||
double amount = 4;
|
||||
string currency = 5;
|
||||
string status = 6;
|
||||
string provider = 7;
|
||||
optional string transaction_id = 8;
|
||||
optional string user_email = 9;
|
||||
optional string plan_name = 10;
|
||||
string invoice_id = 11;
|
||||
optional int32 term_months = 12;
|
||||
optional string payment_method = 13;
|
||||
optional string expires_at = 14;
|
||||
optional double wallet_amount = 15;
|
||||
optional double topup_amount = 16;
|
||||
google.protobuf.Timestamp created_at = 17;
|
||||
google.protobuf.Timestamp updated_at = 18;
|
||||
}
|
||||
|
||||
message AdminPlan {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
optional string description = 3;
|
||||
repeated string features = 4;
|
||||
double price = 5;
|
||||
string cycle = 6;
|
||||
int64 storage_limit = 7;
|
||||
int32 upload_limit = 8;
|
||||
int32 duration_limit = 9;
|
||||
string quality_limit = 10;
|
||||
bool is_active = 11;
|
||||
int64 user_count = 12;
|
||||
int64 payment_count = 13;
|
||||
int64 subscription_count = 14;
|
||||
}
|
||||
|
||||
message AdminAdTemplate {
|
||||
string id = 1;
|
||||
string user_id = 2;
|
||||
string name = 3;
|
||||
optional string description = 4;
|
||||
string vast_tag_url = 5;
|
||||
string ad_format = 6;
|
||||
optional int64 duration = 7;
|
||||
bool is_active = 8;
|
||||
bool is_default = 9;
|
||||
optional string owner_email = 10;
|
||||
google.protobuf.Timestamp created_at = 11;
|
||||
google.protobuf.Timestamp updated_at = 12;
|
||||
}
|
||||
|
||||
message AdminJob {
|
||||
string id = 1;
|
||||
string status = 2;
|
||||
int32 priority = 3;
|
||||
string user_id = 4;
|
||||
string name = 5;
|
||||
int64 time_limit = 6;
|
||||
string input_url = 7;
|
||||
string output_url = 8;
|
||||
int64 total_duration = 9;
|
||||
int64 current_time = 10;
|
||||
double progress = 11;
|
||||
optional string agent_id = 12;
|
||||
string logs = 13;
|
||||
string config = 14;
|
||||
bool cancelled = 15;
|
||||
int32 retry_count = 16;
|
||||
int32 max_retries = 17;
|
||||
google.protobuf.Timestamp created_at = 18;
|
||||
google.protobuf.Timestamp updated_at = 19;
|
||||
}
|
||||
|
||||
message AdminAgent {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
string platform = 3;
|
||||
string backend = 4;
|
||||
string version = 5;
|
||||
int32 capacity = 6;
|
||||
string status = 7;
|
||||
double cpu = 8;
|
||||
double ram = 9;
|
||||
google.protobuf.Timestamp last_heartbeat = 10;
|
||||
google.protobuf.Timestamp created_at = 11;
|
||||
google.protobuf.Timestamp updated_at = 12;
|
||||
}
|
||||
55
proto/app/v1/payments.proto
Normal file
55
proto/app/v1/payments.proto
Normal file
@@ -0,0 +1,55 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package stream.app.v1;
|
||||
|
||||
option go_package = "stream.api/internal/gen/proto/app/v1;appv1";
|
||||
|
||||
import "app/v1/common.proto";
|
||||
|
||||
service PaymentsService {
|
||||
rpc CreatePayment(CreatePaymentRequest) returns (CreatePaymentResponse);
|
||||
rpc ListPaymentHistory(ListPaymentHistoryRequest) returns (ListPaymentHistoryResponse);
|
||||
rpc TopupWallet(TopupWalletRequest) returns (TopupWalletResponse);
|
||||
rpc DownloadInvoice(DownloadInvoiceRequest) returns (DownloadInvoiceResponse);
|
||||
}
|
||||
|
||||
message CreatePaymentRequest {
|
||||
string plan_id = 1;
|
||||
int32 term_months = 2;
|
||||
string payment_method = 3;
|
||||
optional double topup_amount = 4;
|
||||
}
|
||||
|
||||
message CreatePaymentResponse {
|
||||
Payment payment = 1;
|
||||
PlanSubscription subscription = 2;
|
||||
double wallet_balance = 3;
|
||||
string invoice_id = 4;
|
||||
string message = 5;
|
||||
}
|
||||
|
||||
message ListPaymentHistoryRequest {}
|
||||
|
||||
message ListPaymentHistoryResponse {
|
||||
repeated PaymentHistoryItem payments = 1;
|
||||
}
|
||||
|
||||
message TopupWalletRequest {
|
||||
double amount = 1;
|
||||
}
|
||||
|
||||
message TopupWalletResponse {
|
||||
WalletTransaction wallet_transaction = 1;
|
||||
double wallet_balance = 2;
|
||||
string invoice_id = 3;
|
||||
}
|
||||
|
||||
message DownloadInvoiceRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message DownloadInvoiceResponse {
|
||||
string filename = 1;
|
||||
string content_type = 2;
|
||||
string content = 3;
|
||||
}
|
||||
80
proto/app/v1/videos.proto
Normal file
80
proto/app/v1/videos.proto
Normal file
@@ -0,0 +1,80 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package stream.app.v1;
|
||||
|
||||
option go_package = "stream.api/internal/gen/proto/app/v1;appv1";
|
||||
|
||||
import "app/v1/common.proto";
|
||||
|
||||
service VideosService {
|
||||
rpc GetUploadUrl(GetUploadUrlRequest) returns (GetUploadUrlResponse);
|
||||
rpc CreateVideo(CreateVideoRequest) returns (CreateVideoResponse);
|
||||
rpc ListVideos(ListVideosRequest) returns (ListVideosResponse);
|
||||
rpc GetVideo(GetVideoRequest) returns (GetVideoResponse);
|
||||
rpc UpdateVideo(UpdateVideoRequest) returns (UpdateVideoResponse);
|
||||
rpc DeleteVideo(DeleteVideoRequest) returns (MessageResponse);
|
||||
}
|
||||
|
||||
message GetUploadUrlRequest {
|
||||
string filename = 1;
|
||||
}
|
||||
|
||||
message GetUploadUrlResponse {
|
||||
string upload_url = 1;
|
||||
string key = 2;
|
||||
string file_id = 3;
|
||||
}
|
||||
|
||||
message CreateVideoRequest {
|
||||
string title = 1;
|
||||
optional string description = 2;
|
||||
string url = 3;
|
||||
int64 size = 4;
|
||||
int32 duration = 5;
|
||||
optional string format = 6;
|
||||
}
|
||||
|
||||
message CreateVideoResponse {
|
||||
Video video = 1;
|
||||
}
|
||||
|
||||
message ListVideosRequest {
|
||||
int32 page = 1;
|
||||
int32 limit = 2;
|
||||
optional string search = 3;
|
||||
optional string status = 4;
|
||||
}
|
||||
|
||||
message ListVideosResponse {
|
||||
repeated Video videos = 1;
|
||||
int64 total = 2;
|
||||
int32 page = 3;
|
||||
int32 limit = 4;
|
||||
}
|
||||
|
||||
message GetVideoRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message GetVideoResponse {
|
||||
Video video = 1;
|
||||
}
|
||||
|
||||
message UpdateVideoRequest {
|
||||
string id = 1;
|
||||
string title = 2;
|
||||
optional string description = 3;
|
||||
string url = 4;
|
||||
int64 size = 5;
|
||||
int32 duration = 6;
|
||||
optional string format = 7;
|
||||
optional string status = 8;
|
||||
}
|
||||
|
||||
message UpdateVideoResponse {
|
||||
Video video = 1;
|
||||
}
|
||||
|
||||
message DeleteVideoRequest {
|
||||
string id = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user