package com.lanyuanxiaoyao.service.web.controller;

import com.lanyuanxiaoyao.service.forest.service.InfoService;
import com.lanyuanxiaoyao.service.web.controller.base.AmisCrudResponse;
import com.lanyuanxiaoyao.service.web.controller.base.AmisResponse;
import com.lanyuanxiaoyao.service.web.controller.base.BaseController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 日志相关
 *
 * @author lanyuanxiaoyao
 * @date 2023-05-25
 */
@RestController
@RequestMapping("log")
public class LogController extends BaseController {
    private static final Logger logger = LoggerFactory.getLogger(LogController.class);

    private final InfoService infoService;

    @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
    public LogController(InfoService infoService) {
        this.infoService = infoService;
    }

    @GetMapping("query_sql_log")
    public AmisCrudResponse querySQLLog() {
        return AmisResponse.responseCrudData(infoService.sqlLogs());
    }
}
