| package com.moral.api.config.properties; | 
|   | 
| import com.moral.api.entity.SysArea; | 
| import lombok.Data; | 
| import org.springframework.boot.context.properties.ConfigurationProperties; | 
| import org.springframework.stereotype.Component; | 
|   | 
| import java.util.List; | 
| import java.util.Map; | 
|   | 
| /** | 
|  * @ClassName | 
|  * @Description TODO | 
|  * @Author 陈凯裕 | 
|  * @Date 2021/12/31 8:56 | 
|  * @Version TODO | 
|  **/ | 
| @Data | 
| @ConfigurationProperties(prefix = "special-city") | 
| @Component | 
| public class SpecialCitiesProperties { | 
|   | 
|     private List<SysArea> twentyEightCities; | 
|   | 
|     private List<SysArea> heBeiEightCities; | 
|   | 
|     private List<SysArea> oneSixEightCities; | 
|   | 
|     public boolean isTwentyEightCities(Integer cityCode){ | 
|         for (SysArea city : twentyEightCities) { | 
|             if(city.getAreaCode().equals(cityCode)) | 
|                 return true; | 
|         } | 
|         return false; | 
|     } | 
|   | 
|     public boolean isHeBeiEightCities(Integer cityCode){ | 
|         for (SysArea city : heBeiEightCities) { | 
|             if(city.getAreaCode().equals(cityCode)) | 
|                 return true; | 
|         } | 
|         return false; | 
|     } | 
|   | 
|     public boolean isOneSixEightCities(Integer cityCode){ | 
|         for (SysArea city : oneSixEightCities) { | 
|             if(city.getAreaCode().equals(cityCode)) | 
|                 return true; | 
|         } | 
|         return false; | 
|     } | 
|   | 
| } |