/**
 * 
 */
package org.springblade.system.client;

import java.util.List;

import org.springblade.common.openfeign.OpenFeignConstants;
import org.springblade.system.client.factory.DataPermClientFallbackFactory;
import org.springblade.system.client.model.DataPermModel;
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.RequestParam;

/**
 * @author wookvn
 *
 *	权限组
 */
//@RequestMapping(OpenFeignConstants.SYSTEM_SERVICE + "/dataPerm")
@FeignClient(contextId = "dataPermClient", 
	value = OpenFeignConstants.SYSTEM_SERVICE, 
	fallbackFactory = DataPermClientFallbackFactory.class)
public interface DataPermClient {

	/**
	 * 根据ID查询
	 * @param id
	 * @return
	 */
	@GetMapping(OpenFeignConstants.SYSTEM_SERVICE + "/dataPerm/info/{id}")
	public DataPermModel getById(@PathVariable Integer id);
	
	/**
	 * 根据ID列表查询
	 * @param ids
	 * @return
	 */
	@GetMapping(OpenFeignConstants.SYSTEM_SERVICE + "/dataPerm/listByIds")
	public List<DataPermModel> listByIds(@RequestParam List<Integer> ids);
	
	/**
	 * 校验是否拥有超级权限组权限
	 * @param userId
	 * @return
	 */
	@GetMapping(OpenFeignConstants.SYSTEM_SERVICE + "/dataPerm/checkSuperPerm/{userId}")
	public Boolean checkSuperPermission(@PathVariable Long userId);
}
