package com.sptg.estate.api.feigns;

import com.sptg.common.core.beans.ResultBean;
import com.sptg.estate.api.dto.ThirdUserDto;
import com.sptg.estate.api.entity.ThirdUser;
import com.sptg.estate.api.feigns.fallback.ThirdUserFeignFallbackFactory;
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;

/**
 * title: UserFeign
 * package: com.sptg.estate.api.feigns
 * description: 住户 服务接口
 *
 *
 *
 */
@FeignClient(value = "smart-house-estate",fallbackFactory = ThirdUserFeignFallbackFactory.class)
public interface ThirdUserFeign {

    /**
     * 功能描述:新增房间元
     * @param userDto 住户业务对象
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/thirdUser/addUser")
    ResultBean<Boolean> addUser(@RequestBody ThirdUserDto userDto);

    /**
     * 根据Id 查找住户
     * @param id 必填
     * @return User
     *
     *
     */
    @GetMapping(value = "/thirdUser/findUserById/{id}")
    ThirdUser findUserById(@PathVariable(value = "id") Long id);

    /**
     * 功能描述:编辑住户
     * @param userDto 住户业务对象
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/thirdUser/updateUser")
    ResultBean<Boolean> updateUser(@RequestBody ThirdUserDto userDto);

    /**
     * 功能描述:删除住户
     * @param userDto 住户业务对象
     * @return ResultBean<Boolean>
     *
     *
     */
    @PostMapping(value = "/thirdUser/deleteUser")
    ResultBean<Boolean> deleteUser(@RequestBody ThirdUserDto userDto);



    @PostMapping(value = "/thirdUser/updateEntity")
    boolean updateEntity(@RequestBody ThirdUser user);


    @PostMapping(value = "/thirdUser/getListByCondition")
    List<ThirdUser> getListByCondition(@RequestBody ThirdUserDto dto);
}
