/*
 * Copyright (c) 2023 codvision.com All Rights Reserved.
 */

package com.codvision.webapi.remote;

import com.codvision.commoncore.common.ResponseEntity;
import com.codvision.commonfeign.config.OpenFeignConfig;
import com.codvision.webapi.bean.RemoteOrg;
import com.codvision.webapi.common.ListResponseEntity;
import com.codvision.webapi.remote.interceptor.BaseRequestInterceptor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 组织远程调用
 * @author lingee
 * @date 2023/8/17
 */
@FeignClient(name = "remote-org-sevice", url = "${cvbp.auth.host}", configuration = {OpenFeignConfig.class, BaseRequestInterceptor.class})
public interface RemoteOrgService {

    /**
     * 获取组织列表
     *
     * @param keyword 关键字
     * @param isAll   是否全部
     * @param page    当前页
     * @param size    页面大小
     * @return 组织分页结果
     */
    @PostMapping("/org/all")
    ResponseEntity<ListResponseEntity<RemoteOrg>> pageOrgList(@RequestParam(value = "keyword", required = false) String keyword,
                                                              @RequestParam(value = "isAll", required = false, defaultValue = "false") Boolean isAll,
                                                              @RequestParam(value = "page", required = false, defaultValue = "1") int page,
                                                              @RequestParam(value = "size", required = false, defaultValue = "10") int size);
}
