forked from Abdulbari/sgeUpdated
Make creation of default area nested in city initialization
This commit is contained in:
@@ -121,7 +121,8 @@ public class SgsApplication implements CommandLineRunner {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public SgsApplication(RoleService roleService, PermissionService permissionService, RoleRepo roleRepo,
|
public SgsApplication(RoleService roleService, PermissionService permissionService, RoleRepo roleRepo,
|
||||||
AreaService areaService, NeighborhoodRepo neighborhoodRepo, NeighborhoodService neighborhoodService, CityService cityService,
|
AreaService areaService, NeighborhoodRepo neighborhoodRepo, NeighborhoodService neighborhoodService,
|
||||||
|
CityService cityService,
|
||||||
CityRepo cityRepo, DistrictRepo districtRepo, DistrictService districtService, CountryRepo countryRepo,
|
CityRepo cityRepo, DistrictRepo districtRepo, DistrictService districtService, CountryRepo countryRepo,
|
||||||
CountryService countryService, OrganizationService organizationService, UserService userService,
|
CountryService countryService, OrganizationService organizationService, UserService userService,
|
||||||
PasswordEncoder passwordEncoder, SectorService sectorService, SubSectorService subSectorService,
|
PasswordEncoder passwordEncoder, SectorService sectorService, SubSectorService subSectorService,
|
||||||
@@ -858,6 +859,7 @@ public class SgsApplication implements CommandLineRunner {
|
|||||||
}
|
}
|
||||||
if (cityService.findAll().isEmpty()) {
|
if (cityService.findAll().isEmpty()) {
|
||||||
createCitiesFromJson();
|
createCitiesFromJson();
|
||||||
|
createDefaultArea();
|
||||||
}
|
}
|
||||||
if (districtService.findAll().isEmpty()) {
|
if (districtService.findAll().isEmpty()) {
|
||||||
createDistrictFromJson();
|
createDistrictFromJson();
|
||||||
@@ -865,9 +867,6 @@ public class SgsApplication implements CommandLineRunner {
|
|||||||
if (neighborhoodService.findAll().isEmpty()) {
|
if (neighborhoodService.findAll().isEmpty()) {
|
||||||
createNeighborhoodsFromJson();
|
createNeighborhoodsFromJson();
|
||||||
}
|
}
|
||||||
if (!cityService.findAll().isEmpty()) {
|
|
||||||
createDefaultArea();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void createDefaultArea() {
|
void createDefaultArea() {
|
||||||
|
|||||||
Reference in New Issue
Block a user