From 12d1327525e7508e24ceae9fdc16bead8847961c Mon Sep 17 00:00:00 2001 From: androidlover5842 Date: Sat, 31 Jan 2026 10:03:50 +0530 Subject: [PATCH] ocr: allow 75% indians poor --- .../trisolarisserver/config/ApiExceptionHandler.kt | 13 ++++++++++--- src/main/resources/application.properties | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/com/android/trisolarisserver/config/ApiExceptionHandler.kt b/src/main/kotlin/com/android/trisolarisserver/config/ApiExceptionHandler.kt index adce821..dfe6de5 100644 --- a/src/main/kotlin/com/android/trisolarisserver/config/ApiExceptionHandler.kt +++ b/src/main/kotlin/com/android/trisolarisserver/config/ApiExceptionHandler.kt @@ -2,6 +2,7 @@ package com.android.trisolarisserver.config import jakarta.servlet.http.HttpServletRequest import org.springframework.http.HttpStatus +import org.springframework.http.MediaType import org.springframework.http.ResponseEntity import org.springframework.security.access.AccessDeniedException import org.springframework.web.bind.annotation.ExceptionHandler @@ -18,7 +19,9 @@ class ApiExceptionHandler { request: HttpServletRequest ): ResponseEntity { val status = ex.statusCode as HttpStatus - return ResponseEntity.status(status).body( + return ResponseEntity.status(status) + .contentType(MediaType.APPLICATION_JSON) + .body( ApiError( timestamp = OffsetDateTime.now().toString(), status = status.value(), @@ -34,7 +37,9 @@ class ApiExceptionHandler { ex: AccessDeniedException, request: HttpServletRequest ): ResponseEntity { - return ResponseEntity.status(HttpStatus.FORBIDDEN).body( + return ResponseEntity.status(HttpStatus.FORBIDDEN) + .contentType(MediaType.APPLICATION_JSON) + .body( ApiError( timestamp = OffsetDateTime.now().toString(), status = HttpStatus.FORBIDDEN.value(), @@ -50,7 +55,9 @@ class ApiExceptionHandler { ex: Exception, request: HttpServletRequest ): ResponseEntity { - return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body( + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) + .contentType(MediaType.APPLICATION_JSON) + .body( ApiError( timestamp = OffsetDateTime.now().toString(), status = HttpStatus.INTERNAL_SERVER_ERROR.value(), diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 8ee9b44..7a93a2e 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -30,6 +30,6 @@ ai.llama.repeatPenalty=1.0 ai.llama.topK=40 ocr.paddle.enabled=true ocr.paddle.baseUrl=https://ocr.hoteltrisolaris.in/ -ocr.paddle.minScore=0.75 -ocr.paddle.minAverageScore=0.8 +ocr.paddle.minScore=0.9 +ocr.paddle.minAverageScore=0.75 ocr.paddle.minTextLength=4