From 34cabe5f70494c100f4ce308dc4c8974a0272f91 Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Fri, 20 Oct 2023 16:05:12 +0800 Subject: [PATCH] logo search --- model/gmodel/fs_preprocess_logo_logic.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/model/gmodel/fs_preprocess_logo_logic.go b/model/gmodel/fs_preprocess_logo_logic.go index edfe98f5..ec09f4de 100644 --- a/model/gmodel/fs_preprocess_logo_logic.go +++ b/model/gmodel/fs_preprocess_logo_logic.go @@ -47,6 +47,10 @@ func (p *FsPreprocessLogoModel) PreLogoSearch(ctx context.Context, zipcode strin resp[i].ResourceUrl = FsString(testData[rand.Uint64()%uint64(len(testData))]) } + if resp == nil { + resp = make([]PreLogoSearchResult, 0) + } + return resp, nil } @@ -72,6 +76,10 @@ func (p *FsPreprocessLogoModel) PreLogoSearchSuggestions(ctx context.Context, ke resp[i].ResourceUrl = FsString(testData[rand.Uint64()%uint64(len(testData))]) } + if resp == nil { + resp = make([]PreLogoSearchResult, 0) + } + return resp, nil }