package com.zcxk.charge.xxl.client;

import com.zcxk.charge.api.dto.OrgBaseTreeInfoDto;
import com.zcxk.charge.core.entity.OperateLogEntity;
import com.zcxk.charge.core.entity.Org;
import com.zcxk.charge.xxl.config.FeignConfig;
import com.zcxk.core.common.pojo.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 服务调用
 * @author  wangli
 * @data 2020-11-16 15:46
 */
@FeignClient(value = "user-center",configuration={FeignConfig.class})
public interface UserCenterClient {

    /**
    * 日志保存（仅设备增删改）
    * @author Andy
    * @date 11:15 2021/8/18
    * @param operateLogEntity:
    * @return com.zcxk.core.common.pojo.AjaxMessage<java.lang.Integer>
    **/
    @PostMapping("/operateLog/insert")
    AjaxMessage<Integer> insert(OperateLogEntity operateLogEntity);

    /**
    * getAllByTenantId
    * @author Andy
    * @date 11:15 2021/8/18
    * @param :
    * @return java.util.List<com.zcxk.charge.core.entity.Org>
    **/
    @PostMapping("/org/getAllByTenantId")
    List<Org> getAllByTenantId();

    /**
    * findUserIdsByPermissonOrg
    * @author Andy
    * @date 11:14 2021/8/18
    * @param tenantId:
    * @param companyOrgId:
    * @param deptOrgId:
    * @return java.util.List<java.lang.Integer>
    **/
    @PostMapping("/user/findUserIdsByPermissonOrg")
    List<Integer> findUserIdsByPermissonOrg(@RequestParam("tenantId") String tenantId, @RequestParam("companyOrgId") Integer companyOrgId, @RequestParam("deptOrgId") Integer deptOrgId);

    /**
    * countCompanyByUser
    * @author Andy
    * @date 11:14 2021/8/18
    * @param :
    * @return java.lang.Integer
    **/
    @PostMapping(value = "/org/countCompanyByUser")
    Integer countCompanyByUser();

    /**
    * getCompanyByUser
    * @author Andy
    * @date 11:14 2021/8/18
    * @param condition:
    * @param companyIds:
    * @return java.util.List<com.zcxk.charge.api.dto.OrgBaseTreeInfoDto>
    **/
    @PostMapping(value = "/org/getCompanyByUser")
    List<OrgBaseTreeInfoDto> getCompanyByUser(@RequestParam(value = "condition", required = false) String condition, @RequestBody List<Integer> companyIds);
}
