dev add statistic complaints by status
Test Workflow / test (push) Has been cancelled

This commit is contained in:
2026-05-25 14:16:39 +07:00
parent 6929060661
commit d55b1620d5
4 changed files with 95 additions and 0 deletions
@@ -59,6 +59,8 @@ public class ApiController {
private final Map<Integer, RequestHandler> handlers;
private final Map<Integer, RequestHandler> internalHandlers;
private final FileEntityService fileEntityService;
private final AuthService authService;
@@ -126,6 +128,35 @@ public class ApiController {
}
}
@PostMapping("/internal/data")
public ResponseEntity<?> handleInternalPostRequest(@RequestBody BaseRequest request) {
Integer msgId = request.getMsgId();
BaseResponse response;
RequestHandler handler = internalHandlers.get(msgId);
try {
if (handler == null) {
response = new BaseResponse(msgId,
MessageCode.MSG_ID_NOT_FOUND.getCode(),
MessageCode.MSG_ID_NOT_FOUND.getDescription(),
new HashMap<>());
} else {
response = handler.handle(request);
}
return ResponseEntity.ok().body(response);
} catch (Exception e) {
log.error("Handler execution failed for msgId: {}", msgId, e);
BaseResponse errorResponse = new BaseResponse(msgId,
MessageCode.INVALID_JSON_BODY.getCode(),
MessageCode.INVALID_JSON_BODY.getDescription(),
new HashMap<>());
return ResponseEntity.ok().body(errorResponse);
}
}
@PostMapping("/v{version}/files/chunk")
public ResponseEntity<BaseResponse> uploadChunk(
@PathVariable("version") int version,