From 91f7f46144d4da05af59f90d09a5e72658e42932 Mon Sep 17 00:00:00 2001 From: braumye Date: Mon, 29 Jan 2024 13:38:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E9=94=99=E8=AF=AF=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openplatform/miniprogram/basic/basic.go | 30 ++++++++++--------------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/openplatform/miniprogram/basic/basic.go b/openplatform/miniprogram/basic/basic.go index e79a3d8..ea9a90c 100644 --- a/openplatform/miniprogram/basic/basic.go +++ b/openplatform/miniprogram/basic/basic.go @@ -79,11 +79,9 @@ func (basic *Basic) CheckNickName(nickname string) (*CheckNickNameResp, error) { if err != nil { return nil, err } - result := &CheckNickNameResp{} - if err := util.DecodeWithError(data, result, "wxverify/checkwxverifynickname"); err != nil { - return nil, err - } - return result, nil + res := &CheckNickNameResp{} + err = util.DecodeWithError(data, res, "CheckNickName") + return res, err } // SetNickNameResp 设置小程序名称结果 @@ -124,11 +122,9 @@ func (basic *Basic) SetNickNameFull(param *SetNickNameParam) (*SetNickNameResp, if err != nil { return nil, err } - result := &SetNickNameResp{} - if err := util.DecodeWithError(data, result, "setnickname"); err != nil { - return nil, err - } - return result, nil + res := &SetNickNameResp{} + err = util.DecodeWithError(data, res, "SetNickName") + return res, err } // SetSignatureResp 小程序功能介绍修改结果 @@ -150,7 +146,7 @@ func (basic *Basic) SetSignature(signature string) error { if err != nil { return err } - return util.DecodeWithError(data, &SetSignatureResp{}, "account/modifysignature") + return util.DecodeWithError(data, &SetSignatureResp{}, "SetSignature") } // GetSearchStatusResp 查询小程序当前是否可被搜索 @@ -171,11 +167,9 @@ func (basic *Basic) GetSearchStatus(signature string) (*GetSearchStatusResp, err if err != nil { return nil, err } - result := &GetSearchStatusResp{} - if err := util.DecodeWithError(data, result, "getwxasearchstatus"); err != nil { - return nil, err - } - return result, nil + res := &GetSearchStatusResp{} + err = util.DecodeWithError(data, res, "GetSearchStatus") + return res, err } // SetSearchStatusResp 小程序是否可被搜索修改结果 @@ -198,7 +192,7 @@ func (basic *Basic) SetSearchStatus(status int) error { if err != nil { return err } - return util.DecodeWithError(data, &SetSearchStatusResp{}, "changewxasearchstatus") + return util.DecodeWithError(data, &SetSearchStatusResp{}, "SetSearchStatus") } // SetHeadImageResp 小程序头像修改结果 @@ -239,5 +233,5 @@ func (basic *Basic) SetHeadImageFull(param *SetHeadImageParam) error { if err != nil { return err } - return util.DecodeWithError(data, &SetHeadImageResp{}, "account/modifyheadimage") + return util.DecodeWithError(data, &SetHeadImageResp{}, "account/setheadimage") }