Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add method SendTaskCardMessage #59

Merged
merged 2 commits into from Jan 7, 2021
Merged

add method SendTaskCardMessage #59

merged 2 commits into from Jan 7, 2021

Conversation

zhaikangqi
Copy link
Contributor

添加了发送任务卡片类型的消息

Copy link
Owner

@xen0n xen0n left a comment

Choose a reason for hiding this comment

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

Also update the README about the addition.

models.go Outdated
Comment on lines 944 to 948
Key string `json:"key"`
Name string `json:"name"`
ReplaceName string `json:"replace_name"`
Color string `json:"color"`
IsBold bool `json:"is_bold"`
Copy link
Owner

Choose a reason for hiding this comment

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

Add field descriptions from official docs.

message.go Outdated
Comment on lines 201 to 209
btnByte, err := json.Marshal(btn)
if err != nil {
return errors.New("btn convert to json fail: " + err.Error())
}
var btnSlice []map[string]interface{}
err = json.Unmarshal(btnByte, &btnSlice)
if err != nil {
return errors.New("btn convert to []map fail: " + 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.

This shouldn't be necessary, a []TaskCardBtn is an interface{} after all, there's no custom marshaling logic at play.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

是的,我已经删除了这部分代码

Copy link
Owner

@xen0n xen0n left a comment

Choose a reason for hiding this comment

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

Assuming you tested the code yourself, it should be ready to go. I'd like to rename some fields and make the "button color" string an enum instead, but that can come later.

Thanks for your contribution!

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 7, 2021

Build succeeded:

  • continuous-integration/travis-ci/push

@bors bors bot merged commit 68e8836 into xen0n:develop Jan 7, 2021
jioswu pushed a commit to jioswu/go-workwx that referenced this pull request Feb 24, 2021
59: add method SendTaskCardMessage r=xen0n a=zhaikangqi

添加了发送任务卡片类型的消息

Co-authored-by: zhaikangqi <794556486@qq.com>
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.

None yet

2 participants