package com.yuchen.saas.manage.system.api.feign;

import com.yuchen.saas.manage.system.api.dto.CouponMenuDTO;
import com.yuchen.saas.manage.system.api.entity.Dept;
import com.yuchen.saas.manage.system.api.entity.DeptPark;
import com.yuchen.saas.manage.system.api.entity.NestDeptDetail;
import com.yuchen.saas.manage.system.api.vo.DeptInfoVO;
import com.yuchen.saas.manage.system.api.vo.DeptVO;
import com.yuchen.saas.manage.system.api.vo.OrgDeptAndRoleVO;
import org.nest.springwrap.core.launch.app.AppNameConstant;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: 肖润飞
 * @CreateTime: 2022/11/25 13:37
 * @Description: TODO
 * @Version: 1.0
 */
@FeignClient(
        value = AppNameConstant.SAAS_SYSTEM,
        fallbackFactory = DeptFeignFallback.class
)
public interface DeptFeignServer {

    @GetMapping("/dept/getChildrenIdsByParentId")
    R getChildrenIdsByParentId(@RequestParam String tenantId, @RequestParam String parentId, @RequestParam String deptName);

    @GetMapping("/dept/getDeptAndRoleByDept")
    R<OrgDeptAndRoleVO> getDeptAndRoleByDept(@RequestParam  Long deptId, @RequestParam Long userId);

    @GetMapping("/dept/getDept")
    R<Dept> getDept(@RequestParam  Long deptId);

    @GetMapping("/dept/getDeptByName/{deptName}")
    R<List<Dept>> getDeptByName(@PathVariable String deptName);


    @GetMapping("/dept/getAllDeptList")
    R<List<Dept>> getAllDeptList();

    @GetMapping("/dept/getListByDeptId")
    R<List<DeptPark>> getListByDeptId(@RequestParam  Long id);

    @GetMapping("/dept/getDeptInfoByCode")
    R<Dept> getDeptInfoByCode(@RequestParam String code);

    @GetMapping("/dept/verifyIsDeptUser")
    R<Boolean> verifyIsDeptUser(@RequestParam Long id, @RequestParam Long userId);

    @PostMapping("/dept/addCouponMenu")
    R<Boolean> addCouponMenu(@RequestBody CouponMenuDTO couponMenuDTO);

    @GetMapping("/dept/getDeptDetailByDeptId")
    R<NestDeptDetail> getDeptDetailByDeptId(@RequestParam Long deptId);

    @GetMapping("/dept/childDeptTreeByDeptIdNei")
    R<List<DeptVO>> childDeptTreeByDeptIdNei(@RequestParam Long depId);

    @GetMapping("/dept/listDeptInfoByChildId")
    R<List<DeptInfoVO>> listDeptInfoByChildId(@RequestParam Long deptId);

    @GetMapping("/dept/allByParentId")
    R<List<Dept>> allByParentId(@RequestParam Long depId);

    @PostMapping("/dept/findDeptListByIds")
    R<List<Dept>> findDeptListByIds(@RequestBody List<Long> depIdList);
}
