package org.springblade.estate.feign;

import io.swagger.annotations.ApiParam;
import org.springblade.core.tool.api.R;
import org.springblade.estate.dto.AuthorizeRecordsDTO;
import org.springblade.estate.dto.UserAccessPermissionsDTO;
import org.springblade.estate.entity.UserAccessPermissions;
import org.springblade.estate.vo.UserAccessPermissionsVO;
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 javax.validation.Valid;
import java.util.List;

/**
 *  Feign
 *
 * @author lianghanqiang
 * @since 2022-01-07
 */
@FeignClient(value = "cyzh-estate",path = "/feign/useraccesspermissions")
public interface IUserAccessPermissionsClient  {

	/**
	 * 详情
	 */
	@GetMapping("/detail")
    UserAccessPermissionsVO detail(UserAccessPermissions userAccessPermissions);

	/**
	 * 查询
	 */
	@GetMapping("/list")
    List<UserAccessPermissionsVO> list(UserAccessPermissions userAccessPermissions);



	/**
	 * 新增
	 */
	@PostMapping("/save")
	boolean save(@Valid @RequestBody UserAccessPermissions userAccessPermissions);

	/**
	 * 修改
	 */
	@PostMapping("/update")
    boolean update(@Valid @RequestBody UserAccessPermissions userAccessPermissions);

	/**
	 * 新增或修改
	 */
	@PostMapping("/submit")
    boolean submit(@Valid @RequestBody UserAccessPermissions userAccessPermissions);


	/**
	 * 删除
	 */
	@PostMapping("/remove")
    boolean remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids);

	@PostMapping("/generateUserAccessPermissions")
	R generateUserAccessPermissions(@RequestBody AuthorizeRecordsDTO authorizeRecordsDTO);

	@PostMapping("/deleteUserAccessPermissions")
	R deleteUserAccessPermissions(@RequestBody AuthorizeRecordsDTO authorizeRecordsDTO);

	@GetMapping("/getUserIdsByUserType")
	List<Long> getUserIdsByUserType(@RequestParam String userType);

	@PostMapping("/pushFace")
	R pushFace(@RequestBody UserAccessPermissionsDTO userAccessPermissionsDTO);

	@PostMapping("/deleteFace")
	R deleteFace(@RequestParam(value = "userId") String userId, @RequestParam(value = "userType") String userType);

	@PostMapping("/getListByUserAndAddress")
	List<UserAccessPermissionsVO> getListByUserAndAddress(@RequestParam(value = "userId") String userId, @RequestParam(value = "userType") String userType,
										@RequestParam(value = "residentialId", required =  false) Long residentialId, @RequestParam(value = "unitId", required = false) Long unitId
										, @RequestParam(value = "permissions", required = false) Integer permissions);
}
