package com.ningdatech.pmapi.projectdeclared.controller;

import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.projectdeclared.manage.OperationManage;
import com.ningdatech.pmapi.projectdeclared.model.dto.OperationDTO;
import com.ningdatech.pmapi.projectdeclared.model.vo.OperationVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @Classname OperationController
 * @Description 申报项目-实施
 * @Date 2023/7/31 09:29
 * @Author PoffyZhang
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/api/v1/declared/operation")
@Api(value = "OperationController", tags = "申报管理-实施")
@RequiredArgsConstructor
public class OperationController {
    private final OperationManage operationManage;

    @ApiOperation(value = "实施详情", notes = "实施详情")
    @GetMapping("/detail/{projectId}")
    public OperationVO detail(@PathVariable Long projectId) {
        return operationManage.detail(projectId);
    }

    @PostMapping("/push-operation")
    @ApiOperation("填写实施计划")
    @WebLog("填写实施计划")
    public String pushOperation(@RequestBody OperationDTO operation) {
        return operationManage.pushOperation(operation);
    }

}
