package com.nantian.cloud.jljc.service;

import com.nantian.cloud.jljc.service.impl.FeignUpmsFallBackServiceImpl;
import com.nantian.sc.cloud.admin.api.dto.DeptTree;
import com.nantian.sc.cloud.admin.api.entity.SysDept;
import com.nantian.sc.cloud.admin.api.entity.SysDeptRelation;
import com.nantian.sc.cloud.common.core.constant.ServiceNameConstants;
import com.nantian.sc.cloud.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * 远程调用sc-upms-biz服务
 * @date 2020-11-17
 */
@FeignClient(contextId = "feignUpmsService", value = ServiceNameConstants.UPMS_SERVICE, fallback = FeignUpmsFallBackServiceImpl.class)
public interface FeignUpmsService {

    /**
     * 获取子级部门
     */
    @GetMapping("/dept/getDescendantList/{deptId}")
    //@GetMapping("/dept/getDescendantList/aa/{deptId}")
    R<List<SysDeptRelation>> getDescendantList(@PathVariable(value = "deptId") Integer deptId);

    /**
     * 获取部门树形下拉框
     */
    @GetMapping("/dept/treeBySelect")
    R<List<DeptTree>> getTreeBySelect();

    /**
     * 返回组织集合
     */
    @GetMapping("/dept/list")
    R<List<SysDept>> getList();
}
