package com.ruoyi.system.api;

import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.system.api.domain.SysDept;
import com.ruoyi.system.api.factory.RemoteDeptFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * 组织机构服务
 * 
 * @author ruoyi
 */
@FeignClient(contextId = "remoteDeptService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteDeptFallbackFactory.class)
public interface RemoteDeptService
{
    /**
     * 组织机构列表
     * @return 结果
     */
    @RequestMapping("/dept/getAllDeptList")
    List<SysDept> getAllDeptList();

    /**
     * 组织机构子列表
     * @return 结果
     */
    @RequestMapping("/dept/getSubDeptList/{deptId}")
    List<SysDept> getSubDeptList(@PathVariable("deptId") Long deptId);

    /**
     * 更新组织机构的工厂代码
     * @return 结果
     */
    @RequestMapping("/dept/editFactoryCode/{deptId}/{factoryCode}")
    int editFactoryCode(@PathVariable("deptId") Long deptId, @PathVariable("factoryCode") String factoryCode);

}
