Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加对话能力相关接口和单元测试(顾问,原导购) #2113

Merged
merged 2 commits into from
May 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
package me.chanjar.weixin.mp.api;

import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.bean.guide.*;

import java.util.List;

/**
* @author <a href="https://www.sacoc.cn">广州跨界-宋心成</a>
* @date 2021/5/13/013
*/
public interface WxMpGuideBuyerService {
/**
* 为顾问分配客户(批量)
*
* <pre>
* 请求地址: POST https://api.weixin.qq.com/cgi-bin/guide/addguidebuyerrelation?access_token=ACCESS_TOKEN
* 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Shopping_Guide/buyer-account/shopping-guide.addGuideBuyerRelation.html
* </pre>
*
* @param account 顾问微信号(guide_account和guide_openid二选一,若同时请求,默认为guide_account)
* @param openid 顾问openid或者unionid(guide_account和guide_openid二选一)
* @param infos 客户列表
* @return 客户列表添加结果
* @throws WxErrorException .
*/
List<WxMpGuideBuyerResp> addGuideBuyerRelation(String account, String openid, List<WxMpAddGuideBuyerInfo> infos) throws WxErrorException;

/**
* 为顾问分配客户(单个)
*
* @param account 顾问微信号(guide_account和guide_openid二选一,若同时请求,默认为guide_account)
* @param openid 顾问openid或者unionid(guide_account和guide_openid二选一)
* @param userOpenid 用户openid
* @param nickname 用户昵称
* @throws WxErrorException .
*/
void addGuideBuyerRelation(String account, String openid, String userOpenid, String nickname) throws WxErrorException;

/**
* 为顾问移除客户(批量)
*
* <pre>
* 请求地址: POST https://api.weixin.qq.com/cgi-bin/guide/delguidebuyerrelation?access_token=ACCESS_TOKEN
* 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Shopping_Guide/buyer-account/shopping-guide.delGuideBuyerRelation.html
* </pre>
*
* @param account 顾问微信号(guide_account和guide_openid二选一,若同时请求,默认为guide_account)
* @param openid 顾问openid或者unionid(guide_account和guide_openid二选一)
* @param buyerOpenIds 客户openid列表,不超过200
* @return 客户列表移除结果
*/
List<WxMpGuideBuyerResp> delGuideBuyerRelation(String account, String openid, List<String> buyerOpenIds) throws WxErrorException;

/**
* 为顾问移除客户(单个)
*
* @param account 顾问微信号(guide_account和guide_openid二选一,若同时请求,默认为guide_account)
* @param openid 顾问openid或者unionid(guide_account和guide_openid二选一)
* @param userOpenid 用户openid
* @throws WxErrorException .
*/
void delGuideBuyerRelation(String account, String openid, String userOpenid) throws WxErrorException;

/**
* 获取顾问的客户列表
*
* <pre>
* 请求地址: POST https://api.weixin.qq.com/cgi-bin/guide/getguidebuyerrelationlist?access_token=ACCESS_TOKEN
* 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Shopping_Guide/buyer-account/shopping-guide.getGuideBuyerRelationList.html
* </pre>
*
* @param account 顾问微信号(guide_account和guide_openid二选一,若同时请求,默认为guide_account)
* @param openid 顾问openid或者unionid(guide_account和guide_openid二选一)
* @param page 分页页数,从0开始,用于组内顾问分页获取
* @param num 每页数量
* @return 顾问的客户列表
* @throws WxErrorException .
*/
WxMpGuideBuyerInfoList getGuideBuyerRelationList(String account, String openid, int page, int num) throws WxErrorException;

/**
* 为客户更换顾问(批量)
*
* <pre>
* 请求地址: POST https://api.weixin.qq.com/cgi-bin/guide/rebindguideacctforbuyer?access_token=ACCESS_TOKEN
* 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Shopping_Guide/buyer-account/shopping-guide.rebindGuideAcctForBuyer.html
* </pre>
*
* @param oldAccount 原顾问微信号(old_guide_account和new_guide_account配套使用)
* @param oldOpenid 原顾问openid或者unionid(old_guide_openid和new_guide_openid配套使用)
* @param account 新顾问微信号(new_guide_account和new_guide_openid二选一)
* @param openid 新顾问openid或者unionid(new_guide_account和new_guide_openid二选一)
* @param buyerOpenIds 客户列表,不超过200
* @return 客户列表换绑结果
* @throws WxErrorException .
*/
List<WxMpGuideBuyerResp> rebindGuideAcctForBuyer(String oldAccount, String oldOpenid, String account, String openid, List<String> buyerOpenIds) throws WxErrorException;

/**
* 为客户更换顾问(单个)
*
* @param oldAccount 原顾问微信号(old_guide_account和new_guide_account配套使用)
* @param oldOpenid 原顾问openid或者unionid(old_guide_openid和new_guide_openid配套使用)
* @param account 新顾问微信号(new_guide_account和new_guide_openid二选一)
* @param openid 新顾问openid或者unionid(new_guide_account和new_guide_openid二选一)
* @param userOpenid 用户openid
* @throws WxErrorException 。
*/
void rebindGuideAcctForBuyer(String oldAccount, String oldOpenid, String account, String openid, String userOpenid) throws WxErrorException;

/**
* 修改客户昵称
*
* <pre>
* 请求地址: POST https://api.weixin.qq.com/cgi-bin/guide/updateguidebuyerrelation?access_token=ACCESS_TOKEN
* 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Shopping_Guide/buyer-account/shopping-guide.updateGuideBuyerRelation.html
* </pre>
*
* @param account 顾问微信号(guide_account和guide_openid二选一,若同时请求,默认为guide_account)
* @param openid 顾问openid或者unionid(guide_account和guide_openid二选一)
* @param userOpenid 客户openid
* @param nickname 客户昵称
* @throws WxErrorException .
*/
void updateGuideBuyerRelation(String account, String openid, String userOpenid, String nickname) throws WxErrorException;

/**
* 查询客户所属顾问
*
* <pre>
* 请求地址: POST https://api.weixin.qq.com/cgi-bin/guide/getguidebuyerrelationbybuyer?access_token=ACCESS_TOKEN
* 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Shopping_Guide/buyer-account/shopping-guide.getGuideBuyerRelationByBuyer.html
* </pre>
*
* @param openid 客户openid
* @return 客户顾问关系信息
* @throws WxErrorException .
*/
WxMpGuideBuyerRelation getGuideBuyerRelationByBuyer(String openid) throws WxErrorException;

/**
* 查询指定顾问和客户的关系
*
* <pre>
* 请求地址: POST https://api.weixin.qq.com/cgi-bin/guide/getguidebuyerrelation?access_token=ACCESS_TOKEN
* 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Shopping_Guide/buyer-account/shopping-guide.getGuideBuyerRelation.html
* </pre>
*
* @param account 顾问微信号(guide_account和guide_openid二选一,若同时请求,默认为guide_account)
* @param openid 顾问openid或者unionid(guide_account和guide_openid二选一)
* @param userOpenid 客户openid
* @return 客户信息
* @throws WxErrorException .
*/
WxMpGuideBuyerInfo getGuideBuyerRelation(String account, String openid, String userOpenid) throws WxErrorException;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
package me.chanjar.weixin.mp.api;

import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.mp.bean.guide.WxMpGuideMassed;
import me.chanjar.weixin.mp.bean.guide.WxMpGuideMassedInfo;
import me.chanjar.weixin.mp.bean.guide.WxMpGuideMaterialInfo;

import java.util.List;

/**
* @author <a href="https://www.sacoc.cn">广州跨界-宋心成</a>
* @date 2021/5/13/013
*/
public interface WxMpGuideMassedJobService {

/**
* 添加群发任务
*
* <pre>
* 请求地址: POST https://api.weixin.qq.com/cgi-bin/guide/addguidemassendjob?access_token=ACCESS_TOKEN
* 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Shopping_Guide/task-account/shopping-guide.addGuideMassendJob.html
* </pre>
*
* @param account 顾问微信号(guide_account和guide_openid二选一)
* @param openid 顾问openid或者unionid(guide_account和guide_openid二选一)
* @param taskName 群发任务名称,不超过16字
* @param taskRemark 群发任务备注,不超过100字
* @param pushTime 任务下发给顾问的时间, 秒级时间戳, 范围为当前时间开始到最近一个月内
* @param userOpenIds 客户openid列表
* @param materialInfos 不超过3个素材
* @return 群发任务id与客户openid列表
* @throws WxErrorException 。
*/
WxMpGuideMassed addGuideMassedJob(String account, String openid, String taskName, String taskRemark, Long pushTime, List<String> userOpenIds, List<WxMpGuideMaterialInfo> materialInfos) throws WxErrorException;

/**
* 获取群发任务列表
*
* <pre>
* 请求地址: POST https://api.weixin.qq.com/cgi-bin/guide/getguidemassendjoblist?access_token=ACCESS_TOKEN
* 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Shopping_Guide/task-account/shopping-guide.getGuideMassendJobList.html
* </pre>
*
* @param account 顾问微信号(guide_account和guide_openid二选一)
* @param openid 顾问openid或者unionid(guide_account和guide_openid二选一)
* @param taskStatus 获取指定状态的任务(为空则表示拉取所有状态的任务)
* @param offset 偏移位置(从什么位置开始拉取)
* @param limit 条数(默认50)
* @return 群发任务列表
* @throws WxErrorException 。
*/
List<WxMpGuideMassedInfo> getGuideMassedJobList(String account, String openid, List<Integer> taskStatus, Integer offset, Integer limit) throws WxErrorException;

/**
* 获取指定群发任务信息
*
* <pre>
* 请求地址: POST https://api.weixin.qq.com/cgi-bin/guide/getguidemassendjob?access_token=ACCESS_TOKEN
* 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Shopping_Guide/task-account/shopping-guide.getGuideMassendJob.html
* </pre>
*
* @param taskId 任务ID
* @return 群发任务信息
* @throws WxErrorException 。
*/
WxMpGuideMassedInfo getGuideMassedJob(String taskId) throws WxErrorException;

/**
* 修改群发任务
* 无法修改已经执行的任务,返回参数错误
*
* <pre>
* 请求地址: POST https://api.weixin.qq.com/cgi-bin/guide/updateguidemassendjob?access_token=ACCESS_TOKEN
* 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Shopping_Guide/task-account/shopping-guide.updateGuideMassendJob.html
* </pre>
*
* @param taskId 任务ID
* @param taskName 群发任务名称,不超过16字
* @param taskRemark 群发任务备注,不超过100字
* @param pushTime 下发时间, 秒级时间戳, 范围为当前时间开始到最近一个月内
* @param userOpenIds 客户openid列表
* @param materialInfos 不超过3个素材
* @throws WxErrorException 。
*/
void updateGuideMassedJob(String taskId, String taskName, String taskRemark, Long pushTime, List<String> userOpenIds, List<WxMpGuideMaterialInfo> materialInfos) throws WxErrorException;

/**
* 取消群发任务
* 取消给顾问分配的群发任务, 已执行的任务无法取消。
*
* <pre>
* 请求地址: POST https://api.weixin.qq.com/cgi-bin/guide/cancelguidemassendjob?access_token=ACCESS_TOKEN
* 文档地址:https://developers.weixin.qq.com/doc/offiaccount/Shopping_Guide/task-account/shopping-guide.cancelGuideMassendJob.html
* </pre>
*
* @param taskId 任务ID
* @throws WxErrorException .
*/
void cancelGuideMassedJob(String taskId) throws WxErrorException;
}
Loading