🎨 #3575 【视频号】微信小店api官方将要废除finder_id,以promoter_id代替
Some checks failed
Publish to Maven Central / build-and-publish (push) Has been cancelled

This commit is contained in:
altusea 2025-05-13 22:57:07 +08:00 committed by GitHub
parent 1a74e3e3a8
commit d776792bae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 91 additions and 14 deletions

View File

@ -15,43 +15,84 @@ public interface WxLeaguePromoterService {
/**
* 新增达人
*
* @param finderId 视频号finder_id
* @param finderId 视频号finder_id待废除
* @return 结果
* @deprecated 使用 {@link #addPromoterV2(String)}
*/
@Deprecated
WxChannelBaseResponse addPromoter(String finderId) throws WxErrorException;
/**
* 编辑达人
*
* @param finderId 视频号finder_id
* @param finderId 视频号finder_id待废除
* @param type 操作 1取消邀请 2结束合作
* @return 结果
* @deprecated 使用 {@link #updatePromoterV2(String, int)}
*/
@Deprecated
WxChannelBaseResponse updatePromoter(String finderId, int type) throws WxErrorException;
/**
* 删除达人
*
* @param finderId 视频号finder_id
* @param finderId 视频号finder_id待废除
* @return 结果
* @deprecated 使用 {@link #deletePromoterV2(String)}
*/
@Deprecated
WxChannelBaseResponse deletePromoter(String finderId) throws WxErrorException;
/**
* 获取达人详情信息
*
* @param finderId 视频号finder_id
* @param finderId 视频号finder_id待废除
* @return 结果
* @deprecated 使用 {@link #getPromoterInfoV2(String)}
*/
@Deprecated
PromoterInfoResponse getPromoterInfo(String finderId) throws WxErrorException;
/**
* 获取达人列表
*
* @param pageIndex 页面下标下标从1开始默认为1
* @param pageSize 单页达人数不超过200
* @param status 拉取该状态下的达人列表
* @return 结果
*/
PromoterListResponse listPromoter(Integer pageIndex, Integer pageSize, Integer status) throws WxErrorException;
/**
* 新增达人
*
* @param promoterId 达人带货id
* @return 结果
*/
WxChannelBaseResponse addPromoterV2(String promoterId) throws WxErrorException;
/**
* 编辑达人
*
* @param promoterId 达人带货id
* @param type 操作 1取消邀请 2结束合作
* @return 结果
*/
WxChannelBaseResponse updatePromoterV2(String promoterId, int type) throws WxErrorException;
/**
* 删除达人
*
* @param promoterId 达人带货id
* @return 结果
*/
WxChannelBaseResponse deletePromoterV2(String promoterId) throws WxErrorException;
/**
* 获取达人详情信息
*
* @param promoterId 达人带货id
* @return 结果
*/
PromoterInfoResponse getPromoterInfoV2(String promoterId) throws WxErrorException;
/**
* 获取达人列表
*
* @param pageIndex 页面下标下标从1开始默认为1
* @param pageSize 单页达人数不超过200
* @param status 拉取该状态下的达人列表
* @return 结果
*/
PromoterListResponse listPromoter(Integer pageIndex, Integer pageSize, Integer status) throws WxErrorException;
}

View File

@ -58,6 +58,34 @@ public class WxLeaguePromoterServiceImpl implements WxLeaguePromoterService {
return ResponseUtils.decode(resJson, PromoterInfoResponse.class);
}
@Override
public WxChannelBaseResponse addPromoterV2(String promoterId) throws WxErrorException {
String reqJson = "{\"promoter_id\":\"" + promoterId + "\"}";
String resJson = shopService.post(ADD_PROMOTER_URL, reqJson);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
@Override
public WxChannelBaseResponse updatePromoterV2(String promoterId, int type) throws WxErrorException {
String reqJson = "{\"promoter_id\":\"" + promoterId + "\",\"type\":" + type + "}";
String resJson = shopService.post(EDIT_PROMOTER_URL, reqJson);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
@Override
public WxChannelBaseResponse deletePromoterV2(String promoterId) throws WxErrorException {
String reqJson = "{\"promoter_id\":\"" + promoterId + "\"}";
String resJson = shopService.post(DELETE_PROMOTER_URL, reqJson);
return ResponseUtils.decode(resJson, WxChannelBaseResponse.class);
}
@Override
public PromoterInfoResponse getPromoterInfoV2(String promoterId) throws WxErrorException {
String reqJson = "{\"promoter_id\":\"" + promoterId + "\"}";
String resJson = shopService.post(GET_PROMOTER_URL, reqJson);
return ResponseUtils.decode(resJson, PromoterInfoResponse.class);
}
@Override
public PromoterListResponse listPromoter(Integer pageIndex, Integer pageSize, Integer status)
throws WxErrorException {

View File

@ -18,11 +18,19 @@ import me.chanjar.weixin.channel.bean.base.WxChannelBaseResponse;
public class PromoterListResponse extends WxChannelBaseResponse {
private static final long serialVersionUID = 1411870432999885996L;
/** 达人finder_id列表 */
/** 达人finder_id列表待废除后续以promoter_ids为准 */
@JsonProperty("finder_ids")
private List<String> finderIds;
/** 达人总数 */
@JsonProperty("total_num")
private Integer totalNum;
/** 后面是否还有true: 还有内容; false: 已结束)*/
@JsonProperty("continue_flag")
private Boolean continueFlag;
/** 达人带货id列表 */
@JsonProperty("promoter_ids")
private List<String> promoterIds;
}