Commit b20eb3ea by shenjunjie

项目添加友好/敏感渠道默认值

parent 44eb4486
......@@ -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);
}
}
......
......@@ -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());
......
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