package com.vctgo.system.api;

import com.vctgo.common.core.constant.ServiceNameConstants;
import com.vctgo.common.core.domain.R;
import com.vctgo.system.api.domain.SysLocationSetting;
import com.vctgo.system.api.domain.SysReLocationClass;
import com.vctgo.system.api.domain.dto.SysLocationDto;
import com.vctgo.system.api.domain.dto.SysLocationReClassDto;
import com.vctgo.system.api.domain.dto.TemporaryConfig;
import com.vctgo.system.api.factory.RemoteLocationFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * 用户服务
 *
 * @author vctgo
 */
@FeignClient(contextId = "remoteLocationService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteLocationFallbackFactory.class)
public interface RemoteLocationService {

    /**
     * 全量查询租户管理列表
     *
     * @return
     */
    @GetMapping("/sysLocationSetting/external/page")
    R<List<SysLocationSetting>> allList(@SpringQueryMap TemporaryConfig temporaryConfig);

    /**
     * 通过参数获取到所有符合条件的位置id
     */
    @PostMapping("/sysLocationSetting/locationIdList")
    R<List<SysLocationSetting>> locationIdList(SysLocationSetting sysLocationSetting);

    /**
     * 根据位置信息查询其对应的班级信息
     */
    @GetMapping("/sysLocationSetting/external/class/list")
    R<List<SysLocationReClassDto>> getRelatedClassList(@SpringQueryMap SysLocationReClassDto sysLocationReClassDto);

    /**
     * 通过位置Id列表获取位置信息
     *
     * @param locationIdArray
     * @return
     */
    @GetMapping("/sysLocationSetting/locationId/list")
    R<List<SysLocationSetting>> locationIdList(@RequestParam("locationIdArray") Long[] locationIdArray);

    /**
     * 通过租户Id获取该租户所有的位置和区域信息
     *
     * @return
     */
    @GetMapping("/sysLocationSetting/locationAndAreaList/{tenantId}")
    R<List<SysLocationSetting>> locationAndAreaList(@PathVariable("tenantId") String tenantId);

    @GetMapping("/sysLocationSetting/external/location/list")
    R<List<SysLocationReClassDto>> getRelatedLocationList(@SpringQueryMap SysLocationReClassDto sysLocationReClassDto);

    @GetMapping("/sysLocationSetting/getLocationIdList")
    R<List<SysLocationDto>> getLocationIdList(@SpringQueryMap SysLocationDto locationDto);

    @GetMapping("/sysLocationSetting/selectLocationSettingInfo/{attribute}")
    R<List<SysLocationSetting>> getLocationSettingInfo(@PathVariable("attribute") String attribute);

    @GetMapping("/sysLocationSetting/classId/{classId}")
    R<List<SysReLocationClass>> getLocationSettingInfoByClassId(@PathVariable("classId") String classId);

    @GetMapping("/sysLocationSetting/classIds/{classIds}")
    R<List<SysReLocationClass>> getLocationSettingInfoByClassIds(@PathVariable("classIds") String classIds);
}
