Commit 0b836a50 by shenjunjie

Merge branch 'feature' into 'dev'

Feature

See merge request !370
parents 3d1941e9 67e6d009
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<dubbo.version>2.7.4.1</dubbo.version> <dubbo.version>2.7.4.1</dubbo.version>
<curator.version>2.12.0</curator.version> <curator.version>2.12.0</curator.version>
<push.log.version>2.17.0-SNAPSHOT</push.log.version> <push.log.version>2.17.0-SNAPSHOT</push.log.version>
<event-client.version>1.0.9.4-SNAPSHOT</event-client.version> <event-client.version>1.0.9.6-SNAPSHOT</event-client.version>
<cleaner-unified-filter.version>1.1.5-SNAPSHOT</cleaner-unified-filter.version> <cleaner-unified-filter.version>1.1.5-SNAPSHOT</cleaner-unified-filter.version>
</properties> </properties>
......
...@@ -63,6 +63,7 @@ public class RedisKeyPrefix { ...@@ -63,6 +63,7 @@ public class RedisKeyPrefix {
public static final String HOT_RANK_LIST = "BRANDKBS:HOT:RANK_LIST:"; public static final String HOT_RANK_LIST = "BRANDKBS:HOT:RANK_LIST:";
public static final String HOT_LIST = "BRANDKBS:HOT:LIST:"; public static final String HOT_LIST = "BRANDKBS:HOT:LIST:";
public static final String HOT_KEYWORD = "BRANDKBS:HOT:KEYWORD:"; public static final String HOT_KEYWORD = "BRANDKBS:HOT:KEYWORD:";
public static final String HOT_FILTER_WORD = "BRANDKBS:HOT:FILTER_WORD:";
public static final String HOT_SUPPLEMENT_WORD = "BRANDKBS:HOT:SUPPLEMENT_WORD:"; public static final String HOT_SUPPLEMENT_WORD = "BRANDKBS:HOT:SUPPLEMENT_WORD:";
/** /**
...@@ -126,6 +127,10 @@ public class RedisKeyPrefix { ...@@ -126,6 +127,10 @@ public class RedisKeyPrefix {
return RedisKeyPrefix.generateRedisKey(RedisKeyPrefix.HOT_KEYWORD, projectId); return RedisKeyPrefix.generateRedisKey(RedisKeyPrefix.HOT_KEYWORD, projectId);
} }
public static String hotFilterWordKey(String projectId) {
return RedisKeyPrefix.generateRedisKey(RedisKeyPrefix.HOT_FILTER_WORD, projectId);
}
public static String supplementWordKey(String projectId) { public static String supplementWordKey(String projectId) {
return RedisKeyPrefix.generateRedisKey(RedisKeyPrefix.HOT_SUPPLEMENT_WORD, projectId); return RedisKeyPrefix.generateRedisKey(RedisKeyPrefix.HOT_SUPPLEMENT_WORD, projectId);
} }
......
...@@ -79,7 +79,7 @@ public class ExtraController extends BaseController { ...@@ -79,7 +79,7 @@ public class ExtraController extends BaseController {
@ApiOperation("全网搜-维护记录-调整") @ApiOperation("全网搜-维护记录-调整")
@PutMapping("/maintain/adjust") @PutMapping("/maintain/adjust")
@Auth(role = RoleEnum.ADMIN) @Auth(role = RoleEnum.SUPER_ADMIN)
public ResponseResult adjustRecord(@ApiParam(name = "json:{count:调整数值)") @RequestBody JSONObject json) { public ResponseResult adjustRecord(@ApiParam(name = "json:{count:调整数值)") @RequestBody JSONObject json) {
wholeSearchService.adjustRecord(json.getInteger("count")); wholeSearchService.adjustRecord(json.getInteger("count"));
return ResponseResult.success(); return ResponseResult.success();
......
...@@ -22,6 +22,8 @@ import org.springframework.http.ResponseEntity; ...@@ -22,6 +22,8 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.util.List;
/** /**
* @Description: 前台事件库 * @Description: 前台事件库
* @Author: shentao * @Author: shentao
...@@ -187,8 +189,8 @@ public class AppEventController extends BaseController { ...@@ -187,8 +189,8 @@ public class AppEventController extends BaseController {
@ApiOperation("前台事件库-事件监测-新增事件监测") @ApiOperation("前台事件库-事件监测-新增事件监测")
@PostMapping("/addEventMonitor") @PostMapping("/addEventMonitor")
public ResponseResult addEventMonitor(@RequestBody EventDTO dto){ public ResponseResult addEventMonitor(@RequestBody EventDTO dto){
if (eventService.getMonitoringEventsCount() >= 10){ if (eventService.getMonitoringEventsCount() >= 5){
return ResponseResult.failure("监测事件数量不得超过10"); return ResponseResult.failure("监测事件数量不得超过5");
} }
eventService.addEventMonitor(dto); eventService.addEventMonitor(dto);
return ResponseResult.success(); return ResponseResult.success();
...@@ -272,4 +274,18 @@ public class AppEventController extends BaseController { ...@@ -272,4 +274,18 @@ public class AppEventController extends BaseController {
eventService.continueEvent(eventId); eventService.continueEvent(eventId);
return ResponseResult.success(); return ResponseResult.success();
} }
@ApiOperation("前台事件库-事件分析-手动更新")
@PutMapping("/manual-update/{eventId}")
public ResponseResult modifyMonitorEventStatus(@PathVariable String eventId){
eventService.modifyMonitorEventStatusToManualUpdate(eventId);
return ResponseResult.success();
}
@ApiOperation("前台事件库-事件分析-轮询事件状态")
@PostMapping("/schedule")
public ResponseResult scheduleEventStatus(@RequestBody JSONObject json){
List<String> eventIds = json.getJSONArray("eventIds").toJavaList(String.class);
return ResponseResult.success(eventService.scheduleEventStatus(eventIds));
}
} }
...@@ -157,6 +157,19 @@ public class AppHotController extends BaseController { ...@@ -157,6 +157,19 @@ public class AppHotController extends BaseController {
return ResponseResult.success(defaultKeyword); return ResponseResult.success(defaultKeyword);
} }
@ApiOperation("热点库-品牌热点-噪音词获取")
@GetMapping("/filter-word")
public ResponseResult getFilterWord(@ApiParam(name = "竞品id")@RequestParam(required = false) String contendId) {
boolean primary = null == contendId;
String keyId = primary ? UserThreadLocal.getProjectId() : contendId;
String key = RedisKeyPrefix.hotFilterWordKey(keyId);
String filterWord = redisUtil.get(key);
if (null != filterWord) {
return ResponseResult.success(JSONArray.parseArray(filterWord));
}
return ResponseResult.success();
}
@ApiOperation("热点库-品牌热点-关键词调整") @ApiOperation("热点库-品牌热点-关键词调整")
@PutMapping("/keyword/update") @PutMapping("/keyword/update")
public ResponseResult updateKeyword(@ApiParam(name = "json:{list:关键词数组,contendId:竞品id}") @RequestBody JSONObject json) { public ResponseResult updateKeyword(@ApiParam(name = "json:{list:关键词数组,contendId:竞品id}") @RequestBody JSONObject json) {
...@@ -166,6 +179,15 @@ public class AppHotController extends BaseController { ...@@ -166,6 +179,15 @@ public class AppHotController extends BaseController {
return ResponseResult.success(); return ResponseResult.success();
} }
@ApiOperation("热点库-品牌热点-噪音词调整")
@PutMapping("/filter-word/update")
public ResponseResult updateFilterWord(@ApiParam(name = "json:{list:噪音词数组,contendId:竞品id}") @RequestBody JSONObject json) {
JSONArray list = json.getJSONArray("list");
String contendId = json.getString("contendId");
redisUtil.set(RedisKeyPrefix.hotFilterWordKey(null == contendId ? UserThreadLocal.getProjectId() : contendId), list.toJSONString());
return ResponseResult.success();
}
/** /**
* weibo 热搜 * weibo 热搜
* weibo-topic 话题 * weibo-topic 话题
...@@ -387,10 +409,16 @@ public class AppHotController extends BaseController { ...@@ -387,10 +409,16 @@ public class AppHotController extends BaseController {
*/ */
private JSONObject searchHotHandler(int pageSize, int page, String type, String sort, Long startTime, Long endTime,String contendId) { private JSONObject searchHotHandler(int pageSize, int page, String type, String sort, Long startTime, Long endTime,String contendId) {
String keyId = null == contendId ? UserThreadLocal.getProjectId() : contendId; String keyId = null == contendId ? UserThreadLocal.getProjectId() : contendId;
// 关键词
String keywordStr = redisUtil.get(RedisKeyPrefix.hotKeywordKey(keyId)); String keywordStr = redisUtil.get(RedisKeyPrefix.hotKeywordKey(keyId));
if (null == keywordStr) { if (null == keywordStr) {
return null; return null;
} }
// 噪音词
String filterWord = redisUtil.get(RedisKeyPrefix.hotFilterWordKey(keyId));
if (StringUtils.isNotBlank(filterWord)){
filterWord = StringUtils.join(JSONArray.parseArray(filterWord, String.class), "|");
}
String accurateWord = null; String accurateWord = null;
List<Object> valueList = redisUtil.getMapValueAll(RedisKeyPrefix.supplementWordKey(keyId)); List<Object> valueList = redisUtil.getMapValueAll(RedisKeyPrefix.supplementWordKey(keyId));
if (CollectionUtils.isNotEmpty(valueList)) { if (CollectionUtils.isNotEmpty(valueList)) {
...@@ -400,9 +428,9 @@ public class AppHotController extends BaseController { ...@@ -400,9 +428,9 @@ public class AppHotController extends BaseController {
String keyword = StringUtils.join(JSONArray.parseArray(keywordStr, String.class), "|"); String keyword = StringUtils.join(JSONArray.parseArray(keywordStr, String.class), "|");
ResponseEntity<JSONObject> jsonObjectResponseEntity; ResponseEntity<JSONObject> jsonObjectResponseEntity;
if (null != startTime && null != endTime) { if (null != startTime && null != endTime) {
jsonObjectResponseEntity = restTemplate.getForEntity(hotSearchUrl + "&startTime={7}&endTime={8}", JSONObject.class, pageSize, page, type, keyword, sort, accurateWord, startTime, endTime); jsonObjectResponseEntity = restTemplate.getForEntity(hotSearchUrl + "&startTime={8}&endTime={9}", JSONObject.class, pageSize, page, type, keyword, sort, accurateWord, filterWord, startTime, endTime);
} else { } else {
jsonObjectResponseEntity = restTemplate.getForEntity(hotSearchUrl, JSONObject.class, pageSize, page, type, keyword, sort, accurateWord); jsonObjectResponseEntity = restTemplate.getForEntity(hotSearchUrl, JSONObject.class, pageSize, page, type, keyword, sort, accurateWord, filterWord);
} }
return jsonObjectResponseEntity.getBody(); return jsonObjectResponseEntity.getBody();
} }
......
...@@ -324,4 +324,18 @@ public interface EventMiddlewareDao { ...@@ -324,4 +324,18 @@ public interface EventMiddlewareDao {
* @return * @return
*/ */
Map<String, Integer> getTopPlatformAnyEmotion(Long startTime, Long endTime, String emotion, String projectId, String contendId); Map<String, Integer> getTopPlatformAnyEmotion(Long startTime, Long endTime, String emotion, String projectId, String contendId);
/**
* 将监测事件修改为手动更新状态
* @param eventId
* @return
*/
ReturnData modifyMonitorEventStatusToManualUpdate(String eventId);
/**
* 轮询监测事件更新状态
* @param eventIds
* @return
*/
ReturnData scheduleEventStatus(List<String> eventIds);
} }
...@@ -221,4 +221,14 @@ public class EventMiddlewareDaoImpl implements EventMiddlewareDao { ...@@ -221,4 +221,14 @@ public class EventMiddlewareDaoImpl implements EventMiddlewareDao {
public Map<String, Integer> getTopPlatformAnyEmotion(Long startTime, Long endTime, String emotion, String projectId, String contendId) { public Map<String, Integer> getTopPlatformAnyEmotion(Long startTime, Long endTime, String emotion, String projectId, String contendId) {
return eventClient.getTopPlatformAnyEmotion(startTime, endTime, emotion, projectId, contendId); return eventClient.getTopPlatformAnyEmotion(startTime, endTime, emotion, projectId, contendId);
} }
@Override
public ReturnData modifyMonitorEventStatusToManualUpdate(String eventId) {
return eventMonitorClient.modifyMonitorEventStatusToManualUpdate(eventId);
}
@Override
public ReturnData scheduleEventStatus(List<String> eventIds) {
return eventMonitorClient.scheduleEventStatus(eventIds);
}
} }
...@@ -422,4 +422,18 @@ public interface EventService { ...@@ -422,4 +422,18 @@ public interface EventService {
* @param eventId 事件id * @param eventId 事件id
*/ */
void continueEvent(String eventId); void continueEvent(String eventId);
/**
* 将监测事件修改为手动更新状态
* @param eventId
* @return
*/
void modifyMonitorEventStatusToManualUpdate(String eventId);
/**
* 轮询监测事件更新状态
* @param eventIds
* @return
*/
JSONObject scheduleEventStatus(List<String> eventIds);
} }
...@@ -883,6 +883,16 @@ public class EventServiceImpl implements EventService { ...@@ -883,6 +883,16 @@ public class EventServiceImpl implements EventService {
eventMiddlewareDao.continueEvent(eventId, submitter, submitterId); eventMiddlewareDao.continueEvent(eventId, submitter, submitterId);
} }
@Override
public void modifyMonitorEventStatusToManualUpdate(String eventId) {
eventMiddlewareDao.modifyMonitorEventStatusToManualUpdate(eventId);
}
@Override
public JSONObject scheduleEventStatus(List<String> eventIds) {
return (JSONObject) eventMiddlewareDao.scheduleEventStatus(eventIds).getData();
}
@Data @Data
public static class MongoQueryUtil { public static class MongoQueryUtil {
......
...@@ -84,7 +84,7 @@ crisis.event.url =https://crisis.zhiweidata.com/event/{1}/general?share={2} ...@@ -84,7 +84,7 @@ crisis.event.url =https://crisis.zhiweidata.com/event/{1}/general?share={2}
trends.longTimeInListSearchByInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}&day={3} trends.longTimeInListSearchByInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}&day={3}
trends.findHotSearchESDataInTimeByInner.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4} trends.findHotSearchESDataInTimeByInner.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime
trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5\}&accurateWord={6} trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7}
trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner?name={1}&startTime={2}&type={3} trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner?name={1}&startTime={2}&type={3}
trends.getHotSearchSnapshot.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3} trends.getHotSearchSnapshot.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3}
#\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3 #\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3
......
...@@ -87,7 +87,7 @@ crisis.event.url =https://crisis.zhiweidata.com/event/{1}/general?share={2} ...@@ -87,7 +87,7 @@ crisis.event.url =https://crisis.zhiweidata.com/event/{1}/general?share={2}
trends.longTimeInListSearchByInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}&day={3} trends.longTimeInListSearchByInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}&day={3}
trends.findHotSearchESDataInTimeByInner.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4} trends.findHotSearchESDataInTimeByInner.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime
trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5\}&accurateWord={6} trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7}
trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner?name={1}&startTime={2}&type={3} trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner?name={1}&startTime={2}&type={3}
trends.getHotSearchSnapshot.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3} trends.getHotSearchSnapshot.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3}
......
...@@ -84,7 +84,7 @@ crisis.event.url =https://crisis.zhiweidata.com/event/{1}/general?share={2} ...@@ -84,7 +84,7 @@ crisis.event.url =https://crisis.zhiweidata.com/event/{1}/general?share={2}
trends.longTimeInListSearchByInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}&day={3} trends.longTimeInListSearchByInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}&day={3}
trends.findHotSearchESDataInTimeByInner.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4} trends.findHotSearchESDataInTimeByInner.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findHotSearchESDataInTimeByInner?limit={1}&page={2}&type={3}&word={4}
trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime
trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6} trends.getHotSearchFromEsInTimeAndTypeOrWord.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchFromEsInTimeAndTypeOrWord?limit={1}&page={2}&type={3}&word={4}&sort={5}&accurateWord={6}&maskWord={7}
trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner?name={1}&startTime={2}&type={3} trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner?name={1}&startTime={2}&type={3}
trends.getHotSearchSnapshot.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3} trends.getHotSearchSnapshot.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/getHotSearchSnapshot?type={1}&time={2}&rank={3}
#\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3 #\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3
......
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