package com.wms_main.controller.wms;

import com.wms_main.model.dto.query.SysApiQuery;
import com.wms_main.model.dto.query.SysLogQuery;
import com.wms_main.model.dto.response.wms.WmsApiResponse;
import com.wms_main.model.vo.wms.PageVo;
import com.wms_main.model.vo.wms.SysApiVo;
import com.wms_main.model.vo.wms.SysLogVo;
import com.wms_main.service.controller.ILogControllerService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * 日志控制类
 */
@RestController
@ResponseBody
@CrossOrigin
@RequiredArgsConstructor
@RequestMapping("/wms/log")
public class LogController {
    private final ILogControllerService logControllerService;

    /**
     * 查询接口接收日志
     * @param logQuery 查询参数
     * @return 查询结果
     */
    @PostMapping("/queryLogsByPage")
    public WmsApiResponse<PageVo<SysLogVo>> queryLogsByPage(@RequestBody SysLogQuery logQuery) {
        return logControllerService.queryLogsByPage(logQuery);
    }

    /**
     * 查询接口发送日志
     * @param apiQuery 查询参数
     * @return 查询结果
     */
    @PostMapping("/queryApisByPage")
    public WmsApiResponse<PageVo<SysApiVo>> queryApisByPage(@RequestBody SysApiQuery apiQuery) {
        return logControllerService.queryApisByPage(apiQuery);
    }
}
