package com.tzy.s.wx.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.tzy.s.wx.dto.Result;
import com.tzy.s.wx.service.WxMessageApi;
import org.apache.commons.lang.StringUtils;

public class WxMessageApiImpl implements WxMessageApi {

    /**
     *
     * @param accesstoken
     * @param message
     * @return
     */
    @Override
    public Result sendTemplateMsaasge(String accesstoken, JSONObject message){
        if(StringUtils.isEmpty(accesstoken))return Result.error(-1,"token不能爲空");
        if(null == message || message.isEmpty())return Result.error(-1,"message不能爲空");
        return SendTemplateMessage.sendMessage(accesstoken, message);
    }

}
