| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.web.controller;
|
1 |
package com.spice.profitmandi.web.controller;
|
| 2 |
|
2 |
|
| 3 |
import com.fasterxml.jackson.core.type.TypeReference;
|
3 |
import com.fasterxml.jackson.core.type.TypeReference;
|
| 4 |
import com.fasterxml.jackson.databind.ObjectMapper;
|
4 |
import com.fasterxml.jackson.databind.ObjectMapper;
|
| 5 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
- |
|
| 6 |
import com.spice.profitmandi.dao.entity.Page;
|
5 |
import com.spice.profitmandi.dao.entity.Page;
|
| 7 |
import com.spice.profitmandi.dao.entity.dtr.WebListing;
|
6 |
import com.spice.profitmandi.dao.entity.dtr.WebListing;
|
| 8 |
import com.spice.profitmandi.dao.repository.dtr.WebListingRepository;
|
7 |
import com.spice.profitmandi.dao.repository.dtr.WebListingRepository;
|
| 9 |
import com.spice.profitmandi.service.page.PageRepository;
|
8 |
import com.spice.profitmandi.service.page.PageRepository;
|
| 10 |
import org.apache.logging.log4j.LogManager;
|
9 |
import org.apache.logging.log4j.LogManager;
|
| Line 73... |
Line 72... |
| 73 |
|
72 |
|
| 74 |
List<Object> sectionDataList = new ArrayList<>();
|
73 |
List<Object> sectionDataList = new ArrayList<>();
|
| 75 |
sectionDataList.add(parent.get("sectionData"));
|
74 |
sectionDataList.add(parent.get("sectionData"));
|
| 76 |
children.forEach(c -> sectionDataList.add(c.get("sectionData")));
|
75 |
children.forEach(c -> sectionDataList.add(c.get("sectionData")));
|
| 77 |
|
76 |
|
| - |
|
77 |
if (parent.get("sectionBelow") == null && !children.isEmpty()) {
|
| - |
|
78 |
Object firstChildBelow = children.get(0).get("sectionBelow");
|
| - |
|
79 |
if (firstChildBelow != null) {
|
| - |
|
80 |
parent.put("sectionBelow", firstChildBelow);
|
| - |
|
81 |
}
|
| - |
|
82 |
}
|
| - |
|
83 |
|
| 78 |
try {
|
84 |
try {
|
| 79 |
parent.put("sectionData", objectMapper.writeValueAsString(sectionDataList));
|
85 |
parent.put("sectionData", objectMapper.writeValueAsString(sectionDataList));
|
| 80 |
} catch (Exception e) {
|
86 |
} catch (Exception e) {
|
| 81 |
throw new RuntimeException("Failed to serialize sectionData list", e);
|
87 |
throw new RuntimeException("Failed to serialize sectionData list", e);
|
| 82 |
}
|
88 |
}
|