Skip to content

客服管理功能添加#600

Merged
silenceper merged 16 commits intosilenceper:v2from
waro163:customer-service-mgt
Aug 13, 2022
Merged

客服管理功能添加#600
silenceper merged 16 commits intosilenceper:v2from
waro163:customer-service-mgt

Conversation

@waro163
Copy link
Contributor

@waro163 waro163 commented Aug 7, 2022

所有代码均自测通过;

官方文档有2处:
官方文档【1】链接:
https://developers.weixin.qq.com/doc/offiaccount/Customer_Service/Customer_Service_Management.html

官方文档【2】链接:
https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Service_Center_messages.html

以上两处文档不同之处有几方面:
1中添加和更新客服不需要密码参数,2中有参数。代码采用1文档
1中删除客服账号使用get请求,2中使用post请求。代码采用2文档

@silenceper
Copy link
Owner

麻烦fix一下ci的错误

@waro163
Copy link
Contributor Author

waro163 commented Aug 8, 2022

麻烦fix一下ci的错误

这个ci错误是结构体命名的问题。
但是如果按照CI的提示来命名结构体会让人不知所云,缺失一些信息。

所以我考虑修改提示错误中的CustomerService为KeFu,虽然为拼音,但是简明扼要,又对应公众号平台里面的命名。
应该没有问题,稍后我会修复该错误

@silenceper
Copy link
Owner

不建议英文和拼音混用。这里提示包名已经是CustomerService,直接去掉前缀,对于调用方来说我觉得是不是其实还好。
customerservice.Manager 也能知道是这个包下的信息

@waro163
Copy link
Contributor Author

waro163 commented Aug 8, 2022

不建议英文和拼音混用。这里提示包名已经是CustomerService,直接去掉前缀,对于调用方来说我觉得是不是其实还好。 customerservice.Manager 也能知道是这个包下的信息

嗯嗯,Manager已经按照修改了。

新添加了一个NewCommonError函数,针对微信一些接口没有errcode和errmsg的格式,也可以返回该通用错误。

var res resKeFuOnlineList
err = json.Unmarshal(response, &res)
if err != nil {
err = util.NewCommonError("ListOnlineCustomerService", -1, err.Error())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果是错误返回什么信息呢?没有errcode?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

接口没有errmsg和errcode返回字段。
不过在返回结构体中已经添加了这两个字段,该用util.DecodeWithError进行解析。

@silenceper silenceper merged commit 37f9e98 into silenceper:v2 Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants