package cn.qinys.platform.upms.api.controller;

import cn.qinys.platform.base.response.Result;
import cn.qinys.platform.base.security.annotation.HasPermission;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import cn.qinys.platform.upms.api.req.GatewayLogPageReq;
import cn.qinys.platform.upms.api.resp.GatewayLogPageResp;
import cn.qinys.platform.upms.api.service.IGatewayService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description:
 *
 * @author tanlie
 * Date: 2024/4/26 17:21
 */
@AllArgsConstructor
@RestController
@RequestMapping("/upms/gateway")
public class GatewayController extends DevBaseController{

    private final IGatewayService gatewayService;


    /**
     * 网关日志分页
     *
     * @return
     */
    @HasPermission({"dev.gateway"})
    @GetMapping("/log/page")
    public Result<Page<GatewayLogPageResp>> queryDictionaries(GatewayLogPageReq req) {
        Page<GatewayLogPageResp> respPage = gatewayService.getPage(req);
        return new Result<>(respPage);
    }

}
