package com.sptg.permissions.biz.controller;

import com.sptg.permissions.api.entity.Street;
import com.sptg.permissions.api.feigns.StreetFeign;
import com.sptg.permissions.biz.service.StreetServiceInterface;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

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

/**
 * Created By lidexi in 2020/12/23
 * 全国街道 - 控制器
 **/
@RestController
@RequiredArgsConstructor
public class StreetController implements StreetFeign {

    private final StreetServiceInterface streetServiceInterface;
    @Override
    @GetMapping(value = "/area/getStreetList/{areaCode}")
    public List<Street> getStreetList(@PathVariable(value = "areaCode") String areaCode) {
        return this.streetServiceInterface.selectStreetByAreaCode(areaCode);
    }

    @Override
    @GetMapping(value = "/area/getStreetDetail/{streetCode}")
    public Street getStreetDetail(@PathVariable(value = "streetCode") String streetCode) {
        return this.streetServiceInterface.getStreetDetail(streetCode);
    }
}
