- 优化入参
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

master v1.0.2
李光春 2 years ago
parent a50fb4a060
commit 7095a04cc7

@ -1,3 +1,7 @@
## v1.0.2 / 2022年06月05日
- 优化入参
## v1.0.1 / 2022年06月05日
- 优化

@ -1,27 +0,0 @@
package wechatqy
// Params 请求参数
type Params map[string]interface{}
func NewParams() Params {
p := make(Params)
return p
}
func (app *App) NewParamsWith(params ...Params) Params {
p := make(Params)
for _, v := range params {
p.SetParams(v)
}
return p
}
func (p Params) Set(key string, value interface{}) {
p[key] = value
}
func (p Params) SetParams(params Params) {
for key, value := range params {
p[key] = value
}
}

@ -1,3 +1,3 @@
package wechatqy
const Version = "1.0.1"
const Version = "1.0.2"

@ -27,9 +27,9 @@ func NewWebhookSendResult(result WebhookSendResponse, body []byte, http goreques
// WebhookSend 发送应用消息
// https://developer.work.weixin.qq.com/document/path/90372
func (app *App) WebhookSend(notMustParams ...Params) *WebhookSendResult {
func (app *App) WebhookSend(notMustParams ...gorequest.Params) *WebhookSendResult {
// 参数
params := app.NewParamsWith(notMustParams...)
params := gorequest.NewParamsWith(notMustParams...)
// 请求
request, err := app.request(fmt.Sprintf("https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=%s&type=%s", app.key, "text"), params)
// 定义

Loading…
Cancel
Save