Compare commits

...

6 Commits

Author SHA1 Message Date
8a9bb7d179 修改自媒体账号获取方式 2026-01-22 09:54:53 +08:00
9f9634e38e 发送日志数据 2026-01-22 09:27:39 +08:00
e1b9781daf 取消授权 2026-01-20 16:46:55 +08:00
abecc03b96 修改套餐过期 2026-01-20 16:26:05 +08:00
e2097a5b2c Merge branch 'main' into feature-four-daiyb 2026-01-20 10:10:16 +08:00
ed3c23724d 添加艺人编号 2026-01-19 10:36:28 +08:00
13 changed files with 7980 additions and 14161 deletions

File diff suppressed because it is too large Load Diff

View File

@ -206,6 +206,15 @@ func (this *GenerateJWTRequest) Validate() error {
func (this *GenerateJWTResponse) Validate() error { func (this *GenerateJWTResponse) Validate() error {
return nil return nil
} }
func (this *UnlinkSocialNetworkRequest) Validate() error {
if this.Platform == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Platform", fmt.Errorf(`platform不能为空`))
}
return nil
}
func (this *UnlinkSocialNetworkResponse) Validate() error {
return nil
}
func (this *HistoryPostId) Validate() error { func (this *HistoryPostId) Validate() error {
return nil return nil
} }

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT. // Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-triple v1.0.8 // - protoc-gen-go-triple v1.0.8
// - protoc v3.21.1 // - protoc v6.32.0--rc2
// source: pb/ayrshare.proto // source: pb/ayrshare.proto
package aryshare package aryshare
@ -37,6 +37,7 @@ type AyrshareClient interface {
CreateProfile(ctx context.Context, in *CreateProfileRequest, opts ...grpc_go.CallOption) (*CreateProfileResponse, common.ErrorWithAttachment) CreateProfile(ctx context.Context, in *CreateProfileRequest, opts ...grpc_go.CallOption) (*CreateProfileResponse, common.ErrorWithAttachment)
GetProfiles(ctx context.Context, in *GetProfilesRequest, opts ...grpc_go.CallOption) (*GetProfilesResponse, common.ErrorWithAttachment) GetProfiles(ctx context.Context, in *GetProfilesRequest, opts ...grpc_go.CallOption) (*GetProfilesResponse, common.ErrorWithAttachment)
GenerateJWT(ctx context.Context, in *GenerateJWTRequest, opts ...grpc_go.CallOption) (*GenerateJWTResponse, common.ErrorWithAttachment) GenerateJWT(ctx context.Context, in *GenerateJWTRequest, opts ...grpc_go.CallOption) (*GenerateJWTResponse, common.ErrorWithAttachment)
UnlinkSocialNetwork(ctx context.Context, in *UnlinkSocialNetworkRequest, opts ...grpc_go.CallOption) (*UnlinkSocialNetworkResponse, common.ErrorWithAttachment)
// 历史记录相关 api // 历史记录相关 api
GetHistory(ctx context.Context, in *GetHistoryRequest, opts ...grpc_go.CallOption) (*GetHistoryResponse, common.ErrorWithAttachment) GetHistory(ctx context.Context, in *GetHistoryRequest, opts ...grpc_go.CallOption) (*GetHistoryResponse, common.ErrorWithAttachment)
GetHistoryById(ctx context.Context, in *GetHistoryByIdRequest, opts ...grpc_go.CallOption) (*GetHistoryByIdResponse, common.ErrorWithAttachment) GetHistoryById(ctx context.Context, in *GetHistoryByIdRequest, opts ...grpc_go.CallOption) (*GetHistoryByIdResponse, common.ErrorWithAttachment)
@ -71,6 +72,7 @@ type AyrshareClientImpl struct {
CreateProfile func(ctx context.Context, in *CreateProfileRequest) (*CreateProfileResponse, error) CreateProfile func(ctx context.Context, in *CreateProfileRequest) (*CreateProfileResponse, error)
GetProfiles func(ctx context.Context, in *GetProfilesRequest) (*GetProfilesResponse, error) GetProfiles func(ctx context.Context, in *GetProfilesRequest) (*GetProfilesResponse, error)
GenerateJWT func(ctx context.Context, in *GenerateJWTRequest) (*GenerateJWTResponse, error) GenerateJWT func(ctx context.Context, in *GenerateJWTRequest) (*GenerateJWTResponse, error)
UnlinkSocialNetwork func(ctx context.Context, in *UnlinkSocialNetworkRequest) (*UnlinkSocialNetworkResponse, error)
GetHistory func(ctx context.Context, in *GetHistoryRequest) (*GetHistoryResponse, error) GetHistory func(ctx context.Context, in *GetHistoryRequest) (*GetHistoryResponse, error)
GetHistoryById func(ctx context.Context, in *GetHistoryByIdRequest) (*GetHistoryByIdResponse, error) GetHistoryById func(ctx context.Context, in *GetHistoryByIdRequest) (*GetHistoryByIdResponse, error)
GetHistoryByPlatform func(ctx context.Context, in *GetHistoryByPlatformRequest) (*GetHistoryByPlatformResponse, error) GetHistoryByPlatform func(ctx context.Context, in *GetHistoryByPlatformRequest) (*GetHistoryByPlatformResponse, error)
@ -137,6 +139,12 @@ func (c *ayrshareClient) GenerateJWT(ctx context.Context, in *GenerateJWTRequest
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GenerateJWT", in, out) return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GenerateJWT", in, out)
} }
func (c *ayrshareClient) UnlinkSocialNetwork(ctx context.Context, in *UnlinkSocialNetworkRequest, opts ...grpc_go.CallOption) (*UnlinkSocialNetworkResponse, common.ErrorWithAttachment) {
out := new(UnlinkSocialNetworkResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UnlinkSocialNetwork", in, out)
}
func (c *ayrshareClient) GetHistory(ctx context.Context, in *GetHistoryRequest, opts ...grpc_go.CallOption) (*GetHistoryResponse, common.ErrorWithAttachment) { func (c *ayrshareClient) GetHistory(ctx context.Context, in *GetHistoryRequest, opts ...grpc_go.CallOption) (*GetHistoryResponse, common.ErrorWithAttachment) {
out := new(GetHistoryResponse) out := new(GetHistoryResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string) interfaceKey := ctx.Value(constant.InterfaceKey).(string)
@ -246,6 +254,7 @@ type AyrshareServer interface {
CreateProfile(context.Context, *CreateProfileRequest) (*CreateProfileResponse, error) CreateProfile(context.Context, *CreateProfileRequest) (*CreateProfileResponse, error)
GetProfiles(context.Context, *GetProfilesRequest) (*GetProfilesResponse, error) GetProfiles(context.Context, *GetProfilesRequest) (*GetProfilesResponse, error)
GenerateJWT(context.Context, *GenerateJWTRequest) (*GenerateJWTResponse, error) GenerateJWT(context.Context, *GenerateJWTRequest) (*GenerateJWTResponse, error)
UnlinkSocialNetwork(context.Context, *UnlinkSocialNetworkRequest) (*UnlinkSocialNetworkResponse, error)
// 历史记录相关 api // 历史记录相关 api
GetHistory(context.Context, *GetHistoryRequest) (*GetHistoryResponse, error) GetHistory(context.Context, *GetHistoryRequest) (*GetHistoryResponse, error)
GetHistoryById(context.Context, *GetHistoryByIdRequest) (*GetHistoryByIdResponse, error) GetHistoryById(context.Context, *GetHistoryByIdRequest) (*GetHistoryByIdResponse, error)
@ -293,6 +302,9 @@ func (UnimplementedAyrshareServer) GetProfiles(context.Context, *GetProfilesRequ
func (UnimplementedAyrshareServer) GenerateJWT(context.Context, *GenerateJWTRequest) (*GenerateJWTResponse, error) { func (UnimplementedAyrshareServer) GenerateJWT(context.Context, *GenerateJWTRequest) (*GenerateJWTResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GenerateJWT not implemented") return nil, status.Errorf(codes.Unimplemented, "method GenerateJWT not implemented")
} }
func (UnimplementedAyrshareServer) UnlinkSocialNetwork(context.Context, *UnlinkSocialNetworkRequest) (*UnlinkSocialNetworkResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UnlinkSocialNetwork not implemented")
}
func (UnimplementedAyrshareServer) GetHistory(context.Context, *GetHistoryRequest) (*GetHistoryResponse, error) { func (UnimplementedAyrshareServer) GetHistory(context.Context, *GetHistoryRequest) (*GetHistoryResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetHistory not implemented") return nil, status.Errorf(codes.Unimplemented, "method GetHistory not implemented")
} }
@ -543,6 +555,35 @@ func _Ayrshare_GenerateJWT_Handler(srv interface{}, ctx context.Context, dec fun
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Ayrshare_UnlinkSocialNetwork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(UnlinkSocialNetworkRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("UnlinkSocialNetwork", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Ayrshare_GetHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { func _Ayrshare_GetHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetHistoryRequest) in := new(GetHistoryRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@ -1038,6 +1079,10 @@ var Ayrshare_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "GenerateJWT", MethodName: "GenerateJWT",
Handler: _Ayrshare_GenerateJWT_Handler, Handler: _Ayrshare_GenerateJWT_Handler,
}, },
{
MethodName: "UnlinkSocialNetwork",
Handler: _Ayrshare_UnlinkSocialNetwork_Handler,
},
{ {
MethodName: "GetHistory", MethodName: "GetHistory",
Handler: _Ayrshare_GetHistory_Handler, Handler: _Ayrshare_GetHistory_Handler,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT. // Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-triple v1.0.8 // - protoc-gen-go-triple v1.0.8
// - protoc v3.21.1 // - protoc v6.32.0--rc2
// source: pb/fiee/cast.proto // source: pb/fiee/cast.proto
package cast package cast
@ -54,6 +54,7 @@ type CastClient interface {
RefreshWorkList(ctx context.Context, in *RefreshWorkListReq, opts ...grpc_go.CallOption) (*RefreshWorkListResp, common.ErrorWithAttachment) RefreshWorkList(ctx context.Context, in *RefreshWorkListReq, opts ...grpc_go.CallOption) (*RefreshWorkListResp, common.ErrorWithAttachment)
WorkResource(ctx context.Context, in *WorkResourceReq, opts ...grpc_go.CallOption) (*WorkResourceResp, common.ErrorWithAttachment) WorkResource(ctx context.Context, in *WorkResourceReq, opts ...grpc_go.CallOption) (*WorkResourceResp, common.ErrorWithAttachment)
UpdateWorkResource(ctx context.Context, in *UpdateWorkResourceReq, opts ...grpc_go.CallOption) (*UpdateWorkResourceResp, common.ErrorWithAttachment) UpdateWorkResource(ctx context.Context, in *UpdateWorkResourceReq, opts ...grpc_go.CallOption) (*UpdateWorkResourceResp, common.ErrorWithAttachment)
UpdateMediaAccStatus(ctx context.Context, in *UpdateMediaAccStatusReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
OAuthAccount(ctx context.Context, in *OAuthAccountReq, opts ...grpc_go.CallOption) (*OAuthAccountResp, common.ErrorWithAttachment) OAuthAccount(ctx context.Context, in *OAuthAccountReq, opts ...grpc_go.CallOption) (*OAuthAccountResp, common.ErrorWithAttachment)
OAuthAccountV2(ctx context.Context, in *OAuthAccountV2Req, opts ...grpc_go.CallOption) (*OAuthAccountV2Resp, common.ErrorWithAttachment) OAuthAccountV2(ctx context.Context, in *OAuthAccountV2Req, opts ...grpc_go.CallOption) (*OAuthAccountV2Resp, common.ErrorWithAttachment)
OAuthCodeToToken(ctx context.Context, in *OAuthCodeToTokenReq, opts ...grpc_go.CallOption) (*OAuthCodeToTokenResp, common.ErrorWithAttachment) OAuthCodeToToken(ctx context.Context, in *OAuthCodeToTokenReq, opts ...grpc_go.CallOption) (*OAuthCodeToTokenResp, common.ErrorWithAttachment)
@ -164,6 +165,7 @@ type CastClientImpl struct {
RefreshWorkList func(ctx context.Context, in *RefreshWorkListReq) (*RefreshWorkListResp, error) RefreshWorkList func(ctx context.Context, in *RefreshWorkListReq) (*RefreshWorkListResp, error)
WorkResource func(ctx context.Context, in *WorkResourceReq) (*WorkResourceResp, error) WorkResource func(ctx context.Context, in *WorkResourceReq) (*WorkResourceResp, error)
UpdateWorkResource func(ctx context.Context, in *UpdateWorkResourceReq) (*UpdateWorkResourceResp, error) UpdateWorkResource func(ctx context.Context, in *UpdateWorkResourceReq) (*UpdateWorkResourceResp, error)
UpdateMediaAccStatus func(ctx context.Context, in *UpdateMediaAccStatusReq) (*emptypb.Empty, error)
OAuthAccount func(ctx context.Context, in *OAuthAccountReq) (*OAuthAccountResp, error) OAuthAccount func(ctx context.Context, in *OAuthAccountReq) (*OAuthAccountResp, error)
OAuthAccountV2 func(ctx context.Context, in *OAuthAccountV2Req) (*OAuthAccountV2Resp, error) OAuthAccountV2 func(ctx context.Context, in *OAuthAccountV2Req) (*OAuthAccountV2Resp, error)
OAuthCodeToToken func(ctx context.Context, in *OAuthCodeToTokenReq) (*OAuthCodeToTokenResp, error) OAuthCodeToToken func(ctx context.Context, in *OAuthCodeToTokenReq) (*OAuthCodeToTokenResp, error)
@ -391,6 +393,12 @@ func (c *castClient) UpdateWorkResource(ctx context.Context, in *UpdateWorkResou
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateWorkResource", in, out) return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateWorkResource", in, out)
} }
func (c *castClient) UpdateMediaAccStatus(ctx context.Context, in *UpdateMediaAccStatusReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment) {
out := new(emptypb.Empty)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateMediaAccStatus", in, out)
}
func (c *castClient) OAuthAccount(ctx context.Context, in *OAuthAccountReq, opts ...grpc_go.CallOption) (*OAuthAccountResp, common.ErrorWithAttachment) { func (c *castClient) OAuthAccount(ctx context.Context, in *OAuthAccountReq, opts ...grpc_go.CallOption) (*OAuthAccountResp, common.ErrorWithAttachment) {
out := new(OAuthAccountResp) out := new(OAuthAccountResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string) interfaceKey := ctx.Value(constant.InterfaceKey).(string)
@ -798,6 +806,7 @@ type CastServer interface {
RefreshWorkList(context.Context, *RefreshWorkListReq) (*RefreshWorkListResp, error) RefreshWorkList(context.Context, *RefreshWorkListReq) (*RefreshWorkListResp, error)
WorkResource(context.Context, *WorkResourceReq) (*WorkResourceResp, error) WorkResource(context.Context, *WorkResourceReq) (*WorkResourceResp, error)
UpdateWorkResource(context.Context, *UpdateWorkResourceReq) (*UpdateWorkResourceResp, error) UpdateWorkResource(context.Context, *UpdateWorkResourceReq) (*UpdateWorkResourceResp, error)
UpdateMediaAccStatus(context.Context, *UpdateMediaAccStatusReq) (*emptypb.Empty, error)
OAuthAccount(context.Context, *OAuthAccountReq) (*OAuthAccountResp, error) OAuthAccount(context.Context, *OAuthAccountReq) (*OAuthAccountResp, error)
OAuthAccountV2(context.Context, *OAuthAccountV2Req) (*OAuthAccountV2Resp, error) OAuthAccountV2(context.Context, *OAuthAccountV2Req) (*OAuthAccountV2Resp, error)
OAuthCodeToToken(context.Context, *OAuthCodeToTokenReq) (*OAuthCodeToTokenResp, error) OAuthCodeToToken(context.Context, *OAuthCodeToTokenReq) (*OAuthCodeToTokenResp, error)
@ -959,6 +968,9 @@ func (UnimplementedCastServer) WorkResource(context.Context, *WorkResourceReq) (
func (UnimplementedCastServer) UpdateWorkResource(context.Context, *UpdateWorkResourceReq) (*UpdateWorkResourceResp, error) { func (UnimplementedCastServer) UpdateWorkResource(context.Context, *UpdateWorkResourceReq) (*UpdateWorkResourceResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateWorkResource not implemented") return nil, status.Errorf(codes.Unimplemented, "method UpdateWorkResource not implemented")
} }
func (UnimplementedCastServer) UpdateMediaAccStatus(context.Context, *UpdateMediaAccStatusReq) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateMediaAccStatus not implemented")
}
func (UnimplementedCastServer) OAuthAccount(context.Context, *OAuthAccountReq) (*OAuthAccountResp, error) { func (UnimplementedCastServer) OAuthAccount(context.Context, *OAuthAccountReq) (*OAuthAccountResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method OAuthAccount not implemented") return nil, status.Errorf(codes.Unimplemented, "method OAuthAccount not implemented")
} }
@ -1901,6 +1913,35 @@ func _Cast_UpdateWorkResource_Handler(srv interface{}, ctx context.Context, dec
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Cast_UpdateMediaAccStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateMediaAccStatusReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("UpdateMediaAccStatus", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Cast_OAuthAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { func _Cast_OAuthAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(OAuthAccountReq) in := new(OAuthAccountReq)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@ -3835,6 +3876,10 @@ var Cast_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "UpdateWorkResource", MethodName: "UpdateWorkResource",
Handler: _Cast_UpdateWorkResource_Handler, Handler: _Cast_UpdateWorkResource_Handler,
}, },
{
MethodName: "UpdateMediaAccStatus",
Handler: _Cast_UpdateMediaAccStatus_Handler,
},
{ {
MethodName: "OAuthAccount", MethodName: "OAuthAccount",
Handler: _Cast_OAuthAccount_Handler, Handler: _Cast_OAuthAccount_Handler,

View File

@ -43,13 +43,6 @@ var PlatformPublishStatusMM = map[cast.PublishStatusENUM]string{
cast.PublishStatusENUM_PublishMediaStatus_EXCEPTION: "异常", cast.PublishStatusENUM_PublishMediaStatus_EXCEPTION: "异常",
} }
var PlatformIDMM = map[int]string{
1: "TIKTOK",
2: "YouTube",
3: "Ins",
4: "DM",
}
var WorkStatusMM = map[int]string{ var WorkStatusMM = map[int]string{
1: "草稿", 1: "草稿",
2: "审核中", 2: "审核中",

View File

@ -24,6 +24,7 @@ func MediaRouter(r *gin.RouterGroup) {
media.POST("artist-info", serviceCast.ArtistInfo) media.POST("artist-info", serviceCast.ArtistInfo)
media.POST("sync-as-profile", serviceCast.SyncAsProfile) media.POST("sync-as-profile", serviceCast.SyncAsProfile)
media.POST("import-media-account", serviceCast.ImportMediaAccount) media.POST("import-media-account", serviceCast.ImportMediaAccount)
media.POST("unbind-auth", serviceCast.UnbindAuth)
} }
mediaNoLogin := r.Group("media") mediaNoLogin := r.Group("media")
{ {

View File

@ -6,6 +6,7 @@ import (
"fonchain-fiee/cmd/config" "fonchain-fiee/cmd/config"
"fonchain-fiee/pkg/model/login" "fonchain-fiee/pkg/model/login"
"fonchain-fiee/pkg/service" "fonchain-fiee/pkg/service"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
@ -16,7 +17,7 @@ func UserAccounts(ctx *gin.Context) {
userInfo := login.GetUserInfoFromC(ctx) userInfo := login.GetUserInfoFromC(ctx)
req.ArtistUuid = fmt.Sprint(userInfo.ID) req.ArtistUuid = fmt.Sprint(userInfo.ID)
} else { } else {
req.ArtistUuid = "61" req.ArtistUuid = "1234"
} }
if err = ctx.ShouldBind(&req); err != nil { if err = ctx.ShouldBind(&req); err != nil {

View File

@ -992,6 +992,14 @@ func processMediaMetricsTask(ctx context.Context, task mediaMetricsTask) *cast.M
} }
socialResp, err := service.AyrshareProvider.GetSocialAnalytics(ctx, socialReq) socialResp, err := service.AyrshareProvider.GetSocialAnalytics(ctx, socialReq)
if err != nil { if err != nil {
// 传送账号错误,用来判断是不是被封了
go func(task mediaMetricsTask) {
_, _ = service.CastProvider.UpdateMediaAccStatus(ctx, &cast.UpdateMediaAccStatusReq{
ArtistUuid: task.artistInfo.ArtistUuid,
PlatformID: task.platformID,
InfoResp: err.Error(),
})
}(task)
// 构建失败记录 // 构建失败记录
return buildFailedMediaMetricsItem(task.artistInfo, task.dateCN, 3, "获取社交分析数据失败", task.platformID, mediaInfoResp.Info) return buildFailedMediaMetricsItem(task.artistInfo, task.dateCN, 3, "获取社交分析数据失败", task.platformID, mediaInfoResp.Info)
} }

View File

@ -772,3 +772,48 @@ func updateMediaAccount(platformName string, platformId cast.PlatformIDENUM, sub
//} //}
return err return err
} }
func UnbindAuth(ctx *gin.Context) {
var req *cast.OAuthAccountV2Req
var err error
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
if err = req.Validate(); err != nil {
service.Error(ctx, err)
return
}
mediaResp, err := service.CastProvider.MediaUserList(ctx, &cast.MediaUserListReq{
MediaUserID: req.MediaAccountUuid,
Page: 1,
PageSize: 1,
})
if err != nil {
service.Error(ctx, err)
return
}
if mediaResp == nil || len(mediaResp.Data) == 0 {
service.Error(ctx, errors.New("未找到该账号"))
return
}
asArtistResp, _err := service.CastProvider.GetArtist(context.Background(), &cast.GetArtistReq{
ArtistUuid: fmt.Sprint(mediaResp.Data[0].ArtistUuid),
})
if _err != nil {
service.Error(ctx, errors.New("未找到该艺人"))
return
}
resp, err := service.AyrshareProvider.UnlinkSocialNetwork(context.Background(), &aryshare.UnlinkSocialNetworkRequest{
Platform: modelCast.PlatformNameKv[mediaResp.Data[0].PlatformID],
ProfileKey: asArtistResp.ArtistInfo.ProfileKey,
})
if err != nil {
zap.L().Error("UnlinkSocialNetwork err", zap.Error(err))
service.Error(ctx, errors.New("解除授权失败"))
return
}
_ = SyncAsAuth(mediaResp.Data[0].ArtistUuid)
service.Success(ctx, resp)
return
}

View File

@ -17,13 +17,17 @@ import (
func Test(ctx *gin.Context) { func Test(ctx *gin.Context) {
action := ctx.PostForm("action") action := ctx.PostForm("action")
if action == "" { if action == "" {
workUuid := ctx.PostForm("workUuid") profileKey := ctx.PostForm("profileKey")
err := CheckImage(workUuid) platformName := ctx.PostForm("platformName")
resp, err := service.AyrshareProvider.GetSocialAnalytics(context.Background(), &aryshare.GetSocialAnalyticsRequest{
ProfileKey: profileKey,
Platforms: []string{platformName},
})
if err != nil { if err != nil {
service.Error(ctx, err) service.Error(ctx, err)
return return
} }
service.Success(ctx, nil) service.Success(ctx, resp)
return return
} }

View File

@ -1497,6 +1497,7 @@ func ImportWorkBatch(ctx *gin.Context) {
temp.ArtistName = subInfoResp.Name temp.ArtistName = subInfoResp.Name
temp.ArtistPhone = subInfoResp.TelNum temp.ArtistPhone = subInfoResp.TelNum
temp.ArtistPhoneAreaCode = subInfoResp.TelAreaCode temp.ArtistPhoneAreaCode = subInfoResp.TelAreaCode
temp.ArtistSubNum = subInfoResp.SubNum
} }
if len(row) > 7 { if len(row) > 7 {
temp.Title = utils.CleanString(row[7]) temp.Title = utils.CleanString(row[7])