From 35c44ac9613aceeaabdf8c752b1bd442e843f663 Mon Sep 17 00:00:00 2001
From: Bunny <1319900154@qq.com>
Date: Mon, 25 Dec 2023 16:47:24 +0800
Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=B7=A8=E5=9F=9F;=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9MySQL=E8=AF=AD=E6=B3=95=E9=94=99=E8=AF=AF;=E8=8E=B7?=
=?UTF-8?q?=E5=8F=96=E5=88=86=E7=B1=BB=E6=A0=91=E5=BD=A2=E6=95=B0=E6=8D=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.idea/workspace.xml | 64 +++++++------------
.../controller/CategoryController.java | 31 +++++++++
.../src/main/resources/application-dev.yml | 10 +--
.../mapper/product/CategoryMapper.xml | 12 +++-
4 files changed, 70 insertions(+), 47 deletions(-)
create mode 100644 spzx-service/service-product/src/main/java/cn/bunny/web/product/controller/CategoryController.java
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b05738c..762d4f3 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,47 +4,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
+
@@ -56,6 +20,7 @@
+
@@ -90,6 +55,10 @@
1703487755445
-
+
+
+
+ 1703491174875
+
+
+
+ 1703491174875
+
+
+
+
+
+
\ No newline at end of file
diff --git a/spzx-service/service-product/src/main/java/cn/bunny/web/product/controller/CategoryController.java b/spzx-service/service-product/src/main/java/cn/bunny/web/product/controller/CategoryController.java
new file mode 100644
index 0000000..51c2e63
--- /dev/null
+++ b/spzx-service/service-product/src/main/java/cn/bunny/web/product/controller/CategoryController.java
@@ -0,0 +1,31 @@
+package cn.bunny.web.product.controller;
+
+import cn.bunny.common.spzx.model.entity.product.Category;
+import cn.bunny.common.spzx.model.vo.common.Result;
+import cn.bunny.common.spzx.model.vo.common.ResultCodeEnum;
+import cn.bunny.web.product.service.CategoryService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@Tag(name = "分类接口管理")
+@RequestMapping(value="/api/product/category")
+@CrossOrigin
+public class CategoryController {
+ @Resource
+ private CategoryService categoryService;
+
+ @Operation(summary = "获取分类树形数据",description = "按照树型方式进行封装")
+ @GetMapping("findCategoryTree")
+ public Result findCategoryTree() {
+ List categoryList= categoryService.findCategoryTree();
+ return Result.build(categoryList, ResultCodeEnum.SUCCESS);
+ }
+}
diff --git a/spzx-service/service-product/src/main/resources/application-dev.yml b/spzx-service/service-product/src/main/resources/application-dev.yml
index 5d56c90..ff9b068 100644
--- a/spzx-service/service-product/src/main/resources/application-dev.yml
+++ b/spzx-service/service-product/src/main/resources/application-dev.yml
@@ -4,16 +4,16 @@ server:
spring:
application:
name: service-product
- cloud:
- nacos:
- discovery:
- server-addr: localhost:8848
+# cloud:
+# nacos:
+# discovery:
+# server-addr: localhost:8848
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://60.204.230.80:3306/db_spzx?characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true
username: root
- password: root
+ password: "02120212"
mybatis:
config-location: classpath:mybatis-config.xml
diff --git a/spzx-service/service-product/src/main/resources/mapper/product/CategoryMapper.xml b/spzx-service/service-product/src/main/resources/mapper/product/CategoryMapper.xml
index f6e99c5..136a2f7 100644
--- a/spzx-service/service-product/src/main/resources/mapper/product/CategoryMapper.xml
+++ b/spzx-service/service-product/src/main/resources/mapper/product/CategoryMapper.xml
@@ -11,7 +11,17 @@
+
+
+