package com.dsk.web.controller.search.macroMarket;

import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.dtos.OpRegionalEconomicDataRegionalListDto;
import com.dsk.common.dtos.OpRegionalEconomicDataStatisticsRegionalDto;
import com.dsk.common.dtos.OpRegionalEconomicDataV1PageDto;
import com.dsk.system.service.EconomicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;


/**
 * @ClassName RegionalEconomicDataController
 * @Description 区域经济大全
 * @Author Dgm
 * @Date 2023/5/18 10:09
 * @Version 1.0.0
 */
@RestController
@RequestMapping(value ="/economic")
public class RegionalEconomicDataController {

    @Autowired
    private EconomicService economicService;

    /***
     *@Description: 全国经济大全分页列表
     *@Param:
     *@return: com.dsk.common.core.domain.AjaxResult
     *@Author: Dgm
     *@date: 2023/5/18 10:29
     */
    @PostMapping("/national/nationalPage")
    public AjaxResult nationalPage(@RequestBody @Valid OpRegionalEconomicDataV1PageDto dto) {
        return economicService.nationalPage(dto);
    }

    /***
     *@Description: 获取年份
     *@Param:
     *@return: com.dsk.acc.security.common.msg.RestResponse
     *@Author: Dgm
     *@date: 2023/5/18 10:29
     */
    @GetMapping("/years/list")
    public AjaxResult yearsList() {
        return economicService.yearsList();
    }


    /***
     *@Description: 全国经济大全详情
     *@Param:
     *@return: com.dsk.common.core.domain.AjaxResult
     *@Author: Dgm
     *@date: 2023/5/18 10:29
     */
    @GetMapping("/details/{id}")
    public AjaxResult details(@PathVariable("id") Integer id) {
        return economicService.details(id);
    }


    /***
     *@Description: 地区经济-统计
     *@Param:
     *@return: com.dsk.common.core.domain.AjaxResult
     *@Author: Dgm
     *@date: 2023/5/18 10:29
     */
    @PostMapping("/statistics/regional")
    public AjaxResult statisticsRegional(@RequestBody OpRegionalEconomicDataStatisticsRegionalDto dto) {
        return economicService.statisticsRegional(dto);
    }

    /***
     *@Description: 地区经济-主要指标列表
     *@Param:
     *@return: com.dsk.common.core.domain.AjaxResult
     *@Author: Dgm
     *@date: 2023/5/18 10:29
     */
    @PostMapping("/regional/list")
    public AjaxResult regionalList(@RequestBody OpRegionalEconomicDataRegionalListDto dto) {
        return economicService.regionalList(dto);
    }


}
