Commit 8a6510ac by 王祖波

批量接口

parent c847a7c7
......@@ -5,6 +5,7 @@ import java.util.List;
import com.gic.haoban.manage.api.qdto.combined.CombinedQDTO;
import com.gic.haoban.manage.web.qo.combined.CombinedQO;
import com.gic.haoban.manage.web.qo.combined.CombinedsQO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
......@@ -185,4 +186,22 @@ public class QwMessageController extends WebBaseController {
}
return RestResponse.failure("-1", resp.getMessage()) ;
}
@RequestMapping("combined-qw-materialids")
public RestResponse<Object> combinedMaterialIds(@RequestBody CombinedsQO combinedQO) {
String wxEnterpriseId = combinedQO.getWxEnterpriseId();
CombinedQDTO combinedQDTO = com.gic.commons.util.EntityUtil.changeEntityNew(CombinedQDTO.class, combinedQO);
List<String> imageUrlList = combinedQO.getImageUrlList();
List<String> resultList = new ArrayList<>();
for (String imageUrl : imageUrlList) {
combinedQDTO.setImageUrl(imageUrl);
ServiceResponse<String> resp = this.materialApiService.getMaterialIdByCombined(wxEnterpriseId, combinedQDTO) ;
if(!resp.isSuccess() || StringUtils.isBlank(resp.getResult())) {
return RestResponse.failure("-1", resp.getMessage()) ;
}
String result = resp.getResult();
resultList.add(result);
}
return RestResponse.successResult(resultList) ;
}
}
package com.gic.haoban.manage.web.qo.combined;
import java.io.Serializable;
import java.util.List;
public class CombinedsQO implements Serializable {
private static final long serialVersionUID = -28454620622119889L;
private String wxEnterpriseId;
/**
* 主图url
*/
private List<String> imageUrlList;
/**
* 小程序码url
*/
private String qrCodeUrl;
/**
* 展示样式
*/
private Integer showStyle;
/**
* 第一行文字
*/
private String lineOne;
/**
* 第二行文字
*/
private String lineTwo;
/**
* 1群发 2朋友圈
*/
private Integer mediaType ;
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public List<String> getImageUrlList() {
return imageUrlList;
}
public void setImageUrlList(List<String> imageUrlList) {
this.imageUrlList = imageUrlList;
}
public String getQrCodeUrl() {
return qrCodeUrl;
}
public void setQrCodeUrl(String qrCodeUrl) {
this.qrCodeUrl = qrCodeUrl;
}
public Integer getShowStyle() {
return showStyle;
}
public void setShowStyle(Integer showStyle) {
this.showStyle = showStyle;
}
public String getLineOne() {
return lineOne;
}
public void setLineOne(String lineOne) {
this.lineOne = lineOne;
}
public String getLineTwo() {
return lineTwo;
}
public void setLineTwo(String lineTwo) {
this.lineTwo = lineTwo;
}
public Integer getMediaType() {
return mediaType;
}
public void setMediaType(Integer mediaType) {
this.mediaType = mediaType;
}
}
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