197 lines
8.0 KiB
Protocol Buffer
197 lines
8.0 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package radio;
|
|
|
|
option go_package = "./radio";
|
|
|
|
// ========== 用户Profile ==========
|
|
message RadioUserProfile {
|
|
string id = 1;
|
|
string userId = 2;
|
|
string nickName = 3;
|
|
string avatarId = 4;
|
|
int32 isVip = 5;
|
|
int64 vipExpireAt = 6;
|
|
int32 vipLevel = 7;
|
|
}
|
|
message GetRadioUserProfileReq { string userId = 1; }
|
|
message GetRadioUserProfileResp { RadioUserProfile profile = 1; }
|
|
|
|
// ========== 分类 ==========
|
|
message CategoryInfo {
|
|
string id = 1;
|
|
string name = 2;
|
|
string icon = 3;
|
|
int32 sort = 4;
|
|
}
|
|
message CreateCategoryReq { string name = 1; string icon = 2; int32 sort = 3; }
|
|
message CreateCategoryResp { string id = 1; }
|
|
message UpdateCategoryReq { string id = 1; string name = 2; string icon = 3; int32 sort = 4; }
|
|
message UpdateCategoryResp {}
|
|
message DeleteByIdsReq { repeated string ids = 1; }
|
|
message DeleteResp {}
|
|
message GetCategoryListReq { int32 current = 1; int32 pageSize = 2; }
|
|
message GetCategoryListResp { repeated CategoryInfo list = 1; int64 total = 2; }
|
|
|
|
// ========== 频道 ==========
|
|
message ChannelInfo {
|
|
string id = 1;
|
|
string categoryId = 2;
|
|
string name = 3;
|
|
string description = 4;
|
|
int32 isFree = 5;
|
|
int32 isVipOnly = 6;
|
|
int32 monthlyPrice = 7;
|
|
int32 quarterlyPrice = 8;
|
|
int32 annualPrice = 9;
|
|
string cover = 10;
|
|
string tags = 11;
|
|
int32 sort = 12;
|
|
int32 status = 13;
|
|
int64 createdAt = 14;
|
|
}
|
|
message CreateChannelReq {
|
|
string categoryId = 1; string name = 2; string description = 3;
|
|
int32 isFree = 4; int32 isVipOnly = 5;
|
|
int32 monthlyPrice = 6; int32 quarterlyPrice = 7; int32 annualPrice = 8;
|
|
string cover = 9; string tags = 10; int32 sort = 11;
|
|
}
|
|
message CreateChannelResp { string id = 1; }
|
|
message UpdateChannelReq {
|
|
string id = 1; string name = 2; string description = 3;
|
|
int32 isFree = 4; int32 isVipOnly = 5;
|
|
int32 monthlyPrice = 6; int32 quarterlyPrice = 7; int32 annualPrice = 8;
|
|
string cover = 9; string tags = 10; int32 sort = 11; int32 status = 12;
|
|
}
|
|
message UpdateChannelResp {}
|
|
message GetChannelListReq { int32 current = 1; int32 pageSize = 2; string categoryId = 3; string userId = 4; }
|
|
message GetChannelListResp { repeated ChannelInfo list = 1; int64 total = 2; }
|
|
message GetChannelDetailReq { string id = 1; string userId = 2; }
|
|
message GetChannelDetailResp { ChannelInfo channel = 1; }
|
|
|
|
// ========== 节目 ==========
|
|
message ProgramInfo {
|
|
string id = 1;
|
|
string channelId = 2;
|
|
string title = 3;
|
|
string description = 4;
|
|
string content = 5;
|
|
string cover = 6;
|
|
string audioId = 7;
|
|
int32 audioStatus = 8;
|
|
int32 duration = 9;
|
|
string tags = 10;
|
|
int32 playCount = 11;
|
|
int32 likeCount = 12;
|
|
int32 status = 13;
|
|
int64 createdAt = 14;
|
|
}
|
|
message CreateProgramReq {
|
|
string channelId = 1; string title = 2; string description = 3;
|
|
string content = 4; string cover = 5; string tags = 6;
|
|
}
|
|
message CreateProgramResp { string id = 1; }
|
|
message UpdateProgramReq {
|
|
string id = 1; string title = 2; string description = 3;
|
|
string content = 4; string cover = 5; string audioId = 6;
|
|
int32 audioStatus = 7; int32 duration = 8; string tags = 9; int32 status = 10;
|
|
}
|
|
message UpdateProgramResp {}
|
|
message GetProgramListReq { int32 current = 1; int32 pageSize = 2; string channelId = 3; string userId = 4; }
|
|
message GetProgramListResp { repeated ProgramInfo list = 1; int64 total = 2; }
|
|
message GetProgramDetailReq { string id = 1; string userId = 2; }
|
|
message GetProgramDetailResp { ProgramInfo program = 1; }
|
|
|
|
// ========== 音色 ==========
|
|
message VoiceInfo {
|
|
string id = 1; string speakerId = 2; string name = 3;
|
|
string description = 4; string gender = 5; string icon = 6;
|
|
string audioId = 7; int32 sort = 8; int32 status = 9;
|
|
int32 isDefault = 10; int32 useCount = 11;
|
|
}
|
|
message CreateVoiceReq { string speakerId = 1; string name = 2; string description = 3; string gender = 4; string icon = 5; string audioId = 6; int32 sort = 7; int32 isDefault = 8; }
|
|
message CreateVoiceResp { string id = 1; }
|
|
message UpdateVoiceReq { string id = 1; string name = 2; string description = 3; string icon = 4; string audioId = 5; int32 sort = 6; int32 status = 7; int32 isDefault = 8; }
|
|
message UpdateVoiceResp {}
|
|
message GetVoiceListReq { int32 current = 1; int32 pageSize = 2; }
|
|
message GetVoiceListResp { repeated VoiceInfo list = 1; int64 total = 2; }
|
|
|
|
// ========== 互动 ==========
|
|
message ToggleLikeReq { string userId = 1; string programId = 2; }
|
|
message ToggleLikeResp { bool liked = 1; }
|
|
message ToggleFavoriteReq { string userId = 1; string programId = 2; }
|
|
message ToggleFavoriteResp { bool favorited = 1; }
|
|
message CommentReq { string userId = 1; string programId = 2; string content = 3; string parentId = 4; }
|
|
message CommentResp {}
|
|
message RecordHistoryReq { string userId = 1; string programId = 2; int32 duration = 3; }
|
|
message RecordHistoryResp {}
|
|
message GetHistoryListReq { string userId = 1; int32 current = 2; int32 pageSize = 3; }
|
|
message GetHistoryListResp { repeated ProgramInfo list = 1; int64 total = 2; }
|
|
message GetFavoriteListReq { string userId = 1; int32 current = 2; int32 pageSize = 3; }
|
|
message GetFavoriteListResp { repeated ProgramInfo list = 1; int64 total = 2; }
|
|
|
|
// ========== 订阅/支付 ==========
|
|
message SubscriptionInfo {
|
|
string id = 1; string userId = 2; string channelId = 3;
|
|
int64 expiredAt = 4; int32 status = 5;
|
|
}
|
|
message GetMySubscriptionsReq { string userId = 1; }
|
|
message GetMySubscriptionsResp { repeated SubscriptionInfo list = 1; }
|
|
message CreatePayOrderReq { string userId = 1; string channelId = 2; string planType = 3; }
|
|
message CreatePayOrderResp { string orderNo = 1; string prepayId = 2; }
|
|
|
|
// ========== VIP ==========
|
|
message VipConfigInfo {
|
|
string id = 1; string name = 2; string planType = 3;
|
|
int32 price = 4; int32 originalPrice = 5; int32 duration = 6;
|
|
string desc = 7;
|
|
}
|
|
message GetVipConfigListReq { int32 current = 1; int32 pageSize = 2; }
|
|
message GetVipConfigListResp { repeated VipConfigInfo list = 1; int64 total = 2; }
|
|
message GetMyVipInfoReq { string userId = 1; }
|
|
message GetMyVipInfoResp { RadioUserProfile profile = 1; }
|
|
|
|
// ========== 通用 ==========
|
|
message Empty {}
|
|
|
|
// ========== 服务定义 ==========
|
|
service RadioService {
|
|
// 用户
|
|
rpc GetRadioUserProfile(GetRadioUserProfileReq) returns (GetRadioUserProfileResp);
|
|
// 分类
|
|
rpc CreateCategory(CreateCategoryReq) returns (CreateCategoryResp);
|
|
rpc UpdateCategory(UpdateCategoryReq) returns (UpdateCategoryResp);
|
|
rpc DeleteCategory(DeleteByIdsReq) returns (DeleteResp);
|
|
rpc GetCategoryList(GetCategoryListReq) returns (GetCategoryListResp);
|
|
// 频道
|
|
rpc CreateChannel(CreateChannelReq) returns (CreateChannelResp);
|
|
rpc UpdateChannel(UpdateChannelReq) returns (UpdateChannelResp);
|
|
rpc DeleteChannel(DeleteByIdsReq) returns (DeleteResp);
|
|
rpc GetChannelList(GetChannelListReq) returns (GetChannelListResp);
|
|
rpc GetChannelDetail(GetChannelDetailReq) returns (GetChannelDetailResp);
|
|
// 节目
|
|
rpc CreateProgram(CreateProgramReq) returns (CreateProgramResp);
|
|
rpc UpdateProgram(UpdateProgramReq) returns (UpdateProgramResp);
|
|
rpc DeleteProgram(DeleteByIdsReq) returns (DeleteResp);
|
|
rpc GetProgramList(GetProgramListReq) returns (GetProgramListResp);
|
|
rpc GetProgramDetail(GetProgramDetailReq) returns (GetProgramDetailResp);
|
|
// 音色
|
|
rpc CreateVoice(CreateVoiceReq) returns (CreateVoiceResp);
|
|
rpc UpdateVoice(UpdateVoiceReq) returns (UpdateVoiceResp);
|
|
rpc DeleteVoice(DeleteByIdsReq) returns (DeleteResp);
|
|
rpc GetVoiceList(GetVoiceListReq) returns (GetVoiceListResp);
|
|
// 互动
|
|
rpc ToggleLike(ToggleLikeReq) returns (ToggleLikeResp);
|
|
rpc ToggleFavorite(ToggleFavoriteReq) returns (ToggleFavoriteResp);
|
|
rpc CommentProgram(CommentReq) returns (CommentResp);
|
|
rpc RecordHistory(RecordHistoryReq) returns (RecordHistoryResp);
|
|
rpc GetHistoryList(GetHistoryListReq) returns (GetHistoryListResp);
|
|
rpc GetFavoriteList(GetFavoriteListReq) returns (GetFavoriteListResp);
|
|
// 订阅
|
|
rpc GetMySubscriptions(GetMySubscriptionsReq) returns (GetMySubscriptionsResp);
|
|
rpc CreatePayOrder(CreatePayOrderReq) returns (CreatePayOrderResp);
|
|
// VIP
|
|
rpc GetVipConfigList(GetVipConfigListReq) returns (GetVipConfigListResp);
|
|
rpc GetMyVipInfo(GetMyVipInfoReq) returns (GetMyVipInfoResp);
|
|
}
|