class SmsYunPianClient implements SmsClient {

    @Override
    public SendResult singleSend(String mobile, String sign, String templateCode, String template, Map<String, String> templateParams) {
        // build 模板
        template = buildTemplate(sign, template, templateParams);

        // 请求参数
        Map<String, String> params = new LinkedHashMap<>();
        params.put("apikey", apiKey);
        params.put("mobile", mobile);
        params.put("text", template);
        // TODO: 2019/5/19 sin 运营商发送报告 回调
        // params.put("callback_url", template);
        String result = post(URL_SEND_SINGLE, params);
        JSONObject jsonObject = JSON.parseObject(result);
        if (jsonObject.containsKey("code")
                && !(jsonObject.getInteger("code") == SUCCESS_CODE)) {
            throw new ServiceException(AdminErrorCodeEnum.SMS_PLATFORM_FAIL.getCode(),
                    jsonObject.getString("detail"));
        }

        return new SendResult()
                .setIsSuccess(SUCCESS_CODE == jsonObject.getInteger("code"))
                .setCode(jsonObject.getInteger("code"))
                .setMessage(jsonObject.getString("detail"));
    }

}