package com.sptg.estate.biz.controller;

import com.sptg.common.core.beans.ResultBean;
import com.sptg.estate.api.entity.Contract;
import com.sptg.estate.api.entity.ProjectBook;
import com.sptg.estate.api.feigns.ContractFeign;
import com.sptg.estate.api.feigns.ProjectBookFeign;
import com.sptg.estate.biz.service.ProjectBookServiceInterface;
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/projectBook")
public class ProjectBookController implements ProjectBookFeign {

    private final ProjectBookServiceInterface projectBookServiceInterface;

    @Override
    @PostMapping(value = "/insertByResidentialId")
    public ResultBean<Boolean> insertByResidentialId(@RequestBody ProjectBook projectBook) {
        return this.projectBookServiceInterface.insertByResidentialId(projectBook);
    }

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

    @Override
    @PostMapping(value = "/editByProjectId")
    public ResultBean<Boolean> editByProjectId(@RequestBody ProjectBook projectBook) {
        return this.projectBookServiceInterface.editByProjectId(projectBook);
    }


}
