|
@@ -12,8 +12,6 @@ import com.tzld.longarticle.recommend.server.model.param.ChooseMinigramParam;
|
|
|
import com.tzld.longarticle.recommend.server.model.param.GetOffVideosParam;
|
|
|
import com.tzld.longarticle.recommend.server.model.param.RecallVideosParam;
|
|
|
import com.tzld.longarticle.recommend.server.model.param.SearchVideoParam;
|
|
|
-import com.tzld.longarticle.recommend.server.model.vo.ChooseMinigramResponse;
|
|
|
-import com.tzld.longarticle.recommend.server.model.vo.SearchVideoResponse;
|
|
|
import com.tzld.longarticle.recommend.server.repository.longArticle.*;
|
|
|
import com.tzld.longarticle.recommend.server.service.video.CardGeneratorService;
|
|
|
import com.tzld.longarticle.recommend.server.service.video.MatchVideoService;
|
|
@@ -75,17 +73,17 @@ public class MatchVideoServiceImpl implements MatchVideoService {
|
|
|
|
|
|
@Transactional
|
|
|
@Override
|
|
|
- public CommonResponse<SearchVideoResponse> searchVideo(SearchVideoParam searchVideoParam) {
|
|
|
+ public String searchVideo(SearchVideoParam searchVideoParam) {
|
|
|
+ JSONObject res = new JSONObject();
|
|
|
if (StringUtils.isEmpty(searchVideoParam.getContent())
|
|
|
|| StringUtils.isEmpty(searchVideoParam.getArticleId())
|
|
|
|| StringUtils.isEmpty(searchVideoParam.getGhId())
|
|
|
|| StringUtils.isEmpty(searchVideoParam.getAccountName())
|
|
|
|| StringUtils.isEmpty(searchVideoParam.getTitle())) {
|
|
|
- SearchVideoResponse searchVideoResponse = new SearchVideoResponse();
|
|
|
- searchVideoResponse.setCode(1);
|
|
|
- searchVideoResponse.setStatus("fail");
|
|
|
- searchVideoResponse.setInfo("params check error");
|
|
|
- return CommonResponse.success(searchVideoResponse);
|
|
|
+ res.put("code", 1);
|
|
|
+ res.put("status", "fail");
|
|
|
+ res.put("info", "params check error");
|
|
|
+ return res.toJSONString();
|
|
|
}
|
|
|
String traceId = String.format("search-%s-%s", UUID.randomUUID(), System.currentTimeMillis() / 1000);
|
|
|
LongArticlesMatchVideo longArticlesMatchVideo = new LongArticlesMatchVideo();
|
|
@@ -94,6 +92,7 @@ public class MatchVideoServiceImpl implements MatchVideoService {
|
|
|
longArticlesMatchVideo.setFlowPoolLevel(searchVideoParam.getFlowPoolLevelTag());
|
|
|
longArticlesMatchVideo.setGhId(searchVideoParam.getGhId());
|
|
|
longArticlesMatchVideo.setAccountName(searchVideoParam.getAccountName());
|
|
|
+ longArticlesMatchVideo.setUpdateTime(new Date());
|
|
|
longArticlesMatchVideo.setRequestTimestamp(System.currentTimeMillis() / 1000);
|
|
|
if (searchVideoParam.getPublishFlag() == null) {
|
|
|
longArticlesMatchVideo.setPublishFlag(1);
|
|
@@ -115,34 +114,34 @@ public class MatchVideoServiceImpl implements MatchVideoService {
|
|
|
crawlerProduceIdMap.setContentId(searchVideoParam.getArticleId());
|
|
|
crawlerProduceIdMapRepository.save(crawlerProduceIdMap);
|
|
|
}
|
|
|
- SearchVideoResponse searchVideoResponse = new SearchVideoResponse();
|
|
|
- searchVideoResponse.setCode(0);
|
|
|
- searchVideoResponse.setStatus("success input to article queue");
|
|
|
- searchVideoResponse.setTraceId(traceId);
|
|
|
- return CommonResponse.success(searchVideoResponse);
|
|
|
+
|
|
|
+ res.put("code", 0);
|
|
|
+ res.put("status", "success input to article queue");
|
|
|
+ res.put("traceId", traceId);
|
|
|
+ return res.toJSONString();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public CommonResponse<ChooseMinigramResponse> chooseMinigram(ChooseMinigramParam chooseMinigramParam) {
|
|
|
+ public String chooseMinigram(ChooseMinigramParam chooseMinigramParam) {
|
|
|
String ghId = chooseMinigramParam.getGhId();
|
|
|
- ChooseMinigramResponse chooseMinigramResponse = new ChooseMinigramResponse();
|
|
|
+ JSONObject res = new JSONObject();
|
|
|
if (ghId != null && EXPERIMENT_27_GH_ID_SET.contains(ghId)) {
|
|
|
- chooseMinigramResponse.setProgramAvatar(MinigramEnum.XYMHFQDD_27.getAvatar());
|
|
|
- chooseMinigramResponse.setProgramId(MinigramEnum.XYMHFQDD_27.getId());
|
|
|
- chooseMinigramResponse.setProgramName(MinigramEnum.XYMHFQDD_27.getName());
|
|
|
- chooseMinigramResponse.setTrace_id(chooseMinigramParam.getTraceId());
|
|
|
+ res.put("programAvatar", MinigramEnum.XYMHFQDD_27.getAvatar());
|
|
|
+ res.put("programId", MinigramEnum.XYMHFQDD_27.getId());
|
|
|
+ res.put("programName", MinigramEnum.XYMHFQDD_27.getName());
|
|
|
+ res.put("trace_id", chooseMinigramParam.getTraceId());
|
|
|
} else if (ghId != null && ghIdInPqVideo.contains(ghId)) {
|
|
|
- chooseMinigramResponse.setProgramAvatar(MinigramEnum.PQSP4.getAvatar());
|
|
|
- chooseMinigramResponse.setProgramId(MinigramEnum.PQSP4.getId());
|
|
|
- chooseMinigramResponse.setProgramName(MinigramEnum.PQSP4.getName());
|
|
|
- chooseMinigramResponse.setTrace_id(chooseMinigramParam.getTraceId());
|
|
|
+ res.put("programAvatar", MinigramEnum.PQSP4.getAvatar());
|
|
|
+ res.put("programId", MinigramEnum.PQSP4.getId());
|
|
|
+ res.put("programName", MinigramEnum.PQSP4.getName());
|
|
|
+ res.put("trace_id", chooseMinigramParam.getTraceId());
|
|
|
} else {
|
|
|
- chooseMinigramResponse.setProgramAvatar(MinigramEnum.VLOG0.getAvatar());
|
|
|
- chooseMinigramResponse.setProgramId(MinigramEnum.VLOG0.getId());
|
|
|
- chooseMinigramResponse.setProgramName(MinigramEnum.VLOG0.getName());
|
|
|
- chooseMinigramResponse.setTrace_id(chooseMinigramParam.getTraceId());
|
|
|
+ res.put("programAvatar", MinigramEnum.VLOG0.getAvatar());
|
|
|
+ res.put("programId", MinigramEnum.VLOG0.getId());
|
|
|
+ res.put("programName", MinigramEnum.VLOG0.getName());
|
|
|
+ res.put("trace_id", chooseMinigramParam.getTraceId());
|
|
|
}
|
|
|
- return CommonResponse.success(chooseMinigramResponse);
|
|
|
+ return res.toJSONString();
|
|
|
}
|
|
|
|
|
|
@Override
|