package jnpf.personnels;

import jnpf.base.ActionResult;
import jnpf.model.personnels.dto.turnover.FtbDepUserDTO;
import jnpf.model.personnels.vo.turnover.FtbPersonnelsTurnoverManagementVO;
import jnpf.permission.vo.v2.user.UserBoundVO;
import jnpf.personnels.fallback.FtbPersonnelsTurnoverManagementFallBackApi;
import jnpf.util.NoDataSourceBind;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Title: FtbPersonnelsTurnoverManagementApi
 * @Author: peng.hao
 * @create: 2024/2/19 10:36
 */
@FeignClient(name = "jnpf-ftb", fallback = FtbPersonnelsTurnoverManagementFallBackApi.class, path = "/web/personnels-turnover")
public interface FtbPersonnelsTurnoverManagementApi {

    @GetMapping("/closeUserAccountRegularlyAfterResignation")
    @NoDataSourceBind
    ActionResult<String> closeUserAccountRegularlyAfterResignation(@RequestParam("tenantId") String tenantId);

    /**
     * 离职用户已签署离职协议
     * @param userId 用户id
     * @return
     */
    @GetMapping("/user-has-sign-an-agreement")
    Boolean userHasSignedASeparationAgreement(@RequestParam("userId") String userId,@RequestParam("flag") Integer flag);

    /**
     * 获取所有离职人员信息
     */
    @GetMapping("/query-turnover-list")
    List<FtbPersonnelsTurnoverManagementVO> queryTurnoverList();
    /**
     * 获取离职人员信息
     * 1.按多个userId
     * 2.按多个组织id
     * 3.按多个岗位id
     */
    @PostMapping("/get-dep-user")
    List<UserBoundVO> getInformationAboutTheDepartingPerson(@RequestBody FtbDepUserDTO dto);
    @PostMapping("/not-token-get-dep-user")
    List<UserBoundVO> getInformationAboutTheDepartingPersonNotToken(@RequestBody FtbDepUserDTO dto);
}
