Commit c60988a4 by shenjunjie

Merge branch 'feature' into 'dev'

Feature

See merge request !469
parents 9d8f0bea 426541cc
......@@ -61,8 +61,7 @@ public class AopLogRecord {
private static final List<String> URL_PATTERNS = Arrays.asList("/getNewAll", "/getNew", "/schedule");
@AfterReturning(value = "execution(public * com..controller..admin..*Controller.*(..)) || execution(* com..controller..app..*Controller.*(..)) || execution(* com..controller..LoginController.checkBind())", returning = "ResponseResult")
private void beforeLog(JoinPoint joinPoint, ResponseResult ResponseResult){
String pid = null;
private void beforeLog(JoinPoint joinPoint, ResponseResult ResponseResult) {
try {
long now = System.currentTimeMillis();
// RequestContextHolder 顾名思义 持有 request 上下文的容器
......@@ -87,7 +86,7 @@ public class AopLogRecord {
// 前后台,false:前台,true:后台
boolean backstage = uri.contains("admin");
String token = request.getHeader(jwtKey);
pid = request.getHeader("pid");
String pid = request.getHeader("pid");
// 任意有一个不为空
if (!(Tools.isNullOrUndefined(token) || Tools.isNullOrUndefined(pid))) {
Map<String, Object> map = JwtUtil.unsign(request.getHeader(jwtKey), Map.class);
......@@ -102,7 +101,11 @@ public class AopLogRecord {
}
String userId = userIdObj.toString();
String projectId = request.getHeader("pid");
UserInfo userInfo = userService.queryUserInfo(userId, projectId);
UserInfo userInfo;
if (null == (userInfo = userService.queryUserInfo(userId, projectId))) {
log.error("用户信息解析异常,pid:{},userId:{}", pid, userId);
return;
}
String nickName = userInfo.getNickname();
// 请求地址和服务器地址
String severAddress = InetAddress.getLocalHost().getHostAddress();
......@@ -121,7 +124,7 @@ public class AopLogRecord {
}
}
} catch (Exception e) {
log.error("beforeLog,pid:{}",pid, e);
log.error("beforeLog-", e);
}
}
......
......@@ -50,7 +50,7 @@ public class AppSearchController extends BaseController {
@Autowired
private RestTemplate restTemplate;
@Value("${trends.findHotSearchESDataInTimeByInner.url}")
@Value("${trends.findAllPlatformHotSearchESDataInTime.url}")
private String trendsSearchUrl;
@Value("${crisis.search.url}")
......@@ -88,9 +88,12 @@ public class AppSearchController extends BaseController {
@GetMapping("/hot/list")
public ResponseResult searchHotList(@RequestParam(value = "pageSize", defaultValue = "10") Integer limit,
@RequestParam(value = "page", defaultValue = "1") Integer page,
@RequestParam(value = "type", defaultValue = "weibo") String type,
@RequestParam(value = "keyword") String keyword) {
ResponseEntity<JSONObject> jsonObjectResponseEntity = restTemplate.getForEntity(trendsSearchUrl, JSONObject.class, limit, page, type, keyword);
@RequestParam(value = "type", defaultValue = "all") String type,
@RequestParam(value = "keyword") String keyword,
@RequestParam(value = "sort") String sort,
@RequestParam(value = "startTime", required = false) Long startTime,
@RequestParam(value = "endTime", required = false) Long endTime) {
ResponseEntity<JSONObject> jsonObjectResponseEntity = restTemplate.getForEntity(trendsSearchUrl, JSONObject.class, limit, page, type, keyword, sort, startTime, endTime);
JSONObject result = jsonObjectResponseEntity.getBody();
if (Objects.nonNull(result)) {
return ResponseResult.success(result);
......
......@@ -20,10 +20,12 @@ public enum HotPlatformEnum {
ZHIHU("知乎", "zhihu", "知乎热搜"),
JINRITOUTIAO("今日头条", "toutiao", "今日头条热搜"),
DOUYIN("抖音", "douyin", "抖音热搜"),
DOUYIN_RISE("抖音", "douyin-rise", "抖音预热榜"),
BILIBILI("B站", "bilibili", "B站热搜"),
BILIBILI_RANKING("B站", "bilibili-ranking", "B站排行榜"),
KUAISHOU("快手", "kuaishou", "快手热榜"),
BAIDU("百度", "baidu", "百度热搜");
BAIDU("百度", "baidu", "百度热搜"),
XIAOHONGSHU("小红书", "little-red-book", "小红书热榜");
private final String platform;
private final String engName;
......
......@@ -36,6 +36,7 @@ public class Project extends AbstractProject {
/**
* 模块展示列表(1:标注库 2:大库)
*/
@Deprecated
private List<Integer> moduleShowList;
/**
......
......@@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import org.apache.commons.collections4.CollectionUtils;
import org.bson.types.ObjectId;
import java.util.*;
......@@ -159,6 +158,23 @@ public class ProjectVO {
project.setModuleShowList(this.getModuleShowList());
project.setToolsetShowList(this.getToolsetShowList());
project.setChannelFileUrl(this.getChannelFileUrl());
// 负面渠道判断默认值
if (null == negativeChannelParams) {
this.negativeChannelParams = new HashMap<>();
negativeChannelParams.put("negativeArticles", 0.6);
negativeChannelParams.put("negativeEvent", 0.3);
negativeChannelParams.put("specialArticles", 0.1);
negativeChannelParams.put("experience", 0.0);
}
// 友好渠道判断默认值
if (null == positiveChannelParams) {
this.positiveChannelParams = new HashMap<>();
positiveChannelParams.put("specialArticles", 0.1);
positiveChannelParams.put("positiveEvent", 0.3);
positiveChannelParams.put("negative", 0.25);
positiveChannelParams.put("neutral", 0.35);
positiveChannelParams.put("experience", 0.0);
}
project.setNegativeChannelParams((this.getNegativeChannelParams()));
project.setPositiveChannelParams((this.getPositiveChannelParams()));
project.setBlackChannelGroup(this.getBlackChannelGroup());
......
......@@ -88,7 +88,7 @@ crisis.share.url=https://crisis.zhiweidata.com/app/brandkbs/share/{1}
crisis.event.url=https://crisis.zhiweidata.com/share/crisisDetails?id={1}&share={2}
#\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3
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.findAllPlatformHotSearchESDataInTime.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findAllPlatformHotSearchESDataInTime?limit={1}&page={2}&type={3}&word={4}&sort={5}&startTime={6}&endTime={7}
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}&maskWord={7}
trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner
......
......@@ -17,10 +17,14 @@ brandkbs.image.url=https://brandkbs.zhiweidata.com/brandkbs/images/
#\u56FE\u7247\u8D44\u6E90\u8DEF\u5F84
cbs.imagesPath=file:${brandkbs.img.url},file:${brandkbs.head.url}
#redis
#redis \u6D4B\u8BD5
spring.redis.host=192.168.0.24
spring.redis.database=2
spring.redis.port=6379
#redis \u7EBF\u4E0A
#spring.redis.host=115.236.59.91
#spring.redis.database=0
#spring.redis.port=7376
#mongo\u914D\u7F6E
......@@ -93,7 +97,7 @@ crisis.share.url=https://crisis.zhiweidata.com/app/brandkbs/share/{1}
crisis.event.url=https://crisis.zhiweidata.com/share/crisisDetails?id={1}&share={2}
#\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3
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.findAllPlatformHotSearchESDataInTime.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findAllPlatformHotSearchESDataInTime?limit={1}&page={2}&type={3}&word={4}&sort={5}&startTime={6}&endTime={7}
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}&maskWord={7}
trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner
......
......@@ -88,7 +88,7 @@ crisis.share.url=https://crisis.zhiweidata.com/app/brandkbs/share/{1}
crisis.event.url=https://crisis.zhiweidata.com/share/crisisDetails?id={1}&share={2}
#\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3
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.findAllPlatformHotSearchESDataInTime.url=https://hotsearch-manage.zhiweidata.com/hotsearch/hotSearch/findAllPlatformHotSearchESDataInTime?limit={1}&page={2}&type={3}&word={4}&sort={5}&startTime={6}&endTime={7}
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}&maskWord={7}
trends.queryHotSearchTrendInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/queryHotSearchTrendInner
......
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