package org.springblade.estate.feign;

import io.swagger.annotations.ApiParam;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.tool.api.R;
import org.springblade.estate.dto.ApplyUserDTO;
import org.springblade.estate.dto.ApplyUserPageDTO;
import org.springblade.estate.entity.ApplyUser;
import org.springblade.estate.vo.ApplyUserVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
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 javax.validation.Valid;
import java.util.List;

/**
 * 申请用户表---房屋成员 Feign
 *
 * @author lianghanqiang
 * @since 2021-04-23
 */
@FeignClient(value = "cyzh-estate", path = "/feign/applyuser")
public interface IApplyUserClient {

	/**
	 * 详情
	 */
	@GetMapping("/detail")
	ApplyUserVO detail(@SpringQueryMap ApplyUser applyUser);

	/**
	 * 详情
	 */
	@GetMapping("/getById")
	ApplyUser getById(@RequestParam Long id);

	/**
	 * 查询 申请用户表---房屋成员
	 */
	@GetMapping("/list")
	List<ApplyUserVO> list(@SpringQueryMap ApplyUser applyUser);

	@PostMapping("/page")
	BladePage<ApplyUserVO> page(@RequestBody ApplyUserDTO applyUserDTO);

	@PostMapping("/pageCondition")
	BladePage<ApplyUserVO> pageCondition(@RequestBody ApplyUserDTO applyUserDTO);

	@PostMapping("/authentication")
	boolean authentication(@RequestBody ApplyUser applyUser);

	@PostMapping("/addApplyUserForFamily")
	boolean addApplyUserForFamily(@RequestBody ApplyUser applyUser);

	@PostMapping("/appUpdateAuditStatus")
	R appUpdateAuditStatus(@RequestBody ApplyUserDTO applyUserDTO);


	/**
	 * 新增 申请用户表---房屋成员
	 */
	@PostMapping("/save")
	boolean save(@Valid @RequestBody ApplyUser applyUser);

	/**
	 * 修改 申请用户表---房屋成员
	 */
	@PostMapping("/update")
	boolean update(@Valid @RequestBody ApplyUser applyUser);

	/**
	 * 新增或修改 申请用户表---房屋成员
	 */
	@PostMapping("/submit")
	boolean submit(@Valid @RequestBody ApplyUser applyUser);


	/**
	 * 删除 申请用户表---房屋成员
	 */
	@PostMapping("/remove")
	boolean remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids);

	/**
	 * 根据memberId分页获取住户审核记录
	 */
	@PostMapping("/getAllApplyUserByMemberId")
	BladePage<ApplyUserVO> getAllApplyUserByCondition(@RequestBody ApplyUserDTO applyUserDTO);

	@PostMapping("/getByAuditStatus")
	List<ApplyUser> getByAuditStatus(@RequestBody ApplyUserDTO applyUserDTO);

	@PostMapping("/getListByMember")
	List<ApplyUser> getListByMember(@RequestParam(value = "memberId") Long memberId, @RequestParam(value = "residentialId") Long residentialId,
									@RequestParam(value = "roomId", required = false) Long roomId, @RequestParam(value = "auditStatus", required = false) Integer auditStatus);
	@PostMapping("/logout")
    Boolean logout(@RequestParam Long memberId);
}
