Commit 5ade5814 by shenjunjie

Merge remote-tracking branch 'origin/feature' into feature

parents 4f1a595f b6907a3c
package com.zhiwei.brandkbs2.controller.app;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.zhiwei.brandkbs2.auth.Auth;
import com.zhiwei.brandkbs2.controller.BaseController;
import com.zhiwei.brandkbs2.enmus.RoleEnum;
......@@ -7,7 +9,11 @@ import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.service.EventService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
/**
* @Description: 前台事件库
......@@ -19,6 +25,23 @@ import org.springframework.web.bind.annotation.*;
@Api(tags = "前台事件库", description = "提供前台事件相关信息展示")
@Auth(role = RoleEnum.CUSTOMER)
public class AppEventController extends BaseController {
@Autowired
private RestTemplate restTemplate;
@Value("${ef.search.url}")
private String getEfSearchUrl;
@Value("${ef.searchCriteria.url}")
private String getEfSearchCriteriaUrl;
@Value("${ef.filterNew.url}")
private String getFilterNewUrl;
@Value("${ef.captcha.url}")
private String efCaptchaUrl;
@Value("${ef.checkCaptcha.url}")
private String efCheckCaptchaUrl;
private final EventService eventService;
......@@ -75,4 +98,49 @@ public class AppEventController extends BaseController {
return ResponseResult.success(eventService.getEventTopArticlesAnalysis(id, type, emotion, aggTitle));
}
@ApiOperation("前台事件库-全网事件库-搜索")
@GetMapping("/getWholeNetworkEvents")
public ResponseResult getWholeNetworkEvents(@RequestParam("keyword") String keyword,
@RequestParam(value = "page",defaultValue = "1") Integer page){
String name = keyword.trim();
ResponseEntity<String> responseEntity = restTemplate.getForEntity(getEfSearchUrl, String.class, name, page);
JSONObject jsonObject = JSON.parseObject(responseEntity.getBody());
return ResponseResult.success(jsonObject);
}
@ApiOperation("前台事件库-全网事件库-搜索条件")
@GetMapping("/getWholeNetworkSearchCriteria")
public ResponseResult getWholeNetworkSearchCriteria(){
ResponseEntity<String> responseEntity = restTemplate.getForEntity(getEfSearchCriteriaUrl, String.class);
JSONObject jsonObject = JSON.parseObject(responseEntity.getBody());
return ResponseResult.success(jsonObject);
}
@ApiOperation("前台事件库-全网事件库-列表")
@GetMapping("/getWholeNetworkEventsList")
public ResponseResult getWholeNetworkEventsList(@RequestParam(value = "firstType", required = false, defaultValue = "") String firstType,
@RequestParam(value = "start", required = false, defaultValue = "0") long start,
@RequestParam(value = "end", required = false, defaultValue = "0") long end,
@RequestParam(value = "page", required = false, defaultValue = "1") int page){
ResponseEntity<String> responseEntity = restTemplate.getForEntity(getFilterNewUrl, String.class, firstType, start, end, page);
JSONObject jsonObject = JSON.parseObject(responseEntity.getBody());
return ResponseResult.success(jsonObject);
}
@ApiOperation("前台事件库-全网事件库-得到验证码")
@GetMapping("/getWholeNetworkCaptcha")
public ResponseResult getWholeNetworkCaptcha(){
ResponseEntity<String> responseEntity = restTemplate.getForEntity(efCaptchaUrl, String.class);
JSONObject jsonObject = JSON.parseObject(responseEntity.getBody());
return ResponseResult.success(jsonObject);
}
@ApiOperation("前台事件库-全网事件库-校验验证码")
@GetMapping("/checkWholeNetworkCaptcha")
public ResponseResult checkWholeNetworkCaptcha(@RequestParam(value = "id", required = false, defaultValue = "") String id,
@RequestParam(value = "captcha", required = false, defaultValue = "") String captcha){
ResponseEntity<String> responseEntity = restTemplate.getForEntity(efCheckCaptchaUrl, String.class, id, captcha);
JSONObject jsonObject = JSON.parseObject(responseEntity.getBody());
return ResponseResult.success(jsonObject);
}
}
......@@ -40,6 +40,12 @@ public class MarkSearchDTO {
private String linkedGroupId;
/**
* 竞品id,主品牌默认0
*/
@ApiModelProperty(value = "竞品id")
private String contendId = "0";
/**
* 时间类型
*/
@ApiModelProperty("时间类型")
......
......@@ -69,4 +69,10 @@ crisis.share.url=https://crisis.zhiweidata.com/app/brandkbs/share/{1}
#\u70ED\u70B9\u5E93\u5916\u90E8\u63A5\u53E3
trends.longTimeInListSearchByInner.url=https://trends.zhiweidata.com/hotSearchTrend/inner/longTimeInListSearchByInner?sortType={1}&type={2}
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
\ No newline at end of file
trends.longTimeInListSearch.url=https://trends.zhiweidata.com/hotSearchTrend/search/longTimeInListSearch?type={1}&sortType=realTime
#\u4E8B\u4EF6\u5E93\u5916\u90E8\u63A5\u53E3
ef.search.url=https://ef.zhiweidata.com/external/search.do?name={1}&page={2}
ef.searchCriteria.url=https://ef.zhiweidata.com/index/getSearchKey.do
ef.filterNew.url=https://ef.zhiweidata.com/filterNew.do?firstType={1}&start={2}&end={3}&page={4}
ef.captcha.url=https://ef.zhiweidata.com/captchaApi/getNewCaptcha.do.do?type=test
ef.checkCaptcha.url=https://ef.zhiweidata.com/captchaApi/checkeCaptcha.do.do?id={1}&captcha={2}&type=test
\ No newline at end of file
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