package com.tofly.api;

import com.tofly.common.core.entity.ResultRespone;
import com.tofly.pojo.Department;
import com.tofly.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

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

@FeignClient(name = "tofly-base",contextId="DepartmentClient")
public interface DepartmentClient {

    @GetMapping("/department/{id}")
    ResultRespone<Department> getById(@PathVariable("id") Long id);

    @GetMapping("/department/listAll")
    ResultRespone<List<Department>> departmentListAll();

    @GetMapping("/user/getUserByDepts")
    ResultRespone<List<Map<String, Object>>> getUserByDepts(@RequestParam(value = "depts") String depts);

    @GetMapping("/user/getDeptUserList")
    ResultRespone<List<User>> getDeptUserList(@RequestParam(value = "deptId", required = false) Long deptId);

    @GetMapping("/user/getDeptUserIdList")
    ResultRespone<List<Long>> getDeptUserIdList(@RequestParam(value = "deptId", required = false) Long deptId);

    @GetMapping("/department/subList")
    ResultRespone<List<Department>> getDepartmentPage(@RequestParam("id") Long id, @RequestParam(name = "returnSelf", required = false) String returnSelf);

}