package com.ichangzuo.system.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ichangzuo.common.result.PageResult;
import com.ichangzuo.system.model.entity.Statistics;
import com.ichangzuo.system.model.query.StatisticsPageQuery;
import com.ichangzuo.system.service.impl.StatisticsServiceImpl;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/statistics")
@RequiredArgsConstructor
public class StatisticsController {
    private final StatisticsServiceImpl statisticsService;

    @Operation(summary = "分页列表")
    @GetMapping("/page")
    public PageResult<Statistics> pagedSoftware(StatisticsPageQuery queryParams ) {
        IPage<Statistics> result = statisticsService.page(queryParams);
        return PageResult.success(result);
    }
}
