package com.siwei.system.api;

import com.siwei.common.core.constant.SecurityConstants;
import com.siwei.common.core.constant.ServiceNameConstants;
import com.siwei.common.core.domain.R;
import com.siwei.system.api.domain.SysDept;
import com.siwei.system.api.factory.RemoteDeptFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 用户服务
 *
 * @author siwei-zhx
 */
@FeignClient(contextId = "remoteDeptService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteDeptFallbackFactory.class)
public interface RemoteDeptService {

    /**
     * 查询当前用户的当前和下层区县
     *
     * @param deptId 用户信息
     * @return 结果
     */
    @GetMapping("/dept/child")
    public R<List<SysDept>> childByDeptId(
            @RequestParam("deptId") Long deptId,
            @RequestParam("isTree") Boolean isTree,
            @RequestHeader(SecurityConstants.FROM_SOURCE) String source);


}
