package com.sptg.estate.api.feigns;

import com.sptg.common.core.beans.ResultBean;
import com.sptg.estate.api.entity.MemberAndUser;
import com.sptg.estate.api.feigns.fallback.MemberAndUserFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * title: MemberFeign
 * package: com.sptg.estate.api.feigns
 * description::会员与住户-服务接口
 *
 *               
 *                
 */
@FeignClient(value= "smart-house-estate",fallbackFactory= MemberAndUserFeignFallbackFactory.class)
public interface MemberAndUserFeign {

    /**
     * 功能描述:根据条件查询会员与user的关系
     * @param memberAndUser
     * @return ResultBean<Member>
     *                
     *                      
     */
    @PostMapping(value = "/memberAndUser/getByCondition")
    List<MemberAndUser> getByCondition(MemberAndUser memberAndUser);

    /**
     * 功能描述:检测会员和住户是否存在关系
     * @param memberAndUser
     * @return ResultBean<Member>
     *                
     *                      
     */
    @PostMapping(value = "/memberAndUser/checkRelationship")
    ResultBean<Boolean> checkRelationship(MemberAndUser memberAndUser);

    @PostMapping(value = "/memberAndUser/addEntity")
    boolean addEntity(@RequestBody MemberAndUser memberAndUser);

    @GetMapping(value = "/getListByMemberId")
    List<MemberAndUser> getListByMemberId(@RequestParam(value = "memberId") Long memberId);

    @PostMapping(value = "/deleteMemberAndUser")
    boolean deleteMemberAndUser(@RequestBody MemberAndUser memberAndUser);
}
