From 52004cf2bacf8a4ce89927d05d5e0bc5c4ff649a Mon Sep 17 00:00:00 2001
From: bunny <1319900154@qq.com>
Date: Wed, 27 Mar 2024 13:14:26 +0800
Subject: [PATCH] =?UTF-8?q?feat(=E6=96=B0=E5=A2=9E-=E9=A6=96=E9=A1=B5?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3=E7=AE=A1=E7=90=86):=20=E8=8E=B7=E5=8F=96?=
=?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=95=B0=E6=8D=AE-=E4=BF=AE=E5=A4=8DSQL?=
=?UTF-8?q?=E8=AF=AD=E5=8F=A5=E5=86=99=E9=94=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: bunny <1319900154@qq.com>
---
.../src/main/resources/application.yml | 6 +++---
.../product/controller/IndexController.java | 2 ++
.../src/main/resources/application.yml | 18 ++++++++++++++++--
.../src/main/resources/logback-spring.xml | 2 +-
.../mapper/product/CategoryMapper.xml | 6 ++++--
5 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/spzx-manager/src/main/resources/application.yml b/spzx-manager/src/main/resources/application.yml
index 0289c69..59c06e1 100644
--- a/spzx-manager/src/main/resources/application.yml
+++ b/spzx-manager/src/main/resources/application.yml
@@ -23,9 +23,9 @@ spring:
logging:
level:
- com.atguigu.mapper: debug
- com.atguigu.controller: info
- com.atguigu.service: info
+ com.atguigu.spzx.manger.mapper: debug
+ com.atguigu.spzx.manger.controller: info
+ com.atguigu.spzx.manger.service: info
pattern:
dateformat: HH:mm:ss:SSS
file:
diff --git a/spzx-service/service-product/src/main/java/com/atguigu/product/controller/IndexController.java b/spzx-service/service-product/src/main/java/com/atguigu/product/controller/IndexController.java
index 19f21f8..893e982 100644
--- a/spzx-service/service-product/src/main/java/com/atguigu/product/controller/IndexController.java
+++ b/spzx-service/service-product/src/main/java/com/atguigu/product/controller/IndexController.java
@@ -9,6 +9,7 @@ import com.atguigu.spzx.model.vo.result.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
+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;
@@ -18,6 +19,7 @@ import java.util.List;
@Tag(name = "首页接口管理")
@RestController
@RequestMapping(value = "/api/product/index")
+@CrossOrigin
public class IndexController {
@Autowired
private CategoryService categoryService;
diff --git a/spzx-service/service-product/src/main/resources/application.yml b/spzx-service/service-product/src/main/resources/application.yml
index a9dfd31..439cc67 100644
--- a/spzx-service/service-product/src/main/resources/application.yml
+++ b/spzx-service/service-product/src/main/resources/application.yml
@@ -17,6 +17,20 @@ spring:
username: ${bunny.datasource.username}
password: "${bunny.datasource.password}"
+logging:
+ level:
+ com.atguigu.product.mapper: debug
+ com.atguigu.product.controller: info
+ com.atguigu.product.service: info
+ pattern:
+ dateformat: HH:mm:ss:SSS
+ file:
+ path: "logs/${spring.application.name}"
+
mybatis:
- config-location: classpath:mybatis-config.xml
- mapper-locations: classpath:/mapper/*/*.xml
\ No newline at end of file
+ type-aliases-package: com.atguigu.spzx.model
+ mapper-locations: classpath:/mapper/*/*.xml
+ configuration:
+ log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+ map-underscore-to-camel-case: true
+ auto-mapping-behavior: full
diff --git a/spzx-service/service-product/src/main/resources/logback-spring.xml b/spzx-service/service-product/src/main/resources/logback-spring.xml
index acce308..0e33e44 100644
--- a/spzx-service/service-product/src/main/resources/logback-spring.xml
+++ b/spzx-service/service-product/src/main/resources/logback-spring.xml
@@ -4,7 +4,7 @@
logback
-
+
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 a06193c..4014a09 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,9 @@
select
from category
- where is_deleted = 0
- and parent_id = #{parentId} order by id
+ where parent_id = 0
+ and status = 1
+ and is_deleted = 0
+ order by order_num