u
This commit is contained in:
1 parent
c330e52fd3
commit
87d63b6542
341 files changed
+128714
-48
No files matched your search
+7
@@ -4,6 +4,7 @@ import cn.g3soft.context.UserContext;
|
||||
import cn.g3soft.utils.*;
|
||||
import cn.g3soft.utils.uniqueId.idgen.UniqueId;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -85,6 +86,9 @@ public class FileController {
|
||||
|
||||
// 如果删除成功,发送删除请求
|
||||
if (deleteCount > 0) {
|
||||
if(StringUtils.isBlank(objectName)){
|
||||
return Result.fail("删除失败,文件格式有误");
|
||||
}
|
||||
String requestUrl = String.format("http://g3oss.g3soft.cn:8082/delete?bucketName=%s&objectName=%s", bucketName, objectName);
|
||||
try {
|
||||
HttpUtils.sendGet(requestUrl);
|
||||
@@ -113,6 +117,9 @@ public class FileController {
|
||||
}
|
||||
|
||||
String objectName = mxMapfilename.substring(index);
|
||||
if(StringUtils.isBlank(objectName)){
|
||||
return Result.fail("删除失败,文件格式有误");
|
||||
}
|
||||
|
||||
// 发送删除请求
|
||||
String requestUrl = String.format("http://g3oss.g3soft.cn:8082/delete?bucketName=%s&objectName=%s", bucketName, objectName);
|
||||
|
||||
+2
-1
@@ -18,6 +18,7 @@ import java.util.Map;
|
||||
@RestController
|
||||
@RequestMapping("/ocr")
|
||||
public class OcrController {
|
||||
|
||||
@PostMapping("/box")
|
||||
public Result<Map<String,Object>> boxOcr(@RequestBody Map<String,Object> params){
|
||||
ValidationUtils.checkRequiredFields(params, "fileUrl");
|
||||
@@ -69,6 +70,6 @@ public class OcrController {
|
||||
} catch (Exception e){
|
||||
return Result.fail("OCR 识别失败,请联系管理员");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -29,8 +29,12 @@ public class DbUtils {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!SAFE_IDENTIFIER.matcher(name).matches()) {
|
||||
throw new RuntimeException("非法标识符: " + name);
|
||||
// 去除排序关键词 (如 desc 或 asc),只检查标识符部分
|
||||
String[] parts = name.split("\\s+"); // 按空格分割,分割后第一部分是标识符
|
||||
String identifier = parts[0]; // 取第一部分作为标识符
|
||||
|
||||
if (!SAFE_IDENTIFIER.matcher(identifier).matches()) {
|
||||
throw new RuntimeException("非法标识符: " + identifier);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ server:
|
||||
threads:
|
||||
max: 800 # 最大线程数
|
||||
min-spare: 100 # 初始化的线程数
|
||||
port: 8084
|
||||
port: 8085
|
||||
|
||||
spring:
|
||||
servlet:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
url=jdbc:sqlserver://118.89.70.199:1433;databaseName=G3HY2025
|
||||
url=jdbc:sqlserver://118.89.70.199:1433;databaseName=G3BoxOCR
|
||||
username=sa
|
||||
password=zhang520..
|
||||
driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
Reference in new issue
Block a user