package com.yuchen.saas.manage.scope.api.feign;

import org.nest.springwrap.core.datascope.model.DataScopeModel;
import org.nest.springwrap.core.launch.app.AppNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@FeignClient(
	value = AppNameConstant.SAAS_SYSTEM,
	fallback = IDataScopeClientFallback.class
)
public interface IDataScopeClient {

	String API_PREFIX = "/client/data-scope";
	String GET_DATA_SCOPE_BY_MAPPER = API_PREFIX + "/by-mapper";
	String GET_DATA_SCOPE_BY_CODE = API_PREFIX + "/by-code";
	String GET_DEPT_ANCESTORS = API_PREFIX + "/dept-ancestors";

	
	@GetMapping(GET_DATA_SCOPE_BY_MAPPER)
    DataScopeModel getDataScopeByMapper(@RequestParam("mapperId") String mapperId, @RequestParam("roleId") String roleId);

	
	@GetMapping(GET_DATA_SCOPE_BY_CODE)
    DataScopeModel getDataScopeByCode(@RequestParam("code") String code);

	
	@GetMapping(GET_DEPT_ANCESTORS)
	List<Long> getDeptAncestors(@RequestParam("deptId") Long deptId);


}
