package com.project.zcustom.controller.service;


import com.project.zcustom.controller.core.AjaxResult;
import com.project.zcustom.controller.core.BaseController;
import com.project.zcustom.service.service.basics.IPlatBasicsCompanyService;
import com.project.zcustom.service.service.basics.IPlatBasicsServerService;
import com.project.zcustom.service.service.basics.IPlatBasicsService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 基础运行数据Controller
 *
 * @author change
 * @date 2024-10-21
 */

@RestController
@RequestMapping("/large/basics")
@RequiredArgsConstructor(onConstructor_ = @Autowired)
public class PlatBasicsController extends BaseController {

    private final IPlatBasicsService platBasicsService;
    private final IPlatBasicsCompanyService platBasicsCompanyService;
    private final IPlatBasicsServerService platBasicsServerService;



    @RequestMapping("/getOverviewData")
    public AjaxResult getOverviewData(@RequestParam String appOrg) {
        return AjaxResult.success("查询成功", platBasicsService.getOverviewData(appOrg));
    }


    @RequestMapping("/getTopTenCompany")
    public AjaxResult getTopTenCompany(@RequestParam String appOrg) {
        return AjaxResult.success("查询成功", platBasicsCompanyService.getTopTenCompany(appOrg));
    }



    @RequestMapping("/getServerListData")
    public AjaxResult getServerListData(@RequestParam String appOrg) {
        return AjaxResult.success("查询成功", platBasicsServerService.selectServerListByAppOrg(appOrg));
    }

}
