package cn.reghao.devops.web.mgr.log.service;

import cn.reghao.devops.web.mgr.log.model.po.AccessLog;
import cn.reghao.devops.web.mgr.log.model.vo.AppLogVO;
import cn.reghao.devops.web.mgr.log.model.po.AppLog;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author reghao
 * @date 2023-10-23 14:36:52
 */
@Service
public class LogService {
    public void saveAppLog(cn.reghao.jutil.jdk.result.AppLog appLog) {
    }

    public List<AppLogVO> getAppLogs(String app, String host, String level) {
        //List<AppLog> list = appLogMongo.findByPage(app, host ,level);
        List<AppLog> list = new ArrayList<>();
        Collections.reverse(list);
        return list.stream().map(AppLogVO::new).collect(Collectors.toList());
    }

    public void saveAccessLog(AccessLog accessLog) {
    }
}
