Compare commits
No commits in common. "2825ca826eb49d128fc72c4715dae16396fbca9a" and "761b9b656beacfc3c007ffc5cb2e5afa1622d494" have entirely different histories.
2825ca826e
...
761b9b656b
@ -1,4 +0,0 @@
|
|||||||
## 测试服后台
|
|
||||||
http://172.16.100.99:9028/
|
|
||||||
13580848136
|
|
||||||
## https://saas-test.szjixun.cn
|
|
||||||
2256
api/cast/cast.pb.go
2256
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
@ -43,11 +43,8 @@ type CastClient interface {
|
|||||||
RePublish(ctx context.Context, in *RePublishReq, opts ...grpc_go.CallOption) (*RePublishResp, common.ErrorWithAttachment)
|
RePublish(ctx context.Context, in *RePublishReq, opts ...grpc_go.CallOption) (*RePublishResp, common.ErrorWithAttachment)
|
||||||
DelWork(ctx context.Context, in *DelWorkReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
|
DelWork(ctx context.Context, in *DelWorkReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
|
||||||
WorkInfo(ctx context.Context, in *WorkInfoReq, opts ...grpc_go.CallOption) (*WorkInfoResp, common.ErrorWithAttachment)
|
WorkInfo(ctx context.Context, in *WorkInfoReq, opts ...grpc_go.CallOption) (*WorkInfoResp, common.ErrorWithAttachment)
|
||||||
OAuthAccount(ctx context.Context, in *OAuthAccountReq, opts ...grpc_go.CallOption) (*OAuthAccountResp, common.ErrorWithAttachment)
|
OAuthYoutubeUrl(ctx context.Context, in *OAuthYoutubeUrlReq, opts ...grpc_go.CallOption) (*OAuthYoutubeUrlResp, common.ErrorWithAttachment)
|
||||||
OAuthCodeToToken(ctx context.Context, in *OAuthCodeToTokenReq, opts ...grpc_go.CallOption) (*OAuthCodeToTokenResp, common.ErrorWithAttachment)
|
OAuthYoutubeToken(ctx context.Context, in *OAuthYoutubeTokenReq, opts ...grpc_go.CallOption) (*OAuthYoutubeTokenResp, common.ErrorWithAttachment)
|
||||||
RefreshToken(ctx context.Context, in *RefreshTokenReq, opts ...grpc_go.CallOption) (*RefreshTokenResp, common.ErrorWithAttachment)
|
|
||||||
PublishMediaInfo(ctx context.Context, in *PublishMediaInfoReq, opts ...grpc_go.CallOption) (*PublishMediaInfoResp, common.ErrorWithAttachment)
|
|
||||||
Test(ctx context.Context, in *emptypb.Empty, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type castClient struct {
|
type castClient struct {
|
||||||
@ -69,11 +66,8 @@ type CastClientImpl struct {
|
|||||||
RePublish func(ctx context.Context, in *RePublishReq) (*RePublishResp, error)
|
RePublish func(ctx context.Context, in *RePublishReq) (*RePublishResp, error)
|
||||||
DelWork func(ctx context.Context, in *DelWorkReq) (*emptypb.Empty, error)
|
DelWork func(ctx context.Context, in *DelWorkReq) (*emptypb.Empty, error)
|
||||||
WorkInfo func(ctx context.Context, in *WorkInfoReq) (*WorkInfoResp, error)
|
WorkInfo func(ctx context.Context, in *WorkInfoReq) (*WorkInfoResp, error)
|
||||||
OAuthAccount func(ctx context.Context, in *OAuthAccountReq) (*OAuthAccountResp, error)
|
OAuthYoutubeUrl func(ctx context.Context, in *OAuthYoutubeUrlReq) (*OAuthYoutubeUrlResp, error)
|
||||||
OAuthCodeToToken func(ctx context.Context, in *OAuthCodeToTokenReq) (*OAuthCodeToTokenResp, error)
|
OAuthYoutubeToken func(ctx context.Context, in *OAuthYoutubeTokenReq) (*OAuthYoutubeTokenResp, error)
|
||||||
RefreshToken func(ctx context.Context, in *RefreshTokenReq) (*RefreshTokenResp, error)
|
|
||||||
PublishMediaInfo func(ctx context.Context, in *PublishMediaInfoReq) (*PublishMediaInfoResp, error)
|
|
||||||
Test func(ctx context.Context, in *emptypb.Empty) (*emptypb.Empty, error)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CastClientImpl) GetDubboStub(cc *triple.TripleConn) CastClient {
|
func (c *CastClientImpl) GetDubboStub(cc *triple.TripleConn) CastClient {
|
||||||
@ -172,34 +166,16 @@ func (c *castClient) WorkInfo(ctx context.Context, in *WorkInfoReq, opts ...grpc
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/WorkInfo", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/WorkInfo", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *castClient) OAuthAccount(ctx context.Context, in *OAuthAccountReq, opts ...grpc_go.CallOption) (*OAuthAccountResp, common.ErrorWithAttachment) {
|
func (c *castClient) OAuthYoutubeUrl(ctx context.Context, in *OAuthYoutubeUrlReq, opts ...grpc_go.CallOption) (*OAuthYoutubeUrlResp, common.ErrorWithAttachment) {
|
||||||
out := new(OAuthAccountResp)
|
out := new(OAuthYoutubeUrlResp)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OAuthAccount", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OAuthYoutubeUrl", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *castClient) OAuthCodeToToken(ctx context.Context, in *OAuthCodeToTokenReq, opts ...grpc_go.CallOption) (*OAuthCodeToTokenResp, common.ErrorWithAttachment) {
|
func (c *castClient) OAuthYoutubeToken(ctx context.Context, in *OAuthYoutubeTokenReq, opts ...grpc_go.CallOption) (*OAuthYoutubeTokenResp, common.ErrorWithAttachment) {
|
||||||
out := new(OAuthCodeToTokenResp)
|
out := new(OAuthYoutubeTokenResp)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OAuthCodeToToken", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OAuthYoutubeToken", in, out)
|
||||||
}
|
|
||||||
|
|
||||||
func (c *castClient) RefreshToken(ctx context.Context, in *RefreshTokenReq, opts ...grpc_go.CallOption) (*RefreshTokenResp, common.ErrorWithAttachment) {
|
|
||||||
out := new(RefreshTokenResp)
|
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/RefreshToken", in, out)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *castClient) PublishMediaInfo(ctx context.Context, in *PublishMediaInfoReq, opts ...grpc_go.CallOption) (*PublishMediaInfoResp, common.ErrorWithAttachment) {
|
|
||||||
out := new(PublishMediaInfoResp)
|
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/PublishMediaInfo", in, out)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *castClient) Test(ctx context.Context, in *emptypb.Empty, 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+"/Test", in, out)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CastServer is the server API for Cast service.
|
// CastServer is the server API for Cast service.
|
||||||
@ -220,11 +196,8 @@ type CastServer interface {
|
|||||||
RePublish(context.Context, *RePublishReq) (*RePublishResp, error)
|
RePublish(context.Context, *RePublishReq) (*RePublishResp, error)
|
||||||
DelWork(context.Context, *DelWorkReq) (*emptypb.Empty, error)
|
DelWork(context.Context, *DelWorkReq) (*emptypb.Empty, error)
|
||||||
WorkInfo(context.Context, *WorkInfoReq) (*WorkInfoResp, error)
|
WorkInfo(context.Context, *WorkInfoReq) (*WorkInfoResp, error)
|
||||||
OAuthAccount(context.Context, *OAuthAccountReq) (*OAuthAccountResp, error)
|
OAuthYoutubeUrl(context.Context, *OAuthYoutubeUrlReq) (*OAuthYoutubeUrlResp, error)
|
||||||
OAuthCodeToToken(context.Context, *OAuthCodeToTokenReq) (*OAuthCodeToTokenResp, error)
|
OAuthYoutubeToken(context.Context, *OAuthYoutubeTokenReq) (*OAuthYoutubeTokenResp, error)
|
||||||
RefreshToken(context.Context, *RefreshTokenReq) (*RefreshTokenResp, error)
|
|
||||||
PublishMediaInfo(context.Context, *PublishMediaInfoReq) (*PublishMediaInfoResp, error)
|
|
||||||
Test(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
|
|
||||||
mustEmbedUnimplementedCastServer()
|
mustEmbedUnimplementedCastServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -275,20 +248,11 @@ func (UnimplementedCastServer) DelWork(context.Context, *DelWorkReq) (*emptypb.E
|
|||||||
func (UnimplementedCastServer) WorkInfo(context.Context, *WorkInfoReq) (*WorkInfoResp, error) {
|
func (UnimplementedCastServer) WorkInfo(context.Context, *WorkInfoReq) (*WorkInfoResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method WorkInfo not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method WorkInfo not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedCastServer) OAuthAccount(context.Context, *OAuthAccountReq) (*OAuthAccountResp, error) {
|
func (UnimplementedCastServer) OAuthYoutubeUrl(context.Context, *OAuthYoutubeUrlReq) (*OAuthYoutubeUrlResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method OAuthAccount not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method OAuthYoutubeUrl not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedCastServer) OAuthCodeToToken(context.Context, *OAuthCodeToTokenReq) (*OAuthCodeToTokenResp, error) {
|
func (UnimplementedCastServer) OAuthYoutubeToken(context.Context, *OAuthYoutubeTokenReq) (*OAuthYoutubeTokenResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method OAuthCodeToToken not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method OAuthYoutubeToken not implemented")
|
||||||
}
|
|
||||||
func (UnimplementedCastServer) RefreshToken(context.Context, *RefreshTokenReq) (*RefreshTokenResp, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method RefreshToken not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedCastServer) PublishMediaInfo(context.Context, *PublishMediaInfoReq) (*PublishMediaInfoResp, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method PublishMediaInfo not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedCastServer) Test(context.Context, *emptypb.Empty) (*emptypb.Empty, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Test not implemented")
|
|
||||||
}
|
}
|
||||||
func (s *UnimplementedCastServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
func (s *UnimplementedCastServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||||
s.proxyImpl = impl
|
s.proxyImpl = impl
|
||||||
@ -724,8 +688,8 @@ func _Cast_WorkInfo_Handler(srv interface{}, ctx context.Context, dec func(inter
|
|||||||
return interceptor(ctx, in, info, handler)
|
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_OAuthYoutubeUrl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(OAuthAccountReq)
|
in := new(OAuthYoutubeUrlReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -737,7 +701,7 @@ func _Cast_OAuthAccount_Handler(srv interface{}, ctx context.Context, dec func(i
|
|||||||
for k, v := range md {
|
for k, v := range md {
|
||||||
invAttachment[k] = v
|
invAttachment[k] = v
|
||||||
}
|
}
|
||||||
invo := invocation.NewRPCInvocation("OAuthAccount", args, invAttachment)
|
invo := invocation.NewRPCInvocation("OAuthYoutubeUrl", 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()
|
||||||
@ -753,8 +717,8 @@ func _Cast_OAuthAccount_Handler(srv interface{}, ctx context.Context, dec func(i
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _Cast_OAuthCodeToToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
func _Cast_OAuthYoutubeToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(OAuthCodeToTokenReq)
|
in := new(OAuthYoutubeTokenReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -766,94 +730,7 @@ func _Cast_OAuthCodeToToken_Handler(srv interface{}, ctx context.Context, dec fu
|
|||||||
for k, v := range md {
|
for k, v := range md {
|
||||||
invAttachment[k] = v
|
invAttachment[k] = v
|
||||||
}
|
}
|
||||||
invo := invocation.NewRPCInvocation("OAuthCodeToToken", args, invAttachment)
|
invo := invocation.NewRPCInvocation("OAuthYoutubeToken", 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_RefreshToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(RefreshTokenReq)
|
|
||||||
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("RefreshToken", 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_PublishMediaInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(PublishMediaInfoReq)
|
|
||||||
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("PublishMediaInfo", 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_Test_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(emptypb.Empty)
|
|
||||||
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("Test", 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()
|
||||||
@ -933,24 +810,12 @@ var Cast_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
Handler: _Cast_WorkInfo_Handler,
|
Handler: _Cast_WorkInfo_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "OAuthAccount",
|
MethodName: "OAuthYoutubeUrl",
|
||||||
Handler: _Cast_OAuthAccount_Handler,
|
Handler: _Cast_OAuthYoutubeUrl_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "OAuthCodeToToken",
|
MethodName: "OAuthYoutubeToken",
|
||||||
Handler: _Cast_OAuthCodeToToken_Handler,
|
Handler: _Cast_OAuthYoutubeToken_Handler,
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "RefreshToken",
|
|
||||||
Handler: _Cast_RefreshToken_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "PublishMediaInfo",
|
|
||||||
Handler: _Cast_PublishMediaInfo_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "Test",
|
|
||||||
Handler: _Cast_Test_Handler,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc_go.StreamDesc{},
|
Streams: []grpc_go.StreamDesc{},
|
||||||
|
|||||||
@ -21,7 +21,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"fonchain-fiee/cmd/config"
|
"fonchain-fiee/cmd/config"
|
||||||
"fonchain-fiee/pkg/cache"
|
"fonchain-fiee/pkg/cache"
|
||||||
"fonchain-fiee/pkg/common"
|
|
||||||
"fonchain-fiee/pkg/logger"
|
"fonchain-fiee/pkg/logger"
|
||||||
"fonchain-fiee/pkg/router"
|
"fonchain-fiee/pkg/router"
|
||||||
)
|
)
|
||||||
@ -56,7 +55,6 @@ func bootstrap() (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cache.LoadRedis(redisConfig)
|
cache.LoadRedis(redisConfig)
|
||||||
common.Init()
|
|
||||||
//
|
//
|
||||||
//gpt.InitSet(configEnv.Ai.Host, configEnv.Ai.TelNum, configEnv.Ai.Password)
|
//gpt.InitSet(configEnv.Ai.Host, configEnv.Ai.TelNum, configEnv.Ai.Password)
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@ -4,11 +4,10 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"fonchain-fiee/pkg/common"
|
"fonchain-fiee/pkg/common"
|
||||||
"os"
|
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"github.com/BurntSushi/toml"
|
"github.com/BurntSushi/toml"
|
||||||
"gopkg.in/ini.v1"
|
"gopkg.in/ini.v1"
|
||||||
|
"os"
|
||||||
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -118,7 +117,6 @@ type System struct {
|
|||||||
Domain string
|
Domain string
|
||||||
ErpHost string
|
ErpHost string
|
||||||
FieeHost string
|
FieeHost string
|
||||||
AuthRedirectUrl string
|
|
||||||
}
|
}
|
||||||
type Oss struct {
|
type Oss struct {
|
||||||
AccessKeyId string
|
AccessKeyId string
|
||||||
|
|||||||
@ -1,15 +0,0 @@
|
|||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>隐私政策</title>
|
|
||||||
<style>
|
|
||||||
body { font-family: Arial, sans-serif; line-height: 1.6; }
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<p>H5系统隐私政策</p><p>生效日期:2025年9月2日</p><p>1. 信息收集与使用</p><p>收集的个人信息类型</p><p>基础信息:手机号、微信昵称、头像、设备信息(IMEI、操作系统版本)。</p><p>支付信息:订单号、支付金额、交易时间(通过加密方式传输,不存储银行卡信息)。</p><p>自媒体平台授权信息,例如:</p><p>抖音:API接口权限(仅限内容同步)。</p><p>内容生成数据:用户输入的关键词、风格偏好、历史生成内容。</p><p>收集目的</p><p>账号验证与支付:手机号用于身份核验,支付信息用于完成交易。</p><p>内容发布:通过授权信息调用第三方平台API,执行用户指令。</p><p>2. 信息共享与转让</p><p>第三方平台接口:仅在用户授权范围内调用API,不共享用户平台账号密码。</p><p>支付合作方:与微信支付、支付宝等服务商共享订单信息以完成交易。</p><p>法律要求:如配合司法机关调查或响应政府要求,可能披露必要信息。</p><p>3. 用户权利</p><p>访问与控制:</p><p>可随时在“个人中心”查看历史生成内容、订单记录及授权状态。</p><p>删除与撤回:</p><p>可申请删除个人账户及生成内容(不包含已同步至第三方平台的内容)。</p><p>4. 数据安全</p><p>技术措施:采用HTTPS加密传输、数据库脱敏存储,定期进行安全漏洞检测。</p><p>第三方SDK:仅接入必要SDK(如微信登录、地图服务等),并签署数据保密协议。</p><p>5. 隐私政策更新</p><p>如涉及重大变更(如新增数据收集项),将通过短信/邮件通知并要求重新授权。</p><p>6. 联系我们</p><p>如有疑问,请通过以下方式联系:</p><p>客服邮箱:develop@fiee.com</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>服务条款</title>
|
|
||||||
<style>
|
|
||||||
body { font-family: Arial, sans-serif; line-height: 1.6; }
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<p>服务条款</p><p>生效日期:2025年9月2日</p><p>1. 接受条款</p><p>通过注册或使用本系统(以下简称“服务”),您确认已阅读、理解并同意以下条款。若您不同意本条款,请立即停止使用本服务。</p><p>2. 服务内容</p><p>本系统提供自媒体内容生成与发布服务,用户可购买套餐后生成图文、短视频等原创内容,并通过系统接口同步至指定自媒体平台(如微信公众号、抖音、小红书等)。</p><p>服务包含AI辅助创作、内容优化建议、一键发布功能,具体内容以实际功能模块为准。</p><p>3. 用户权利与义务</p><p>账号与支付</p><p>注册需提供手机号或微信授权,购买套餐需通过系统支持的支付方式(如微信支付、支付宝)。</p><p>您需确保支付账户信息真实有效,因虚假信息导致的损失由您自行承担。</p><p>内容生成与发布</p><p>生成内容为原创作品,最终发布权归用户所有。</p><p>用户需对生成内容进行人工审核,确认无误后方可发布。因内容违规导致的平台处罚或法律纠纷,责任由用户承担。</p><p>系统不对用户未审核内容的合规性负责,但有权对明显违法内容(如涉黄、涉政)进行过滤拦截。</p><p>第三方平台接口</p><p>用户需授权系统调用其自媒体平台API(如tiktok开发者接口),授权范围限于内容发布及数据同步。</p><p>授权信息仅用于执行用户指令,系统不存储用户平台账号密码等敏感信息。</p><p>4. 套餐与退款</p><p>套餐有效期自购买成功日起计算,逾期未使用的套餐不支持退款。</p><p>如因系统故障或服务瑕疵导致无法正常使用,可联系客服协商退款。</p><p>5. 知识产权</p><p>由系统生成的内容(如文案、图片)默认无版权归属限制,但用户需遵守以下规则:</p><p>不得将内容用于商业用途(如转售、批量分发);</p><p>不得篡改系统生成内容的署名或标识;</p><p>若内容包含第三方素材(如音乐、图片),用户需自行确保使用合法性。</p><p>6. 责任限制</p><p>系统不对以下情形承担责任:</p><p>用户未审核内容导致的平台封禁、投诉或法律风险;</p><p>第三方平台接口变更或服务中断;</p><p>因不可抗力(如网络故障)导致的发布延迟。</p><p>7. 其他</p><p>本条款解释权归服务提供方所有,更新后将在系统内公示,用户继续使用即视为同意。</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
||||||
@ -6,8 +6,6 @@ Host = "https://common.szjixun.cn"
|
|||||||
RedirectUri = "/api/redirect/url"
|
RedirectUri = "/api/redirect/url"
|
||||||
ErpHost = "http://114.218.158.24:9020"
|
ErpHost = "http://114.218.158.24:9020"
|
||||||
FieeHost = "http://114.218.158.24:9020"
|
FieeHost = "http://114.218.158.24:9020"
|
||||||
AuthRedirectUrl = "http://172.16.100.99:9028/media_account"
|
|
||||||
|
|
||||||
[bos]
|
[bos]
|
||||||
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
||||||
Sk = "d2ecaa9d75114d3b9f42b99014198306"
|
Sk = "d2ecaa9d75114d3b9f42b99014198306"
|
||||||
|
|||||||
@ -6,7 +6,6 @@ Host = "https://common.szjixun.cn"
|
|||||||
RedirectUri = "/api/redirect/url"
|
RedirectUri = "/api/redirect/url"
|
||||||
ErpHost = "https://erpapi.fontree.cn"
|
ErpHost = "https://erpapi.fontree.cn"
|
||||||
FieeHost = "https://erpapi.fiee.com"
|
FieeHost = "https://erpapi.fiee.com"
|
||||||
AuthRedirectUrl = "https://erp.fiee.com/media_account"
|
|
||||||
[bos]
|
[bos]
|
||||||
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
||||||
Sk = "d2ecaa9d75114d3b9f42b99014198306"
|
Sk = "d2ecaa9d75114d3b9f42b99014198306"
|
||||||
|
|||||||
@ -6,8 +6,6 @@ Host = "https://common.szjixun.cn"
|
|||||||
RedirectUri = "/api/redirect/url"
|
RedirectUri = "/api/redirect/url"
|
||||||
ErpHost = "http://114.218.158.24:9020"
|
ErpHost = "http://114.218.158.24:9020"
|
||||||
FieeHost = "http://114.218.158.24:9020"
|
FieeHost = "http://114.218.158.24:9020"
|
||||||
FieeApiHost = "https://saas-test.szjixun.cn"
|
|
||||||
AuthRedirectUrl = "http://172.16.100.99:9028/media_account"
|
|
||||||
[bos]
|
[bos]
|
||||||
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
||||||
Sk = "d2ecaa9d75114d3b9f42b99014198306"
|
Sk = "d2ecaa9d75114d3b9f42b99014198306"
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
package common
|
|
||||||
|
|
||||||
import "fonchain-fiee/pkg/utils"
|
|
||||||
|
|
||||||
func Init() {
|
|
||||||
_ = utils.CreateDirPath("./runtime")
|
|
||||||
utils.CopyFile("./data/policy.html", "./runtime")
|
|
||||||
utils.CopyFile("./data/service.html", "./runtime")
|
|
||||||
utils.CopyFile("../data/policy.html", "./runtime")
|
|
||||||
utils.CopyFile("../data/service.html", "./runtime")
|
|
||||||
}
|
|
||||||
@ -4,12 +4,11 @@ import (
|
|||||||
"fonchain-fiee/pkg/middleware"
|
"fonchain-fiee/pkg/middleware"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
serviceCast "fonchain-fiee/pkg/service/cast"
|
serviceCast "fonchain-fiee/pkg/service/cast"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
func MediaRouter(r *gin.RouterGroup) {
|
func MediaRouter(r *gin.RouterGroup) {
|
||||||
noAuth := r.Group("")
|
//noAuth := r.Group("")
|
||||||
auth := r.Group("")
|
auth := r.Group("")
|
||||||
auth.Use(middleware.CheckWebLogin(service.AccountProvider))
|
auth.Use(middleware.CheckWebLogin(service.AccountProvider))
|
||||||
media := auth.Group("media")
|
media := auth.Group("media")
|
||||||
@ -18,14 +17,12 @@ func MediaRouter(r *gin.RouterGroup) {
|
|||||||
media.POST("unbind-manager", serviceCast.UnbindManager)
|
media.POST("unbind-manager", serviceCast.UnbindManager)
|
||||||
media.POST("bind-manager", serviceCast.BindManager)
|
media.POST("bind-manager", serviceCast.BindManager)
|
||||||
media.POST("update-account", serviceCast.UpdateMediaAccount)
|
media.POST("update-account", serviceCast.UpdateMediaAccount)
|
||||||
media.POST("oauth-account", serviceCast.OAuthAccount)
|
media.POST("oauth-url", serviceCast.OAuthUrl)
|
||||||
media.POST("refresh-token", serviceCast.RefreshToken)
|
|
||||||
}
|
}
|
||||||
mediaNoLogin := r.Group("media")
|
mediaNoLogin := r.Group("media")
|
||||||
{
|
{
|
||||||
mediaNoLogin.GET("oauth2callback", serviceCast.OAuth2Callback)
|
mediaNoLogin.GET("oauth2callback", serviceCast.OAuth2Callback)
|
||||||
mediaNoLogin.Any("test", serviceCast.Test)
|
mediaNoLogin.GET("test", serviceCast.Test)
|
||||||
//mediaNoLogin.GET("dmoauth2callback", serviceCast.DMOAuth2Callback)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
work := auth.Group("work")
|
work := auth.Group("work")
|
||||||
@ -38,11 +35,5 @@ func MediaRouter(r *gin.RouterGroup) {
|
|||||||
work.POST("republish", serviceCast.RePublish)
|
work.POST("republish", serviceCast.RePublish)
|
||||||
work.POST("delete", serviceCast.DelWork)
|
work.POST("delete", serviceCast.DelWork)
|
||||||
work.POST("remind", serviceCast.Remind)
|
work.POST("remind", serviceCast.Remind)
|
||||||
work.POST("publish-info", serviceCast.PublishInfo)
|
|
||||||
}
|
|
||||||
|
|
||||||
social := noAuth.Group("social")
|
|
||||||
{
|
|
||||||
social.GET("tiktok-redirect", serviceCast.TikTokRedirect)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,6 @@ package cast
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"fonchain-fiee/api/accountFiee"
|
"fonchain-fiee/api/accountFiee"
|
||||||
"fonchain-fiee/api/bundle"
|
"fonchain-fiee/api/bundle"
|
||||||
"fonchain-fiee/api/cast"
|
"fonchain-fiee/api/cast"
|
||||||
@ -11,13 +10,9 @@ import (
|
|||||||
"fonchain-fiee/pkg/e"
|
"fonchain-fiee/pkg/e"
|
||||||
modelCast "fonchain-fiee/pkg/model/cast"
|
modelCast "fonchain-fiee/pkg/model/cast"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
"net/http"
|
|
||||||
"net/url"
|
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"google.golang.org/protobuf/types/known/emptypb"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
func MediaUserList(ctx *gin.Context) {
|
func MediaUserList(ctx *gin.Context) {
|
||||||
@ -165,10 +160,9 @@ func UpdateMediaAccount(ctx *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 账号授权
|
func OAuthUrl(ctx *gin.Context) {
|
||||||
func OAuthAccount(ctx *gin.Context) {
|
var req *cast.OAuthYoutubeUrlReq
|
||||||
var req *cast.OAuthAccountReq
|
var resp *cast.OAuthYoutubeUrlResp
|
||||||
var resp *cast.OAuthAccountResp
|
|
||||||
var err error
|
var err error
|
||||||
if err = ctx.ShouldBind(&req); err != nil {
|
if err = ctx.ShouldBind(&req); err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
@ -178,7 +172,7 @@ func OAuthAccount(ctx *gin.Context) {
|
|||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if resp, err = service.CastProvider.OAuthAccount(ctx, req); err != nil {
|
if resp, err = service.CastProvider.OAuthYoutubeUrl(ctx, req); err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -187,63 +181,15 @@ func OAuthAccount(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func OAuth2Callback(ctx *gin.Context) {
|
func OAuth2Callback(ctx *gin.Context) {
|
||||||
var (
|
|
||||||
platformIds string
|
|
||||||
userID string
|
|
||||||
)
|
|
||||||
code := ctx.Query("code")
|
code := ctx.Query("code")
|
||||||
state := ctx.Query("state")
|
state := ctx.Query("state")
|
||||||
stateMM, _ := url.ParseQuery(state)
|
//scope := ctx.Query("scope")
|
||||||
if len(stateMM["platform_id"]) > 0 {
|
resp, err := service.CastProvider.OAuthYoutubeToken(ctx, &cast.OAuthYoutubeTokenReq{
|
||||||
platformIds = stateMM["platform_id"][0]
|
MediaAccountUuid: state,
|
||||||
}
|
|
||||||
if len(stateMM["user_id"]) > 0 {
|
|
||||||
userID = stateMM["user_id"][0]
|
|
||||||
}
|
|
||||||
platformID, _ := strconv.ParseInt(platformIds, 10, 64)
|
|
||||||
req := &cast.OAuthCodeToTokenReq{
|
|
||||||
Code: code,
|
Code: code,
|
||||||
UserID: userID,
|
//scope: scope,
|
||||||
}
|
})
|
||||||
switch platformID {
|
|
||||||
case int64(cast.PlatformIDENUM_DM):
|
|
||||||
req.PlatformID = cast.PlatformIDENUM_DM
|
|
||||||
case int64(cast.PlatformIDENUM_TIKTOK):
|
|
||||||
req.PlatformID = cast.PlatformIDENUM_TIKTOK
|
|
||||||
default:
|
|
||||||
service.Error(ctx, errors.New(e.GetMsg(e.InvalidParams)))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
zap.L().Info("OAuth2Callback", zap.Any("req", req), zap.Any("code", code), zap.Any("state", state))
|
|
||||||
_, err := service.CastProvider.OAuthCodeToToken(ctx, req)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Info("OAuth2Callback error", zap.Error(err))
|
|
||||||
|
|
||||||
ctx.Redirect(http.StatusFound, fmt.Sprintf("%s?%s", config.AppConfig.System.AuthRedirectUrl, "status=1"))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// TODO 跳转到前端页面
|
|
||||||
ctx.Redirect(http.StatusFound, fmt.Sprintf("%s?%s", config.AppConfig.System.AuthRedirectUrl, "status=0"))
|
|
||||||
//service.Success(ctx, map[string]interface{}{
|
|
||||||
// "req": req,
|
|
||||||
// "resp": resp,
|
|
||||||
//})
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func RefreshToken(ctx *gin.Context) {
|
|
||||||
var req *cast.RefreshTokenReq
|
|
||||||
var resp *cast.RefreshTokenResp
|
|
||||||
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
|
|
||||||
}
|
|
||||||
if resp, err = service.CastProvider.RefreshToken(ctx, req); err != nil {
|
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -252,6 +198,6 @@ func RefreshToken(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Test(ctx *gin.Context) {
|
func Test(ctx *gin.Context) {
|
||||||
service.CastProvider.Test(ctx, &emptypb.Empty{})
|
service.Success(ctx, nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
1
pkg/service/cast/oauth.go
Normal file
1
pkg/service/cast/oauth.go
Normal file
@ -0,0 +1 @@
|
|||||||
|
package cast
|
||||||
@ -1,38 +0,0 @@
|
|||||||
package cast
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"fonchain-fiee/pkg/service"
|
|
||||||
"net/url"
|
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TikTokRedirect(ctx *gin.Context) {
|
|
||||||
var state, decodeParams, code string
|
|
||||||
var err error
|
|
||||||
var values url.Values
|
|
||||||
fmt.Println(code)
|
|
||||||
state = ctx.Query("state")
|
|
||||||
decodeParams, err = url.QueryUnescape(state)
|
|
||||||
values, err = url.ParseQuery(decodeParams)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
switch values.Get("source") {
|
|
||||||
case "authcode":
|
|
||||||
code = ctx.Query("code")
|
|
||||||
/*resp, _err := service.CastProvider.OAuthTikTokToken(ctx, &cast.OAuthTikTokTokenReq{
|
|
||||||
Code: code,
|
|
||||||
UserID: values.Get("userid"),
|
|
||||||
})
|
|
||||||
if _err != nil {
|
|
||||||
service.Error(ctx, _err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
service.Success(ctx, resp)*/
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
@ -11,9 +11,7 @@ import (
|
|||||||
"fonchain-fiee/pkg/e"
|
"fonchain-fiee/pkg/e"
|
||||||
modelCast "fonchain-fiee/pkg/model/cast"
|
modelCast "fonchain-fiee/pkg/model/cast"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
"fonchain-fiee/pkg/utils/stime"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
@ -33,7 +31,6 @@ func UpdateWorkImage(ctx *gin.Context) {
|
|||||||
ID: artistId,
|
ID: artistId,
|
||||||
Domain: "app",
|
Domain: "app",
|
||||||
})
|
})
|
||||||
zap.L().Info("UpdateWorkImage infoResp", zap.Any("infoResp", infoResp))
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
@ -56,7 +53,6 @@ func UpdateWorkImage(ctx *gin.Context) {
|
|||||||
newCtx := NewCtxWithUserInfo(ctx)
|
newCtx := NewCtxWithUserInfo(ctx)
|
||||||
req.Source = 1
|
req.Source = 1
|
||||||
resp, err := service.CastProvider.UpdateWorkImage(newCtx, req)
|
resp, err := service.CastProvider.UpdateWorkImage(newCtx, req)
|
||||||
zap.L().Info("UpdateWorkImage resp", zap.Any("resp", resp))
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
@ -79,7 +75,6 @@ func UpdateWorkVideo(ctx *gin.Context) {
|
|||||||
ID: artistId,
|
ID: artistId,
|
||||||
Domain: "app",
|
Domain: "app",
|
||||||
})
|
})
|
||||||
zap.L().Info("UpdateWorkVideo", zap.Any("infoResp", infoResp))
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
@ -102,7 +97,6 @@ func UpdateWorkVideo(ctx *gin.Context) {
|
|||||||
newCtx := NewCtxWithUserInfo(ctx)
|
newCtx := NewCtxWithUserInfo(ctx)
|
||||||
req.Source = 1
|
req.Source = 1
|
||||||
resp, err := service.CastProvider.UpdateWorkVideo(newCtx, req)
|
resp, err := service.CastProvider.UpdateWorkVideo(newCtx, req)
|
||||||
zap.L().Info("UpdateWorkVideo", zap.Any("resp", resp))
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
@ -152,14 +146,6 @@ func WorkList(ctx *gin.Context) {
|
|||||||
approvalID, _ := strconv.ParseUint(v.ApprovalID, 10, 64)
|
approvalID, _ := strconv.ParseUint(v.ApprovalID, 10, 64)
|
||||||
workUuidApprovalIDMap[int(approvalID)] = v.WorkUuid
|
workUuidApprovalIDMap[int(approvalID)] = v.WorkUuid
|
||||||
}
|
}
|
||||||
statusUpdateDate, _ := stime.DatetimeToTimes(v.StatusUpdateTime, "2006-01-02 15:04:05")
|
|
||||||
if v.WorkStatus == 6 && (time.Now().Unix()-int64(statusUpdateDate) < 300) {
|
|
||||||
go func() {
|
|
||||||
_, _ = service.CastProvider.PublishMediaInfo(context.Background(), &cast.PublishMediaInfoReq{
|
|
||||||
WorkUuid: v.WorkUuid,
|
|
||||||
})
|
|
||||||
}()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if len(workUuidApprovalIDMap) > 0 {
|
if len(workUuidApprovalIDMap) > 0 {
|
||||||
_ = RefreshWorkApprovalStatus(ctx, workUuidApprovalIDMap)
|
_ = RefreshWorkApprovalStatus(ctx, workUuidApprovalIDMap)
|
||||||
@ -190,10 +176,8 @@ func WorkDetail(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func CheckUserBundleBalance(userID int32, balanceType modelCast.BalanceTypeEnum) (err error) {
|
func CheckUserBundleBalance(userID int32, balanceType modelCast.BalanceTypeEnum) (err error) {
|
||||||
zap.L().Info("CheckUserBundleBalance", zap.Any("userID", userID))
|
|
||||||
resp, err := service.BundleProvider.GetBundleBalanceByUserId(context.Background(), &bundle.GetBundleBalanceByUserIdReq{UserId: userID})
|
resp, err := service.BundleProvider.GetBundleBalanceByUserId(context.Background(), &bundle.GetBundleBalanceByUserIdReq{UserId: userID})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.L().Error("CheckUserBundleBalance", zap.Any("err", err))
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
zap.L().Info("CheckUserBundleBalance", zap.Any("resp", resp))
|
zap.L().Info("CheckUserBundleBalance", zap.Any("resp", resp))
|
||||||
@ -222,7 +206,6 @@ func RePublish(ctx *gin.Context) {
|
|||||||
var (
|
var (
|
||||||
req *cast.RePublishReq
|
req *cast.RePublishReq
|
||||||
resp *cast.RePublishResp
|
resp *cast.RePublishResp
|
||||||
//workInfoResp *cast.WorkInfoResp
|
|
||||||
)
|
)
|
||||||
var err error
|
var err error
|
||||||
if err = ctx.ShouldBind(&req); err != nil {
|
if err = ctx.ShouldBind(&req); err != nil {
|
||||||
@ -230,39 +213,28 @@ func RePublish(ctx *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
newCtx := NewCtxWithUserInfo(ctx)
|
newCtx := NewCtxWithUserInfo(ctx)
|
||||||
/* workInfoResp, err = service.CastProvider.WorkInfo(context.Background(), &cast.WorkInfoReq{
|
|
||||||
WorkUuid: req.WorkUuid,
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
fmt.Println(workInfoResp)*/
|
|
||||||
/*artistID, _ := strconv.ParseInt(workInfoResp.ArtistUuid, 10, 64)
|
|
||||||
if err = CheckUserBundleBalance(int32(artistID), modelCast.BalanceTypeVideoValue); err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
balanceReq := &bundle.AddBundleBalanceReq{
|
|
||||||
UserId: int32(artistID),
|
|
||||||
}
|
|
||||||
if workInfoResp.WorkCategory == 1 {
|
|
||||||
balanceReq.ImageConsumptionNumber = 1
|
|
||||||
}
|
|
||||||
if workInfoResp.WorkCategory == 2 {
|
|
||||||
balanceReq.VideoConsumptionNumber = 1
|
|
||||||
}
|
|
||||||
_, err = service.BundleProvider.AddBundleBalance(context.Background(), balanceReq)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}*/
|
|
||||||
resp, err = service.CastProvider.RePublish(newCtx, req)
|
resp, err = service.CastProvider.RePublish(newCtx, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
service.Error(ctx, err)
|
service.Error(ctx, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
service.Success(ctx, resp)
|
artistID, _ := strconv.ParseUint(resp.ArtistUuid, 10, 64)
|
||||||
|
balanceReq := &bundle.AddBundleBalanceReq{
|
||||||
|
UserId: int32(artistID),
|
||||||
|
}
|
||||||
|
if resp.WorkCategory == 1 {
|
||||||
|
balanceReq.ImageConsumptionNumber = 1
|
||||||
|
}
|
||||||
|
if resp.WorkCategory == 2 {
|
||||||
|
balanceReq.VideoConsumptionNumber = 1
|
||||||
|
}
|
||||||
|
_, err = service.BundleProvider.AddBundleBalance(context.Background(), balanceReq)
|
||||||
|
if err != nil {
|
||||||
|
service.Error(ctx, err)
|
||||||
|
//FIXME 进行回滚
|
||||||
|
return
|
||||||
|
}
|
||||||
|
service.Success(ctx, nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -392,20 +364,3 @@ func Remind(ctx *gin.Context) {
|
|||||||
service.Success(ctx, nil)
|
service.Success(ctx, nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func PublishInfo(ctx *gin.Context) {
|
|
||||||
var req *cast.PublishMediaInfoReq
|
|
||||||
var resp *cast.PublishMediaInfoResp
|
|
||||||
var err error
|
|
||||||
if err = ctx.ShouldBind(&req); err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
resp, err = service.CastProvider.PublishMediaInfo(context.Background(), req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
service.Success(ctx, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|||||||
@ -7,9 +7,6 @@
|
|||||||
package stime
|
package stime
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"fonchain-fiee/pkg/e"
|
|
||||||
"go.uber.org/zap"
|
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -91,19 +88,3 @@ var WeekStrMap = map[string]string{
|
|||||||
"Saturday": "六",
|
"Saturday": "六",
|
||||||
"Sunday": "日",
|
"Sunday": "日",
|
||||||
}
|
}
|
||||||
|
|
||||||
func DatetimeToTimes(datetime string, dateFormat string) (times int32, err error) {
|
|
||||||
if datetime == "" {
|
|
||||||
times = 0
|
|
||||||
return
|
|
||||||
}
|
|
||||||
loc, _ := time.LoadLocation("Asia/Shanghai")
|
|
||||||
t, err := time.ParseInLocation(dateFormat, datetime, loc)
|
|
||||||
if err != nil {
|
|
||||||
zap.L().Error("DatetimeToTimes err:"+datetime+":", zap.Error(err))
|
|
||||||
err = errors.New(e.GetCodeMsg(e.InvalidParams))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
times = int32(t.Unix())
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|||||||
@ -7,16 +7,14 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"fonchain-fiee/pkg/e"
|
"fonchain-fiee/pkg/e"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"github.com/tealeg/xlsx"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
|
||||||
"github.com/tealeg/xlsx"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -130,36 +128,3 @@ func ResponseXls(c *gin.Context, content io.ReadSeeker, fileTag string) {
|
|||||||
//c.Writer.Header().Add("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
//c.Writer.Header().Add("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||||
http.ServeContent(c.Writer, c.Request, fileName, time.Now(), content)
|
http.ServeContent(c.Writer, c.Request, fileName, time.Now(), content)
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateDirPath(path string) (err error) {
|
|
||||||
if _, err = os.Stat(path); os.IsNotExist(err) {
|
|
||||||
if err = os.MkdirAll(path, os.ModePerm); err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func CopyFile(src, dstDir string) (string, error) {
|
|
||||||
in, err := os.Open(src)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
defer in.Close()
|
|
||||||
if err := os.MkdirAll(dstDir, 0755); err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
dst := filepath.Join(dstDir, filepath.Base(src))
|
|
||||||
out, err := os.Create(dst)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
defer out.Close()
|
|
||||||
if _, err = io.Copy(out, in); err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
if err = out.Sync(); err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
return dst, nil
|
|
||||||
}
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user