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.PositionRecord;
import com.sptg.estate.api.feigns.PositionRecordFeign;
import com.sptg.estate.biz.service.PositionRecordServiceInterface;
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: DeviceInstallationController
 * package: com.sptg.estate.biz.service
 * description: 环境评审 - 控制器
 *
 *               
 *                      
 */
@RestController
@RequiredArgsConstructor
@RequestMapping(value = "/implement/position/record")
public class PositionRecordController implements PositionRecordFeign {

    private final PositionRecordServiceInterface positionRecordServiceInterface;


    @Override
    @PostMapping("/getListByPositionId")
    public ResultBean<PositionRecord> getListByPositionId(@RequestBody Long positionId){
        return new ResultBean<>(ResultEnum.SUCCESS,this.positionRecordServiceInterface.getListByPositionId(positionId));
    }

    @Override
    @PostMapping("/findById")
    public ResultBean<PositionRecord> findById(@RequestBody Long id) {
        return new ResultBean<>(ResultEnum.SUCCESS,this.positionRecordServiceInterface.selectById(id));
    }
}
