package com.dsk.web.controller.business;

import com.alibaba.fastjson2.JSONObject;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.utils.SecurityUtils;
import com.dsk.system.domain.business.dto.BusinessSearchDto;
import com.dsk.system.service.IBusinessOverviewService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 项目概览
 * @author lcl
 * @create 2023/8/14
 */
@Api("项目概览")
@RestController
@RequestMapping("/business/overview")
public class BusinessOverviewController extends BaseController {

    @Autowired
    private IBusinessOverviewService baseService;

    /**
     * 项目统计
     */
    @GetMapping("/statistics")
    public AjaxResult statistics(){
        return AjaxResult.success(baseService.statistics(new BusinessSearchDto(SecurityUtils.getUserId())));
    }

    /**
     * 公招项目地区统计
     * @return
     */
    @GetMapping("/countGroupByProvince")
    public AjaxResult countGroupByProvince(@RequestBody JSONObject object){
        return baseService.countGroupByProvince(object);
    }

    /**
     * 公招项目投资金额统计
     * @return
     */
    @GetMapping("/rangByMoney")
    public AjaxResult rangByMoney(@RequestBody JSONObject object){
        return baseService.rangByMoney(object);
    }
}
