mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
:new :#2382 【企业微信】增加获取商品图册的接口
This commit is contained in:
@@ -109,7 +109,7 @@ public interface WxCpExternalContactService {
|
||||
* @param userId 外部联系人的userid
|
||||
* @return . external contact
|
||||
* @throws WxErrorException the wx error exception
|
||||
* @deprecated 建议使用 {@link #getContactDetail(String)}
|
||||
* @deprecated 建议使用 {@link #getContactDetail(String, String)}
|
||||
*/
|
||||
@Deprecated
|
||||
WxCpExternalContactInfo getExternalContact(String userId) throws WxErrorException;
|
||||
@@ -130,10 +130,11 @@ public interface WxCpExternalContactService {
|
||||
* </pre>
|
||||
*
|
||||
* @param userId 外部联系人的userid,注意不是企业成员的帐号
|
||||
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
|
||||
* @return . contact detail
|
||||
* @throws WxErrorException .
|
||||
*/
|
||||
WxCpExternalContactInfo getContactDetail(String userId) throws WxErrorException;
|
||||
WxCpExternalContactInfo getContactDetail(String userId, String cursor) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 企业和服务商可通过此接口,将微信外部联系人的userid转为微信openid,用于调用支付相关接口。暂不支持企业微信外部联系人(ExternalUserid为wo开头)的userid转openid。
|
||||
@@ -190,7 +191,7 @@ public interface WxCpExternalContactService {
|
||||
* @throws WxErrorException .
|
||||
*/
|
||||
String opengidToChatid(@NotNull String opengid) throws WxErrorException;
|
||||
|
||||
|
||||
/**
|
||||
* 批量获取客户详情.
|
||||
* <pre>
|
||||
@@ -789,4 +790,31 @@ public interface WxCpExternalContactService {
|
||||
* @throws WxErrorException the wx error exception
|
||||
*/
|
||||
WxCpBaseResp delGroupWelcomeTemplate(@NotNull String templateId, String agentId) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 获取商品图册
|
||||
* https://work.weixin.qq.com/api/doc/90000/90135/95096#获取商品图册列表
|
||||
* </pre>
|
||||
*
|
||||
* @param limit 返回的最大记录数,整型,最大值100,默认值50,超过最大值时取默认值
|
||||
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
|
||||
* @return wx cp base resp
|
||||
* @throws WxErrorException the wx error exception
|
||||
*/
|
||||
WxCpProductAlbumListResult getProductAlbumList(Integer limit, String cursor) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 获取商品图册
|
||||
* https://work.weixin.qq.com/api/doc/90000/90135/95096#获取商品图册
|
||||
* </pre>
|
||||
*
|
||||
* @param productId 商品id
|
||||
* @return wx cp base resp
|
||||
* @throws WxErrorException the wx error exception
|
||||
*/
|
||||
WxCpProductAlbumResult getProductAlbum(String productId) throws WxErrorException;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -102,8 +102,12 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxCpExternalContactInfo getContactDetail(String userId) throws WxErrorException {
|
||||
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CONTACT_DETAIL + userId);
|
||||
public WxCpExternalContactInfo getContactDetail(String userId, String cursor) throws WxErrorException {
|
||||
String params = userId;
|
||||
if(StringUtils.isNotEmpty(cursor)){
|
||||
params = params + "&cursor=" + cursor;
|
||||
}
|
||||
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CONTACT_DETAIL + params);
|
||||
String responseContent = this.mainService.get(url, null);
|
||||
return WxCpExternalContactInfo.fromJson(responseContent);
|
||||
}
|
||||
@@ -702,4 +706,45 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
|
||||
final String result = this.mainService.post(url, json.toString());
|
||||
return WxCpBaseResp.fromJson(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 获取商品图册
|
||||
* https://work.weixin.qq.com/api/doc/90000/90135/95096#获取商品图册列表
|
||||
* </pre>
|
||||
*
|
||||
* @param limit 返回的最大记录数,整型,最大值100,默认值50,超过最大值时取默认值
|
||||
* @param cursor 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用可不填
|
||||
* @return wx cp base resp
|
||||
* @throws WxErrorException the wx error exception
|
||||
*/
|
||||
@Override
|
||||
public WxCpProductAlbumListResult getProductAlbumList(Integer limit, String cursor) throws WxErrorException {
|
||||
JsonObject json = new JsonObject();
|
||||
json.addProperty("limit", limit);
|
||||
json.addProperty("cursor", cursor);
|
||||
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_PRODUCT_ALBUM_LIST);
|
||||
final String result = this.mainService.post(url, json.toString());
|
||||
return WxCpProductAlbumListResult.fromJson(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 获取商品图册
|
||||
* https://work.weixin.qq.com/api/doc/90000/90135/95096#获取商品图册
|
||||
* </pre>
|
||||
*
|
||||
* @param productId 商品id
|
||||
* @return wx cp base resp
|
||||
* @throws WxErrorException the wx error exception
|
||||
*/
|
||||
@Override
|
||||
public WxCpProductAlbumResult getProductAlbum(String productId) throws WxErrorException {
|
||||
JsonObject json = new JsonObject();
|
||||
json.addProperty("product_id", productId);
|
||||
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_PRODUCT_ALBUM);
|
||||
final String result = this.mainService.post(url, json.toString());
|
||||
return WxCpProductAlbumResult.fromJson(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user