From 67b7e7d2b18cbc132f99ae275c7cbb7622e98e19 Mon Sep 17 00:00:00 2001 From: aichy126 <16996097+aichy126@users.noreply.github.com> Date: Wed, 16 Nov 2022 10:32:29 +0800 Subject: [PATCH] error msg --- internal/service/tag_common/tag_common.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/service/tag_common/tag_common.go b/internal/service/tag_common/tag_common.go index 31d66871..173f9db7 100644 --- a/internal/service/tag_common/tag_common.go +++ b/internal/service/tag_common/tag_common.go @@ -73,16 +73,16 @@ func (ts *TagCommonService) GetSiteWriteRecommendTag(ctx context.Context) (tags return tags, nil } -func (ts *TagCommonService) SetSiteWriteRecommendTag(ctx context.Context, tags []string, required bool, userID string) (err error) { +func (ts *TagCommonService) SetSiteWriteRecommendTag(ctx context.Context, tags []string, required bool, userID string) (msg string, err error) { err = ts.UpdateTag(ctx, tags, userID) if err != nil { - return err + return err.Error(), err } err = ts.SetTagsAttribute(ctx, tags, "recommend", true) if err != nil { - return err + return "", err } - return nil + return "", nil } func (ts *TagCommonService) GetSiteWriteReservedTag(ctx context.Context) (tags []string, err error) { @@ -94,16 +94,16 @@ func (ts *TagCommonService) GetSiteWriteReservedTag(ctx context.Context) (tags [ return tags, nil } -func (ts *TagCommonService) SetSiteWriteReservedTag(ctx context.Context, tags []string, userID string) (err error) { +func (ts *TagCommonService) SetSiteWriteReservedTag(ctx context.Context, tags []string, userID string) (msg string, err error) { err = ts.UpdateTag(ctx, tags, userID) if err != nil { - return err + return err.Error(), err } err = ts.SetTagsAttribute(ctx, tags, "reserved", true) if err != nil { - return err + return "", err } - return nil + return "", nil } // SetTagsAttribute