Commit b7df3a61 by 刘宇峰

用户组织feign开放接口

1 parent ac969509
......@@ -7,6 +7,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Collection;
import java.util.List;
@FeignClient(
......@@ -18,13 +19,48 @@ import java.util.List;
)
public interface OrganizationService {
@GetMapping(value = "/getSuperiorsBySubId")
R<List<Organization>> getSuperiorsBySubId(@RequestParam("subOrgId") Long subOrgId);
/**
* 根据userId获取租户机构
*
* @param userId
* @return
*/
@GetMapping(value = "/getTenantPathsByUserId")
R<List<Organization>> getTenantPathsByUserId(@RequestParam("userId") Long userId);
/**
* 获取根组织层级
*
* @return
*/
@GetMapping(value = "/getRootOrgs")
R<List<Organization>> getRootOrganizations();
@GetMapping(value = "/getSubOrgs")
/**
* 获取下级组织
*
* @param orgId
* @return
*/
@GetMapping(value = "/getSubOrgsBySuperiorId")
R<List<Organization>> getSubOrganizations(@RequestParam("orgId") Long orgId);
/**
* 根据用户id获取组织层级
*
* @param userIds
* @return
*/
@GetMapping(value = "/getOrgsByUserIds")
R<List<Organization>> getOrgsByUserIds(@RequestParam("userIds") Collection<Long> userIds);
/**
* 获取特定层级的机构
*
* @param level
* @return
*/
@GetMapping(value = "/getSpecialLevelOrgs")
R<List<Organization>> getSpecialLevelOrganizations(@RequestParam("level") Integer level);
}
......@@ -7,6 +7,7 @@ import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.Collection;
import java.util.List;
@Slf4j
......@@ -17,7 +18,7 @@ public class OrganizationServiceFallbackImpl implements OrganizationService {
private Throwable cause;
@Override
public R<List<Organization>> getSuperiorsBySubId(Long subOrgId) {
public R<List<Organization>> getTenantPathsByUserId(Long userId) {
log.warn("熔断啦 {}", cause.getMessage());
return R.ok();
}
......@@ -34,4 +35,16 @@ public class OrganizationServiceFallbackImpl implements OrganizationService {
return R.ok();
}
@Override
public R<List<Organization>> getOrgsByUserIds(Collection<Long> userIds) {
log.warn("熔断啦 {}", cause.getMessage());
return R.ok();
}
@Override
public R<List<Organization>> getSpecialLevelOrganizations(Integer level) {
log.warn("熔断啦 {}", cause.getMessage());
return R.ok();
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!