class WxMaTemplateServiceImpl implements WxMaTemplateService {

  @Override
  public WxMaTemplateAddResult addTemplate(String id, List<Integer> keywordIdList) throws WxErrorException {

    Map<String, Object> params = new HashMap<>();
    params.put("id", id);
    params.put("keyword_id_list", keywordIdList.toArray());

    String responseText = this.wxMaService.post(TEMPLATE_ADD_URL, WxGsonBuilder.create().toJson(params));
    WxError wxError = WxError.fromJson(responseText);
    if (wxError.getErrorCode() == 0) {
      return WxMaTemplateAddResult.fromJson(responseText);
    } else {
      throw new WxErrorException(wxError);
    }
  }

  public  WxMaTemplateServiceImpl(WxMaService wxMaService);

}