完成部分接口
This commit is contained in:
parent
99520e87d4
commit
7008b4aa2a
1191
api/cast/cast.pb.go
1191
api/cast/cast.pb.go
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -18,6 +18,7 @@ import (
|
|||||||
common "github.com/dubbogo/triple/pkg/common"
|
common "github.com/dubbogo/triple/pkg/common"
|
||||||
constant "github.com/dubbogo/triple/pkg/common/constant"
|
constant "github.com/dubbogo/triple/pkg/common/constant"
|
||||||
triple "github.com/dubbogo/triple/pkg/triple"
|
triple "github.com/dubbogo/triple/pkg/triple"
|
||||||
|
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||||
)
|
)
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
@ -30,7 +31,11 @@ const _ = grpc_go.SupportPackageIsVersion7
|
|||||||
type CastClient interface {
|
type CastClient interface {
|
||||||
MediaUserList(ctx context.Context, in *MediaUserListReq, opts ...grpc_go.CallOption) (*MediaUserListResp, common.ErrorWithAttachment)
|
MediaUserList(ctx context.Context, in *MediaUserListReq, opts ...grpc_go.CallOption) (*MediaUserListResp, common.ErrorWithAttachment)
|
||||||
UpdateMediaAccount(ctx context.Context, in *UpdateMediaAccountReq, opts ...grpc_go.CallOption) (*UpdateMediaAccountResp, common.ErrorWithAttachment)
|
UpdateMediaAccount(ctx context.Context, in *UpdateMediaAccountReq, opts ...grpc_go.CallOption) (*UpdateMediaAccountResp, common.ErrorWithAttachment)
|
||||||
UpdateWork(ctx context.Context, in *UpdateWorkReq, opts ...grpc_go.CallOption) (*UpdateWorkResp, common.ErrorWithAttachment)
|
UnbindManager(ctx context.Context, in *UnbindManagerReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
|
||||||
|
BindManager(ctx context.Context, in *BindManagerReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
|
||||||
|
UpdateWorkImage(ctx context.Context, in *UpdateWorkImageReq, opts ...grpc_go.CallOption) (*UpdateWorkImageResp, common.ErrorWithAttachment)
|
||||||
|
UpdateWorkVideo(ctx context.Context, in *UpdateWorkVideoReq, opts ...grpc_go.CallOption) (*UpdateWorkVideoResp, common.ErrorWithAttachment)
|
||||||
|
WorkList(ctx context.Context, in *WorkListReq, opts ...grpc_go.CallOption) (*WorkListResp, common.ErrorWithAttachment)
|
||||||
}
|
}
|
||||||
|
|
||||||
type castClient struct {
|
type castClient struct {
|
||||||
@ -40,7 +45,11 @@ type castClient struct {
|
|||||||
type CastClientImpl struct {
|
type CastClientImpl struct {
|
||||||
MediaUserList func(ctx context.Context, in *MediaUserListReq) (*MediaUserListResp, error)
|
MediaUserList func(ctx context.Context, in *MediaUserListReq) (*MediaUserListResp, error)
|
||||||
UpdateMediaAccount func(ctx context.Context, in *UpdateMediaAccountReq) (*UpdateMediaAccountResp, error)
|
UpdateMediaAccount func(ctx context.Context, in *UpdateMediaAccountReq) (*UpdateMediaAccountResp, error)
|
||||||
UpdateWork func(ctx context.Context, in *UpdateWorkReq) (*UpdateWorkResp, error)
|
UnbindManager func(ctx context.Context, in *UnbindManagerReq) (*emptypb.Empty, error)
|
||||||
|
BindManager func(ctx context.Context, in *BindManagerReq) (*emptypb.Empty, error)
|
||||||
|
UpdateWorkImage func(ctx context.Context, in *UpdateWorkImageReq) (*UpdateWorkImageResp, error)
|
||||||
|
UpdateWorkVideo func(ctx context.Context, in *UpdateWorkVideoReq) (*UpdateWorkVideoResp, error)
|
||||||
|
WorkList func(ctx context.Context, in *WorkListReq) (*WorkListResp, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CastClientImpl) GetDubboStub(cc *triple.TripleConn) CastClient {
|
func (c *CastClientImpl) GetDubboStub(cc *triple.TripleConn) CastClient {
|
||||||
@ -67,10 +76,34 @@ func (c *castClient) UpdateMediaAccount(ctx context.Context, in *UpdateMediaAcco
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateMediaAccount", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateMediaAccount", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *castClient) UpdateWork(ctx context.Context, in *UpdateWorkReq, opts ...grpc_go.CallOption) (*UpdateWorkResp, common.ErrorWithAttachment) {
|
func (c *castClient) UnbindManager(ctx context.Context, in *UnbindManagerReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment) {
|
||||||
out := new(UpdateWorkResp)
|
out := new(emptypb.Empty)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateWork", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UnbindManager", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *castClient) BindManager(ctx context.Context, in *BindManagerReq, 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+"/BindManager", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *castClient) UpdateWorkImage(ctx context.Context, in *UpdateWorkImageReq, opts ...grpc_go.CallOption) (*UpdateWorkImageResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(UpdateWorkImageResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateWorkImage", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *castClient) UpdateWorkVideo(ctx context.Context, in *UpdateWorkVideoReq, opts ...grpc_go.CallOption) (*UpdateWorkVideoResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(UpdateWorkVideoResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateWorkVideo", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *castClient) WorkList(ctx context.Context, in *WorkListReq, opts ...grpc_go.CallOption) (*WorkListResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(WorkListResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/WorkList", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
// CastServer is the server API for Cast service.
|
// CastServer is the server API for Cast service.
|
||||||
@ -79,7 +112,11 @@ func (c *castClient) UpdateWork(ctx context.Context, in *UpdateWorkReq, opts ...
|
|||||||
type CastServer interface {
|
type CastServer interface {
|
||||||
MediaUserList(context.Context, *MediaUserListReq) (*MediaUserListResp, error)
|
MediaUserList(context.Context, *MediaUserListReq) (*MediaUserListResp, error)
|
||||||
UpdateMediaAccount(context.Context, *UpdateMediaAccountReq) (*UpdateMediaAccountResp, error)
|
UpdateMediaAccount(context.Context, *UpdateMediaAccountReq) (*UpdateMediaAccountResp, error)
|
||||||
UpdateWork(context.Context, *UpdateWorkReq) (*UpdateWorkResp, error)
|
UnbindManager(context.Context, *UnbindManagerReq) (*emptypb.Empty, error)
|
||||||
|
BindManager(context.Context, *BindManagerReq) (*emptypb.Empty, error)
|
||||||
|
UpdateWorkImage(context.Context, *UpdateWorkImageReq) (*UpdateWorkImageResp, error)
|
||||||
|
UpdateWorkVideo(context.Context, *UpdateWorkVideoReq) (*UpdateWorkVideoResp, error)
|
||||||
|
WorkList(context.Context, *WorkListReq) (*WorkListResp, error)
|
||||||
mustEmbedUnimplementedCastServer()
|
mustEmbedUnimplementedCastServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,8 +131,20 @@ func (UnimplementedCastServer) MediaUserList(context.Context, *MediaUserListReq)
|
|||||||
func (UnimplementedCastServer) UpdateMediaAccount(context.Context, *UpdateMediaAccountReq) (*UpdateMediaAccountResp, error) {
|
func (UnimplementedCastServer) UpdateMediaAccount(context.Context, *UpdateMediaAccountReq) (*UpdateMediaAccountResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateMediaAccount not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateMediaAccount not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedCastServer) UpdateWork(context.Context, *UpdateWorkReq) (*UpdateWorkResp, error) {
|
func (UnimplementedCastServer) UnbindManager(context.Context, *UnbindManagerReq) (*emptypb.Empty, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateWork not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method UnbindManager not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCastServer) BindManager(context.Context, *BindManagerReq) (*emptypb.Empty, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method BindManager not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCastServer) UpdateWorkImage(context.Context, *UpdateWorkImageReq) (*UpdateWorkImageResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateWorkImage not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCastServer) UpdateWorkVideo(context.Context, *UpdateWorkVideoReq) (*UpdateWorkVideoResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateWorkVideo not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedCastServer) WorkList(context.Context, *WorkListReq) (*WorkListResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method WorkList not implemented")
|
||||||
}
|
}
|
||||||
func (s *UnimplementedCastServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
func (s *UnimplementedCastServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||||
s.proxyImpl = impl
|
s.proxyImpl = impl
|
||||||
@ -183,8 +232,8 @@ func _Cast_UpdateMediaAccount_Handler(srv interface{}, ctx context.Context, dec
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _Cast_UpdateWork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
func _Cast_UnbindManager_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(UpdateWorkReq)
|
in := new(UnbindManagerReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -196,7 +245,123 @@ func _Cast_UpdateWork_Handler(srv interface{}, ctx context.Context, dec func(int
|
|||||||
for k, v := range md {
|
for k, v := range md {
|
||||||
invAttachment[k] = v
|
invAttachment[k] = v
|
||||||
}
|
}
|
||||||
invo := invocation.NewRPCInvocation("UpdateWork", args, invAttachment)
|
invo := invocation.NewRPCInvocation("UnbindManager", 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_BindManager_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(BindManagerReq)
|
||||||
|
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("BindManager", 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_UpdateWorkImage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdateWorkImageReq)
|
||||||
|
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("UpdateWorkImage", 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_UpdateWorkVideo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdateWorkVideoReq)
|
||||||
|
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("UpdateWorkVideo", 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_WorkList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(WorkListReq)
|
||||||
|
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("WorkList", args, invAttachment)
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
return result, result.Error()
|
return result, result.Error()
|
||||||
@ -228,8 +393,24 @@ var Cast_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
Handler: _Cast_UpdateMediaAccount_Handler,
|
Handler: _Cast_UpdateMediaAccount_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "UpdateWork",
|
MethodName: "UnbindManager",
|
||||||
Handler: _Cast_UpdateWork_Handler,
|
Handler: _Cast_UnbindManager_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "BindManager",
|
||||||
|
Handler: _Cast_BindManager_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdateWorkImage",
|
||||||
|
Handler: _Cast_UpdateWorkImage_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdateWorkVideo",
|
||||||
|
Handler: _Cast_UpdateWorkVideo_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "WorkList",
|
||||||
|
Handler: _Cast_WorkList_Handler,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc_go.StreamDesc{},
|
Streams: []grpc_go.StreamDesc{},
|
||||||
|
@ -13,11 +13,15 @@ func MediaRouter(r *gin.RouterGroup) {
|
|||||||
auth.Use(middleware.CheckWebLogin(service.AccountProvider))
|
auth.Use(middleware.CheckWebLogin(service.AccountProvider))
|
||||||
media := auth.Group("media")
|
media := auth.Group("media")
|
||||||
{
|
{
|
||||||
|
media.POST("user-list", serviceCast.MediaUserList)
|
||||||
|
media.POST("unbind-manager", serviceCast.UnbindManager)
|
||||||
|
media.POST("bind-manager", serviceCast.BindManager)
|
||||||
media.POST("update-account", serviceCast.UpdateMediaAccount)
|
media.POST("update-account", serviceCast.UpdateMediaAccount)
|
||||||
}
|
}
|
||||||
|
|
||||||
work := auth.Group("work")
|
work := auth.Group("work")
|
||||||
{
|
{
|
||||||
work.POST("update-work", serviceCast.UpdateWork)
|
work.POST("update-work-image", serviceCast.UpdateWorkImage)
|
||||||
|
work.POST("update-work-video", serviceCast.UpdateWorkVideo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,14 +2,76 @@ package cast
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fonchain-fiee/api/accountFiee"
|
"fonchain-fiee/api/accountFiee"
|
||||||
"fonchain-fiee/api/cast"
|
"fonchain-fiee/api/cast"
|
||||||
"fonchain-fiee/cmd/config"
|
"fonchain-fiee/cmd/config"
|
||||||
|
"fonchain-fiee/pkg/e"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func MediaUserList(ctx *gin.Context) {
|
||||||
|
var req *cast.MediaUserListReq
|
||||||
|
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
|
||||||
|
}
|
||||||
|
resp, err := service.CastProvider.MediaUserList(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func UnbindManager(ctx *gin.Context) {
|
||||||
|
var req *cast.UnbindManagerReq
|
||||||
|
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
|
||||||
|
}
|
||||||
|
_, err = service.CastProvider.UnbindManager(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func BindManager(ctx *gin.Context) {
|
||||||
|
var req *cast.BindManagerReq
|
||||||
|
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
|
||||||
|
}
|
||||||
|
_, err = service.CastProvider.BindManager(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func UpdateMediaAccount(ctx *gin.Context) {
|
func UpdateMediaAccount(ctx *gin.Context) {
|
||||||
var req *cast.UpdateMediaAccountReq
|
var req *cast.UpdateMediaAccountReq
|
||||||
var infoResp *accountFiee.UserInfoResponse
|
var infoResp *accountFiee.UserInfoResponse
|
||||||
@ -40,8 +102,12 @@ func UpdateMediaAccount(ctx *gin.Context) {
|
|||||||
TelNum: "18288888888",
|
TelNum: "18288888888",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
req.ArtistUserName = infoResp.Name
|
req.ArtistName = infoResp.Name
|
||||||
req.ArtistPhone = infoResp.TelNum
|
req.ArtistPhone = infoResp.TelNum
|
||||||
|
if _, ok := cast.PlatformType_name[int32(req.PlatformType)]; !ok {
|
||||||
|
service.Error(ctx, errors.New(e.GetMsg(e.InvalidParams)))
|
||||||
|
return
|
||||||
|
}
|
||||||
resp, err := service.CastProvider.UpdateMediaAccount(ctx, req)
|
resp, err := service.CastProvider.UpdateMediaAccount(ctx, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
|
@ -1,18 +1,75 @@
|
|||||||
package cast
|
package cast
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
|
"fonchain-fiee/api/accountFiee"
|
||||||
"fonchain-fiee/api/cast"
|
"fonchain-fiee/api/cast"
|
||||||
|
"fonchain-fiee/cmd/config"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
func UpdateWork(ctx *gin.Context) {
|
func UpdateWorkImage(ctx *gin.Context) {
|
||||||
var req *cast.UpdateWorkReq
|
var req *cast.UpdateWorkImageReq
|
||||||
if err := ctx.ShouldBind(&req); err != nil {
|
var infoResp *accountFiee.UserInfoResponse
|
||||||
|
var err error
|
||||||
|
if err = ctx.ShouldBind(&req); err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp, err := service.CastProvider.UpdateWork(ctx, req)
|
if config.AppConfig.System.AppMode != "dev" {
|
||||||
|
artistId, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
||||||
|
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
|
||||||
|
ID: artistId,
|
||||||
|
Domain: "app",
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
infoResp = &accountFiee.UserInfoResponse{
|
||||||
|
Name: "小波",
|
||||||
|
TelNum: "18288888888",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
req.ArtistPhone = infoResp.TelNum
|
||||||
|
resp, err := service.CastProvider.UpdateWorkImage(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func UpdateWorkVideo(ctx *gin.Context) {
|
||||||
|
var req *cast.UpdateWorkVideoReq
|
||||||
|
var infoResp *accountFiee.UserInfoResponse
|
||||||
|
var err error
|
||||||
|
if err = ctx.ShouldBind(&req); err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if config.AppConfig.System.AppMode != "dev" {
|
||||||
|
artistId, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
||||||
|
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
|
||||||
|
ID: artistId,
|
||||||
|
Domain: "app",
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
infoResp = &accountFiee.UserInfoResponse{
|
||||||
|
Name: "小波",
|
||||||
|
TelNum: "18288888888",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
req.ArtistPhone = infoResp.TelNum
|
||||||
|
resp, err := service.CastProvider.UpdateWorkVideo(ctx, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user