This commit is contained in:
苏尹岚
2021-03-26 16:29:27 +08:00
parent 559908276d
commit e45d85e999
3 changed files with 7 additions and 3 deletions

View File

@@ -23,6 +23,7 @@ type MsgController struct {
// @Param content formData string true "消息内容"
// @Param messageType formData int true "消息类型1为普通给商家发的消息3为活动内容通知"
// @Param actInfo formData string false "如果是活动内容通知需传"
// @Param imgs formData string false "图片s"
// @Param isAsync formData bool false "是否异步操作,缺省否"
// @Param isContinueWhenError formData bool false "单个失败是否继续缺省false"
// @Success 200 {object} controllers.CallResult
@@ -31,10 +32,11 @@ type MsgController struct {
func (c *MsgController) SendStoreMessage() {
c.callSendStoreMessage(func(params *tMsgSendStoreMessageParams) (retVal interface{}, errCode string, err error) {
var storeIDs []int
if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDs); err != nil {
var imgs []string
if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDs, params.Imgs, &imgs); err != nil {
return retVal, "", err
}
retVal, err = weixinmsg.SendStoreMessage(params.Ctx, params.Title, params.Content, storeIDs, params.ActInfo, params.MessageType, params.IsAsync, params.IsContinueWhenError)
retVal, err = weixinmsg.SendStoreMessage(params.Ctx, params.Title, params.Content, storeIDs, imgs, params.ActInfo, params.MessageType, params.IsAsync, params.IsContinueWhenError)
return retVal, "", err
})
}