|
|
@@ -4,15 +4,15 @@ import cn.hutool.core.util.StrUtil;
|
|
|
import com.cyksj.common.util.IoKit;
|
|
|
import com.cyksj.common.util.StringUtil;
|
|
|
import com.cyksj.common.util.Xmls;
|
|
|
+import com.cyksj.dto.Result;
|
|
|
+import com.cyksj.enums.GatewayResponse;
|
|
|
import com.cyksj.model.dto.MsgEvent;
|
|
|
import com.cyksj.service.gzh.GzhService;
|
|
|
+import com.cyksj.service.wechat.WeChatService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.IOException;
|
|
|
@@ -32,6 +32,8 @@ public class GzhController {
|
|
|
|
|
|
private final GzhService gzhService;
|
|
|
|
|
|
+ private final WeChatService weChatService;
|
|
|
+
|
|
|
@RequestMapping(value = "/msg/notify", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
public String msgNotify(@RequestParam(value = "echostr", required = false) String echoStr) throws IOException {
|
|
|
if (StrUtil.endWithIgnoreCase(request.getMethod(), RequestMethod.GET.name())) {
|
|
|
@@ -65,4 +67,14 @@ public class GzhController {
|
|
|
|
|
|
return gzhService.gzhMsg(msgEvent);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生成永久渠道二维码
|
|
|
+ */
|
|
|
+ @GetMapping("/get/notExpired/popularizeCode")
|
|
|
+ public Result<String> getNotExpiredPopularizeCode(String sceneKey) throws Exception {
|
|
|
+ //获取gzh带参数的二维码
|
|
|
+ String url = weChatService.getNotExpiredWxGzhQrCode(sceneKey);
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(url);
|
|
|
+ }
|
|
|
}
|