@Test public void testSet() throws WxErrorException { final Integer agentId = this.wxCpService.getWxCpConfigStorage().getAgentId(); this.wxCpService.getAgentService().set(WxCpAgent.builder() .description("abcddd") .logoMediaId("aaaaaaaaaaaaaa") .agentId(agentId) .build()); }
@Override public void set(WxCpAgent agentInfo) throws WxErrorException { String url = "https: String responseContent = this.mainService.post(url, agentInfo.toJson()); JsonObject jsonObject = JSON_PARSER.parse(responseContent).getAsJsonObject(); if (jsonObject.get("errcode").getAsInt() != 0) { throw new WxErrorException(WxError.fromJson(responseContent)); } }
WxCpAgentServiceImpl implements WxCpAgentService { @Override public void set(WxCpAgent agentInfo) throws WxErrorException { String url = "https: String responseContent = this.mainService.post(url, agentInfo.toJson()); JsonObject jsonObject = JSON_PARSER.parse(responseContent).getAsJsonObject(); if (jsonObject.get("errcode").getAsInt() != 0) { throw new WxErrorException(WxError.fromJson(responseContent)); } } }
WxCpAgentServiceImpl implements WxCpAgentService { @Override public void set(WxCpAgent agentInfo) throws WxErrorException { String url = "https: String responseContent = this.mainService.post(url, agentInfo.toJson()); JsonObject jsonObject = JSON_PARSER.parse(responseContent).getAsJsonObject(); if (jsonObject.get("errcode").getAsInt() != 0) { throw new WxErrorException(WxError.fromJson(responseContent)); } } WxCpAgentServiceImpl(WxCpService mainService); }
WxCpAgentServiceImpl implements WxCpAgentService { @Override public void set(WxCpAgent agentInfo) throws WxErrorException { String url = "https: String responseContent = this.mainService.post(url, agentInfo.toJson()); JsonObject jsonObject = JSON_PARSER.parse(responseContent).getAsJsonObject(); if (jsonObject.get("errcode").getAsInt() != 0) { throw new WxErrorException(WxError.fromJson(responseContent)); } } WxCpAgentServiceImpl(WxCpService mainService); @Override WxCpAgent get(Integer agentId); @Override void set(WxCpAgent agentInfo); @Override List<WxCpAgent> list(); }
WxCpAgentServiceImpl implements WxCpAgentService { @Override public void set(WxCpAgent agentInfo) throws WxErrorException { String url = "https: String responseContent = this.mainService.post(url, agentInfo.toJson()); JsonObject jsonObject = JSON_PARSER.parse(responseContent).getAsJsonObject(); if (jsonObject.get("errcode").getAsInt() != 0) { throw new WxErrorException(WxError.fromJson(responseContent)); } } WxCpAgentServiceImpl(WxCpService mainService); @Override WxCpAgent get(Integer agentId); @Override void set(WxCpAgent agentInfo); @Override List<WxCpAgent> list();  }