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

import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.dtos.SpecialBondInformationPageDto;
import com.dsk.common.dtos.SpecialPurposeBondsDto;
import com.dsk.common.dtos.SpecialPurposeBondsPageDto;
import com.dsk.system.service.SpecialPurposeBondsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName SpecialBondProjectsController
 * @Description 专项债项目
 * @Author Dgm
 * @Date 2023/5/18 10:09
 * @Version 1.0.0
 */
@RestController
@RequestMapping(value ="/specialPurposeBonds")
public class SpecialBondProjectsController {

    @Autowired
    private SpecialPurposeBondsService specialPurposeBondsService;

    /***
     *@Description: 专项债项目分页列表
     *@Param:
     *@return: com.dsk.common.core.domain.AjaxResult
     *@Author: Dgm
     *@date: 2023/5/18 10:29
     */
    @PostMapping("/projects/page")
    public AjaxResult page(@RequestBody SpecialPurposeBondsPageDto pageDto) {
        return specialPurposeBondsService.page(pageDto);
    }


    /***
     *@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") String id) {
        return specialPurposeBondsService.details(id);
    }


    /***
     *@Description: 专项债-项目类别统计
     *@Param:
     *@return: com.dsk.common.core.domain.AjaxResult
     *@Author: Dgm
     *@date: 2023/5/18 10:29
     */
    @PostMapping("/bond/statistics")
    public AjaxResult bondStatistics(@RequestBody SpecialPurposeBondsDto dto) {
        return specialPurposeBondsService.bondStatistics(dto);
    }


    /***
     *@Description: 专项债分页列表
     *@Param:
     *@return: com.dsk.common.core.domain.AjaxResult
     *@Author: Dgm
     *@date: 2023/5/18 10:29
     */
    @PostMapping("/bond/page")
    public AjaxResult bondPage(@RequestBody SpecialBondInformationPageDto dto) {
        return specialPurposeBondsService.bondPage(dto);
    }

}
