+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.modules.group.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO;
+import com.epmet.commons.tools.scan.param.TextScanParamDTO;
+import com.epmet.commons.tools.scan.param.TextTaskDTO;
+import com.epmet.commons.tools.scan.result.SyncScanResult;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.utils.ScanContentUtils;
+import com.epmet.commons.tools.utils.SendMqMsgUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * 群组信息表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-03-28
+ */
+@RestController
+public class TestPController {
+
+ @RequestMapping("scan")
+ public Result setVisitSwitch(@RequestParam String content){
+ String url = "https://epmet-dev.elinkservice.cn/api/epmetscan/api/textSyncScan";
+ TextTaskDTO p = new TextTaskDTO();
+ p.setDataId("1");
+ String content1 = "开着房车去旅行,已经成了不少人出游的新方式。临近“五一”,房车租赁市场持续火爆,尽管价格比平时贵了不少,可仍一车难求。\n" +
+ "\n" +
+ "“临近‘五一’,想开一辆房车拉着一家人去草原旅游,没想到一周前就已经租不到车了。”读者刘先生说,最近一段时间,他总是在一些短视频平台上看到有人开着房车出门旅行的视频。眼下春暖花开,正是出游的好时节,开上一辆房车,不仅节省了住宿费,还能体验一种不同的出行方式。不过,这周起刘先生搜索相关的房车租赁信息时,却发现不少房车租赁公司已经是一车难求了。\n" +
+ "在某房车租车软件上记者发现,位于房山和顺义的两个取车还车点,五一期间的全部车型已经被租赁一空。而在另一家房车租赁公司的价格目录里,明确标注了租赁价格分为平时价和节假日价,后者是前者的1.2倍。\n" +
+ "\n" +
+ "“‘五一’期间,北京的房车租赁情况很紧张,目前只剩一台东风了,你可以考虑一下。”一家房车租赁公司的工作人员介绍,他们公司规定“五一”期间租赁时间为五天起租,仅剩的东风车型每天的租金在1278元。“‘五一’期间的价格会比平时高一些,我建议您在5月6日之后租,一方面没有租赁时长的限制,另一方面租金会便宜不少,每天也就900多元。";
+ if (StringUtils.isBlank(content)){
+ p.setContent(content1);
+ }else{
+ p.setContent(content);
+ }
+ List list = new ArrayList<>();
+ list.add(p);
+ TextScanParamDTO param = new TextScanParamDTO();
+ param.setTasks(list);
+ Result imgSyncScanResult = ScanContentUtils.textSyncScan(url, param);
+ System.out.println("==================="+ JSON.toJSONString(imgSyncScanResult));
+ SyncScanResult result = new SyncScanResult();
+ if (imgSyncScanResult != null){
+ SyncScanResult imgSyncScanResultData = imgSyncScanResult.getData();
+ if (imgSyncScanResult.success()&&imgSyncScanResultData.isAllPass()) {
+ result.setAllPass(imgSyncScanResultData.isAllPass());
+ result.getSuccessDataIds().addAll(imgSyncScanResultData.getSuccessDataIds());
+ result.getFailDataIds().addAll(imgSyncScanResultData.getFailDataIds());
+ System.out.println("================"+JSON.toJSONString(result));
+ }
+ }
+ return new Result().ok(result);
+ }
+
+ @RequestMapping("test-mq")
+ public Result testMqMsg(@RequestParam String content){
+ MqBaseMsgDTO msg = null;
+ if (StringUtils.isBlank(content)){
+ content = "{\"appId\":\"202007161443499985fa2d397436d10356542134c8f008c48\",\"eventClass\":\"resi_group\",\"eventTag\":\"shift_topic_to_issue\",\"msg\":\"[{\\\"actionFlag\\\":\\\"plus\\\",\\\"agencyId\\\":\\\"e9b55911549fe7b0d0427b557f7c5efc\\\",\\\"customerId\\\":\\\"45687aa479955f9d06204d415238f7cc\\\",\\\"eventClass\\\":\\\"resi_group\\\",\\\"eventTag\\\":\\\"topic_to_issue\\\",\\\"gridId\\\":\\\"708a3567b54ced7219666489f9d838ab\\\",\\\"groupId\\\":\\\"6838a625e4ccc0dc036f9903af833ad9\\\",\\\"isCommon\\\":false,\\\"remark\\\":\\\"小组成就3小组中发布的话题\\\\\\\"还是不行这里在测试测试测试为什么发反反复复反反复复反反复复方法不够爽肤水的分身乏术分身乏术发烧反反复复方法分为玩儿玩儿玩儿啦啦啦啦\\\\\\\"被转为议题\\\",\\\"sourceId\\\":\\\"67a06a217ecf46cd92944040323e70e0\\\",\\\"sourceType\\\":\\\"issue\\\",\\\"userId\\\":\\\"74b5d6792d89fb2fb2d0363de3cbc1aa\\\"},{\\\"actionFlag\\\":\\\"plus\\\",\\\"agencyId\\\":\\\"e9b55911549fe7b0d0427b557f7c5efc\\\",\\\"customerId\\\":\\\"45687aa479955f9d06204d415238f7cc\\\",\\\"eventTag\\\":\\\"shift_topic_to_issue\\\",\\\"gridId\\\":\\\"708a3567b54ced7219666489f9d838ab\\\",\\\"groupId\\\":\\\"6838a625e4ccc0dc036f9903af833ad9\\\",\\\"isCommon\\\":false,\\\"remark\\\":\\\"将话题\\\\\\\"还是不行\\\\\\\"转为议题\\\",\\\"sourceId\\\":\\\"67a06a217ecf46cd92944040323e70e0\\\",\\\"sourceType\\\":\\\"issue\\\",\\\"userId\\\":\\\"74b5d6792d89fb2fb2d0363de3cbc1aa\\\"}]\",\"requestUrl\":\"https://epmet-dev.elinkservice.cn/estos/producerService/producer/sendMsg\",\"token\":\"52d9d9b0e7d0eb5b8b81c205b579e07c\"}";
+ msg = JSON.parseObject(content,MqBaseMsgDTO.class);
+ }else{
+ msg = new MqBaseMsgDTO();
+ msg.setMsg(content);
+ msg.setEventClass("resi_group");
+ msg.setEventTag("shift_topic_to_issue");
+ }
+
+
+ Result stringResult = SendMqMsgUtils.sendMsg(msg);
+ System.out.println("=========="+JSON.toJSONString(stringResult));
+ return stringResult;
+ }
+
+
+}