|
77 | 77 | import com.qcloud.cos.model.ciModel.auditing.DocumentAuditingResponse;
|
78 | 78 | import com.qcloud.cos.model.ciModel.auditing.DocumentResultInfo;
|
79 | 79 | import com.qcloud.cos.model.ciModel.auditing.ImageAuditingResponse;
|
| 80 | +import com.qcloud.cos.model.ciModel.auditing.ObjectResults; |
80 | 81 | import com.qcloud.cos.model.ciModel.auditing.OcrResults;
|
81 | 82 | import com.qcloud.cos.model.ciModel.auditing.SectionInfo;
|
82 | 83 | import com.qcloud.cos.model.ciModel.auditing.SnapshotInfo;
|
@@ -6082,6 +6083,14 @@ protected void doStartElement(String uri, String name, String qName, Attributes
|
6082 | 6083 | List<DocumentResultInfo> pageSegment = response.getJobsDetail().getPageSegment();
|
6083 | 6084 | if (in("Response", "JobsDetail", "PageSegment") && "Results".equals(name)) {
|
6084 | 6085 | pageSegment.add(new DocumentResultInfo());
|
| 6086 | + } else if (in("Response", "JobsDetail", "PageSegment", "Results","PoliticsInfo") && "ObjectResults".equals(name)) { |
| 6087 | + pageSegment.get(pageSegment.size() - 1).getPoliticsInfo().getObjectResults().add(new ObjectResults()); |
| 6088 | + }else if (in("Response", "JobsDetail", "PageSegment", "Results","PornInfo") && "ObjectResults".equals(name)) { |
| 6089 | + pageSegment.get(pageSegment.size() - 1).getPornInfo().getObjectResults().add(new ObjectResults()); |
| 6090 | + }else if (in("Response", "JobsDetail", "PageSegment", "Results","AdsInfo") && "ObjectResults".equals(name)) { |
| 6091 | + pageSegment.get(pageSegment.size() - 1).getAdsInfo().getObjectResults().add(new ObjectResults()); |
| 6092 | + }else if (in("Response", "JobsDetail", "PageSegment", "Results","TerroristInfo") && "ObjectResults".equals(name)) { |
| 6093 | + pageSegment.get(pageSegment.size() - 1).getTerroristInfo().getObjectResults().add(new ObjectResults()); |
6085 | 6094 | }
|
6086 | 6095 | }
|
6087 | 6096 |
|
@@ -6151,15 +6160,39 @@ protected void doEndElement(String uri, String name, String qName) {
|
6151 | 6160 | resultDetail.setText(getText());
|
6152 | 6161 | } else if ("Url".equalsIgnoreCase(name)) {
|
6153 | 6162 | resultDetail.setUrl(getText());
|
6154 |
| - } |
6155 |
| - }else if (in("Response", "JobsDetail", "PageSegment", "Results", "PornInfo","OcrResults")) { |
| 6163 | + } else if ("Label".equalsIgnoreCase(name)) { |
| 6164 | + resultDetail.setLabel(getText()); |
| 6165 | + } else if ("Suggestion".equalsIgnoreCase(name)) { |
| 6166 | + resultDetail.setSuggestion(getText()); |
| 6167 | + } else if ("PageNumber".equalsIgnoreCase(name)) { |
| 6168 | + resultDetail.setPageNumber(getText()); |
| 6169 | + } else if ("SheetNumber".equalsIgnoreCase(name)) { |
| 6170 | + resultDetail.setSheetNumber(getText()); |
| 6171 | + } |
| 6172 | + } else if (in("Response", "JobsDetail", "PageSegment", "Results", "PornInfo","OcrResults")) { |
6156 | 6173 | parseResultInfo(resultDetail.getPornInfo().getOcrResults(), name, getText());
|
6157 | 6174 | }else if (in("Response", "JobsDetail", "PageSegment", "Results", "PoliticsInfo","OcrResults")) {
|
6158 | 6175 | parseResultInfo(resultDetail.getPoliticsInfo().getOcrResults(), name, getText());
|
6159 | 6176 | }else if (in("Response", "JobsDetail", "PageSegment", "Results", "TerrorismInfo","OcrResults")) {
|
6160 | 6177 | parseResultInfo(resultDetail.getTerroristInfo().getOcrResults(), name, getText());
|
6161 | 6178 | }else if (in("Response", "JobsDetail", "PageSegment", "Results", "AdsInfo","OcrResults")) {
|
6162 | 6179 | parseResultInfo(resultDetail.getAdsInfo().getOcrResults(), name, getText());
|
| 6180 | + }else if (in("Response", "JobsDetail", "PageSegment", "Results", "PornInfo","ObjectResults")) { |
| 6181 | + parseResultInfo(resultDetail.getPornInfo().getObjectResults(), name, getText()); |
| 6182 | + }else if (in("Response", "JobsDetail", "PageSegment", "Results", "PoliticsInfo","ObjectResults")) { |
| 6183 | + parseResultInfo(resultDetail.getPoliticsInfo().getObjectResults(), name, getText()); |
| 6184 | + }else if (in("Response", "JobsDetail", "PageSegment", "Results", "TerrorismInfo","ObjectResults")) { |
| 6185 | + parseResultInfo(resultDetail.getTerroristInfo().getObjectResults(), name, getText()); |
| 6186 | + }else if (in("Response", "JobsDetail", "PageSegment", "Results", "AdsInfo","ObjectResults")) { |
| 6187 | + parseResultInfo(resultDetail.getAdsInfo().getObjectResults(), name, getText()); |
| 6188 | + }else if (in("Response", "JobsDetail", "PageSegment", "Results", "PornInfo","ObjectResults","Location")) { |
| 6189 | + parseResultInfo(resultDetail.getPornInfo().getObjectResults(), name, getText()); |
| 6190 | + }else if (in("Response", "JobsDetail", "PageSegment", "Results", "PoliticsInfo","ObjectResults","Location")) { |
| 6191 | + parseResultInfo(resultDetail.getPoliticsInfo().getObjectResults(), name, getText()); |
| 6192 | + }else if (in("Response", "JobsDetail", "PageSegment", "Results", "TerrorismInfo","ObjectResults","Location")) { |
| 6193 | + parseResultInfo(resultDetail.getTerroristInfo().getObjectResults(), name, getText()); |
| 6194 | + }else if (in("Response", "JobsDetail", "PageSegment", "Results", "AdsInfo","ObjectResults","Location")) { |
| 6195 | + parseResultInfo(resultDetail.getAdsInfo().getObjectResults(), name, getText()); |
6163 | 6196 | }
|
6164 | 6197 | }
|
6165 | 6198 |
|
@@ -6191,6 +6224,36 @@ private void parseInfo(AudtingCommonInfo obj, String name, String value) {
|
6191 | 6224 | default:
|
6192 | 6225 | break;
|
6193 | 6226 | }
|
| 6227 | + |
| 6228 | + } |
| 6229 | + |
| 6230 | + private void parseResultInfo(List<ObjectResults> obj, String name, String value) { |
| 6231 | + if (!obj.isEmpty()) { |
| 6232 | + ObjectResults objectResult = obj.get(obj.size() - 1); |
| 6233 | + ObjectResults.Location location = objectResult.getLocation(); |
| 6234 | + switch (name) { |
| 6235 | + case "Name": |
| 6236 | + objectResult.setName(value); |
| 6237 | + break; |
| 6238 | + case "Height": |
| 6239 | + location.setHeight(value); |
| 6240 | + break; |
| 6241 | + case "Rotate": |
| 6242 | + location.setRotate(value); |
| 6243 | + break; |
| 6244 | + case "Width": |
| 6245 | + location.setWidth(value); |
| 6246 | + break; |
| 6247 | + case "X": |
| 6248 | + location.setX(value); |
| 6249 | + break; |
| 6250 | + case "Y": |
| 6251 | + location.setY(value); |
| 6252 | + break; |
| 6253 | + default: |
| 6254 | + break; |
| 6255 | + } |
| 6256 | + } |
6194 | 6257 | }
|
6195 | 6258 |
|
6196 | 6259 | private void parseResultInfo(OcrResults obj, String name, String value) {
|
|
0 commit comments