package com.zhongshu.card.server.core.controller.openAPI;

import com.zhongshu.opengateway.client.model.param.AccessRecordSearchParam;
import com.zhongshu.opengateway.client.model.ret.ResultContent;
import com.zhongshu.opengateway.client.service.AccessRecordService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/openApi/accessRecord")
@Tag(name = "OpenApi--访问日志")
public class AccessRecordController {

    @Autowired
    AccessRecordService accessRecordService;

    @Operation(summary = "分页查询App下openApi", description = "分页查询App下openApi")
//    @ResourceAuth(value = AuthConstant.SuperAdmin, type = AuthType.Platform, remark = "")
//    @ResourceAuth(value = "openapi", type = AuthType.Project, remark = "")
    @RequestMapping(value = "pageByApp", method = RequestMethod.POST)
    public ResultContent pageByApp(AccessRecordSearchParam param) {
        param.setPage(param.getPage());
        param.setSize(param.getSize());
        return accessRecordService.page(param);
    }

}
