diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/wechat/controller/WxQrCodeContorller.java b/mall-shop/src/main/java/com/suisung/mall/shop/wechat/controller/WxQrCodeContorller.java index 48d5c1fd..1284cc47 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/wechat/controller/WxQrCodeContorller.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/wechat/controller/WxQrCodeContorller.java @@ -6,6 +6,7 @@ import cn.hutool.json.JSONObject; import com.suisung.mall.common.api.CommonResult; import com.suisung.mall.common.exception.ApiException; import com.suisung.mall.common.utils.I18nUtil; +import com.suisung.mall.shop.message.service.ShopMessageTemplateService; import com.suisung.mall.shop.wechat.service.WxQrCodeService; import com.suisung.mall.shop.wechat.service.WxURLSchemeService; import io.swagger.annotations.Api; @@ -26,6 +27,9 @@ public class WxQrCodeContorller { @Autowired private WxURLSchemeService wxURLSchemeService; + @Autowired + private ShopMessageTemplateService shopMessageTemplateService; + @ApiOperation(value = "获取小程序码", notes = "获取小程序码") @RequestMapping(value = "/getWxQrCode", method = RequestMethod.POST) public CommonResult getWxQrCode(@RequestParam(value = "preparedUrl") String preparedUrl, @@ -49,5 +53,13 @@ public class WxQrCodeContorller { public CommonResult generateCommonWxUrlScheme() { return wxURLSchemeService.generateCommonWxUrlScheme(); } + @PostMapping(value = "/common/sendMessage") + public CommonResult sendMessage() { + shopMessageTemplateService.sendToXcxAllUserMessage();//平台店铺消息推送 + shopMessageTemplateService.sendToXcxShopMemberUserMessage();//店铺消息订阅发送 + return wxURLSchemeService.generateCommonWxUrlScheme(); + } + + }