Skip to content

Commit

Permalink
增加搜索反馈数据追踪
Browse files Browse the repository at this point in the history
  • Loading branch information
2511689622 committed Dec 17, 2024
1 parent f3565a7 commit f44cfcd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/datastat/controller/QueryController.java
Original file line number Diff line number Diff line change
Expand Up @@ -768,9 +768,9 @@ public String putGlobalNpsIssue(HttpServletRequest request, @CookieValue(value =

@LimitRequest(callTime = 1, callCount = 1000)
@RequestMapping(value = "/search/issue", method = RequestMethod.POST)
public String putSearchNpsByCommunity(HttpServletRequest request,
public String putSearchNpsByCommunity(HttpServletRequest request, @CookieValue(value = "_Y_G_", required = false) String token,
@RequestParam(value = "community") String community, @Valid @RequestBody SearchIssueBody body) {
return queryService.putSearchNpsByCommunity(request, community,body);
return queryService.putSearchNpsByCommunity(request, token, community,body);
}

@RequestMapping("/user/owner/repos")
Expand Down
13 changes: 12 additions & 1 deletion src/main/java/com/datastat/dao/QueryDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -3708,10 +3708,21 @@ public String putGlobalNpsIssue(CustomPropertiesConfig queryConf, String token,
}
}

public String putSearchNpsByCommunity(CustomPropertiesConfig queryConf, String community, SearchIssueBody body) {
public String putSearchNpsByCommunity(CustomPropertiesConfig queryConf, String token, String community, SearchIssueBody body) {
HashMap<String, Object> resMap = objectMapper.convertValue(body, new TypeReference<HashMap<String, Object>>() {
});
resMap.put("community", community);
String userId = "";
if (token != null && !"mindspore".equals(community)) {
userId = userIdDao.getUserIdByCommunity(token, community);
if (null == userId || userId.equals("")) {
logger.info("UserId is null");
throw new IllegalArgumentException("UserId prase error");
}
} else {
userId = "anonymous";
}
resMap.put("userId", userId);
try {
Date now = new Date();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/datastat/service/QueryService.java
Original file line number Diff line number Diff line change
Expand Up @@ -1577,11 +1577,11 @@ public String putGlobalNpsIssue(HttpServletRequest request, String token, String
return queryDao.putGlobalNpsIssue(queryConf, token, community, body);
}

public String putSearchNpsByCommunity(HttpServletRequest request, String community, SearchIssueBody body) {
public String putSearchNpsByCommunity(HttpServletRequest request, String token, String community, SearchIssueBody body) {
if (!checkCommunity(community)) return ResultUtil.resultJsonStr(404, "error", "not found");
QueryDao queryDao = getQueryDao(request);
CustomPropertiesConfig queryConf = getQueryConf(request);
return queryDao.putSearchNpsByCommunity(queryConf, community, body);
return queryDao.putSearchNpsByCommunity(queryConf, token, community, body);
}

public String queryGolbalIssues(HttpServletRequest request,String token, ContributeRequestParams params) throws Exception {
Expand Down

0 comments on commit f44cfcd

Please sign in to comment.