package com.sptg.estate.biz.controller;

import com.sptg.common.core.beans.ResultBean;
import com.sptg.common.core.beans.ResultEnum;
import com.sptg.estate.api.entity.ProjectCompletion;
import com.sptg.estate.api.feigns.ProjectCompletionFeign;
import com.sptg.estate.biz.service.ProjectCompletionServiceInterface;
import lombok.RequiredArgsConstructor;
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;

/**
 * title: ProjectController
 * package: com.sptg.estate.biz.security
 * description: 物业验收 - 控制器
 *
 *               
 *                      
 */
@RestController
@RequiredArgsConstructor
@RequestMapping(value = "/implement/projectCompletion")
public class ProjectCompletionController implements ProjectCompletionFeign {

    private final ProjectCompletionServiceInterface projectCompletionServiceInterface;

    @Override
    @PostMapping(value = "/insert")
    public ResultBean<Boolean> insert(@RequestBody ProjectCompletion projectCompletion) {
        return this.projectCompletionServiceInterface.insertProjectCompletion(projectCompletion);
    }

    @Override
    @PostMapping(value = "/findByProjectId")
    public ResultBean<ProjectCompletion> findByProjectId(@RequestBody Long projectId) {
        return this.projectCompletionServiceInterface.findByProjectId(projectId);
    }

    @Override
    @PostMapping(value = "/countByProjectId")
    public ResultBean<Boolean> countByProjectId(@RequestBody Long projectId) {
        return this.projectCompletionServiceInterface.countByProjectId(projectId);
    }
}
