From f6bb392d492ebfb6f3d04f4cd1d1795130c606a8 Mon Sep 17 00:00:00 2001 From: MichaelWin Date: Tue, 28 Oct 2025 16:28:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=87=AA=E5=A2=9Eid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/corewing/app/entity/TutorialCategoryRelation.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/corewing/app/entity/TutorialCategoryRelation.java b/src/main/java/com/corewing/app/entity/TutorialCategoryRelation.java index da7310f..42fd192 100644 --- a/src/main/java/com/corewing/app/entity/TutorialCategoryRelation.java +++ b/src/main/java/com/corewing/app/entity/TutorialCategoryRelation.java @@ -1,5 +1,7 @@ package com.corewing.app.entity; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -17,6 +19,7 @@ public class TutorialCategoryRelation implements Serializable { /** * id */ + @TableId(value = "id", type = IdType.AUTO) private Long id; /** From 4ceb96738e343f046b7b3e110927f8e87f7984d6 Mon Sep 17 00:00:00 2001 From: MichaelWin Date: Wed, 29 Oct 2025 16:05:33 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/corewing/app/entity/TutorialCategory.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/corewing/app/entity/TutorialCategory.java b/src/main/java/com/corewing/app/entity/TutorialCategory.java index 624fc23..21a078d 100644 --- a/src/main/java/com/corewing/app/entity/TutorialCategory.java +++ b/src/main/java/com/corewing/app/entity/TutorialCategory.java @@ -27,6 +27,11 @@ public class TutorialCategory implements Serializable { */ private String icon; + /** + * 颜色 + */ + private String color; + /** * 分类名称 */ From 5bb485c6121c75b2c142289816d26192b4a85c18 Mon Sep 17 00:00:00 2001 From: MichaelWin Date: Wed, 29 Oct 2025 16:53:55 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B7=BB=E5=8A=A0=E6=9F=A5=E7=9C=8B=E6=AC=A1?= =?UTF-8?q?=E6=95=B0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/corewing/app/config/SaTokenConfig.java | 2 +- .../app/controller/TutorialController.java | 16 ++++++++++++++++ src/main/resources/static/tutorial/index.html | 10 ++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/static/tutorial/index.html diff --git a/src/main/java/com/corewing/app/config/SaTokenConfig.java b/src/main/java/com/corewing/app/config/SaTokenConfig.java index 5cb6b84..8348d98 100644 --- a/src/main/java/com/corewing/app/config/SaTokenConfig.java +++ b/src/main/java/com/corewing/app/config/SaTokenConfig.java @@ -32,7 +32,7 @@ public class SaTokenConfig implements WebMvcConfigurer { // 排除固件查询接口(不需要登录) .excludePathPatterns("/firmware/**") // 排除静态资源 - .excludePathPatterns("/", "/index.html", "/*.html", "/*.css", "/*.js", "/*.ico", "/static/**") + .excludePathPatterns("/", "/index.html", "/admin/login.html", "/*.css", "/*.js", "/*.ico", "/static/**") // 排除后台管理静态资源 .excludePathPatterns("/admin/**") // 排除 Druid 监控 diff --git a/src/main/java/com/corewing/app/controller/TutorialController.java b/src/main/java/com/corewing/app/controller/TutorialController.java index 428b66f..6e11875 100644 --- a/src/main/java/com/corewing/app/controller/TutorialController.java +++ b/src/main/java/com/corewing/app/controller/TutorialController.java @@ -33,6 +33,22 @@ public class TutorialController { this.tutorialCategoryService = tutorialCategoryService; } + /** + * 添加查看次数 + * @param tutorialId 教程id + * @return + */ + @GetMapping("/addViewCount") + public Result addViewCount(@RequestParam Long tutorialId) { + Tutorial tutorial = tutorialService.getById(tutorialId); + if(tutorial == null) { + return Result.error(); + } + tutorial.setViewCount(tutorial.getViewCount() + 1); + tutorialService.updateById(tutorial); + return Result.success(); + } + /** * 分类查询列表 * diff --git a/src/main/resources/static/tutorial/index.html b/src/main/resources/static/tutorial/index.html new file mode 100644 index 0000000..7959c43 --- /dev/null +++ b/src/main/resources/static/tutorial/index.html @@ -0,0 +1,10 @@ + + + + + 教程展示 + + + + + \ No newline at end of file