package com.sptg.estate.api.feigns;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.estate.api.dto.AgencyDto;
import com.sptg.estate.api.entity.Agency;
import com.sptg.estate.api.feigns.fallback.AgencyFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * Created By lidexi in 2021/1/8
 * 社区 服务接口
 **/
@FeignClient(value = "smart-house-estate", fallbackFactory = AgencyFeignFallbackFactory.class)
public interface AgencyFeign {

    /**
     * 功能描述:社区列表查询
     *
     * @param agencyDto 社区业务对象（含分页及查询条件）
     * @return ResultBean<Page < Agency>>
     */
    @PostMapping(value = "/agency/showAgencyList")
    ResultBean<Page<Agency>> showAgencyList(@RequestBody AgencyDto agencyDto);

    /**
     * 功能描述:新增社区
     *
     * @param agencyDto 社区业务对象
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/agency/addAgency")
    ResultBean<Agency> addAgency(@RequestBody AgencyDto agencyDto);

    /**
     * 功能描述:根据Id查找社区
     *
     * @param id 必填
     * @return Agency
     */
    @GetMapping(value = "/agency/findAgencyById/{id}")
    Agency findAgencyById(@PathVariable(value = "id") Long id);

    /**
     * 功能描述:编辑社区
     *
     * @param agencyDto 社区业务对象
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/agency/updateAgency")
    ResultBean<Boolean> updateAgency(@RequestBody AgencyDto agencyDto);

    /**
     * 功能描述:删除社区
     *
     * @param agencyDto 社区业务对象
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/agency/deleteAgency")
    ResultBean<Boolean> deleteAgency(@RequestBody AgencyDto agencyDto);


    /**
     * 功能描述:批量删除社区
     *
     * @param agencyDto 社区业务对象
     * @return ResultBean<Boolean>
     */
    @PostMapping(value = "/agency/deleteAgencyList")
    ResultBean<Boolean> deleteAgencyList(@RequestBody AgencyDto agencyDto);

    /**
     * 功能描述:根据位置查找社区
     *
     * @param agencyDto 社区业务对象
     * @return ResultBean<Agency>
     */
    @PostMapping(value = "/agency/findListByPosition")
    ResultBean<Agency> findListByPosition(@RequestBody AgencyDto agencyDto);


    @PostMapping(value = "agency/getListByCondition")
    List<Agency> getListByCondition(@RequestBody AgencyDto agencyDto);
}
