From d003844efd4ecd5fced5119f52edd8d1016e478c Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Thu, 24 Aug 2023 15:35:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=B7=BB=E5=8A=A0log=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/repositories/image_handle.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/service/repositories/image_handle.go b/service/repositories/image_handle.go index 4a89f61c..8fd3e078 100644 --- a/service/repositories/image_handle.go +++ b/service/repositories/image_handle.go @@ -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