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