feat: 初次启动
This commit is contained in:
@@ -4,4 +4,7 @@ import "github.com/zeromicro/go-zero/zrpc"
|
||||
|
||||
type Config struct {
|
||||
zrpc.RpcServerConf
|
||||
DB struct {
|
||||
DataSource string
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ func NewCommentProgramLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Co
|
||||
}
|
||||
}
|
||||
|
||||
func (l *CommentProgramLogic) CommentProgram(in *radio.CommentReq) (*radio.CommentResp, error) {
|
||||
func (l *CommentProgramLogic) CommentProgram(in *radio.CommentReq) (*radio.CommonResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.CommentResp{}, nil
|
||||
return &radio.CommonResp{}, nil
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ func NewCreateCategoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Cr
|
||||
}
|
||||
|
||||
// 分类
|
||||
func (l *CreateCategoryLogic) CreateCategory(in *radio.CreateCategoryReq) (*radio.CreateCategoryResp, error) {
|
||||
func (l *CreateCategoryLogic) CreateCategory(in *radio.CategoryReq) (*radio.CommonResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.CreateCategoryResp{}, nil
|
||||
return &radio.CommonResp{}, nil
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ func NewCreateChannelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Cre
|
||||
}
|
||||
|
||||
// 频道
|
||||
func (l *CreateChannelLogic) CreateChannel(in *radio.CreateChannelReq) (*radio.CreateChannelResp, error) {
|
||||
func (l *CreateChannelLogic) CreateChannel(in *radio.CreateChannelReq) (*radio.CommonResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.CreateChannelResp{}, nil
|
||||
return &radio.CommonResp{}, nil
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ func NewCreateProgramLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Cre
|
||||
}
|
||||
|
||||
// 节目
|
||||
func (l *CreateProgramLogic) CreateProgram(in *radio.CreateProgramReq) (*radio.CreateProgramResp, error) {
|
||||
func (l *CreateProgramLogic) CreateProgram(in *radio.CreateProgramReq) (*radio.CommonResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.CreateProgramResp{}, nil
|
||||
return &radio.CommonResp{}, nil
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ func NewCreateVoiceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Creat
|
||||
}
|
||||
|
||||
// 音色
|
||||
func (l *CreateVoiceLogic) CreateVoice(in *radio.CreateVoiceReq) (*radio.CreateVoiceResp, error) {
|
||||
func (l *CreateVoiceLogic) CreateVoice(in *radio.CreateVoiceReq) (*radio.CommonResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.CreateVoiceResp{}, nil
|
||||
return &radio.CommonResp{}, nil
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ func NewDeleteCategoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *De
|
||||
}
|
||||
}
|
||||
|
||||
func (l *DeleteCategoryLogic) DeleteCategory(in *radio.DeleteByIdsReq) (*radio.DeleteResp, error) {
|
||||
func (l *DeleteCategoryLogic) DeleteCategory(in *radio.IdsReq) (*radio.CommonResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.DeleteResp{}, nil
|
||||
return &radio.CommonResp{}, nil
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ func NewDeleteChannelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Del
|
||||
}
|
||||
}
|
||||
|
||||
func (l *DeleteChannelLogic) DeleteChannel(in *radio.DeleteByIdsReq) (*radio.DeleteResp, error) {
|
||||
func (l *DeleteChannelLogic) DeleteChannel(in *radio.IdsReq) (*radio.CommonResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.DeleteResp{}, nil
|
||||
return &radio.CommonResp{}, nil
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ func NewDeleteProgramLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Del
|
||||
}
|
||||
}
|
||||
|
||||
func (l *DeleteProgramLogic) DeleteProgram(in *radio.DeleteByIdsReq) (*radio.DeleteResp, error) {
|
||||
func (l *DeleteProgramLogic) DeleteProgram(in *radio.IdsReq) (*radio.CommonResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.DeleteResp{}, nil
|
||||
return &radio.CommonResp{}, nil
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ func NewDeleteVoiceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Delet
|
||||
}
|
||||
}
|
||||
|
||||
func (l *DeleteVoiceLogic) DeleteVoice(in *radio.DeleteByIdsReq) (*radio.DeleteResp, error) {
|
||||
func (l *DeleteVoiceLogic) DeleteVoice(in *radio.IdsReq) (*radio.CommonResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.DeleteResp{}, nil
|
||||
return &radio.CommonResp{}, nil
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/radio/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/radio/rpc/radio"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetAnalyticsOverviewLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetAnalyticsOverviewLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetAnalyticsOverviewLogic {
|
||||
return &GetAnalyticsOverviewLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
// 数据分析
|
||||
func (l *GetAnalyticsOverviewLogic) GetAnalyticsOverview(in *radio.AnalyticsReq) (*radio.AnalyticsOverviewResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.AnalyticsOverviewResp{}, nil
|
||||
}
|
||||
@@ -23,8 +23,8 @@ func NewGetCategoryListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *G
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetCategoryListLogic) GetCategoryList(in *radio.GetCategoryListReq) (*radio.GetCategoryListResp, error) {
|
||||
func (l *GetCategoryListLogic) GetCategoryList(in *radio.CategoryListReq) (*radio.CategoryListResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.GetCategoryListResp{}, nil
|
||||
return &radio.CategoryListResp{}, nil
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/radio/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/radio/rpc/radio"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetChannelAnalyticsLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetChannelAnalyticsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetChannelAnalyticsLogic {
|
||||
return &GetChannelAnalyticsLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetChannelAnalyticsLogic) GetChannelAnalytics(in *radio.AnalyticsReq) (*radio.ChannelAnalyticsResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.ChannelAnalyticsResp{}, nil
|
||||
}
|
||||
@@ -23,8 +23,8 @@ func NewGetChannelDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetChannelDetailLogic) GetChannelDetail(in *radio.GetChannelDetailReq) (*radio.GetChannelDetailResp, error) {
|
||||
func (l *GetChannelDetailLogic) GetChannelDetail(in *radio.IdReq) (*radio.ChannelInfo, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.GetChannelDetailResp{}, nil
|
||||
return &radio.ChannelInfo{}, nil
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ func NewGetChannelListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetChannelListLogic) GetChannelList(in *radio.GetChannelListReq) (*radio.GetChannelListResp, error) {
|
||||
func (l *GetChannelListLogic) GetChannelList(in *radio.ChannelListReq) (*radio.ChannelListResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.GetChannelListResp{}, nil
|
||||
return &radio.ChannelListResp{}, nil
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ func NewGetFavoriteListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *G
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetFavoriteListLogic) GetFavoriteList(in *radio.GetFavoriteListReq) (*radio.GetFavoriteListResp, error) {
|
||||
func (l *GetFavoriteListLogic) GetFavoriteList(in *radio.InteractionListReq) (*radio.FavoriteListResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.GetFavoriteListResp{}, nil
|
||||
return &radio.FavoriteListResp{}, nil
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ func NewGetHistoryListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetHistoryListLogic) GetHistoryList(in *radio.GetHistoryListReq) (*radio.GetHistoryListResp, error) {
|
||||
func (l *GetHistoryListLogic) GetHistoryList(in *radio.InteractionListReq) (*radio.HistoryListResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.GetHistoryListResp{}, nil
|
||||
return &radio.HistoryListResp{}, nil
|
||||
}
|
||||
|
||||
@@ -23,9 +23,9 @@ func NewGetMySubscriptionsLogic(ctx context.Context, svcCtx *svc.ServiceContext)
|
||||
}
|
||||
}
|
||||
|
||||
// 订阅
|
||||
func (l *GetMySubscriptionsLogic) GetMySubscriptions(in *radio.GetMySubscriptionsReq) (*radio.GetMySubscriptionsResp, error) {
|
||||
// 订阅/VIP
|
||||
func (l *GetMySubscriptionsLogic) GetMySubscriptions(in *radio.SubscriptionListReq) (*radio.SubscriptionListResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.GetMySubscriptionsResp{}, nil
|
||||
return &radio.SubscriptionListResp{}, nil
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ func NewGetMyVipInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetM
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetMyVipInfoLogic) GetMyVipInfo(in *radio.GetMyVipInfoReq) (*radio.GetMyVipInfoResp, error) {
|
||||
func (l *GetMyVipInfoLogic) GetMyVipInfo(in *radio.GetProfileReq) (*radio.RadioUserProfile, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.GetMyVipInfoResp{}, nil
|
||||
return &radio.RadioUserProfile{}, nil
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ func NewGetProgramDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetProgramDetailLogic) GetProgramDetail(in *radio.GetProgramDetailReq) (*radio.GetProgramDetailResp, error) {
|
||||
func (l *GetProgramDetailLogic) GetProgramDetail(in *radio.IdReq) (*radio.ProgramInfo, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.GetProgramDetailResp{}, nil
|
||||
return &radio.ProgramInfo{}, nil
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ func NewGetProgramListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetProgramListLogic) GetProgramList(in *radio.GetProgramListReq) (*radio.GetProgramListResp, error) {
|
||||
func (l *GetProgramListLogic) GetProgramList(in *radio.ProgramListReq) (*radio.ProgramListResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.GetProgramListResp{}, nil
|
||||
return &radio.ProgramListResp{}, nil
|
||||
}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/radio/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/radio/rpc/radio"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetRadioUserProfileLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetRadioUserProfileLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetRadioUserProfileLogic {
|
||||
return &GetRadioUserProfileLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
// 用户
|
||||
func (l *GetRadioUserProfileLogic) GetRadioUserProfile(in *radio.GetRadioUserProfileReq) (*radio.GetRadioUserProfileResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.GetRadioUserProfileResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/radio/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/radio/rpc/radio"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetUserAnalyticsLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetUserAnalyticsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserAnalyticsLogic {
|
||||
return &GetUserAnalyticsLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetUserAnalyticsLogic) GetUserAnalytics(in *radio.AnalyticsReq) (*radio.UserAnalyticsResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.UserAnalyticsResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/radio/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/radio/rpc/radio"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type GetUserProfileLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetUserProfileLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserProfileLogic {
|
||||
return &GetUserProfileLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
// 用户Profile
|
||||
func (l *GetUserProfileLogic) GetUserProfile(in *radio.GetProfileReq) (*radio.RadioUserProfile, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.RadioUserProfile{}, nil
|
||||
}
|
||||
@@ -23,9 +23,8 @@ func NewGetVipConfigListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *
|
||||
}
|
||||
}
|
||||
|
||||
// VIP
|
||||
func (l *GetVipConfigListLogic) GetVipConfigList(in *radio.GetVipConfigListReq) (*radio.GetVipConfigListResp, error) {
|
||||
func (l *GetVipConfigListLogic) GetVipConfigList(in *radio.IdReq) (*radio.VipConfigListResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.GetVipConfigListResp{}, nil
|
||||
return &radio.VipConfigListResp{}, nil
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ func NewGetVoiceListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetV
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetVoiceListLogic) GetVoiceList(in *radio.GetVoiceListReq) (*radio.GetVoiceListResp, error) {
|
||||
func (l *GetVoiceListLogic) GetVoiceList(in *radio.VoiceListReq) (*radio.VoiceListResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.GetVoiceListResp{}, nil
|
||||
return &radio.VoiceListResp{}, nil
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ func NewRecordHistoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Rec
|
||||
}
|
||||
}
|
||||
|
||||
func (l *RecordHistoryLogic) RecordHistory(in *radio.RecordHistoryReq) (*radio.RecordHistoryResp, error) {
|
||||
func (l *RecordHistoryLogic) RecordHistory(in *radio.RecordHistoryReq) (*radio.CommonResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.RecordHistoryResp{}, nil
|
||||
return &radio.CommonResp{}, nil
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ func NewToggleFavoriteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *To
|
||||
}
|
||||
}
|
||||
|
||||
func (l *ToggleFavoriteLogic) ToggleFavorite(in *radio.ToggleFavoriteReq) (*radio.ToggleFavoriteResp, error) {
|
||||
func (l *ToggleFavoriteLogic) ToggleFavorite(in *radio.ToggleFavoriteReq) (*radio.CommonResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.ToggleFavoriteResp{}, nil
|
||||
return &radio.CommonResp{}, nil
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ func NewToggleLikeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Toggle
|
||||
}
|
||||
|
||||
// 互动
|
||||
func (l *ToggleLikeLogic) ToggleLike(in *radio.ToggleLikeReq) (*radio.ToggleLikeResp, error) {
|
||||
func (l *ToggleLikeLogic) ToggleLike(in *radio.ToggleLikeReq) (*radio.CommonResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.ToggleLikeResp{}, nil
|
||||
return &radio.CommonResp{}, nil
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ func NewUpdateCategoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Up
|
||||
}
|
||||
}
|
||||
|
||||
func (l *UpdateCategoryLogic) UpdateCategory(in *radio.UpdateCategoryReq) (*radio.UpdateCategoryResp, error) {
|
||||
func (l *UpdateCategoryLogic) UpdateCategory(in *radio.CategoryUpdateReq) (*radio.CommonResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.UpdateCategoryResp{}, nil
|
||||
return &radio.CommonResp{}, nil
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ func NewUpdateChannelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Upd
|
||||
}
|
||||
}
|
||||
|
||||
func (l *UpdateChannelLogic) UpdateChannel(in *radio.UpdateChannelReq) (*radio.UpdateChannelResp, error) {
|
||||
func (l *UpdateChannelLogic) UpdateChannel(in *radio.UpdateChannelReq) (*radio.CommonResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.UpdateChannelResp{}, nil
|
||||
return &radio.CommonResp{}, nil
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ func NewUpdateProgramLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Upd
|
||||
}
|
||||
}
|
||||
|
||||
func (l *UpdateProgramLogic) UpdateProgram(in *radio.UpdateProgramReq) (*radio.UpdateProgramResp, error) {
|
||||
func (l *UpdateProgramLogic) UpdateProgram(in *radio.UpdateProgramReq) (*radio.CommonResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.UpdateProgramResp{}, nil
|
||||
return &radio.CommonResp{}, nil
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ func NewUpdateVoiceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Updat
|
||||
}
|
||||
}
|
||||
|
||||
func (l *UpdateVoiceLogic) UpdateVoice(in *radio.UpdateVoiceReq) (*radio.UpdateVoiceResp, error) {
|
||||
func (l *UpdateVoiceLogic) UpdateVoice(in *radio.UpdateVoiceReq) (*radio.CommonResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &radio.UpdateVoiceResp{}, nil
|
||||
return &radio.CommonResp{}, nil
|
||||
}
|
||||
|
||||
@@ -23,139 +23,139 @@ func NewRadioServiceServer(svcCtx *svc.ServiceContext) *RadioServiceServer {
|
||||
}
|
||||
}
|
||||
|
||||
// 用户
|
||||
func (s *RadioServiceServer) GetRadioUserProfile(ctx context.Context, in *radio.GetRadioUserProfileReq) (*radio.GetRadioUserProfileResp, error) {
|
||||
l := logic.NewGetRadioUserProfileLogic(ctx, s.svcCtx)
|
||||
return l.GetRadioUserProfile(in)
|
||||
// 用户Profile
|
||||
func (s *RadioServiceServer) GetUserProfile(ctx context.Context, in *radio.GetProfileReq) (*radio.RadioUserProfile, error) {
|
||||
l := logic.NewGetUserProfileLogic(ctx, s.svcCtx)
|
||||
return l.GetUserProfile(in)
|
||||
}
|
||||
|
||||
// 分类
|
||||
func (s *RadioServiceServer) CreateCategory(ctx context.Context, in *radio.CreateCategoryReq) (*radio.CreateCategoryResp, error) {
|
||||
func (s *RadioServiceServer) CreateCategory(ctx context.Context, in *radio.CategoryReq) (*radio.CommonResp, error) {
|
||||
l := logic.NewCreateCategoryLogic(ctx, s.svcCtx)
|
||||
return l.CreateCategory(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) UpdateCategory(ctx context.Context, in *radio.UpdateCategoryReq) (*radio.UpdateCategoryResp, error) {
|
||||
func (s *RadioServiceServer) UpdateCategory(ctx context.Context, in *radio.CategoryUpdateReq) (*radio.CommonResp, error) {
|
||||
l := logic.NewUpdateCategoryLogic(ctx, s.svcCtx)
|
||||
return l.UpdateCategory(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) DeleteCategory(ctx context.Context, in *radio.DeleteByIdsReq) (*radio.DeleteResp, error) {
|
||||
func (s *RadioServiceServer) DeleteCategory(ctx context.Context, in *radio.IdsReq) (*radio.CommonResp, error) {
|
||||
l := logic.NewDeleteCategoryLogic(ctx, s.svcCtx)
|
||||
return l.DeleteCategory(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) GetCategoryList(ctx context.Context, in *radio.GetCategoryListReq) (*radio.GetCategoryListResp, error) {
|
||||
func (s *RadioServiceServer) GetCategoryList(ctx context.Context, in *radio.CategoryListReq) (*radio.CategoryListResp, error) {
|
||||
l := logic.NewGetCategoryListLogic(ctx, s.svcCtx)
|
||||
return l.GetCategoryList(in)
|
||||
}
|
||||
|
||||
// 频道
|
||||
func (s *RadioServiceServer) CreateChannel(ctx context.Context, in *radio.CreateChannelReq) (*radio.CreateChannelResp, error) {
|
||||
func (s *RadioServiceServer) CreateChannel(ctx context.Context, in *radio.CreateChannelReq) (*radio.CommonResp, error) {
|
||||
l := logic.NewCreateChannelLogic(ctx, s.svcCtx)
|
||||
return l.CreateChannel(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) UpdateChannel(ctx context.Context, in *radio.UpdateChannelReq) (*radio.UpdateChannelResp, error) {
|
||||
func (s *RadioServiceServer) UpdateChannel(ctx context.Context, in *radio.UpdateChannelReq) (*radio.CommonResp, error) {
|
||||
l := logic.NewUpdateChannelLogic(ctx, s.svcCtx)
|
||||
return l.UpdateChannel(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) DeleteChannel(ctx context.Context, in *radio.DeleteByIdsReq) (*radio.DeleteResp, error) {
|
||||
func (s *RadioServiceServer) DeleteChannel(ctx context.Context, in *radio.IdsReq) (*radio.CommonResp, error) {
|
||||
l := logic.NewDeleteChannelLogic(ctx, s.svcCtx)
|
||||
return l.DeleteChannel(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) GetChannelList(ctx context.Context, in *radio.GetChannelListReq) (*radio.GetChannelListResp, error) {
|
||||
func (s *RadioServiceServer) GetChannelList(ctx context.Context, in *radio.ChannelListReq) (*radio.ChannelListResp, error) {
|
||||
l := logic.NewGetChannelListLogic(ctx, s.svcCtx)
|
||||
return l.GetChannelList(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) GetChannelDetail(ctx context.Context, in *radio.GetChannelDetailReq) (*radio.GetChannelDetailResp, error) {
|
||||
func (s *RadioServiceServer) GetChannelDetail(ctx context.Context, in *radio.IdReq) (*radio.ChannelInfo, error) {
|
||||
l := logic.NewGetChannelDetailLogic(ctx, s.svcCtx)
|
||||
return l.GetChannelDetail(in)
|
||||
}
|
||||
|
||||
// 节目
|
||||
func (s *RadioServiceServer) CreateProgram(ctx context.Context, in *radio.CreateProgramReq) (*radio.CreateProgramResp, error) {
|
||||
func (s *RadioServiceServer) CreateProgram(ctx context.Context, in *radio.CreateProgramReq) (*radio.CommonResp, error) {
|
||||
l := logic.NewCreateProgramLogic(ctx, s.svcCtx)
|
||||
return l.CreateProgram(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) UpdateProgram(ctx context.Context, in *radio.UpdateProgramReq) (*radio.UpdateProgramResp, error) {
|
||||
func (s *RadioServiceServer) UpdateProgram(ctx context.Context, in *radio.UpdateProgramReq) (*radio.CommonResp, error) {
|
||||
l := logic.NewUpdateProgramLogic(ctx, s.svcCtx)
|
||||
return l.UpdateProgram(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) DeleteProgram(ctx context.Context, in *radio.DeleteByIdsReq) (*radio.DeleteResp, error) {
|
||||
func (s *RadioServiceServer) DeleteProgram(ctx context.Context, in *radio.IdsReq) (*radio.CommonResp, error) {
|
||||
l := logic.NewDeleteProgramLogic(ctx, s.svcCtx)
|
||||
return l.DeleteProgram(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) GetProgramList(ctx context.Context, in *radio.GetProgramListReq) (*radio.GetProgramListResp, error) {
|
||||
func (s *RadioServiceServer) GetProgramList(ctx context.Context, in *radio.ProgramListReq) (*radio.ProgramListResp, error) {
|
||||
l := logic.NewGetProgramListLogic(ctx, s.svcCtx)
|
||||
return l.GetProgramList(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) GetProgramDetail(ctx context.Context, in *radio.GetProgramDetailReq) (*radio.GetProgramDetailResp, error) {
|
||||
func (s *RadioServiceServer) GetProgramDetail(ctx context.Context, in *radio.IdReq) (*radio.ProgramInfo, error) {
|
||||
l := logic.NewGetProgramDetailLogic(ctx, s.svcCtx)
|
||||
return l.GetProgramDetail(in)
|
||||
}
|
||||
|
||||
// 音色
|
||||
func (s *RadioServiceServer) CreateVoice(ctx context.Context, in *radio.CreateVoiceReq) (*radio.CreateVoiceResp, error) {
|
||||
func (s *RadioServiceServer) CreateVoice(ctx context.Context, in *radio.CreateVoiceReq) (*radio.CommonResp, error) {
|
||||
l := logic.NewCreateVoiceLogic(ctx, s.svcCtx)
|
||||
return l.CreateVoice(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) UpdateVoice(ctx context.Context, in *radio.UpdateVoiceReq) (*radio.UpdateVoiceResp, error) {
|
||||
func (s *RadioServiceServer) UpdateVoice(ctx context.Context, in *radio.UpdateVoiceReq) (*radio.CommonResp, error) {
|
||||
l := logic.NewUpdateVoiceLogic(ctx, s.svcCtx)
|
||||
return l.UpdateVoice(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) DeleteVoice(ctx context.Context, in *radio.DeleteByIdsReq) (*radio.DeleteResp, error) {
|
||||
func (s *RadioServiceServer) DeleteVoice(ctx context.Context, in *radio.IdsReq) (*radio.CommonResp, error) {
|
||||
l := logic.NewDeleteVoiceLogic(ctx, s.svcCtx)
|
||||
return l.DeleteVoice(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) GetVoiceList(ctx context.Context, in *radio.GetVoiceListReq) (*radio.GetVoiceListResp, error) {
|
||||
func (s *RadioServiceServer) GetVoiceList(ctx context.Context, in *radio.VoiceListReq) (*radio.VoiceListResp, error) {
|
||||
l := logic.NewGetVoiceListLogic(ctx, s.svcCtx)
|
||||
return l.GetVoiceList(in)
|
||||
}
|
||||
|
||||
// 互动
|
||||
func (s *RadioServiceServer) ToggleLike(ctx context.Context, in *radio.ToggleLikeReq) (*radio.ToggleLikeResp, error) {
|
||||
func (s *RadioServiceServer) ToggleLike(ctx context.Context, in *radio.ToggleLikeReq) (*radio.CommonResp, error) {
|
||||
l := logic.NewToggleLikeLogic(ctx, s.svcCtx)
|
||||
return l.ToggleLike(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) ToggleFavorite(ctx context.Context, in *radio.ToggleFavoriteReq) (*radio.ToggleFavoriteResp, error) {
|
||||
func (s *RadioServiceServer) ToggleFavorite(ctx context.Context, in *radio.ToggleFavoriteReq) (*radio.CommonResp, error) {
|
||||
l := logic.NewToggleFavoriteLogic(ctx, s.svcCtx)
|
||||
return l.ToggleFavorite(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) CommentProgram(ctx context.Context, in *radio.CommentReq) (*radio.CommentResp, error) {
|
||||
func (s *RadioServiceServer) CommentProgram(ctx context.Context, in *radio.CommentReq) (*radio.CommonResp, error) {
|
||||
l := logic.NewCommentProgramLogic(ctx, s.svcCtx)
|
||||
return l.CommentProgram(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) RecordHistory(ctx context.Context, in *radio.RecordHistoryReq) (*radio.RecordHistoryResp, error) {
|
||||
func (s *RadioServiceServer) RecordHistory(ctx context.Context, in *radio.RecordHistoryReq) (*radio.CommonResp, error) {
|
||||
l := logic.NewRecordHistoryLogic(ctx, s.svcCtx)
|
||||
return l.RecordHistory(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) GetHistoryList(ctx context.Context, in *radio.GetHistoryListReq) (*radio.GetHistoryListResp, error) {
|
||||
l := logic.NewGetHistoryListLogic(ctx, s.svcCtx)
|
||||
return l.GetHistoryList(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) GetFavoriteList(ctx context.Context, in *radio.GetFavoriteListReq) (*radio.GetFavoriteListResp, error) {
|
||||
func (s *RadioServiceServer) GetFavoriteList(ctx context.Context, in *radio.InteractionListReq) (*radio.FavoriteListResp, error) {
|
||||
l := logic.NewGetFavoriteListLogic(ctx, s.svcCtx)
|
||||
return l.GetFavoriteList(in)
|
||||
}
|
||||
|
||||
// 订阅
|
||||
func (s *RadioServiceServer) GetMySubscriptions(ctx context.Context, in *radio.GetMySubscriptionsReq) (*radio.GetMySubscriptionsResp, error) {
|
||||
func (s *RadioServiceServer) GetHistoryList(ctx context.Context, in *radio.InteractionListReq) (*radio.HistoryListResp, error) {
|
||||
l := logic.NewGetHistoryListLogic(ctx, s.svcCtx)
|
||||
return l.GetHistoryList(in)
|
||||
}
|
||||
|
||||
// 订阅/VIP
|
||||
func (s *RadioServiceServer) GetMySubscriptions(ctx context.Context, in *radio.SubscriptionListReq) (*radio.SubscriptionListResp, error) {
|
||||
l := logic.NewGetMySubscriptionsLogic(ctx, s.svcCtx)
|
||||
return l.GetMySubscriptions(in)
|
||||
}
|
||||
@@ -165,13 +165,28 @@ func (s *RadioServiceServer) CreatePayOrder(ctx context.Context, in *radio.Creat
|
||||
return l.CreatePayOrder(in)
|
||||
}
|
||||
|
||||
// VIP
|
||||
func (s *RadioServiceServer) GetVipConfigList(ctx context.Context, in *radio.GetVipConfigListReq) (*radio.GetVipConfigListResp, error) {
|
||||
func (s *RadioServiceServer) GetVipConfigList(ctx context.Context, in *radio.IdReq) (*radio.VipConfigListResp, error) {
|
||||
l := logic.NewGetVipConfigListLogic(ctx, s.svcCtx)
|
||||
return l.GetVipConfigList(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) GetMyVipInfo(ctx context.Context, in *radio.GetMyVipInfoReq) (*radio.GetMyVipInfoResp, error) {
|
||||
func (s *RadioServiceServer) GetMyVipInfo(ctx context.Context, in *radio.GetProfileReq) (*radio.RadioUserProfile, error) {
|
||||
l := logic.NewGetMyVipInfoLogic(ctx, s.svcCtx)
|
||||
return l.GetMyVipInfo(in)
|
||||
}
|
||||
|
||||
// 数据分析
|
||||
func (s *RadioServiceServer) GetAnalyticsOverview(ctx context.Context, in *radio.AnalyticsReq) (*radio.AnalyticsOverviewResp, error) {
|
||||
l := logic.NewGetAnalyticsOverviewLogic(ctx, s.svcCtx)
|
||||
return l.GetAnalyticsOverview(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) GetChannelAnalytics(ctx context.Context, in *radio.AnalyticsReq) (*radio.ChannelAnalyticsResp, error) {
|
||||
l := logic.NewGetChannelAnalyticsLogic(ctx, s.svcCtx)
|
||||
return l.GetChannelAnalytics(in)
|
||||
}
|
||||
|
||||
func (s *RadioServiceServer) GetUserAnalytics(ctx context.Context, in *radio.AnalyticsReq) (*radio.UserAnalyticsResp, error) {
|
||||
l := logic.NewGetUserAnalyticsLogic(ctx, s.svcCtx)
|
||||
return l.GetUserAnalytics(in)
|
||||
}
|
||||
|
||||
@@ -1,13 +1,44 @@
|
||||
package svc
|
||||
|
||||
import "sundynix-micro-go/app/radio/rpc/internal/config"
|
||||
import (
|
||||
radioModel "sundynix-micro-go/app/radio/model"
|
||||
"sundynix-micro-go/app/radio/rpc/internal/config"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"gorm.io/driver/mysql"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type ServiceContext struct {
|
||||
Config config.Config
|
||||
DB *gorm.DB
|
||||
}
|
||||
|
||||
func NewServiceContext(c config.Config) *ServiceContext {
|
||||
return &ServiceContext{
|
||||
Config: c,
|
||||
db, err := gorm.Open(mysql.Open(c.DB.DataSource), &gorm.Config{})
|
||||
if err != nil {
|
||||
logx.Errorf("连接数据库失败: %v", err)
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if err := db.AutoMigrate(
|
||||
&radioModel.SundynixRadioUserProfile{},
|
||||
&radioModel.SundynixRadioCategory{},
|
||||
&radioModel.SundynixRadioChannel{},
|
||||
&radioModel.SundynixRadioProgram{},
|
||||
&radioModel.SundynixRadioVoice{},
|
||||
&radioModel.SundynixRadioLike{},
|
||||
&radioModel.SundynixRadioFavorite{},
|
||||
&radioModel.SundynixRadioComment{},
|
||||
&radioModel.SundynixRadioHistory{},
|
||||
&radioModel.SundynixRadioSubscription{},
|
||||
&radioModel.SundynixRadioSubscriptionOrder{},
|
||||
&radioModel.SundynixRadioPayNotify{},
|
||||
&radioModel.SundynixRadioVipConfig{},
|
||||
&radioModel.SundynixRadioListenLog{},
|
||||
); err != nil {
|
||||
logx.Errorf("数据库迁移失败: %v", err)
|
||||
}
|
||||
|
||||
return &ServiceContext{Config: c, DB: db}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user