package org.springblade.thirdparty.oa.feign;

import org.springblade.thirdparty.oa.config.OAFeignClientConfig;
import org.springblade.thirdparty.oa.pojo.response.OACompanyResponse;
import org.springblade.thirdparty.oa.pojo.response.OADepartmentResponse;
import org.springblade.thirdparty.oa.pojo.response.OAPersonResponse;
import org.springblade.thirdparty.oa.pojo.response.OAResponse;
import org.springblade.thirdparty.oa.pojo.search.OACompanySearch;
import org.springblade.thirdparty.oa.pojo.search.OADepartmentSearch;
import org.springblade.thirdparty.oa.pojo.search.OAPersonSearch;
import org.springblade.thirdparty.oa.pojo.search.OASearch;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 *  oa接口
 * @author bfhuange
 * @date 2024/8/22
 */
@FeignClient(name = "OA", url = "${thirdParty.oa.baseUrl}", configuration = OAFeignClientConfig.class)
public interface IOAClient {

    /**
     *  查询公司分页
     * @param param
     * @return
     */
    @PostMapping("${thirdParty.oa.queryCompanyPageUrl:/api/hrm/resful/getHrmsubcompanyWithPage}")
    OAResponse<OACompanyResponse> queryCompanyPage(@RequestBody OASearch<OACompanySearch> param);

    /**
     *  查询部门分页
     * @param param
     * @return
     */
    @PostMapping("${thirdParty.oa.queryDepartmentPage:/api/hrm/resful/getHrmdepartmentWithPage}")
    OAResponse<OADepartmentResponse> queryDepartmentPage(@RequestBody OASearch<OADepartmentSearch> param);

    /**
     *  查询人员分页，用户和公司、部门的关系，存在同一个用户，多条不同公司、部门数据
     * @param param
     * @return
     */
    @PostMapping("${thirdParty.oa.queryPersonPageUrl:/api/hrm/resful/getHrmUserInfoWithPage}")
    OAResponse<OAPersonResponse> queryPersonPage(@RequestBody OASearch<OAPersonSearch> param);
}
