package com.dsk.system.searchService;

import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson2.JSONObject;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.utils.DskOpenApiUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @Author liujie
 * @ClassName MarketAnalysisServiceImpl
 * @Date 2023/5/15 16:40
 **/
@Service
public class MarketAnalysisService {

    @Autowired
    private DskOpenApiUtil dskOpenApiUtil;

    public AjaxResult areaGroupByProvince() {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/marketAnalysis/areaGroupByProvince", null);
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult certGroupByMajorAndLevel() {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/marketAnalysis/certGroupByMajorAndLevel", null);
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult certGroupByMajorProvinceLevel()  {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/marketAnalysis/certGroupByMajorProvinceLevel", null);
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult bidMoneyGroupByProjectType(JSONObject object) {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/marketAnalysis/bidMoneyGroupByProjectType", object);
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult bidGroupCountByProjectType(JSONObject object) {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/marketAnalysis/bidGroupCountByProjectType", object);
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult countGroupByProvince(JSONObject object) {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/marketAnalysis/countGroupByProvince", object);
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    public AjaxResult countGroupByMonth(JSONObject object) {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/marketAnalysis/countGroupByMonth", object);
        return BeanUtil.toBean(map, AjaxResult.class);
    }
}
