package com.dsk.web.controller.search.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson2.JSONObject;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.dtos.ComposeQueryDto;
import com.dsk.common.utils.DskOpenApiUtil;
import com.dsk.web.controller.search.service.BusinessOpportunityRadarService;
import com.dsk.web.controller.search.service.MarketAnalysisService;
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 BusinessOpportunityRadarServiceImpl implements BusinessOpportunityRadarService {

    @Autowired
    private DskOpenApiUtil dskOpenApiUtil;


    @Override
    public AjaxResult jskBidNewsPage(ComposeQueryDto compose) {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/api/nationzj/jskBid/news/page", BeanUtil.beanToMap(compose, false, false));
        return BeanUtil.toBean(map, AjaxResult.class);
    }


    @Override
    public AjaxResult jskBidTenderPage(ComposeQueryDto compose) {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/api/nationzj/jskBidTender/page", BeanUtil.beanToMap(compose, false, false));
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    @Override
    public AjaxResult establishmentPage(ComposeQueryDto compose) {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/api/nationzj/establishment/page", BeanUtil.beanToMap(compose, false, false));
        return BeanUtil.toBean(map, AjaxResult.class);
    }

    @Override
    public AjaxResult landMarketPage(ComposeQueryDto compose) {
        Map<String, Object> map = dskOpenApiUtil.requestBody("/api/nationzj/landMarket/page", BeanUtil.beanToMap(compose, false, false));
        return BeanUtil.toBean(map, AjaxResult.class);
    }
}
