package com.ningdatech.pmapi.projectdeclared.controller;

import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO;
import com.ningdatech.pmapi.projectdeclared.model.req.PrequalificationDeclaredListReq;
import com.ningdatech.pmapi.projectdeclared.manage.PrequalificationDeclaredProjectManage;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.manage.ProjectLibManage;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @Classname PrequalificationDeclaredController
 * @Description 预审申报
 * @Date 2023/2/12 9:03
 * @Author PoffyZhang
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/api/v1/prequalification")
@Api(value = "Prequalification", tags = "申报管理-预审申报")
@RequiredArgsConstructor
public class PrequalificationDeclaredController {

    private final PrequalificationDeclaredProjectManage prequalificationDeclaredProjectManage;

    @ApiOperation(value = "可预审申报项目列表", notes = "可预审申报项目列表")
    @GetMapping("/list")
    public PageVo<ProjectLibListItemVO> list(@Validated @ModelAttribute PrequalificationDeclaredListReq preReq) {
        return prequalificationDeclaredProjectManage.projectLibList(preReq);
    }

    @ApiOperation(value = "申报预审", notes = "申报预审")
    @PostMapping("/start")
    public String startTheProcess(@Validated @RequestBody DefaultDeclaredDTO dto) {
        return prequalificationDeclaredProjectManage.startTheProcess(dto);
    }
}
