Commit aaf91644 by shenjunjie

新增情报方案和关键词配置

parent 9c1d0d4b
...@@ -40,6 +40,12 @@ ...@@ -40,6 +40,12 @@
</properties> </properties>
<dependencies> <dependencies>
<!-- 自动化中间件客户端 -->
<dependency>
<groupId>com.zhiwei.middleware</groupId>
<artifactId>automaticmark-client</artifactId>
<version>2.3.1.1-SNAPSHOT</version>
</dependency>
<!-- 去重 --> <!-- 去重 -->
<dependency> <dependency>
<groupId>com.zhiwei.middleware</groupId> <groupId>com.zhiwei.middleware</groupId>
......
...@@ -16,7 +16,7 @@ public class ChannelType { ...@@ -16,7 +16,7 @@ public class ChannelType {
private static final List<String> MAIN_BODY_TYPES = Arrays.asList("媒体", "团体", "普通用户", "企业", "名人", "政务机构"); private static final List<String> MAIN_BODY_TYPES = Arrays.asList("媒体", "团体", "普通用户", "企业", "名人", "政务机构");
public static final List<String> POLITICS_LEVELS = Arrays.asList("央级", "省级", "地级"); public static final List<String> POLITICS_LEVELS = Arrays.asList("央级", "省级", "地级");
private static final List<String> FIELDS = Arrays.asList("情感", "综合", "财经", "家居", "社会", "时尚", "文化", "历史", "母婴育儿", "体育", "娱乐", "动漫", "汽车", "美食", "健康养生", "国际", "音乐", "游戏", "科技", "旅游", "军事", "时事", "教育"); private static final List<String> FIELDS = Arrays.asList("时政", "财经", "科技", "社会民生", "交通", "综合", "娱乐", "生活", "体育", "教育", "文化", "母婴育儿", "健康");
private static final JSONArray REGION = GlobalPojo.CHINA_AREA_TAGS; private static final JSONArray REGION = GlobalPojo.CHINA_AREA_TAGS;
public static JSONObject channelOption = new JSONObject(); public static JSONObject channelOption = new JSONObject();
public static final List<String> COMMON_FIELDS = Arrays.asList("财经", "科技", "时政", "社会民生", "交通"); public static final List<String> COMMON_FIELDS = Arrays.asList("财经", "科技", "时政", "社会民生", "交通");
......
...@@ -3,14 +3,19 @@ package com.zhiwei.brandkbs2.common; ...@@ -3,14 +3,19 @@ package com.zhiwei.brandkbs2.common;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.zhiwei.brandkbs2.pojo.ChannelTag; import com.zhiwei.brandkbs2.pojo.ChannelTag;
import com.zhiwei.brandkbs2.pojo.HighlightWord;
import com.zhiwei.brandkbs2.pojo.Project; import com.zhiwei.brandkbs2.pojo.Project;
import com.zhiwei.brandkbs2.service.SystemInfoService; import com.zhiwei.brandkbs2.service.SystemInfoService;
import com.zhiwei.brandkbs2.util.Tools; import com.zhiwei.brandkbs2.util.Tools;
import com.zhiwei.middleware.automaticmark.graphs.Graphs;
import com.zhiwei.qbjc.bean.pojo.common.MessagePlatform; import com.zhiwei.qbjc.bean.pojo.common.MessagePlatform;
import com.zhiwei.qbjc.bean.pojo.common.Tag; import com.zhiwei.qbjc.bean.pojo.common.Tag;
import com.zhiwei.brandkbs2.dao.HighlightWordDao;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -18,9 +23,7 @@ import org.springframework.stereotype.Component; ...@@ -18,9 +23,7 @@ import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -40,6 +43,9 @@ public class GlobalPojo { ...@@ -40,6 +43,9 @@ public class GlobalPojo {
@Resource(name = "systemInfoServiceImpl") @Resource(name = "systemInfoServiceImpl")
private SystemInfoService systemInfoService; private SystemInfoService systemInfoService;
@Resource(name = "highlightWordDao")
private HighlightWordDao highlightWordDao;
/** /**
* 监测系统平台 * 监测系统平台
**/ **/
...@@ -72,6 +78,10 @@ public class GlobalPojo { ...@@ -72,6 +78,10 @@ public class GlobalPojo {
public static JSONArray CHINA_AREA_TAGS; public static JSONArray CHINA_AREA_TAGS;
public static Map<String, List<String>> HIGHLIGHT_MAP = new HashMap<>();
public static Map<String, Graphs> PROJECT_GRAPHS = new HashMap<>();
public static final List<String> PERMANENT_PLATFORM_NAMES = Arrays.asList("网媒", "微博", "微信", "今日头条"); public static final List<String> PERMANENT_PLATFORM_NAMES = Arrays.asList("网媒", "微博", "微信", "今日头条");
public static final String ELSE_PLATFORM_NAME = "其他自媒体"; public static final String ELSE_PLATFORM_NAME = "其他自媒体";
...@@ -109,6 +119,7 @@ public class GlobalPojo { ...@@ -109,6 +119,7 @@ public class GlobalPojo {
MEDIA_TYPE = systemInfoService.getMediaTypes(); MEDIA_TYPE = systemInfoService.getMediaTypes();
PROJECT_MAP = systemInfoService.getProjects(); PROJECT_MAP = systemInfoService.getProjects();
YU_QING_PROJECTS = systemInfoService.getYuQingProjects(); YU_QING_PROJECTS = systemInfoService.getYuQingProjects();
updateHighlightGraphs();
log.info("{}-获取PLATFORMS-size:{},TAGS-size:{},LINKED_GROUP_ID_TAGS:{},CHANNEL_TAGS:{},MEDIA_TYPE:{},PROJECT_MAP:{},YUQING-PROJECTS-size:{}", logMsg, PLATFORMS.size(), TAGS.size(), log.info("{}-获取PLATFORMS-size:{},TAGS-size:{},LINKED_GROUP_ID_TAGS:{},CHANNEL_TAGS:{},MEDIA_TYPE:{},PROJECT_MAP:{},YUQING-PROJECTS-size:{}", logMsg, PLATFORMS.size(), TAGS.size(),
LINKED_GROUP_ID_TAGS.size(), CHANNEL_TAGS.size(), MEDIA_TYPE.size(), PROJECT_MAP.size(), YU_QING_PROJECTS.size()); LINKED_GROUP_ID_TAGS.size(), CHANNEL_TAGS.size(), MEDIA_TYPE.size(), PROJECT_MAP.size(), YU_QING_PROJECTS.size());
} catch (Exception e) { } catch (Exception e) {
...@@ -116,6 +127,20 @@ public class GlobalPojo { ...@@ -116,6 +127,20 @@ public class GlobalPojo {
} }
} }
private void updateHighlightGraphs() {
PROJECT_MAP.forEach((key, project) -> {
String id = project.getId();
List<String> list = highlightWordDao.findList(Query.query(Criteria.where("projectId").is(id))).stream().map(HighlightWord::getKeyword).collect(Collectors.toList());
List<String> keywords = new ArrayList<>();
// 拆分关键词中的且逻辑
list.forEach(word -> keywords.addAll(Arrays.asList(word.trim().split(" +"))));
Graphs graphs = new Graphs();
graphs.addGraph(keywords);
HIGHLIGHT_MAP.put(id, list);
PROJECT_GRAPHS.put(id, graphs);
});
}
public static String getPlatformIdByName(String platformName) { public static String getPlatformIdByName(String platformName) {
for (MessagePlatform platform : PLATFORMS) { for (MessagePlatform platform : PLATFORMS) {
if (platform.getName().equals(platformName)) { if (platform.getName().equals(platformName)) {
......
...@@ -5,12 +5,13 @@ import com.zhiwei.brandkbs2.auth.Auth; ...@@ -5,12 +5,13 @@ import com.zhiwei.brandkbs2.auth.Auth;
import com.zhiwei.brandkbs2.auth.UserThreadLocal; import com.zhiwei.brandkbs2.auth.UserThreadLocal;
import com.zhiwei.brandkbs2.controller.BaseController; import com.zhiwei.brandkbs2.controller.BaseController;
import com.zhiwei.brandkbs2.easyexcel.EasyExcelUtil; import com.zhiwei.brandkbs2.easyexcel.EasyExcelUtil;
import com.zhiwei.brandkbs2.easyexcel.dto.ExportHighWordDTO; import com.zhiwei.brandkbs2.easyexcel.dto.ExportWordDTO;
import com.zhiwei.brandkbs2.enmus.RoleEnum; import com.zhiwei.brandkbs2.enmus.RoleEnum;
import com.zhiwei.brandkbs2.model.ResponseResult; import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.pojo.dto.TagFilterDTO; import com.zhiwei.brandkbs2.pojo.dto.TagFilterDTO;
import com.zhiwei.brandkbs2.pojo.vo.ProjectVO; import com.zhiwei.brandkbs2.pojo.vo.ProjectVO;
import com.zhiwei.brandkbs2.service.HighWordService; import com.zhiwei.brandkbs2.service.HighWordService;
import com.zhiwei.brandkbs2.service.HighlightWordService;
import com.zhiwei.brandkbs2.service.ProjectService; import com.zhiwei.brandkbs2.service.ProjectService;
import com.zhiwei.brandkbs2.service.TagFilterService; import com.zhiwei.brandkbs2.service.TagFilterService;
import com.zhiwei.brandkbs2.util.Tools; import com.zhiwei.brandkbs2.util.Tools;
...@@ -42,6 +43,9 @@ public class BaseModuleController extends BaseController { ...@@ -42,6 +43,9 @@ public class BaseModuleController extends BaseController {
@Resource(name = "highWordServiceImpl") @Resource(name = "highWordServiceImpl")
HighWordService highWordService; HighWordService highWordService;
@Resource(name = "highlightWordServiceImpl")
HighlightWordService highlightWordService;
@Resource(name = "projectServiceImpl") @Resource(name = "projectServiceImpl")
ProjectService projectService; ProjectService projectService;
...@@ -68,7 +72,7 @@ public class BaseModuleController extends BaseController { ...@@ -68,7 +72,7 @@ public class BaseModuleController extends BaseController {
@ApiImplicitParams({@ApiImplicitParam(name = "page", value = "页码", defaultValue = "1", paramType = "query", dataType = "int"), @ApiImplicitParam(name = "size", value = "每页记录数", defaultValue = "10", paramType = "query", dataType = "int"), @ApiImplicitParam(name = "keyword", value = "搜索关键字", paramType = "query", dataType = "string")}) @ApiImplicitParams({@ApiImplicitParam(name = "page", value = "页码", defaultValue = "1", paramType = "query", dataType = "int"), @ApiImplicitParam(name = "size", value = "每页记录数", defaultValue = "10", paramType = "query", dataType = "int"), @ApiImplicitParam(name = "keyword", value = "搜索关键字", paramType = "query", dataType = "string")})
@GetMapping("/highWord/list") @GetMapping("/highWord/list")
public ResponseResult findHighWordList(@RequestParam(value = "page", defaultValue = "1") int page, @RequestParam(value = "size", defaultValue = "10") int size, @RequestParam(value = "keyword", defaultValue = "") String keyword) { public ResponseResult findHighWordList(@RequestParam(value = "page", defaultValue = "1") int page, @RequestParam(value = "size", defaultValue = "10") int size, @RequestParam(value = "keyword", defaultValue = "") String keyword) {
return ResponseResult.success(highWordService.findHighWord(page, size, keyword)); return ResponseResult.success(highWordService.findWord(page, size, keyword));
} }
@ApiOperation("添加高频关键词列表") @ApiOperation("添加高频关键词列表")
...@@ -76,14 +80,13 @@ public class BaseModuleController extends BaseController { ...@@ -76,14 +80,13 @@ public class BaseModuleController extends BaseController {
@PostMapping("/highWord/add") @PostMapping("/highWord/add")
public ResponseResult addHighWordList(@RequestBody JSONObject info) { public ResponseResult addHighWordList(@RequestBody JSONObject info) {
List<String> highWords = info.getJSONArray("list").toJavaList(String.class); List<String> highWords = info.getJSONArray("list").toJavaList(String.class);
highWordService.addHighWordList(highWords); return highWordService.addWordList(highWords, UserThreadLocal.getProjectId(), UserThreadLocal.getNickname());
return ResponseResult.success();
} }
@ApiOperation("高频关键词删除") @ApiOperation("高频关键词删除")
@DeleteMapping(value = "/highWord/delete/{id}") @DeleteMapping(value = "/highWord/delete/{id}")
public ResponseResult deleteHighWord(@PathVariable String id) { public ResponseResult deleteHighWord(@PathVariable String id) {
highWordService.deleteHighWord(id); highWordService.deleteWord(id);
return ResponseResult.success(); return ResponseResult.success();
} }
...@@ -96,9 +99,50 @@ public class BaseModuleController extends BaseController { ...@@ -96,9 +99,50 @@ public class BaseModuleController extends BaseController {
@ApiOperation("高频关键词下载") @ApiOperation("高频关键词下载")
@GetMapping(value = "/highWord/download") @GetMapping(value = "/highWord/download")
public ResponseResult downloadHighWord() { public ResponseResult downloadHighWord() {
List<ExportHighWordDTO> list = highWordService.downloadHighWord(); String projectId = UserThreadLocal.getProjectId();
ProjectVO projectVO = projectService.getProjectVOById(UserThreadLocal.getProjectId()); List<ExportWordDTO> list = highWordService.downloadWord(projectId);
EasyExcelUtil.download(projectVO.getBrandName() + "_高频关键词", "sheet1", ExportHighWordDTO.class, list, response); ProjectVO projectVO = projectService.getProjectVOById(projectId);
EasyExcelUtil.download(projectVO.getBrandName() + "_高频关键词", "sheet1", ExportWordDTO.class, list, response);
return ResponseResult.success();
}
@ApiOperation("获取舆情列表高亮关键词")
@ApiImplicitParams({@ApiImplicitParam(name = "page", value = "页码", defaultValue = "1", paramType = "query", dataType = "int"), @ApiImplicitParam(name = "size", value = "每页记录数", defaultValue = "10", paramType = "query", dataType = "int"), @ApiImplicitParam(name = "keyword", value = "搜索关键字", paramType = "query", dataType = "string")})
@GetMapping("/highlightWord/list")
public ResponseResult findHighlightKeywordList(@RequestParam(value = "page", defaultValue = "1") int page,
@RequestParam(value = "pageSize", defaultValue = "10") int pageSize,
@RequestParam(value = "keyword", defaultValue = "") String keyword) {
return ResponseResult.success(highlightWordService.findWord(page, pageSize, keyword));
}
@ApiOperation("添加舆情列表高亮关键词列表")
@ApiImplicitParams(@ApiImplicitParam(name = "list", value = "高亮关键词列表", paramType = "body", dataType = "list"))
@PostMapping("/highlightWord/add")
public ResponseResult addHighlightWordList(@RequestBody JSONObject info) {
List<String> highWords = info.getJSONArray("list").toJavaList(String.class);
return highlightWordService.addWordList(highWords, UserThreadLocal.getProjectId(), UserThreadLocal.getNickname());
}
@ApiOperation("舆情列表高亮关键词删除")
@DeleteMapping(value = "/highlightWord/delete/{id}")
public ResponseResult deleteHighlightWord(@PathVariable String id) {
highlightWordService.deleteWord(id);
return ResponseResult.success();
}
@ApiOperation("舆情列表高亮关键词excel解析")
@PostMapping(value = "/highlightWord/excel/parse", headers = "content-type=multipart/form-data")
public ResponseResult parseExcelHighlightWord(@RequestParam("file") MultipartFile file) {
return Tools.parseExcelInfo(file);
}
@ApiOperation("舆情列表高亮关键词下载")
@GetMapping(value = "/highlightWord/download")
public ResponseResult downloadHighlightWord() {
String projectId = UserThreadLocal.getProjectId();
List<ExportWordDTO> list = highlightWordService.downloadWord(projectId);
ProjectVO projectVO = projectService.getProjectVOById(projectId);
EasyExcelUtil.download(projectVO.getBrandName() + "_舆情列表高亮关键词", "sheet1", ExportWordDTO.class, list, response);
return ResponseResult.success(); return ResponseResult.success();
} }
......
...@@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.Map; import java.util.Map;
...@@ -92,33 +93,42 @@ public class AppWarnController extends BaseController { ...@@ -92,33 +93,42 @@ public class AppWarnController extends BaseController {
@Value("${warn.taskSwitch.url}") @Value("${warn.taskSwitch.url}")
private String warnTaskSwitchUrl; private String warnTaskSwitchUrl;
@ApiOperation("情报预警-推送任务获取/新增") @ApiOperation("情报预警-推送任务获取")
@GetMapping("/project") @GetMapping("/project")
public ResponseResult getPushTaskId() { public ResponseResult getPushTaskId() {
try { try {
String projectId = UserThreadLocal.getProjectId(); return pushTaskId(null, null, HttpMethod.GET);
String projectName = projectService.getProjectById(projectId).getProjectName(); } catch (Exception e) {
String userId = JwtUtil.unsign(request.getHeader(jwtKey), Map.class).get(GenericAttribute.USER_ID).toString(); log.error("情报预警-推送任务获取失败", e);
// header不支持中文 故对userName进行encode操作 return ResponseResult.failure("情报预警-推送任务获取失败");
String userName = URLEncoder.encode(userService.queryUserInfo(userId, projectId).getNickname(), "UTF-8"); }
// 请求头参数设置 }
HttpHeaders headers = new HttpHeaders();
headers.add("token", token);
headers.add("userId", userId);
headers.add("userName", userName);
HttpEntity<Object> request = new HttpEntity<>(headers);
JSONObject data = restTemplate.exchange(warnProjectUrl, HttpMethod.GET, request, JSONObject.class, projectId, projectName).getBody().getJSONObject("data"); @ApiOperation("情报预警-推送任务新增")
return ResponseResult.success(data); @PostMapping("/project")
}catch (Exception e){ public ResponseResult postPushTaskId(@RequestBody JSONObject json) {
log.error("情报预警-推送任务获取/新增失败", e); try {
return ResponseResult.failure("情报预警-推送任务获取/新增失败"); return pushTaskId(null, json.getString("planName"), HttpMethod.POST);
} catch (Exception e) {
log.error("情报预警-推送任务新增失败", e);
return ResponseResult.failure("情报预警-推送任务新增失败");
}
}
@ApiOperation("情报预警-推送任务修改")
@PutMapping("/project")
public ResponseResult putPushTaskId(@RequestBody JSONObject json) {
try {
return pushTaskId(json.getString("taskId"), json.getString("planName"), HttpMethod.PUT);
} catch (Exception e) {
log.error("情报预警-推送任务修改失败", e);
return ResponseResult.failure("情报预警-推送任务修改失败");
} }
} }
@ApiOperation("情报预警-获取项目预警更新条件") @ApiOperation("情报预警-获取项目预警更新条件")
@GetMapping("/warnCriteria") @GetMapping("/warnCriteria")
public ResponseResult getProjectWarnCriteria(@RequestParam(value = "type") String type){ public ResponseResult getProjectWarnCriteria(@RequestParam(value = "type") String type) {
return ResponseResult.success(projectWarnService.getProjectWarnCriteria(UserThreadLocal.getProjectId(), type)); return ResponseResult.success(projectWarnService.getProjectWarnCriteria(UserThreadLocal.getProjectId(), type));
} }
...@@ -136,7 +146,7 @@ public class AppWarnController extends BaseController { ...@@ -136,7 +146,7 @@ public class AppWarnController extends BaseController {
@ApiOperation("情报预警-已扫码推送名单获取") @ApiOperation("情报预警-已扫码推送名单获取")
@GetMapping("/pushRecipientsList") @GetMapping("/pushRecipientsList")
public ResponseResult pushRecipientList(@RequestParam(value = "pushTaskId") String pushTaskId){ public ResponseResult pushRecipientList(@RequestParam(value = "pushTaskId") String pushTaskId) {
// 请求头 // 请求头
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.add("token", token); headers.add("token", token);
...@@ -149,7 +159,7 @@ public class AppWarnController extends BaseController { ...@@ -149,7 +159,7 @@ public class AppWarnController extends BaseController {
@ApiOperation("情报预警-删除推送人") @ApiOperation("情报预警-删除推送人")
@GetMapping("/deletePushRecipients") @GetMapping("/deletePushRecipients")
public ResponseResult deletePushRecipients(@RequestParam(value = "recipientsId") String recipientsId, public ResponseResult deletePushRecipients(@RequestParam(value = "recipientsId") String recipientsId,
@RequestParam(value = "pushTaskId") String pushTaskId){ @RequestParam(value = "pushTaskId") String pushTaskId) {
// 请求头 // 请求头
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.add("token", token); headers.add("token", token);
...@@ -163,7 +173,7 @@ public class AppWarnController extends BaseController { ...@@ -163,7 +173,7 @@ public class AppWarnController extends BaseController {
@PutMapping("/channel/{pushTaskId}") @PutMapping("/channel/{pushTaskId}")
public ResponseResult channel(@ApiParam(name = "channelConfig", value = "情报预警-渠道参与配置-json:{\"channel\": \"string\", \"configName\": \"string\", \"duplicate\": true, \"friendlyChannel\": true, \"markerTags\": [\"string\"], \"primary\": [true], \"pushInterval\": 0, \"threshold\": 0, \"used\": true}", required = true) public ResponseResult channel(@ApiParam(name = "channelConfig", value = "情报预警-渠道参与配置-json:{\"channel\": \"string\", \"configName\": \"string\", \"duplicate\": true, \"friendlyChannel\": true, \"markerTags\": [\"string\"], \"primary\": [true], \"pushInterval\": 0, \"threshold\": 0, \"used\": true}", required = true)
@RequestBody JSONObject channelConfig, @RequestBody JSONObject channelConfig,
@PathVariable(value = "pushTaskId") String pushTaskId){ @PathVariable(value = "pushTaskId") String pushTaskId) {
try { try {
String userId = JwtUtil.unsign(request.getHeader(jwtKey), Map.class).get(GenericAttribute.USER_ID).toString(); String userId = JwtUtil.unsign(request.getHeader(jwtKey), Map.class).get(GenericAttribute.USER_ID).toString();
String userName = URLEncoder.encode(userService.queryUserInfo(userId, UserThreadLocal.getProjectId()).getNickname(), "UTF-8"); String userName = URLEncoder.encode(userService.queryUserInfo(userId, UserThreadLocal.getProjectId()).getNickname(), "UTF-8");
...@@ -178,7 +188,7 @@ public class AppWarnController extends BaseController { ...@@ -178,7 +188,7 @@ public class AppWarnController extends BaseController {
JSONObject data = restTemplate.exchange(warnChannelUrl, HttpMethod.PUT, request, JSONObject.class, pushTaskId).getBody().getJSONObject("data"); JSONObject data = restTemplate.exchange(warnChannelUrl, HttpMethod.PUT, request, JSONObject.class, pushTaskId).getBody().getJSONObject("data");
return ResponseResult.success(data); return ResponseResult.success(data);
}catch (Exception e){ } catch (Exception e) {
log.error("情报预警-渠道参与配置失败", e); log.error("情报预警-渠道参与配置失败", e);
return ResponseResult.failure("情报预警-渠道参与配置失败"); return ResponseResult.failure("情报预警-渠道参与配置失败");
} }
...@@ -188,7 +198,7 @@ public class AppWarnController extends BaseController { ...@@ -188,7 +198,7 @@ public class AppWarnController extends BaseController {
@PutMapping("/hotTop/{pushTaskId}") @PutMapping("/hotTop/{pushTaskId}")
public ResponseResult hotTop(@ApiParam(name = "hotTopConfig", value = "情报预警-热点榜单配置-json:{\"configName\": \"string\", \"filterKeyword\": \"string\", \"firstTop\": true, \"introduction\": true,\"listType\": [\"string\"], \"newHeight\": true, \"pushInterval\": 0, \"topNewHeight\": 0, \"topOnceAgain\": true, \"used\": true, \"warnKeyword\": \"string\"}", required = true) public ResponseResult hotTop(@ApiParam(name = "hotTopConfig", value = "情报预警-热点榜单配置-json:{\"configName\": \"string\", \"filterKeyword\": \"string\", \"firstTop\": true, \"introduction\": true,\"listType\": [\"string\"], \"newHeight\": true, \"pushInterval\": 0, \"topNewHeight\": 0, \"topOnceAgain\": true, \"used\": true, \"warnKeyword\": \"string\"}", required = true)
@RequestBody JSONObject hotTopConfig, @RequestBody JSONObject hotTopConfig,
@PathVariable(value = "pushTaskId") String pushTaskId){ @PathVariable(value = "pushTaskId") String pushTaskId) {
try { try {
String userId = JwtUtil.unsign(request.getHeader(jwtKey), Map.class).get(GenericAttribute.USER_ID).toString(); String userId = JwtUtil.unsign(request.getHeader(jwtKey), Map.class).get(GenericAttribute.USER_ID).toString();
String userName = URLEncoder.encode(userService.queryUserInfo(userId, UserThreadLocal.getProjectId()).getNickname(), "UTF-8"); String userName = URLEncoder.encode(userService.queryUserInfo(userId, UserThreadLocal.getProjectId()).getNickname(), "UTF-8");
...@@ -203,7 +213,7 @@ public class AppWarnController extends BaseController { ...@@ -203,7 +213,7 @@ public class AppWarnController extends BaseController {
JSONObject data = restTemplate.exchange(warnHotTopUrl, HttpMethod.PUT, request, JSONObject.class, pushTaskId).getBody().getJSONObject("data"); JSONObject data = restTemplate.exchange(warnHotTopUrl, HttpMethod.PUT, request, JSONObject.class, pushTaskId).getBody().getJSONObject("data");
return ResponseResult.success(data); return ResponseResult.success(data);
}catch (Exception e){ } catch (Exception e) {
log.error("情报预警-热点榜单配置失败", e); log.error("情报预警-热点榜单配置失败", e);
return ResponseResult.failure("情报预警-热点榜单配置失败"); return ResponseResult.failure("情报预警-热点榜单配置失败");
} }
...@@ -213,7 +223,7 @@ public class AppWarnController extends BaseController { ...@@ -213,7 +223,7 @@ public class AppWarnController extends BaseController {
@PutMapping("/hotEvent/{pushTaskId}") @PutMapping("/hotEvent/{pushTaskId}")
public ResponseResult hotEvent(@ApiParam(name = "hotEventConfig", value = "情报预警-热点事件配置-json:{\"configName\": \"string\", \"contendsEvent\": [\"string\"], \"eventTop\": 0, \"ownEvent\": [\"string\"], \"timeCycles\": 0,\"used\": true, \"zhiWeiEvent\": [\"string\"]}", required = true) public ResponseResult hotEvent(@ApiParam(name = "hotEventConfig", value = "情报预警-热点事件配置-json:{\"configName\": \"string\", \"contendsEvent\": [\"string\"], \"eventTop\": 0, \"ownEvent\": [\"string\"], \"timeCycles\": 0,\"used\": true, \"zhiWeiEvent\": [\"string\"]}", required = true)
@RequestBody JSONObject hotEventConfig, @RequestBody JSONObject hotEventConfig,
@PathVariable(value = "pushTaskId") String pushTaskId){ @PathVariable(value = "pushTaskId") String pushTaskId) {
try { try {
String userId = JwtUtil.unsign(request.getHeader(jwtKey), Map.class).get(GenericAttribute.USER_ID).toString(); String userId = JwtUtil.unsign(request.getHeader(jwtKey), Map.class).get(GenericAttribute.USER_ID).toString();
String userName = URLEncoder.encode(userService.queryUserInfo(userId, UserThreadLocal.getProjectId()).getNickname(), "UTF-8"); String userName = URLEncoder.encode(userService.queryUserInfo(userId, UserThreadLocal.getProjectId()).getNickname(), "UTF-8");
...@@ -228,7 +238,7 @@ public class AppWarnController extends BaseController { ...@@ -228,7 +238,7 @@ public class AppWarnController extends BaseController {
JSONObject data = restTemplate.exchange(warnHotEventUrl, HttpMethod.PUT, request, JSONObject.class, pushTaskId).getBody().getJSONObject("data"); JSONObject data = restTemplate.exchange(warnHotEventUrl, HttpMethod.PUT, request, JSONObject.class, pushTaskId).getBody().getJSONObject("data");
return ResponseResult.success(data); return ResponseResult.success(data);
}catch (Exception e){ } catch (Exception e) {
log.error("情报预警-热点事件配置失败- ", e); log.error("情报预警-热点事件配置失败- ", e);
return ResponseResult.failure("情报预警-热点事件配置失败"); return ResponseResult.failure("情报预警-热点事件配置失败");
} }
...@@ -238,7 +248,7 @@ public class AppWarnController extends BaseController { ...@@ -238,7 +248,7 @@ public class AppWarnController extends BaseController {
@PutMapping("/yuQing/{pushTaskId}") @PutMapping("/yuQing/{pushTaskId}")
public ResponseResult yuQing(@ApiParam(name = "yuQingConfig", value = "情报预警-舆情动态配置-json:{\"channelTypes\": [\"string\"], \"configName\": \"string\", \"contends\": [\"string\"], \"duplicate\": true, \"keyword\": \"string\", \"markerTags\": [\"string\"], \"primary\": [true], \"pushInterval\": 0, \"used\": true}", required = true) public ResponseResult yuQing(@ApiParam(name = "yuQingConfig", value = "情报预警-舆情动态配置-json:{\"channelTypes\": [\"string\"], \"configName\": \"string\", \"contends\": [\"string\"], \"duplicate\": true, \"keyword\": \"string\", \"markerTags\": [\"string\"], \"primary\": [true], \"pushInterval\": 0, \"used\": true}", required = true)
@RequestBody JSONObject yuQingConfig, @RequestBody JSONObject yuQingConfig,
@PathVariable(value = "pushTaskId") String pushTaskId){ @PathVariable(value = "pushTaskId") String pushTaskId) {
try { try {
String userId = JwtUtil.unsign(request.getHeader(jwtKey), Map.class).get(GenericAttribute.USER_ID).toString(); String userId = JwtUtil.unsign(request.getHeader(jwtKey), Map.class).get(GenericAttribute.USER_ID).toString();
String userName = URLEncoder.encode(userService.queryUserInfo(userId, UserThreadLocal.getProjectId()).getNickname(), "UTF-8"); String userName = URLEncoder.encode(userService.queryUserInfo(userId, UserThreadLocal.getProjectId()).getNickname(), "UTF-8");
...@@ -253,7 +263,7 @@ public class AppWarnController extends BaseController { ...@@ -253,7 +263,7 @@ public class AppWarnController extends BaseController {
JSONObject data = restTemplate.exchange(warnYuQingUrl, HttpMethod.PUT, request, JSONObject.class, pushTaskId).getBody().getJSONObject("data"); JSONObject data = restTemplate.exchange(warnYuQingUrl, HttpMethod.PUT, request, JSONObject.class, pushTaskId).getBody().getJSONObject("data");
return ResponseResult.success(data); return ResponseResult.success(data);
}catch (Exception e){ } catch (Exception e) {
log.error("情报预警-舆情动态配置失败", e); log.error("情报预警-舆情动态配置失败", e);
return ResponseResult.failure("情报预警-舆情动态配置失败"); return ResponseResult.failure("情报预警-舆情动态配置失败");
} }
...@@ -262,7 +272,7 @@ public class AppWarnController extends BaseController { ...@@ -262,7 +272,7 @@ public class AppWarnController extends BaseController {
@ApiOperation("情报预警-任务开关") @ApiOperation("情报预警-任务开关")
@PutMapping("/taskSwitch") @PutMapping("/taskSwitch")
public ResponseResult taskSwitch(@ApiParam(name = "info", value = "推送任务-开关-json:{id:, used:true|false, configType:HOT_EVENT}", required = true) public ResponseResult taskSwitch(@ApiParam(name = "info", value = "推送任务-开关-json:{id:, used:true|false, configType:HOT_EVENT}", required = true)
@RequestBody JSONObject info){ @RequestBody JSONObject info) {
try { try {
String userId = JwtUtil.unsign(request.getHeader(jwtKey), Map.class).get(GenericAttribute.USER_ID).toString(); String userId = JwtUtil.unsign(request.getHeader(jwtKey), Map.class).get(GenericAttribute.USER_ID).toString();
String userName = URLEncoder.encode(userService.queryUserInfo(userId, UserThreadLocal.getProjectId()).getNickname(), "UTF-8"); String userName = URLEncoder.encode(userService.queryUserInfo(userId, UserThreadLocal.getProjectId()).getNickname(), "UTF-8");
...@@ -277,9 +287,38 @@ public class AppWarnController extends BaseController { ...@@ -277,9 +287,38 @@ public class AppWarnController extends BaseController {
JSONObject data = restTemplate.exchange(warnTaskSwitchUrl, HttpMethod.PUT, request, JSONObject.class).getBody().getJSONObject("data"); JSONObject data = restTemplate.exchange(warnTaskSwitchUrl, HttpMethod.PUT, request, JSONObject.class).getBody().getJSONObject("data");
return ResponseResult.success(data); return ResponseResult.success(data);
}catch (Exception e){ } catch (Exception e) {
log.error("情报预警-任务开关失败", e); log.error("情报预警-任务开关失败", e);
return ResponseResult.failure("情报预警-任务开关失败"); return ResponseResult.failure("情报预警-任务开关失败");
} }
} }
private ResponseResult pushTaskId(String taskId, String planName, HttpMethod httpMethod) throws UnsupportedEncodingException {
String projectId = UserThreadLocal.getProjectId();
String projectName = projectService.getProjectById(projectId).getProjectName();
String userId = JwtUtil.unsign(request.getHeader(jwtKey), Map.class).get(GenericAttribute.USER_ID).toString();
// header不支持中文 故对userName进行encode操作
String userName = URLEncoder.encode(userService.queryUserInfo(userId, projectId).getNickname(), "UTF-8");
// 请求头参数设置
HttpHeaders headers = new HttpHeaders();
headers.add("token", token);
headers.add("userId", userId);
headers.add("userName", userName);
HttpEntity<Object> request;
if (HttpMethod.GET == httpMethod) {
request = new HttpEntity<>(headers);
return ResponseResult.success(restTemplate.exchange(warnProjectUrl + "?projectId={1}&projectName={2}", httpMethod, request, JSONObject.class, projectId, projectName).getBody().getJSONArray("data"));
}
JSONObject paramMap = new JSONObject();
paramMap.put("planName", planName);
if (HttpMethod.PUT == httpMethod) {
paramMap.put("taskId", taskId);
} else {
paramMap.put("projectId", projectId);
paramMap.put("projectName", projectName);
}
request = new HttpEntity<>(paramMap, headers);
return ResponseResult.success(restTemplate.exchange(warnProjectUrl, httpMethod, request, JSONObject.class).getBody().getJSONArray("data"));
}
} }
package com.zhiwei.brandkbs2.dao;
import com.zhiwei.brandkbs2.pojo.HighlightWord;
/**
* @ClassName: HighlightWordDao
* @Description HighlightWordDao
* @author: sjj
* @date: 2022-06-06 09:47
*/
public interface HighlightWordDao extends BaseMongoDao<HighlightWord>{
}
package com.zhiwei.brandkbs2.dao.impl;
import com.zhiwei.brandkbs2.dao.HighlightWordDao;
import com.zhiwei.brandkbs2.pojo.HighlightWord;
import org.springframework.stereotype.Component;
/**
* @ClassName: HighlightWordDaoImpl
* @Description HighlightWordDaoImpl
* @author: sjj
* @date: 2022-06-06 09:48
*/
@Component("highlightWordDao")
public class HighlightWordDaoImpl extends BaseMongoDaoImpl<HighlightWord> implements HighlightWordDao {
private static final String COLLECTION_NAME = "brandkbs_highlight_word";
public HighlightWordDaoImpl() {
super(COLLECTION_NAME);
}
}
package com.zhiwei.brandkbs2.easyexcel.dto; package com.zhiwei.brandkbs2.easyexcel.dto;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.zhiwei.brandkbs2.pojo.HighWord; import com.zhiwei.brandkbs2.pojo.AbstractBaseWord;
import com.zhiwei.brandkbs2.util.Tools; import com.zhiwei.brandkbs2.util.Tools;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
...@@ -16,7 +16,7 @@ import java.util.Date; ...@@ -16,7 +16,7 @@ import java.util.Date;
*/ */
@Data @Data
@ToString @ToString
public class ExportHighWordDTO { public class ExportWordDTO {
/** /**
* 名称 * 名称
...@@ -36,8 +36,8 @@ public class ExportHighWordDTO { ...@@ -36,8 +36,8 @@ public class ExportHighWordDTO {
@ExcelProperty("上传人") @ExcelProperty("上传人")
private String submitter; private String submitter;
public static ExportHighWordDTO createFromHighWord(HighWord highWord){ public static ExportWordDTO createFromWord(AbstractBaseWord word) {
return Tools.convertMap(highWord,ExportHighWordDTO.class); return Tools.convertMap(word, ExportWordDTO.class);
} }
} }
package com.zhiwei.brandkbs2.pojo;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
import java.util.List;
/**
* @ClassName: AbstractBaseWord
* @Description AbstractBaseWord
* @author: sjj
* @date: 2023-05-25 14:41
*/
@Setter
@Getter
public abstract class AbstractBaseWord extends AbstractBaseMongo {
/**
* 名称
*/
private String keyword;
/**
* 创建时间
*/
private Long cTime;
/**
* 上传人
*/
private String submitter;
/**
* 项目ID
*/
private String projectId;
public static <T> List<T> createFromList(List<String> keywords, String projectId, String submitter) {
List<T> res = new ArrayList<>();
Long now = System.currentTimeMillis();
for (String keyword : keywords) {
AbstractBaseWord word = new HighWord();
word.setKeyword(keyword);
word.setCTime(now);
word.setProjectId(projectId);
word.setSubmitter(submitter);
res.add((T) word);
}
return res;
}
}
...@@ -4,10 +4,6 @@ import lombok.Getter; ...@@ -4,10 +4,6 @@ import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.data.mongodb.core.mapping.Document;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/** /**
* @ClassName: HighWord * @ClassName: HighWord
* @Description 高频词实体 * @Description 高频词实体
...@@ -17,40 +13,5 @@ import java.util.List; ...@@ -17,40 +13,5 @@ import java.util.List;
@Getter @Getter
@Setter @Setter
@Document(collection = "brandkbs_high_word") @Document(collection = "brandkbs_high_word")
public class HighWord extends AbstractBaseMongo { public class HighWord extends AbstractBaseWord {
/**
* 名称
*/
private String keyword;
/**
* 创建时间
*/
private Long cTime;
/**
* 上传人
*/
private String submitter;
/**
* 项目ID
*/
private String projectId;
public static List<HighWord> createFromList(List<String> keywords, String projectId, String submitter) {
List<HighWord> res = new ArrayList<>();
Long now = new Date().getTime();
for (String keyword : keywords) {
HighWord highWord = new HighWord();
highWord.setKeyword(keyword);
highWord.setCTime(now);
highWord.setProjectId(projectId);
highWord.setSubmitter(submitter);
res.add(highWord);
}
return res;
}
} }
package com.zhiwei.brandkbs2.pojo;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.mongodb.core.mapping.Document;
/**
* @ClassName: HighWord
* @Description 高频词实体
* @author: sjj
* @date: 2022-06-06 09:36
*/
@Getter
@Setter
@Document(collection = "brandkbs_highlight_word")
public class HighlightWord extends AbstractBaseWord {
}
...@@ -87,6 +87,11 @@ public class Project extends AbstractProject { ...@@ -87,6 +87,11 @@ public class Project extends AbstractProject {
private Long uTime; private Long uTime;
/** /**
* 高亮关键词
*/
private List<String> highlightKeyword;
/**
* 项目主品牌配置信息转换 * 项目主品牌配置信息转换
* *
* @return 项目对象 * @return 项目对象
......
package com.zhiwei.brandkbs2.service; package com.zhiwei.brandkbs2.service;
import com.alibaba.fastjson.JSONObject;
import com.zhiwei.brandkbs2.easyexcel.dto.ExportHighWordDTO;
import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import java.util.List;
/** /**
* @ClassName: HighWordService * @ClassName: HighWordService
* @Description 高频词服务接口 * @Description 高频词服务接口
* @author: sjj * @author: sjj
* @date: 2022-06-06 09:59 * @date: 2022-06-06 09:59
*/ */
public interface HighWordService { public interface HighWordService extends TableWordService{
/**
* 分页查询高频词列表
*
* @param page 页码
* @param size 页码大小
* @param keyword 关键词
* @return PageVO<JSONObject>
*/
PageVO<JSONObject> findHighWord(int page, int size, String keyword);
/**
* 添加高频关键词
*
* @param highWords 高频词
*/
void addHighWordList(List<String> highWords);
/**
* 删除高频关键词
*
* @param id 高频词id
*/
void deleteHighWord(String id);
/**
* 下载高频关键词
*
* @return List<ExportHighWordDTO>
*/
List<ExportHighWordDTO> downloadHighWord();
} }
\ No newline at end of file
package com.zhiwei.brandkbs2.service;
/**
* @ClassName: HighlightWordService
* @Description HighlightWordService
* @author: sjj
* @date: 2023-05-25 15:10
*/
public interface HighlightWordService extends TableWordService{
}
...@@ -133,4 +133,12 @@ public interface ProjectService { ...@@ -133,4 +133,12 @@ public interface ProjectService {
* @return * @return
*/ */
ResponseResult getHitTagsByLinkedGroupId(String linkedGroupId); ResponseResult getHitTagsByLinkedGroupId(String linkedGroupId);
/**
*
* @param projectId 项目id
* @return 高亮关键词
*/
List<String> getHighlightKeyword(String projectId);
} }
package com.zhiwei.brandkbs2.service;
import com.alibaba.fastjson.JSONObject;
import com.zhiwei.brandkbs2.easyexcel.dto.ExportWordDTO;
import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import java.util.List;
/**
* @ClassName: TableWordService
* @Description TableWordService
* @author: sjj
* @date: 2023-05-25 14:13
*/
public interface TableWordService{
/**
* 分页查询词组列表
*
* @param page 页码
* @param size 页码大小
* @param keyword 关键词
* @return PageVO<JSONObject>
*/
PageVO<JSONObject> findWord(int page, int size, String keyword);
/**
* 添加词组
*
* @param words 词组
*/
ResponseResult addWordList(List<String> words, String projectId, String submitter);
/**
* 删除词组
*
* @param id 词组id
*/
void deleteWord(String id);
/**
* 导出词组
*
* @return List<ExportWordDTO>
*/
List<ExportWordDTO> downloadWord(String projectId);
}
package com.zhiwei.brandkbs2.service.impl; package com.zhiwei.brandkbs2.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.zhiwei.brandkbs2.auth.UserThreadLocal;
import com.zhiwei.brandkbs2.dao.HighWordDao; import com.zhiwei.brandkbs2.dao.HighWordDao;
import com.zhiwei.brandkbs2.easyexcel.dto.ExportHighWordDTO;
import com.zhiwei.brandkbs2.pojo.HighWord;
import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import com.zhiwei.brandkbs2.service.HighWordService; import com.zhiwei.brandkbs2.service.HighWordService;
import com.zhiwei.brandkbs2.util.MongoUtil; import com.zhiwei.brandkbs2.util.MongoUtil;
import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* @ClassName: HighWordServiceImpl * @ClassName: HighWordServiceImpl
* @Description 高频词服务接口实现类 * @Description 高频词服务接口实现类
...@@ -23,49 +13,9 @@ import java.util.stream.Collectors; ...@@ -23,49 +13,9 @@ import java.util.stream.Collectors;
* @date: 2022-06-06 10:02 * @date: 2022-06-06 10:02
*/ */
@Service("highWordServiceImpl") @Service("highWordServiceImpl")
public class HighWordServiceImpl implements HighWordService { public class HighWordServiceImpl extends TableWordServiceImpl implements HighWordService {
@Resource(name = "highWordDao")
HighWordDao highWordDao;
@Resource(name = "mongoUtil")
private com.zhiwei.brandkbs2.util.MongoUtil mongoUtil;
@Override
public PageVO<JSONObject> findHighWord(int page, int size, String keyword) {
String projectId = UserThreadLocal.getProjectId();
Query query = Query.query(Criteria.where("projectId").is(projectId));
long count = highWordDao.count(query);
mongoUtil.start(page, size, query);
List<HighWord> highWordList = highWordDao.findListByKeywordFuzz(query, keyword, new String[]{"keyword"});
List<JSONObject> resList = highWordList.stream().map(highWord -> {
JSONObject result = new JSONObject();
result.put("id", highWord.getId());
result.put("keyword", highWord.getKeyword());
result.put("cTime", highWord.getCTime());
result.put("submitter", highWord.getSubmitter());
return result;
}).collect(Collectors.toList());
MongoUtil.PageHelper<JSONObject> pageHelper = mongoUtil.pageHelper(count, resList);
return PageVO.createPageVo(pageHelper, resList);
}
@Override public HighWordServiceImpl(@Qualifier("highWordDao") HighWordDao highWordDao, @Qualifier("mongoUtil") MongoUtil mongoUtil) {
public void addHighWordList(List<String> highWords) { super(highWordDao, mongoUtil);
List<String> existList = highWordDao.findList(null).stream().map(HighWord::getKeyword).collect(Collectors.toList());
// 去除重复数据
List<String> newList = highWords.stream().filter(word -> !existList.contains(word)).collect(Collectors.toList());
highWordDao.insertMany(HighWord.createFromList(newList, UserThreadLocal.getProjectId(), UserThreadLocal.getNickname()));
} }
@Override
public void deleteHighWord(String id) {
highWordDao.deleteOneById(id);
}
@Override
public List<ExportHighWordDTO> downloadHighWord() {
return highWordDao.findList(null).stream().map(ExportHighWordDTO::createFromHighWord).collect(Collectors.toList());
}
} }
package com.zhiwei.brandkbs2.service.impl;
import com.zhiwei.brandkbs2.dao.HighlightWordDao;
import com.zhiwei.brandkbs2.service.HighlightWordService;
import com.zhiwei.brandkbs2.util.MongoUtil;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
/**
* @ClassName: HighlightWordServiceImpl
* @Description HighlightWordServiceImpl
* @author: sjj
* @date: 2023-05-25 15:11
*/
@Service("highlightWordServiceImpl")
public class HighlightWordServiceImpl extends TableWordServiceImpl implements HighlightWordService {
public HighlightWordServiceImpl(@Qualifier("highlightWordDao") HighlightWordDao highlightWordDao, @Qualifier("mongoUtil") MongoUtil mongoUtil) {
super(highlightWordDao, mongoUtil);
}
}
...@@ -15,6 +15,7 @@ import com.zhiwei.brandkbs2.common.RedisKeyPrefix; ...@@ -15,6 +15,7 @@ import com.zhiwei.brandkbs2.common.RedisKeyPrefix;
import com.zhiwei.brandkbs2.config.Constant; import com.zhiwei.brandkbs2.config.Constant;
import com.zhiwei.brandkbs2.dao.AggreeResultDao; import com.zhiwei.brandkbs2.dao.AggreeResultDao;
import com.zhiwei.brandkbs2.dao.ChannelDao; import com.zhiwei.brandkbs2.dao.ChannelDao;
import com.zhiwei.brandkbs2.dao.HighlightWordDao;
import com.zhiwei.brandkbs2.enmus.ChannelEmotion; import com.zhiwei.brandkbs2.enmus.ChannelEmotion;
import com.zhiwei.brandkbs2.enmus.EmotionEnum; import com.zhiwei.brandkbs2.enmus.EmotionEnum;
import com.zhiwei.brandkbs2.enmus.ImportantChannelEnum; import com.zhiwei.brandkbs2.enmus.ImportantChannelEnum;
...@@ -149,6 +150,9 @@ public class MarkDataServiceImpl implements MarkDataService { ...@@ -149,6 +150,9 @@ public class MarkDataServiceImpl implements MarkDataService {
@Resource(name = "esSearchServiceImpl") @Resource(name = "esSearchServiceImpl")
EsSearchService esSearchService; EsSearchService esSearchService;
@Resource(name = "highlightWordDao")
HighlightWordDao highlightWordDao;
@Override @Override
public PageVO<MarkFlowEntity> getOriginList(MarkSearchDTO markSearchDTO) { public PageVO<MarkFlowEntity> getOriginList(MarkSearchDTO markSearchDTO) {
try { try {
...@@ -168,7 +172,7 @@ public class MarkDataServiceImpl implements MarkDataService { ...@@ -168,7 +172,7 @@ public class MarkDataServiceImpl implements MarkDataService {
// 返回分页结果并设置平台count // 返回分页结果并设置平台count
return PageVO.createPageVo(total, markSearchDTO.getPage(), markSearchDTO.getPageSize(), flowEntityList) return PageVO.createPageVo(total, markSearchDTO.getPage(), markSearchDTO.getPageSize(), flowEntityList)
// 各平台计量 // 各平台计量
.setInfo(new JSONObject(ImmutableMap.of("platformCount", hitsAndCounts.getRight()))); .setInfo(new JSONObject(ImmutableMap.of("highlightWord", highlightWordDao.findList(Query.query(Criteria.where("projectId").is(UserThreadLocal.getProjectId()))).stream().map(HighlightWord::getKeyword).collect(Collectors.toList()))));
} catch (IOException e) { } catch (IOException e) {
ExceptionCast.cast(CommonCodeEnum.FAIL, "es查询异常"); ExceptionCast.cast(CommonCodeEnum.FAIL, "es查询异常");
} }
...@@ -247,10 +251,10 @@ public class MarkDataServiceImpl implements MarkDataService { ...@@ -247,10 +251,10 @@ public class MarkDataServiceImpl implements MarkDataService {
long total = hitsAndCounts.getLeft()[0].getTotalHits().value; long total = hitsAndCounts.getLeft()[0].getTotalHits().value;
// 消息列表 // 消息列表
List<MarkFlowEntity> flowEntityList = getMarkFlowEntity(markSearchDTO, hitsAndCounts.getLeft()[0]); List<MarkFlowEntity> flowEntityList = getMarkFlowEntity(markSearchDTO, hitsAndCounts.getLeft()[0]);
// 返回分页结果并设置平台count // 返回分页结果并返回高亮关键词
return PageVO.createPageVo(total, markSearchDTO.getPage(), markSearchDTO.getPageSize(), flowEntityList) return PageVO.createPageVo(total, markSearchDTO.getPage(), markSearchDTO.getPageSize(), flowEntityList)
// 各平台计量 // 高亮关键词
.setInfo(new JSONObject(ImmutableMap.of("platformCount", hitsAndCounts.getRight()))); .setInfo(new JSONObject(ImmutableMap.of("highlightWord", GlobalPojo.HIGHLIGHT_MAP.get(UserThreadLocal.getProjectId()))));
} catch (IOException e) { } catch (IOException e) {
ExceptionCast.cast(CommonCodeEnum.FAIL, "es查询异常"); ExceptionCast.cast(CommonCodeEnum.FAIL, "es查询异常");
} }
......
...@@ -10,6 +10,7 @@ import com.zhiwei.brandkbs2.auth.UserThreadLocal; ...@@ -10,6 +10,7 @@ import com.zhiwei.brandkbs2.auth.UserThreadLocal;
import com.zhiwei.brandkbs2.common.GenericAttribute; import com.zhiwei.brandkbs2.common.GenericAttribute;
import com.zhiwei.brandkbs2.common.GlobalPojo; import com.zhiwei.brandkbs2.common.GlobalPojo;
import com.zhiwei.brandkbs2.config.Constant; import com.zhiwei.brandkbs2.config.Constant;
import com.zhiwei.brandkbs2.dao.HighlightWordDao;
import com.zhiwei.brandkbs2.enmus.ChannelEmotion; import com.zhiwei.brandkbs2.enmus.ChannelEmotion;
import com.zhiwei.brandkbs2.exception.ExceptionCast; import com.zhiwei.brandkbs2.exception.ExceptionCast;
import com.zhiwei.brandkbs2.model.CommonCodeEnum; import com.zhiwei.brandkbs2.model.CommonCodeEnum;
...@@ -17,6 +18,7 @@ import com.zhiwei.brandkbs2.pojo.MarkFlowEntity; ...@@ -17,6 +18,7 @@ import com.zhiwei.brandkbs2.pojo.MarkFlowEntity;
import com.zhiwei.brandkbs2.service.MarkFlowService; import com.zhiwei.brandkbs2.service.MarkFlowService;
import com.zhiwei.brandkbs2.util.RedisUtil; import com.zhiwei.brandkbs2.util.RedisUtil;
import com.zhiwei.brandkbs2.util.Tools; import com.zhiwei.brandkbs2.util.Tools;
import com.zhiwei.middleware.automaticmark.vo.Keyword;
import com.zhiwei.middleware.cleaner.filter.UnifiedFilterClient; import com.zhiwei.middleware.cleaner.filter.UnifiedFilterClient;
import com.zhiwei.middleware.mark.service.MarkerClient; import com.zhiwei.middleware.mark.service.MarkerClient;
import com.zhiwei.middleware.mark.vo.QueryResult; import com.zhiwei.middleware.mark.vo.QueryResult;
...@@ -57,9 +59,11 @@ public class MarkFlowServiceImpl implements MarkFlowService { ...@@ -57,9 +59,11 @@ public class MarkFlowServiceImpl implements MarkFlowService {
@Resource(name = "filterClient") @Resource(name = "filterClient")
UnifiedFilterClient filterClient; UnifiedFilterClient filterClient;
@Resource(name = "highlightWordDao")
HighlightWordDao highlightWordDao;
@Override @Override
public JSONObject createMarkFlowInfo(MarkInfoSource markInfoSource) { public JSONObject createMarkFlowInfo(MarkInfoSource markInfoSource) {
JSONObject resultInfo = createInfoWithEmotion(markInfoSource.getJson()); JSONObject resultInfo = createInfoWithEmotion(markInfoSource.getJson());
resultInfo.put("sourceDetails", getSourceDetails(markInfoSource)); resultInfo.put("sourceDetails", getSourceDetails(markInfoSource));
return resultInfo; return resultInfo;
...@@ -70,7 +74,7 @@ public class MarkFlowServiceImpl implements MarkFlowService { ...@@ -70,7 +74,7 @@ public class MarkFlowServiceImpl implements MarkFlowService {
JSONObject json = markInfoSource.getJson(); JSONObject json = markInfoSource.getJson();
String linkedGroupId = markInfoSource.getLinkedGroupId(); String linkedGroupId = markInfoSource.getLinkedGroupId();
JSONObject resultInfo = createInfoWithEmotion(json); JSONObject resultInfo = createInfoWithEmotion(json);
resultInfo.put("sourceDetails", getSourceDetails4Origin(json, linkedGroupId)); resultInfo.put("sourceDetails", getSourceDetails4Origin(json, UserThreadLocal.getProjectId(), linkedGroupId));
String zip = Tools.gzip(JSON.toJSONString(json)); String zip = Tools.gzip(JSON.toJSONString(json));
resultInfo.put("zip", zip); resultInfo.put("zip", zip);
return resultInfo; return resultInfo;
...@@ -229,10 +233,11 @@ public class MarkFlowServiceImpl implements MarkFlowService { ...@@ -229,10 +233,11 @@ public class MarkFlowServiceImpl implements MarkFlowService {
// 保留两位小数 // 保留两位小数
sourceDetails.put("channelInfluence", new BigDecimal(channelValue).setScale(2, RoundingMode.UP)); sourceDetails.put("channelInfluence", new BigDecimal(channelValue).setScale(2, RoundingMode.UP));
} }
sourceDetails.put("highlightWordMap", getHighlightWordMap(markInfoSource.getProjectId(), tJson));
return sourceDetails; return sourceDetails;
} }
private JSONObject getSourceDetails4Origin(JSONObject tJson, String linkedGroupId) { private JSONObject getSourceDetails4Origin(JSONObject tJson, String projectId, String linkedGroupId) {
JSONObject sourceDetails = new JSONObject(); JSONObject sourceDetails = new JSONObject();
String source = tJson.getString(GenericAttribute.ES_SOURCE); String source = tJson.getString(GenericAttribute.ES_SOURCE);
// 是否原创 // 是否原创
...@@ -251,9 +256,36 @@ public class MarkFlowServiceImpl implements MarkFlowService { ...@@ -251,9 +256,36 @@ public class MarkFlowServiceImpl implements MarkFlowService {
if (followersNum > 0) { if (followersNum > 0) {
sourceDetails.put("followersNum", followersNum); sourceDetails.put("followersNum", followersNum);
} }
sourceDetails.put("highlightWordMap", getHighlightWordMap(projectId, tJson));
return sourceDetails; return sourceDetails;
} }
private Map<String, Integer> getHighlightWordMap(String projectId, JSONObject json) {
List<Keyword> hitKeywords = GlobalPojo.PROJECT_GRAPHS.get(projectId).find(json.getString(GenericAttribute.ES_IND_FULL_TEXT));
List<String> preWords = GlobalPojo.HIGHLIGHT_MAP.get(projectId);
if (null != preWords && !hitKeywords.isEmpty()) {
Map<String, Integer> resMap = new HashMap<>();
Map<String, Integer> hitMap = new HashMap<>();
hitKeywords.forEach(keyword -> hitMap.compute(keyword.getKey(), (k, v) -> null == v ? 1 : ++v));
outer:
for (String preWord : preWords) {
Integer count = null;
String[] split = preWord.trim().split(" +");
for (String s : split) {
Integer rate = hitMap.get(s);
// 未命中词语
if (null == rate) {
continue outer;
}
count = count == null ? rate : Math.min(count, rate);
}
resMap.put(preWord, count);
}
return Tools.sortMap(resMap, null);
}
return null;
}
/** /**
* 按c4、origin获取ClientFrom * 按c4、origin获取ClientFrom
* *
......
...@@ -427,6 +427,12 @@ public class ProjectServiceImpl implements ProjectService { ...@@ -427,6 +427,12 @@ public class ProjectServiceImpl implements ProjectService {
} }
} }
@Override
public List<String> getHighlightKeyword(String projectId) {
Project project = projectDao.findOneById(projectId);
return Objects.requireNonNull(project).getHighlightKeyword();
}
/** /**
* 获取舆情对应项目的情感标签 * 获取舆情对应项目的情感标签
* @param brandName * @param brandName
......
package com.zhiwei.brandkbs2.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.zhiwei.brandkbs2.auth.UserThreadLocal;
import com.zhiwei.brandkbs2.dao.BaseMongoDao;
import com.zhiwei.brandkbs2.easyexcel.dto.ExportWordDTO;
import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.pojo.AbstractBaseWord;
import com.zhiwei.brandkbs2.pojo.HighWord;
import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import com.zhiwei.brandkbs2.service.TableWordService;
import com.zhiwei.brandkbs2.util.MongoUtil;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import java.util.List;
import java.util.stream.Collectors;
/**
* @ClassName: TableWordServiceImpl
* @Description TableWordServiceImpl
* @author: sjj
* @date: 2023-05-25 14:35
*/
public class TableWordServiceImpl implements TableWordService{
final BaseMongoDao<? extends AbstractBaseWord> baseMongoDao;
final MongoUtil mongoUtil;
public TableWordServiceImpl(BaseMongoDao<? extends AbstractBaseWord> baseMongoDao, MongoUtil mongoUtil) {
this.baseMongoDao = baseMongoDao;
this.mongoUtil = mongoUtil;
}
@Override
public PageVO<JSONObject> findWord(int page, int size, String keyword) {
String projectId = UserThreadLocal.getProjectId();
Query query = Query.query(Criteria.where("projectId").is(projectId));
long count = baseMongoDao.count(query);
mongoUtil.start(page, size, query);
List<? extends AbstractBaseWord> highWordList = baseMongoDao.findListByKeywordFuzz(query, keyword, new String[]{"keyword"});
List<JSONObject> resList = highWordList.stream().map(highWord -> {
JSONObject result = new JSONObject();
result.put("id", highWord.getId());
result.put("keyword", highWord.getKeyword());
result.put("cTime", highWord.getCTime());
result.put("submitter", highWord.getSubmitter());
return result;
}).collect(Collectors.toList());
MongoUtil.PageHelper<JSONObject> pageHelper = mongoUtil.pageHelper(count, resList);
return PageVO.createPageVo(pageHelper, resList);
}
@Override
public ResponseResult addWordList(List<String> words, String projectId, String submitter) {
List<String> existList = baseMongoDao.findList(Query.query(Criteria.where("projectId").is(projectId))).stream().map(AbstractBaseWord::getKeyword).collect(Collectors.toList());
// 去除重复数据
List<String> newList = words.stream().filter(word -> !existList.contains(word)).collect(Collectors.toList());
// 关键词100上限
if (newList.size() + existList.size() > 100) {
return ResponseResult.failure("关键词添加超过上限值100");
}
baseMongoDao.insertMany(HighWord.createFromList(newList, projectId, submitter));
return ResponseResult.success();
}
@Override
public void deleteWord(String id) {
baseMongoDao.deleteOneById(id);
}
@Override
public List<ExportWordDTO> downloadWord(String projectId) {
return baseMongoDao.findList(Query.query(Criteria.where("projectId").is(projectId))).stream().map(ExportWordDTO::createFromWord).collect(Collectors.toList());
}
}
...@@ -171,11 +171,12 @@ public class UserServiceImpl implements UserService { ...@@ -171,11 +171,12 @@ public class UserServiceImpl implements UserService {
newUser.setNickname(userDTO.getNickname()); newUser.setNickname(userDTO.getNickname());
newUser.setRoles(Collections.singletonList(UserRole.createFromUserDto(userDTO))); newUser.setRoles(Collections.singletonList(UserRole.createFromUserDto(userDTO)));
newUser.setSuperAdmin(false); newUser.setSuperAdmin(false);
userDao.insertOne(newUser);
userCenterService.addProduct(newUser.getId());
} else { } else {
newUser = User.createFromUserDTO(userDTO, nickname); newUser = User.createFromUserDTO(userDTO, nickname);
}
userDao.insertOne(newUser); userDao.insertOne(newUser);
userCenterService.addProduct(newUser.getId()); }
return ResponseResult.success(); return ResponseResult.success();
} }
List<UserRole> roles = user.getRoles(); List<UserRole> roles = user.getRoles();
......
...@@ -99,7 +99,7 @@ whole.searchCriteria.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface ...@@ -99,7 +99,7 @@ whole.searchCriteria.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface
whole.extraParam.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/extra/param whole.extraParam.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/extra/param
#\u60C5\u62A5\u9884\u8B66\u5916\u90E8\u63A5\u53E3 #\u60C5\u62A5\u9884\u8B66\u5916\u90E8\u63A5\u53E3
warn.pushTask.token=AoJ0ooy3H2BpHmuaviYObTKw/Xfw/oA5aKccNYhYnoJFJQ/BgeW/ warn.pushTask.token=AoJ0ooy3H2BpHmuaviYObTKw/Xfw/oA5aKccNYhYnoJFJQ/BgeW/
warn.project.url=https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/brandkbs/project?projectId={1}&projectName={2} warn.project.url=https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/brandkbs/project
warn.ticket.url=https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/code?pushId={1}&taskType={2} warn.ticket.url=https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/code?pushId={1}&taskType={2}
warn.pushRecipientsList.url=https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/pushRecipients/{1}?taskType={2} warn.pushRecipientsList.url=https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/pushRecipients/{1}?taskType={2}
warn.deletePushRecipients.url=https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/pushRecipients/?pushId={1}&recipientsId={2}&taskType={3} warn.deletePushRecipients.url=https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/pushRecipients/?pushId={1}&recipientsId={2}&taskType={3}
......
...@@ -102,7 +102,7 @@ whole.searchCriteria.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface ...@@ -102,7 +102,7 @@ whole.searchCriteria.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface
whole.extraParam.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/extra/param whole.extraParam.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/extra/param
#\u60C5\u62A5\u9884\u8B66\u5916\u90E8\u63A5\u53E3 #\u60C5\u62A5\u9884\u8B66\u5916\u90E8\u63A5\u53E3
warn.pushTask.token=AoJ0ooy3H2BpHmuaviYObTKw/Xfw/oA5aKccNYhYnoJFJQ/BgeW/ warn.pushTask.token=AoJ0ooy3H2BpHmuaviYObTKw/Xfw/oA5aKccNYhYnoJFJQ/BgeW/
warn.project.url=http://192.168.0.225:11003/qbjc/brandkbsPush/interface/brandkbs/project?projectId={1}&projectName={2} warn.project.url=http://192.168.0.225:11003/qbjc/brandkbsPush/interface/brandkbs/project
warn.ticket.url=http://192.168.0.225:11003/qbjc/brandkbsPush/interface/code?pushId={1}&taskType={2} warn.ticket.url=http://192.168.0.225:11003/qbjc/brandkbsPush/interface/code?pushId={1}&taskType={2}
warn.pushRecipientsList.url=http://192.168.0.225:11003/qbjc/brandkbsPush/interface/pushRecipients/{1}?taskType={2} warn.pushRecipientsList.url=http://192.168.0.225:11003/qbjc/brandkbsPush/interface/pushRecipients/{1}?taskType={2}
warn.deletePushRecipients.url=http://192.168.0.225:11003/qbjc/brandkbsPush/interface/pushRecipients/?pushId={1}&recipientsId={2}&taskType={3} warn.deletePushRecipients.url=http://192.168.0.225:11003/qbjc/brandkbsPush/interface/pushRecipients/?pushId={1}&recipientsId={2}&taskType={3}
......
...@@ -99,7 +99,7 @@ whole.searchCriteria.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface ...@@ -99,7 +99,7 @@ whole.searchCriteria.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface
whole.extraParam.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/extra/param whole.extraParam.url=https://yuqing.zhiweidata.com/qbjcbackPhoenix/interface/middleware/search/extra/param
#\u60C5\u62A5\u9884\u8B66\u5916\u90E8\u63A5\u53E3 #\u60C5\u62A5\u9884\u8B66\u5916\u90E8\u63A5\u53E3
warn.pushTask.token=AoJ0ooy3H2BpHmuaviYObTKw/Xfw/oA5aKccNYhYnoJFJQ/BgeW/ warn.pushTask.token=AoJ0ooy3H2BpHmuaviYObTKw/Xfw/oA5aKccNYhYnoJFJQ/BgeW/
warn.project.url=https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/brandkbs/project?projectId={1}&projectName={2} warn.project.url=https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/brandkbs/project
warn.ticket.url=https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/code?pushId={1}&taskType={2} warn.ticket.url=https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/code?pushId={1}&taskType={2}
warn.pushRecipientsList.url=https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/pushRecipients/{1}?taskType={2} warn.pushRecipientsList.url=https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/pushRecipients/{1}?taskType={2}
warn.deletePushRecipients.url=https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/pushRecipients/?pushId={1}&recipientsId={2}&taskType={3} warn.deletePushRecipients.url=https://auto-push.zhiweidata.com/qbjc/brandkbsPush/interface/pushRecipients/?pushId={1}&recipientsId={2}&taskType={3}
......
package com.zhiwei.brandkbs2; package com.zhiwei.brandkbs2;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.zhiwei.brandkbs2.easyexcel.dto.ExportHighWordDTO; import com.zhiwei.brandkbs2.config.Constant;
import com.zhiwei.brandkbs2.easyexcel.dto.ExportWordDTO;
import com.zhiwei.brandkbs2.pojo.vo.PageVO; import com.zhiwei.brandkbs2.pojo.vo.PageVO;
import com.zhiwei.brandkbs2.service.HighWordService; import com.zhiwei.brandkbs2.service.HighWordService;
import org.junit.Test; import org.junit.Test;
import org.junit.jupiter.api.Tags;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
...@@ -21,7 +21,7 @@ public class HighWordServiceTest { ...@@ -21,7 +21,7 @@ public class HighWordServiceTest {
@Test @Test
public void findHighWordTest(){ public void findHighWordTest(){
PageVO<JSONObject> ls = highWordService.findHighWord(1, 10, "里"); PageVO<JSONObject> ls = highWordService.findWord(1, 10, "里");
for (JSONObject jsonObject : ls.getList()) { for (JSONObject jsonObject : ls.getList()) {
System.out.println(jsonObject); System.out.println(jsonObject);
} }
...@@ -29,8 +29,8 @@ public class HighWordServiceTest { ...@@ -29,8 +29,8 @@ public class HighWordServiceTest {
@Test @Test
public void downloadHighWordTest(){ public void downloadHighWordTest(){
List<ExportHighWordDTO> exportHighWordDTOS = highWordService.downloadHighWord(); List<ExportWordDTO> exportHighWordDTOS = highWordService.downloadWord(Constant.DEFAULT_PROJECT_ID);
for (ExportHighWordDTO exportHighWordDTO : exportHighWordDTOS) { for (ExportWordDTO exportHighWordDTO : exportHighWordDTOS) {
System.out.println(exportHighWordDTO); System.out.println(exportHighWordDTO);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment