package com.xunmei.system.api; import com.xunmei.common.core.constant.SecurityConstants; import com.xunmei.common.core.constant.ServiceNameConstants; import com.xunmei.common.core.domain.R; import com.xunmei.common.core.vo.IdNameVo; import com.xunmei.system.api.Eto.OrgListByTypesConditionEto; import com.xunmei.system.api.domain.SysOrg; import com.xunmei.system.api.factory.RemoteOrgFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.*; import java.util.List; @FeignClient(contextId = "remoteOrgService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteOrgFallbackFactory.class) public interface RemoteOrgService { /** * 通过用户名查询用户信息 * * @param source 请求来源 * @return 结果 */ @GetMapping("/org/list/nopage") R> getAllOrg(@RequestHeader(SecurityConstants.FROM_SOURCE) String source); @GetMapping("/dept/selectCheckSubOrgIdList") List selectCheckSubOrgIdList(@RequestParam("orgId") Long orgId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @GetMapping("/dept/selectSysOrgById") SysOrg selectSysOrgById(@RequestParam("id") Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); /** * 查询第一级机构 * @param source * @return */ @GetMapping("/org/selectSysOrgByParentId") List selectSysOrgByParentId(@RequestParam("id")Long id,@RequestHeader(SecurityConstants.FROM_SOURCE) String source); @GetMapping("/dept/get/{orgId}") SysOrg selectOrgById(@PathVariable("orgId") Long orgId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @GetMapping("/dept/listByIds") R> listByIds(List ids, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @GetMapping("/dept/findListByOrgType") R> findListByOrgType(Integer execOrgType, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @PostMapping("/org/sync/batch") R batchSaveSyncOrg(@RequestBody List orgList, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @PostMapping("/dept/findListByOrgTypes") R> listByTypes(@RequestBody OrgListByTypesConditionEto eto); @GetMapping("/dept/top") SysOrg selectTopOrg(@RequestHeader(SecurityConstants.FROM_SOURCE) String source); @GetMapping("/dept/selectByOrgType/{orgType}") List selectByOrgType(@PathVariable("orgType") Integer orgType, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @PostMapping("/dept/selectOrgByIdList") List selectOrgByIdList(@RequestBody List orgList, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @GetMapping("/dept/getSysOrgByUserId/{userId}") SysOrg getSysOrgByUserId(@PathVariable("userId") Long userId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); /** * 获取机构及其上级机构的id列表 * @param orgId * @return */ @GetMapping("/org/getUpOrgs/{orgId}") List getUpOrgs(@PathVariable("orgId") Long orgId); /** * * @param source * @return */ @GetMapping("/org/list/findAllOrg") List findAllOrg(@RequestHeader(SecurityConstants.FROM_SOURCE) String source); /** * 获取机构及父级机构的名称 * @param ids * @return */ @PostMapping("/org/getParentNames") R> getParentName(@RequestBody List ids); }