Commit 90bc8687 by guojx

引流链接列表接口调整:shortCode数据

parent 3eacffa1
...@@ -528,14 +528,26 @@ public class HmLinkController { ...@@ -528,14 +528,26 @@ public class HmLinkController {
if (page == null) { if (page == null) {
return RestResponse.successResult(); return RestResponse.successResult();
} }
//查询shortCode
String shortCode = "";
ServiceResponse<HmLinkDTO> hmLinkRes = hmLinkApiService.getByLinkId(loginUser.getWxEnterpriseId(),
loginUser.getEnterpriseId(), qdto.getLinkId());
if (hmLinkRes.isSuccess()) {
HmLinkDTO hmLink = hmLinkRes.getResult();
if (hmLink != null) {
shortCode = hmLink.getShortCode();
}
}
Page<HmLinkListVO> retPage = EntityUtil.changeEntityByJSON(Page.class, page); Page<HmLinkListVO> retPage = EntityUtil.changeEntityByJSON(Page.class, page);
List<HmLinkListVO> list = EntityUtil.changeEntityListByJSON(HmLinkListVO.class, page.getResult()); List<HmLinkListVO> list = EntityUtil.changeEntityListByJSON(HmLinkListVO.class, page.getResult());
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
return RestResponse.successResult(retPage); return RestResponse.successResult(retPage);
} }
ServiceResponse<String> urlResp = this.hmLinkApiService.getHmLinkUrl(); ServiceResponse<String> urlResp = this.hmLinkApiService.getHmLinkUrl();
String finalShortCode = shortCode;
list.forEach(item -> { list.forEach(item -> {
item.setLinkUrl(urlResp.getResult() + item.getShortCode()); item.setShortCode(finalShortCode);
item.setLinkUrl(urlResp.getResult() + finalShortCode);
}); });
retPage.setResult(list); retPage.setResult(list);
return RestResponse.successResult(retPage); return RestResponse.successResult(retPage);
......
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