package com.wechat.callback.processors;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.wechat.callback.passiveresponses.TextResponse;
import com.wechat.callback.tencentrequests.events.ClickEventRequest;
import com.wechat.common.CommonHelper;
import com.wechat.global.message.InfoMsg;

// 按钮事件处理类
@Component
public class ClickEventProcessor {

    @Autowired
    CommonHelper               helper;

    

    protected static final Log log = LogFactory.getLog(ClickEventProcessor.class);

    //账户绑定
    public TextResponse getAccountBinding(ClickEventRequest req) {
        TextResponse rsp = new TextResponse();
        try {
            //用户OpenID
            String openID = req.getFromUserName();

            rsp.setContent(openID);
        }
        catch (Exception e) {
            log.equals(e);
            //系统异常
            rsp.setContent(InfoMsg.ERROR_SYSTEM_ERROR.getMsg());
        }
        return rsp;
    }

   

}
