package com.cnd3b.restcontroller.system.wechatmsg;

import com.cnd3b.common.Controller;
import com.cnd3b.utility.qywechat.base.Parameter;
import com.cnd3b.utility.qywechat.base.SendMsg;
import com.alibaba.fastjson.JSONObject;

public class WechatMsg extends Controller {

    public WechatMsg(JSONObject content) {
        super(content);
    }

    public String sendMsg() {
        String msg = content.getString("msg");
        String wechatid = content.getString("wechatid");
        try {
            Parameter.initParameter();
            SendMsg sendMsg = new SendMsg();
            sendMsg.TextMsg(new String[]{wechatid}, null, Parameter.appid_DRP, "0", msg);
        } catch (Exception e) {
            return getErrReturnObject().setErrMsg(e.getMessage()).toString();
        }
        return getSucReturnObject().toString();
    }
}
