package com.crunii.micro.feign.client;

import com.crunii.micro.common.dto.Result;
import com.crunii.micro.domain.entity.main.TsmOrg;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "service-sysmgr")
@Service
public interface OrgService {
    @ApiOperation(value = "根据区域id获取直属组织")
    @RequestMapping(path = "/auth/OrgController/getOrgByZoneId", method = RequestMethod.GET)
    Result<List<TsmOrg>> getOrgByZoneId(@RequestParam("zoneId")Integer zoneId);

    @ApiOperation(value = "根据组织名获取组织(精确查找)")
    @RequestMapping(path = "/auth/OrgController/getOrgByOrgName", method = RequestMethod.GET)
    Result<TsmOrg> getOrgByOrgName(@RequestParam("orgName") String orgName);
}