package com.uas.platform.b2b.support;

import com.uas.platform.b2b.core.util.ContextUtils;
import com.uas.platform.b2b.core.util.PathUtils;
import com.uas.platform.b2b.model.CommunalLog;
import com.uas.platform.b2b.service.CommunalLogService;
import com.uas.platform.core.logging.BufferedLogger;

/**
 * 平台的一些基本操作的日志，查询使用
 *
 * Created by hejq on 2017-12-12.
 */
public class CommBufferedLogger extends BufferedLogger<CommunalLog> {

    public CommBufferedLogger() {
        super(PathUtils.getFilePath(), CommunalLog.class, ContextUtils.getBean(CommunalLogService.class));
    }

    /**
     * 记录数据同步日志
     *
     * @param title
     *            消息标题
     * @param message
     *            消息
     */
    public void log(String title, String message, String detail, Long enUU) {
        log(new CommunalLog(title, message, detail, enUU));
    }

    /**
     * 用户修改信息同步日志记录
     *
     * @param title
     * @param message
     * @param detail
     * @param userUU
     * @param enUU
     */
    public void log(String title, String message, String detail, Long userUU, Long enUU) {
        log(new CommunalLog(title, message, detail, userUU, enUU));
    }
}
