class WxMpAiOpenServiceImpl implements WxMpAiOpenService {

  @Override
  public String translate(AiLangType langFrom, AiLangType langTo, String content) throws WxErrorException {
    final String responseContent = this.wxMpService.post(String.format(TRANSLATE_URL, langFrom.getCode(), langTo.getCode()),
      content);
    final JsonObject jsonObject = new JsonParser().parse(responseContent).getAsJsonObject();
    if (jsonObject.get("errcode") == null || jsonObject.get("errcode").getAsInt() == 0) {
      return jsonObject.get("to_content").getAsString();
    }

    throw new WxErrorException(WxError.fromJson(responseContent, WxType.MP));
  }

  public  WxMpAiOpenServiceImpl(WxMpService wxMpService);

}