package com.zd.system.api;

import com.zd.common.core.constant.ServiceNameConstants;
import com.zd.common.core.domain.R;
import com.zd.common.core.web.domain.AjaxResult;
import com.zd.system.api.domain.SysDept;
import com.zd.system.api.factory.RemoteDeptFallbackFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 部门服务
 *
 * @author zd
 */
@FeignClient(contextId = "remoteDeptService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteDeptFallbackFactory.class)
public interface RemoteDeptService {
    /**
     * 查询部门列表
     *
     * @param sysDept 用户名
     * @return 结果
     */
    @PostMapping("/dept/listOption")
    public R<List<SysDept>> getDeptList(@RequestBody SysDept sysDept);

    @ApiOperation("通过ids 查询所有的本节点和父节点ID集合")
    @PostMapping("/dept/allParentId")
    public AjaxResult allParentId(@RequestBody List<Long> deptIds);

    @ApiOperation(value = "用户查询是否有电子签章")
    @GetMapping("/dept/sign/queryDeptSignByUserId")
    Map<String, Object> queryDeptSignByUserId();

    @ApiOperation(value = "根据部门id查询部门信息")
    @GetMapping("/dept/info/{id}")
    AjaxResult getInfoById(@PathVariable("id") Long id);
}
