package com.cloudstore.eccom;

import com.alibaba.fastjson.JSONObject;
import com.weaver.base.msgcenter.channel.IMessageReceive;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import weaver.general.BaseBean;

import java.util.List;
import java.util.Map;

public class MessageReceiveTest implements IMessageReceive {
    public static Logger log = LoggerFactory.getLogger("Archives");
    private BaseBean bean=new BaseBean();
    @Override
    public void onMessage(String s) {
        log.error("onMessage:{}",s);
        bean.writeLog("onMessage:{}",s);
    }

    @Override
    public void onStart() {
        log.error("onStartExecute");
        bean.writeLog("onStartExecute");
    }

    @Override
    public void onEnd() {
        log.error("onEndExecute");
        bean.writeLog("onEndExecute");
    }

    @Override
    public void setProp(Map<String, String> map) {
        log.error("setProp:{}",map);
        bean.writeLog("setProp:{}"+map);
    }

    @Override
    public void setList(List<IMessageReceive> list) {
        log.error("setList:{}", JSONObject.toJSONString(list));
        bean.writeLog("setList:{}"+ JSONObject.toJSONString(list));
    }
}
