package org.wfc.system.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.wfc.common.core.web.controller.BaseController;
import org.wfc.common.core.web.domain.AjaxResult;
import org.wfc.common.core.web.page.TableDataInfo;
import org.wfc.system.service.ISysDashboardService;

/**
 * @description:
 * @author: cyc
 * @since: 2025-01-07
 */
@RestController
@RequestMapping("/dashboard")
public class SysDashboardController extends BaseController {

    @Autowired
    private ISysDashboardService sysDashboardService;


    @GetMapping("/page")
    public TableDataInfo page(@RequestParam(value = "searchKey", required = false) String searchKey, @RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize) {
        return sysDashboardService.getSiteList(searchKey, pageNum, pageSize);
    }

    @GetMapping("/overview")
    public AjaxResult overview() {
        return success(sysDashboardService.overview());
    }
}
