用户发送消息

This commit is contained in:
苏尹岚
2020-09-26 10:30:28 +08:00
parent 6ca608f786
commit a30ba2bf1b
4 changed files with 138 additions and 4 deletions

View File

@@ -37,6 +37,28 @@ func (c *MsgController) SendStoreMessage() {
})
}
// @Title 发送用户微信消息
// @Description 发送用户微信消息
// @Param token header string true "认证token"
// @Param userIDs formData string true "用户 ID列表"
// @Param title formData string true "消息标题"
// @Param content formData string true "消息内容"
// @Param isAsync formData bool false "是否异步操作,缺省否"
// @Param isContinueWhenError formData bool false "单个失败是否继续缺省false"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /SendUserMessage [post]
func (c *MsgController) SendUserMessage() {
c.callSendUserMessage(func(params *tMsgSendUserMessageParams) (retVal interface{}, errCode string, err error) {
var userIDs []string
if err = jxutils.Strings2Objs(params.UserIDs, &userIDs); err != nil {
return retVal, "", err
}
retVal, err = weixinmsg.SendUserMessage(params.Ctx, params.Title, params.Content, userIDs, params.IsAsync, params.IsContinueWhenError)
return retVal, "", err
})
}
// @Title 门店读微信消息
// @Description 门店读微信消息此API是自动调用的
// @Param token header string true "认证token"