|
10 | 10 | import me.chanjar.weixin.cp.api.WxCpService;
|
11 | 11 | import me.chanjar.weixin.cp.bean.WxCpBaseResp;
|
12 | 12 | import me.chanjar.weixin.cp.bean.kf.*;
|
| 13 | +import me.chanjar.weixin.cp.bean.kf.WxCpKfAccountAdd; |
| 14 | +import me.chanjar.weixin.cp.bean.kf.WxCpKfAccountAddResp; |
| 15 | +import me.chanjar.weixin.cp.bean.kf.WxCpKfAccountDel; |
| 16 | +import me.chanjar.weixin.cp.bean.kf.WxCpKfAccountLink; |
| 17 | +import me.chanjar.weixin.cp.bean.kf.WxCpKfAccountLinkResp; |
| 18 | +import me.chanjar.weixin.cp.bean.kf.WxCpKfAccountListResp; |
| 19 | +import me.chanjar.weixin.cp.bean.kf.WxCpKfAccountUpd; |
| 20 | +import me.chanjar.weixin.cp.bean.kf.WxCpKfCustomerBatchGetResp; |
| 21 | +import me.chanjar.weixin.cp.bean.kf.WxCpKfMsgListResp; |
| 22 | +import me.chanjar.weixin.cp.bean.kf.WxCpKfMsgSendRequest; |
| 23 | +import me.chanjar.weixin.cp.bean.kf.WxCpKfMsgSendResp; |
| 24 | +import me.chanjar.weixin.cp.bean.kf.WxCpKfServiceStateResp; |
| 25 | +import me.chanjar.weixin.cp.bean.kf.WxCpKfServiceStateTransResp; |
| 26 | +import me.chanjar.weixin.cp.bean.kf.WxCpKfServiceUpgradeConfigResp; |
| 27 | +import me.chanjar.weixin.cp.bean.kf.WxCpKfServicerListResp; |
| 28 | +import me.chanjar.weixin.cp.bean.kf.WxCpKfServicerOpResp; |
13 | 29 | import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
|
14 | 30 |
|
15 | 31 | import java.util.List;
|
@@ -182,6 +198,63 @@ public WxCpKfCustomerBatchGetResp customerBatchGet(List<String> externalUserIdLi
|
182 | 198 | return WxCpKfCustomerBatchGetResp.fromJson(responseContent);
|
183 | 199 | }
|
184 | 200 |
|
| 201 | + @Override |
| 202 | + public WxCpKfServiceUpgradeConfigResp getUpgradeServiceConfig() throws WxErrorException { |
| 203 | + String url = cpService.getWxCpConfigStorage().getApiUrl(CUSTOMER_GET_UPGRADE_SERVICE_CONFIG); |
| 204 | + |
| 205 | + String response = cpService.get(url, null); |
| 206 | + return WxCpKfServiceUpgradeConfigResp.fromJson(response); |
| 207 | + } |
| 208 | + |
| 209 | + @Override |
| 210 | + public WxCpBaseResp upgradeMemberService(String openKfid, String externalUserId, |
| 211 | + String userid, String wording) throws WxErrorException { |
| 212 | + String url = cpService.getWxCpConfigStorage().getApiUrl(CUSTOMER_UPGRADE_SERVICE); |
| 213 | + |
| 214 | + JsonObject json = new JsonObject(); |
| 215 | + json.addProperty("open_kfid", openKfid); |
| 216 | + json.addProperty("external_userid", externalUserId); |
| 217 | + json.addProperty("type", 1); |
| 218 | + |
| 219 | + JsonObject memberJson = new JsonObject(); |
| 220 | + memberJson.addProperty("userid", userid); |
| 221 | + memberJson.addProperty("wording", wording); |
| 222 | + json.add("member", memberJson); |
| 223 | + |
| 224 | + String response = cpService.post(url, json); |
| 225 | + return WxCpBaseResp.fromJson(response); |
| 226 | + } |
| 227 | + |
| 228 | + @Override |
| 229 | + public WxCpBaseResp upgradeGroupchatService(String openKfid, String externalUserId, |
| 230 | + String chatId, String wording) throws WxErrorException { |
| 231 | + String url = cpService.getWxCpConfigStorage().getApiUrl(CUSTOMER_UPGRADE_SERVICE); |
| 232 | + |
| 233 | + JsonObject json = new JsonObject(); |
| 234 | + json.addProperty("open_kfid", openKfid); |
| 235 | + json.addProperty("external_userid", externalUserId); |
| 236 | + json.addProperty("type", 2); |
| 237 | + |
| 238 | + JsonObject groupchatJson = new JsonObject(); |
| 239 | + groupchatJson.addProperty("chat_id", chatId); |
| 240 | + groupchatJson.addProperty("wording", wording); |
| 241 | + json.add("groupchat", groupchatJson); |
| 242 | + |
| 243 | + String response = cpService.post(url, json); |
| 244 | + return WxCpBaseResp.fromJson(response); |
| 245 | + } |
| 246 | + |
| 247 | + @Override |
| 248 | + public WxCpBaseResp cancelUpgradeService(String openKfid, String externalUserId) |
| 249 | + throws WxErrorException { |
| 250 | + String url = cpService.getWxCpConfigStorage().getApiUrl(CUSTOMER_CANCEL_UPGRADE_SERVICE); |
| 251 | + |
| 252 | + JsonObject json = new JsonObject(); |
| 253 | + json.addProperty("open_kfid", openKfid); |
| 254 | + json.addProperty("external_userid", externalUserId); |
| 255 | + String response = cpService.post(url, json); |
| 256 | + return WxCpBaseResp.fromJson(response); |
| 257 | + } |
185 | 258 | @Override
|
186 | 259 | public WxCpKfGetCorpStatisticResp getCorpStatistic(WxCpKfGetCorpStatisticRequest request) throws WxErrorException {
|
187 | 260 | String url = cpService.getWxCpConfigStorage().getApiUrl(GET_CORP_STATISTIC);
|
|
0 commit comments