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.Contract;
import com.sptg.estate.api.feigns.ContractFeign;
import com.sptg.estate.biz.service.ContractServiceInterface;
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/contract")
public class ContractController implements ContractFeign {

    private final ContractServiceInterface contractServiceInterface;
    @Override
    @PostMapping(value = "/findByProjectId")
    public ResultBean<Contract> findByProjectId(@RequestBody Long projectId) {
        return this.contractServiceInterface.findByProjectId(projectId);
    }

    @Override
    @PostMapping(value = "/insertByResidentialId")
    public ResultBean<Boolean> insertByResidentialId(@RequestBody Contract contract) {
        return this.contractServiceInterface.insertByResidentialId(contract);
    }

    @Override
    @PostMapping(value = "/editByProjectId")
    public ResultBean<Boolean> editByProjectId(@RequestBody Contract contract) {
        return this.contractServiceInterface.editByProjectId(contract);
    }
}
