package com.sptg.estate.biz.controller;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.common.core.beans.ResultEnum;
import com.sptg.estate.api.dto.IntegratedServiceDto;
import com.sptg.estate.api.entity.IntegratedService;
import com.sptg.estate.api.feigns.IntegratedServiceFeign;
import com.sptg.estate.biz.service.IntegratedServiceInterface;
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: MemberController
 * package: com.sptg.estate.biz.consumer
 * description: 综合服务方 - 控制器
 *
 *               
 *                
 */
@RestController
@RequiredArgsConstructor
@RequestMapping(value = "/implement/integrated/service")
public class IntegratedServiceController implements IntegratedServiceFeign {

    private final IntegratedServiceInterface integratedServiceInterface;

    @Override
    @PostMapping(value = "/showList")
    public ResultBean<Page<IntegratedService>> showList(@RequestBody IntegratedServiceDto integratedServiceDto) {
        return this.integratedServiceInterface.showList(integratedServiceDto);
    }

    @Override
    @PostMapping(value = "/insert")
    public ResultBean<Boolean> insert(@RequestBody IntegratedService integratedService) {
        return new ResultBean<>(ResultEnum.SUCCESS,this.integratedServiceInterface.insert(integratedService));
    }

    @Override
    @PostMapping(value = "/findById")
    public IntegratedService findById(@RequestBody Long id) {
        return this.integratedServiceInterface.selectById(id);
    }

    @Override
    @PostMapping(value = "/editById")
    public ResultBean<Boolean> editById(@RequestBody IntegratedService integratedService) {
        return new ResultBean<>(ResultEnum.SUCCESS,this.integratedServiceInterface.updateById(integratedService));
    }
}
