package com.sptg.permissions.api.feigns;

import com.sptg.permissions.api.entity.Area;
import com.sptg.permissions.api.entity.Street;
import com.sptg.permissions.api.feigns.fallback.StreetFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.io.Serializable;
import java.util.List;

/**
 * Created By lidexi in 2020/12/23
 **/
@FeignClient(value = "smart-house-permissions",fallbackFactory = StreetFeignFallbackFactory.class)
public interface StreetFeign {


    /**
     * 功能描述: 根据区或县的行政编码编号街道列表
     * @param areaCode 父级编号
     * @return List<Area>
     *
     *
     */
    @GetMapping(value = "/area/getStreetList/{areaCode}")
    List<Street> getStreetList(@PathVariable(value = "areaCode") String areaCode);

    /**
     * 功能描述: 根据街道编号查询街道列表
     * @param streetCode 街道编号
     * @return Area
     *
     *
     */
    @GetMapping(value = "/area/getStreetDetail/{streetCode}")
    Street getStreetDetail(@PathVariable(value = "streetCode") String streetCode);
}
