@Test public void testChatUpdate() throws Exception { this.cpService.getChatService().chatUpdate(chatId, "", "", Arrays.asList("ZhengWuYao"), null); WxCpChat chat = this.cpService.getChatService().chatGet(chatId); System.out.println(chat); Assert.assertEquals(chat.getUsers().size(), 3); }
@Override public void chatUpdate(String chatId, String name, String owner, List<String> usersToAdd, List<String> usersToDelete) throws WxErrorException { Map<String, Object> data = new HashMap<>(5); if (StringUtils.isNotBlank(chatId)) { data.put("chatid", chatId); } if (StringUtils.isNotBlank(name)) { data.put("name", name); } if (StringUtils.isNotBlank(owner)) { data.put("owner", owner); } if (usersToAdd != null && !usersToAdd.isEmpty()) { data.put("add_user_list", usersToAdd); } if (usersToDelete != null && !usersToDelete.isEmpty()) { data.put("del_user_list", usersToDelete); } this.cpService.post(APPCHAT_UPDATE, WxGsonBuilder.create().toJson(data)); }
WxCpChatServiceImpl implements WxCpChatService { @Override public void chatUpdate(String chatId, String name, String owner, List<String> usersToAdd, List<String> usersToDelete) throws WxErrorException { Map<String, Object> data = new HashMap<>(5); if (StringUtils.isNotBlank(chatId)) { data.put("chatid", chatId); } if (StringUtils.isNotBlank(name)) { data.put("name", name); } if (StringUtils.isNotBlank(owner)) { data.put("owner", owner); } if (usersToAdd != null && !usersToAdd.isEmpty()) { data.put("add_user_list", usersToAdd); } if (usersToDelete != null && !usersToDelete.isEmpty()) { data.put("del_user_list", usersToDelete); } this.cpService.post(APPCHAT_UPDATE, WxGsonBuilder.create().toJson(data)); } }
WxCpChatServiceImpl implements WxCpChatService { @Override public void chatUpdate(String chatId, String name, String owner, List<String> usersToAdd, List<String> usersToDelete) throws WxErrorException { Map<String, Object> data = new HashMap<>(5); if (StringUtils.isNotBlank(chatId)) { data.put("chatid", chatId); } if (StringUtils.isNotBlank(name)) { data.put("name", name); } if (StringUtils.isNotBlank(owner)) { data.put("owner", owner); } if (usersToAdd != null && !usersToAdd.isEmpty()) { data.put("add_user_list", usersToAdd); } if (usersToDelete != null && !usersToDelete.isEmpty()) { data.put("del_user_list", usersToDelete); } this.cpService.post(APPCHAT_UPDATE, WxGsonBuilder.create().toJson(data)); } WxCpChatServiceImpl(WxCpService cpService); }
WxCpChatServiceImpl implements WxCpChatService { @Override public void chatUpdate(String chatId, String name, String owner, List<String> usersToAdd, List<String> usersToDelete) throws WxErrorException { Map<String, Object> data = new HashMap<>(5); if (StringUtils.isNotBlank(chatId)) { data.put("chatid", chatId); } if (StringUtils.isNotBlank(name)) { data.put("name", name); } if (StringUtils.isNotBlank(owner)) { data.put("owner", owner); } if (usersToAdd != null && !usersToAdd.isEmpty()) { data.put("add_user_list", usersToAdd); } if (usersToDelete != null && !usersToDelete.isEmpty()) { data.put("del_user_list", usersToDelete); } this.cpService.post(APPCHAT_UPDATE, WxGsonBuilder.create().toJson(data)); } WxCpChatServiceImpl(WxCpService cpService); @Override String chatCreate(String name, String owner, List<String> users, String chatId); @Override String create(String name, String owner, List<String> users, String chatId); @Override void chatUpdate(String chatId, String name, String owner, List<String> usersToAdd, List<String> usersToDelete); @Override void update(String chatId, String name, String owner, List<String> usersToAdd, List<String> usersToDelete); @Override WxCpChat chatGet(String chatId); @Override WxCpChat get(String chatId); @Override void sendMsg(WxCpAppChatMessage message); }
WxCpChatServiceImpl implements WxCpChatService { @Override public void chatUpdate(String chatId, String name, String owner, List<String> usersToAdd, List<String> usersToDelete) throws WxErrorException { Map<String, Object> data = new HashMap<>(5); if (StringUtils.isNotBlank(chatId)) { data.put("chatid", chatId); } if (StringUtils.isNotBlank(name)) { data.put("name", name); } if (StringUtils.isNotBlank(owner)) { data.put("owner", owner); } if (usersToAdd != null && !usersToAdd.isEmpty()) { data.put("add_user_list", usersToAdd); } if (usersToDelete != null && !usersToDelete.isEmpty()) { data.put("del_user_list", usersToDelete); } this.cpService.post(APPCHAT_UPDATE, WxGsonBuilder.create().toJson(data)); } WxCpChatServiceImpl(WxCpService cpService); @Override String chatCreate(String name, String owner, List<String> users, String chatId); @Override String create(String name, String owner, List<String> users, String chatId); @Override void chatUpdate(String chatId, String name, String owner, List<String> usersToAdd, List<String> usersToDelete); @Override void update(String chatId, String name, String owner, List<String> usersToAdd, List<String> usersToDelete); @Override WxCpChat chatGet(String chatId); @Override WxCpChat get(String chatId); @Override void sendMsg(WxCpAppChatMessage message);  }