package com.tofly.base.api.feign.fallback;

import com.tofly.base.api.entity.Log;
import com.tofly.base.api.feign.BaseEsLogService;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.springframework.stereotype.Component;

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

/**
 * @author Administrator
 * @date 2019/9/3  15:01
 */
@Slf4j
@Component
public class BaseEsLogServiceFallbackImpl implements BaseEsLogService {

    private static final Logger logs = org.slf4j.LoggerFactory.getLogger(BaseEsLogServiceFallbackImpl.class);

    @Setter
    private Throwable throwable;

    @Override
    public boolean saveLog(Log log) {
        logs.error("插入日志失败,{},{}",log,throwable);
        return false;
    }

    @Override
    public List queryLog(Map map) {
        logs.error("查询日志失败,{},{}",map,throwable);
        return null;
    }
}
