package com.dsk.jsk.controller;

import com.dsk.common.core.domain.AjaxResult;
import com.dsk.jsk.domain.*;
import com.dsk.jsk.service.service.SpecialPurposeBondsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @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
     */
    @PostMapping("/details")
    public AjaxResult details(@RequestBody @Valid SpecialBondInformationDetailsDto detailsDto) {
        return specialPurposeBondsService.details(detailsDto);
    }


    /***
     *@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);
    }

}
