fix:添加log时间

This commit is contained in:
momo 2023-08-24 15:35:31 +08:00
parent dad56a677b
commit d003844efd

View File

@ -9,8 +9,10 @@ import (
"fusenapi/utils/curl" "fusenapi/utils/curl"
"fusenapi/utils/file" "fusenapi/utils/file"
"fusenapi/utils/hash" "fusenapi/utils/hash"
"time"
"github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/session"
"github.com/zeromicro/go-zero/core/logc"
"github.com/zeromicro/go-zero/core/logx" "github.com/zeromicro/go-zero/core/logx"
"gorm.io/gorm" "gorm.io/gorm"
) )
@ -57,10 +59,12 @@ func (l *defaultImageHandle) LogoInfoSet(ctx context.Context, in *LogoInfoSetReq
postMap := make(map[string]string, 1) postMap := make(map[string]string, 1)
postMap["logo_url"] = in.LogoUrl postMap["logo_url"] = in.LogoUrl
logc.Infof(ctx, "算法请求--LOGO基础信息--开始时间:%v", time.Now().UTC())
err := curl.NewClient(ctx, &curl.Config{ err := curl.NewClient(ctx, &curl.Config{
BaseUrl: *l.BLMServiceUrl, BaseUrl: *l.BLMServiceUrl,
Url: constants.BLMServiceUrlLogoFeatureExtraction, Url: constants.BLMServiceUrlLogoFeatureExtraction,
}).PostJson(postMap, &resultBLM) }).PostJson(postMap, &resultBLM)
logc.Infof(ctx, "算法请求--LOGO基础信息--结束时间:%v", time.Now().UTC())
if err != nil { if err != nil {
logx.Error(err) logx.Error(err)
return nil, err return nil, err
@ -190,11 +194,13 @@ func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq
postMap["module_data"] = moduleDataMap postMap["module_data"] = moduleDataMap
postMap["param_data"] = combineParam postMap["param_data"] = combineParam
logc.Infof(ctx, "算法请求--合图--开始时间:%v", time.Now().UTC())
var resultBLM constants.BLMServiceUrlResult var resultBLM constants.BLMServiceUrlResult
err = curl.NewClient(ctx, &curl.Config{ err = curl.NewClient(ctx, &curl.Config{
BaseUrl: *l.BLMServiceUrl, BaseUrl: *l.BLMServiceUrl,
Url: constants.BLMServiceUrlLogoCombine, Url: constants.BLMServiceUrlLogoCombine,
}).PostJson(postMap, &resultBLM) }).PostJson(postMap, &resultBLM)
logc.Infof(ctx, "算法请求--合图--结束时间:%v", time.Now().UTC())
if err != nil { if err != nil {
logx.Error(err) logx.Error(err)
@ -307,11 +313,12 @@ func (l *defaultImageHandle) LogoStandard(ctx context.Context, in *LogoStandardR
postMap["height"] = in.Height postMap["height"] = in.Height
postMap["proportion"] = in.Proportion postMap["proportion"] = in.Proportion
logc.Infof(ctx, "算法请求--去背景--开始时间:%v", time.Now().UTC())
err = curl.NewClient(ctx, &curl.Config{ err = curl.NewClient(ctx, &curl.Config{
BaseUrl: *l.BLMServiceUrl, BaseUrl: *l.BLMServiceUrl,
Url: constants.BLMServiceUrlLogoRemovebg, Url: constants.BLMServiceUrlLogoRemovebg,
}).PostJson(postMap, &resultBLM) }).PostJson(postMap, &resultBLM)
logc.Infof(ctx, "算法请求--去背景--结束时间:%v", time.Now().UTC())
if err != nil { if err != nil {
logx.Error(err) logx.Error(err)
return nil, err return nil, err