package com.hzya.frame.plugin.sysMessageManageLogBack.plugin;

import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 消息管理日志(SysMessageManageLog)表服务接口
 *
 * @author makejava
 * @since 2024-03-08 10:22:00
 */
public class SysMessageManageLogPluginInitializer extends PluginBaseEntity {
    Logger logger = LoggerFactory.getLogger(SysMessageManageLogPluginInitializer.class);

      @Override
    public void initialize() {
        logger.info(getPluginLabel() + "執行初始化方法initialize()");
    }

    @Override
    public void destroy() {
        logger.info(getPluginLabel() + "執行銷毀方法destroy()");
    }

    @Override
    public String getPluginId() {
        return "SysMessageManageLogPlugin";
    }

    @Override
    public String getPluginName() {
        return "ESB消息日志备份";
    }

    @Override
    public String getPluginLabel() {
        return "ESB消息日志备份";
    }
    @Override
    public String getPluginType() {
        return "1";
    }

    @Override
    public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
        try {
            logger.info("执行成功");
            return BaseResult.getSuccessMessageEntity("执行成功");
        }catch (Exception e){
            e.printStackTrace();
        }
        return BaseResult.getSuccessMessageEntity("执行成功");
    }

}
