From b3d8e8dbbc87210b0f3fc849898d91058d7890f9 Mon Sep 17 00:00:00 2001 From: cuizhibin Date: Tue, 22 Jul 2025 10:16:39 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=B5=8B=E8=AF=95gitea=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/main/java/com/dite/znpt/web/build/DeployController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/main/java/com/dite/znpt/web/build/DeployController.java b/web/src/main/java/com/dite/znpt/web/build/DeployController.java index fc20ca5..1d7b3a1 100644 --- a/web/src/main/java/com/dite/znpt/web/build/DeployController.java +++ b/web/src/main/java/com/dite/znpt/web/build/DeployController.java @@ -108,7 +108,7 @@ public class DeployController { @ApiOperation(value = "查询自动部署日志", httpMethod = "GET") @GetMapping("/deployment-log") public ResponseEntity getDeploymentLog( - @RequestParam(defaultValue = "20") int lines) { + @RequestParam(defaultValue = "100") int lines) { try { Path logFile = Path.of(buildDir, "deploy.log"); if (!Files.exists(logFile)) { From f82c9ceb32fcfb1f9b68b0725cec0df4d8ec8224 Mon Sep 17 00:00:00 2001 From: cuizhibin Date: Tue, 22 Jul 2025 10:23:36 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=B5=8B=E8=AF=95gitea=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/dite/znpt/web/build/DeployController.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/web/src/main/java/com/dite/znpt/web/build/DeployController.java b/web/src/main/java/com/dite/znpt/web/build/DeployController.java index 1d7b3a1..d5b662a 100644 --- a/web/src/main/java/com/dite/znpt/web/build/DeployController.java +++ b/web/src/main/java/com/dite/znpt/web/build/DeployController.java @@ -61,7 +61,7 @@ public class DeployController { // 1. 签名校验 if (!validSignature(body, signature)) { - throw new RuntimeException("签名错误"); + return ResponseEntity.status(403).body("签名验证失败"); } // 2. 启动部署流程 @@ -75,9 +75,8 @@ public class DeployController { try { Mac mac = Mac.getInstance("HmacSHA256"); mac.init(new SecretKeySpec(webhookSecret.getBytes(StandardCharsets.UTF_8), "HmacSHA256")); - byte[] hash = mac.doFinal(body); - String computed = "sha256=" + bytesToHex(hash); - return computed.equalsIgnoreCase(sigHeader); + String computed = bytesToHex(mac.doFinal(body)); + return computed.equalsIgnoreCase(sigHeader); // 不区分大小写 } catch (Exception e) { return false; } From 938218016faed0381164ed0d32f4bfddbaea5fab Mon Sep 17 00:00:00 2001 From: cuizhibin Date: Tue, 22 Jul 2025 14:55:23 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E7=BC=BA=E9=99=B7=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9B=BE=E7=89=87id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/main/java/com/dite/znpt/domain/vo/DefectListResp.java | 3 +++ core/src/main/resources/mapper/DefectMapper.xml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/dite/znpt/domain/vo/DefectListResp.java b/core/src/main/java/com/dite/znpt/domain/vo/DefectListResp.java index f002788..f7f4114 100644 --- a/core/src/main/java/com/dite/znpt/domain/vo/DefectListResp.java +++ b/core/src/main/java/com/dite/znpt/domain/vo/DefectListResp.java @@ -19,6 +19,9 @@ public class DefectListResp implements Serializable { @ApiModelProperty("缺陷id") private String defectId; + @ApiModelProperty("图片id") + private String imageId; + @ApiModelProperty("缺陷名称") private String defectName; diff --git a/core/src/main/resources/mapper/DefectMapper.xml b/core/src/main/resources/mapper/DefectMapper.xml index 48f0fdf..d79faf0 100644 --- a/core/src/main/resources/mapper/DefectMapper.xml +++ b/core/src/main/resources/mapper/DefectMapper.xml @@ -5,7 +5,7 @@ diff --git a/web/src/main/java/com/dite/znpt/web/controller/CommonController.java b/web/src/main/java/com/dite/znpt/web/controller/CommonController.java index 75f14fe..62a9c8a 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/CommonController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/CommonController.java @@ -163,5 +163,11 @@ public class CommonController { return Result.ok(CheckMethodEnum.listAll()); } + @ApiOperation(value = "查询报告状态", httpMethod = "GET") + @GetMapping("/list/report-status") + public Result listReportStatus(){ + return Result.ok(InspectionReportStatusEnum.listAll()); + } + } diff --git a/web/src/main/java/com/dite/znpt/web/controller/InspectionReportController.java b/web/src/main/java/com/dite/znpt/web/controller/InspectionReportController.java index d43883c..de4906f 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/InspectionReportController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/InspectionReportController.java @@ -67,4 +67,11 @@ public class InspectionReportController { inspectionReportService.removeById(reportId); return Result.ok(); } + + @ApiOperation(value = "发布项目机组报告", httpMethod = "POST") + @PutMapping("/publish/{reportId}") + public Result publish(@PathVariable String reportId) { + inspectionReportService.publish(reportId); + return Result.ok(); + } } From a0fd37a74e1b5bbe59be634a5f3f6f6f636402bc Mon Sep 17 00:00:00 2001 From: cuizhibin Date: Wed, 23 Jul 2025 14:45:33 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E7=BC=BA=E9=99=B7=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/dite/znpt/service/impl/DefectServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/dite/znpt/service/impl/DefectServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/DefectServiceImpl.java index a3dc96b..f20ee9f 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/DefectServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/DefectServiceImpl.java @@ -113,7 +113,7 @@ public class DefectServiceImpl extends ServiceImpl i throw new ServiceException(Message.IMAGE_ID_IS_NOT_EXIST); } image.setImageType(ImageTypeEnum.DEFECT.getCode()); - imageService.save(image); + imageService.updateById(image); DefectEntity defectEntity = Converts.INSTANCE.toDefectEntity(req); defectEntity.setImageId(imageId); defectEntity.setLabelInfo(JSONUtil.toJsonStr(req.getMarkInfo())); @@ -197,7 +197,7 @@ public class DefectServiceImpl extends ServiceImpl i throw new ServiceException(Message.IMAGE_ID_IS_NOT_EXIST); } image.setImageType(ImageTypeEnum.DEFECT.getCode()); - imageService.save(image); + imageService.updateById(image); FilePathEnum pathEnum = image.getImagePath().contains("temp") ? FilePathEnum.IMAGE_TEMP : FilePathEnum.IMAGE; String inputPath = pathEnum.getFileAbsolutePath(image.getImagePath()); // 写入attach同层级文件夹下 From 02560bc4bf0e64d99c6332eb1460277fcaadc4e9 Mon Sep 17 00:00:00 2001 From: cuizhibin Date: Wed, 23 Jul 2025 17:27:08 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/main/java/com/dite/znpt/aspect/HttpLogAspect.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/com/dite/znpt/aspect/HttpLogAspect.java b/core/src/main/java/com/dite/znpt/aspect/HttpLogAspect.java index b11acd8..1035ce5 100644 --- a/core/src/main/java/com/dite/znpt/aspect/HttpLogAspect.java +++ b/core/src/main/java/com/dite/znpt/aspect/HttpLogAspect.java @@ -31,7 +31,7 @@ public class HttpLogAspect { /** * 自定义切点 */ - @Pointcut("execution(* com.dite.*.controller.*.*(..)) ") + @Pointcut("execution(* com.dite.znpt.web..*(..)) ") public void log() { }