feat: 初次启动
This commit is contained in:
+308
-107
@@ -4,7 +4,23 @@ package radio;
|
||||
|
||||
option go_package = "./radio";
|
||||
|
||||
// ========== 通用 ==========
|
||||
|
||||
message CommonResp {
|
||||
int64 code = 1;
|
||||
string msg = 2;
|
||||
}
|
||||
|
||||
message IdReq {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message IdsReq {
|
||||
repeated string ids = 1;
|
||||
}
|
||||
|
||||
// ========== 用户Profile ==========
|
||||
|
||||
message RadioUserProfile {
|
||||
string id = 1;
|
||||
string userId = 2;
|
||||
@@ -14,26 +30,45 @@ message RadioUserProfile {
|
||||
int64 vipExpireAt = 6;
|
||||
int32 vipLevel = 7;
|
||||
}
|
||||
message GetRadioUserProfileReq { string userId = 1; }
|
||||
message GetRadioUserProfileResp { RadioUserProfile profile = 1; }
|
||||
|
||||
message GetProfileReq {
|
||||
string userId = 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 CategoryReq {
|
||||
string name = 1;
|
||||
string icon = 2;
|
||||
int32 sort = 3;
|
||||
}
|
||||
|
||||
message CategoryUpdateReq {
|
||||
string id = 1;
|
||||
string name = 2;
|
||||
string icon = 3;
|
||||
int32 sort = 4;
|
||||
}
|
||||
|
||||
message CategoryListResp {
|
||||
repeated CategoryInfo list = 1;
|
||||
int64 total = 2;
|
||||
}
|
||||
|
||||
message CategoryListReq {
|
||||
int32 current = 1;
|
||||
int32 pageSize = 2;
|
||||
}
|
||||
|
||||
// ========== 频道 ==========
|
||||
|
||||
message ChannelInfo {
|
||||
string id = 1;
|
||||
string categoryId = 2;
|
||||
@@ -48,28 +83,52 @@ message ChannelInfo {
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
}
|
||||
|
||||
message ChannelListReq {
|
||||
int32 current = 1;
|
||||
int32 pageSize = 2;
|
||||
string categoryId = 3;
|
||||
string userId = 4;
|
||||
}
|
||||
|
||||
message ChannelListResp {
|
||||
repeated ChannelInfo list = 1;
|
||||
int64 total = 2;
|
||||
}
|
||||
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;
|
||||
@@ -84,113 +143,255 @@ message ProgramInfo {
|
||||
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;
|
||||
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;
|
||||
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 status = 11;
|
||||
}
|
||||
|
||||
message ProgramListReq {
|
||||
int32 current = 1;
|
||||
int32 pageSize = 2;
|
||||
string channelId = 3;
|
||||
string userId = 4;
|
||||
}
|
||||
|
||||
message ProgramListResp {
|
||||
repeated ProgramInfo list = 1;
|
||||
int64 total = 2;
|
||||
}
|
||||
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;
|
||||
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;
|
||||
}
|
||||
|
||||
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 UpdateVoiceReq {
|
||||
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;
|
||||
}
|
||||
|
||||
message VoiceListReq {
|
||||
int32 current = 1;
|
||||
int32 pageSize = 2;
|
||||
}
|
||||
|
||||
message VoiceListResp {
|
||||
repeated VoiceInfo list = 1;
|
||||
int64 total = 2;
|
||||
}
|
||||
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 ToggleLikeReq {
|
||||
string userId = 1;
|
||||
string programId = 2;
|
||||
}
|
||||
|
||||
message ToggleFavoriteReq {
|
||||
string userId = 1;
|
||||
string programId = 2;
|
||||
}
|
||||
|
||||
message CommentReq {
|
||||
string userId = 1;
|
||||
string programId = 2;
|
||||
string content = 3;
|
||||
string parentId = 4;
|
||||
}
|
||||
|
||||
message RecordHistoryReq {
|
||||
string userId = 1;
|
||||
string programId = 2;
|
||||
int32 duration = 3;
|
||||
}
|
||||
|
||||
message InteractionListReq {
|
||||
string userId = 1;
|
||||
int32 current = 2;
|
||||
int32 pageSize = 3;
|
||||
}
|
||||
|
||||
message FavoriteListResp {
|
||||
repeated ProgramInfo list = 1;
|
||||
int64 total = 2;
|
||||
}
|
||||
|
||||
message HistoryListResp {
|
||||
repeated ProgramInfo list = 1;
|
||||
int64 total = 2;
|
||||
}
|
||||
|
||||
// ========== 订阅/VIP ==========
|
||||
|
||||
message SubscriptionInfo {
|
||||
string id = 1;
|
||||
string channelId = 2;
|
||||
int64 expiredAt = 3;
|
||||
int32 status = 4;
|
||||
}
|
||||
|
||||
message SubscriptionListReq {
|
||||
string userId = 1;
|
||||
}
|
||||
|
||||
message SubscriptionListResp {
|
||||
repeated SubscriptionInfo list = 1;
|
||||
}
|
||||
|
||||
message CreatePayOrderReq {
|
||||
string userId = 1;
|
||||
string channelId = 2;
|
||||
string planType = 3;
|
||||
}
|
||||
|
||||
message CreatePayOrderResp {
|
||||
string orderNo = 1;
|
||||
string prepayId = 2;
|
||||
}
|
||||
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 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 {}
|
||||
message VipConfigListResp {
|
||||
repeated VipConfigInfo list = 1;
|
||||
}
|
||||
|
||||
// ========== 数据分析 ==========
|
||||
|
||||
message AnalyticsReq {
|
||||
string startDate = 1;
|
||||
string endDate = 2;
|
||||
}
|
||||
|
||||
message AnalyticsOverviewResp {
|
||||
int64 totalUsers = 1;
|
||||
int64 totalPlays = 2;
|
||||
int64 totalChannels = 3;
|
||||
int64 totalPrograms = 4;
|
||||
}
|
||||
|
||||
message ChannelAnalyticsResp {
|
||||
repeated ChannelAnalyticsItem list = 1;
|
||||
}
|
||||
|
||||
message ChannelAnalyticsItem {
|
||||
string channelId = 1;
|
||||
string channelName = 2;
|
||||
int64 playCount = 3;
|
||||
int64 likeCount = 4;
|
||||
int64 subscriberCount = 5;
|
||||
}
|
||||
|
||||
message UserAnalyticsResp {
|
||||
int64 newUsers = 1;
|
||||
int64 activeUsers = 2;
|
||||
int64 vipUsers = 3;
|
||||
}
|
||||
|
||||
// ========== 服务定义 ==========
|
||||
|
||||
service RadioService {
|
||||
// 用户
|
||||
rpc GetRadioUserProfile(GetRadioUserProfileReq) returns (GetRadioUserProfileResp);
|
||||
// 用户Profile
|
||||
rpc GetUserProfile(GetProfileReq) returns (RadioUserProfile);
|
||||
|
||||
// 分类
|
||||
rpc CreateCategory(CreateCategoryReq) returns (CreateCategoryResp);
|
||||
rpc UpdateCategory(UpdateCategoryReq) returns (UpdateCategoryResp);
|
||||
rpc DeleteCategory(DeleteByIdsReq) returns (DeleteResp);
|
||||
rpc GetCategoryList(GetCategoryListReq) returns (GetCategoryListResp);
|
||||
rpc CreateCategory(CategoryReq) returns (CommonResp);
|
||||
rpc UpdateCategory(CategoryUpdateReq) returns (CommonResp);
|
||||
rpc DeleteCategory(IdsReq) returns (CommonResp);
|
||||
rpc GetCategoryList(CategoryListReq) returns (CategoryListResp);
|
||||
|
||||
// 频道
|
||||
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 CreateChannel(CreateChannelReq) returns (CommonResp);
|
||||
rpc UpdateChannel(UpdateChannelReq) returns (CommonResp);
|
||||
rpc DeleteChannel(IdsReq) returns (CommonResp);
|
||||
rpc GetChannelList(ChannelListReq) returns (ChannelListResp);
|
||||
rpc GetChannelDetail(IdReq) returns (ChannelInfo);
|
||||
|
||||
// 节目
|
||||
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 CreateProgram(CreateProgramReq) returns (CommonResp);
|
||||
rpc UpdateProgram(UpdateProgramReq) returns (CommonResp);
|
||||
rpc DeleteProgram(IdsReq) returns (CommonResp);
|
||||
rpc GetProgramList(ProgramListReq) returns (ProgramListResp);
|
||||
rpc GetProgramDetail(IdReq) returns (ProgramInfo);
|
||||
|
||||
// 音色
|
||||
rpc CreateVoice(CreateVoiceReq) returns (CreateVoiceResp);
|
||||
rpc UpdateVoice(UpdateVoiceReq) returns (UpdateVoiceResp);
|
||||
rpc DeleteVoice(DeleteByIdsReq) returns (DeleteResp);
|
||||
rpc GetVoiceList(GetVoiceListReq) returns (GetVoiceListResp);
|
||||
rpc CreateVoice(CreateVoiceReq) returns (CommonResp);
|
||||
rpc UpdateVoice(UpdateVoiceReq) returns (CommonResp);
|
||||
rpc DeleteVoice(IdsReq) returns (CommonResp);
|
||||
rpc GetVoiceList(VoiceListReq) returns (VoiceListResp);
|
||||
|
||||
// 互动
|
||||
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 ToggleLike(ToggleLikeReq) returns (CommonResp);
|
||||
rpc ToggleFavorite(ToggleFavoriteReq) returns (CommonResp);
|
||||
rpc CommentProgram(CommentReq) returns (CommonResp);
|
||||
rpc RecordHistory(RecordHistoryReq) returns (CommonResp);
|
||||
rpc GetFavoriteList(InteractionListReq) returns (FavoriteListResp);
|
||||
rpc GetHistoryList(InteractionListReq) returns (HistoryListResp);
|
||||
|
||||
// 订阅/VIP
|
||||
rpc GetMySubscriptions(SubscriptionListReq) returns (SubscriptionListResp);
|
||||
rpc CreatePayOrder(CreatePayOrderReq) returns (CreatePayOrderResp);
|
||||
// VIP
|
||||
rpc GetVipConfigList(GetVipConfigListReq) returns (GetVipConfigListResp);
|
||||
rpc GetMyVipInfo(GetMyVipInfoReq) returns (GetMyVipInfoResp);
|
||||
rpc GetVipConfigList(IdReq) returns (VipConfigListResp);
|
||||
rpc GetMyVipInfo(GetProfileReq) returns (RadioUserProfile);
|
||||
|
||||
// 数据分析
|
||||
rpc GetAnalyticsOverview(AnalyticsReq) returns (AnalyticsOverviewResp);
|
||||
rpc GetChannelAnalytics(AnalyticsReq) returns (ChannelAnalyticsResp);
|
||||
rpc GetUserAnalytics(AnalyticsReq) returns (UserAnalyticsResp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user