package com.zcxk.client;

import com.zcxk.config.FeignConfig;
import com.zcxk.dto.OrgBaseTreeInfoDto;
import com.zcxk.entity.OperateLogEntity;
import com.zcxk.entity.Org;
import com.zcxk.model.AjaxMessage;
import org.springframework.cloud.openfeign.FeignClient;
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;

/**
 * @description 服务调用
 * @auto wangli
 * @data 2020-11-16 15:46
 */
@FeignClient(value = "user-center",configuration={FeignConfig.class})
public interface UserCenterClient {

    /**
     * 日志保存（仅设备增删改）
     * @param operateLogEntity
     * @return
     */
    @PostMapping("/operateLog/insert")
    AjaxMessage<Integer> insert(OperateLogEntity operateLogEntity);
    @PostMapping("/org/getAllByTenantId")
    List<Org> getAllByTenantId();

    @PostMapping("/user/findUserIdsByPermissonOrg")
    List<Integer> findUserIdsByPermissonOrg(@RequestParam("tenantId")String tenantId, @RequestParam("companyOrgId")Integer companyOrgId, @RequestParam("deptOrgId")Integer deptOrgId);

    @PostMapping(value = "/org/countCompanyByUser")
    Integer countCompanyByUser();

    @PostMapping(value = "/org/getCompanyByUser")
    List<OrgBaseTreeInfoDto> getCompanyByUser(@RequestParam(value = "condition" ,required =  false) String condition,@RequestBody List<Integer> companyIds);
}
