From a5f16646d4169e8812943858b1d26e3cd639e7a2 Mon Sep 17 00:00:00 2001
From: Saisai Liu <1374434128@qq.com>
Date: Sun, 25 Feb 2024 20:46:27 +0800
Subject: [PATCH] =?UTF-8?q?book=E5=8D=95=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
muyu-auth/pom.xml | 1 +
muyu-gateway/pom.xml | 6 ++++++
muyu-gateway/src/main/resources/bootstrap.yml | 2 +-
muyu-modules/muyu-system/pom.xml | 10 ++++++++++
.../muyu/system/controller/BookInfoController.java | 11 +++++++----
.../muyu/system/service/impl/BookInfoServiceImpl.java | 3 +++
.../main/resources/mapper/system/BookInfoMapper.xml | 4 +++-
pom.xml | 1 +
8 files changed, 32 insertions(+), 6 deletions(-)
diff --git a/muyu-auth/pom.xml b/muyu-auth/pom.xml
index a8ddedc..a5a2587 100644
--- a/muyu-auth/pom.xml
+++ b/muyu-auth/pom.xml
@@ -52,6 +52,7 @@
muyu-common-security
+
diff --git a/muyu-gateway/pom.xml b/muyu-gateway/pom.xml
index 2d3ed58..d8dd805 100644
--- a/muyu-gateway/pom.xml
+++ b/muyu-gateway/pom.xml
@@ -88,6 +88,12 @@
${swagger.fox.version}
+
+ com.alibaba.csp
+ sentinel-core
+ 1.8.7
+
+
diff --git a/muyu-gateway/src/main/resources/bootstrap.yml b/muyu-gateway/src/main/resources/bootstrap.yml
index f9c95e5..da96197 100644
--- a/muyu-gateway/src/main/resources/bootstrap.yml
+++ b/muyu-gateway/src/main/resources/bootstrap.yml
@@ -28,7 +28,7 @@ spring:
eager: true
transport:
# 控制台地址
- dashboard: 43.142.100.73:8718
+ dashboard: 43.142.100.73:8719
# nacos配置持久化
datasource:
ds1:
diff --git a/muyu-modules/muyu-system/pom.xml b/muyu-modules/muyu-system/pom.xml
index be58498..43c43e0 100644
--- a/muyu-modules/muyu-system/pom.xml
+++ b/muyu-modules/muyu-system/pom.xml
@@ -78,6 +78,16 @@
muyu-common-swagger
+
+
+ com.alibaba.csp
+ sentinel-core
+ 1.8.6
+
+
+ com.alibaba.csp
+ sentinel-annotation-aspectj
+
diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/controller/BookInfoController.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/controller/BookInfoController.java
index b385d65..a27cbfe 100644
--- a/muyu-modules/muyu-system/src/main/java/com/muyu/system/controller/BookInfoController.java
+++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/controller/BookInfoController.java
@@ -2,6 +2,10 @@ package com.muyu.system.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
+
+import com.alibaba.csp.sentinel.Entry;
+import com.alibaba.csp.sentinel.SphU;
+import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@@ -41,10 +45,9 @@ public class BookInfoController extends BaseController
@GetMapping("/list")
public Result> list(BookInfo bookInfo)
{
- startPage();
-
- List list = bookInfoService.selectBookInfoList(bookInfo);
- return getDataTable(list);
+ startPage();
+ List list = bookInfoService.selectBookInfoList(bookInfo);
+ return getDataTable(list);
}
/**
diff --git a/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/BookInfoServiceImpl.java b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/BookInfoServiceImpl.java
index 4a87c6a..71fee01 100644
--- a/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/BookInfoServiceImpl.java
+++ b/muyu-modules/muyu-system/src/main/java/com/muyu/system/service/impl/BookInfoServiceImpl.java
@@ -1,5 +1,7 @@
package com.muyu.system.service.impl;
+import com.alibaba.csp.sentinel.EntryType;
+import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.muyu.common.core.utils.DateUtils;
import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.system.domain.BookInfo;
@@ -40,6 +42,7 @@ public class BookInfoServiceImpl implements IBookInfoService {
* @return bookInfo
*/
@Override
+ @SentinelResource(value = "selectBookInfoList", entryType = EntryType.IN)
public List selectBookInfoList(BookInfo bookInfo) {
bookInfo.setCreateBy(SecurityUtils.getUsername());
return bookInfoMapper.selectBookInfoList(bookInfo);
diff --git a/muyu-modules/muyu-system/src/main/resources/mapper/system/BookInfoMapper.xml b/muyu-modules/muyu-system/src/main/resources/mapper/system/BookInfoMapper.xml
index c37c002..3fb6151 100644
--- a/muyu-modules/muyu-system/src/main/resources/mapper/system/BookInfoMapper.xml
+++ b/muyu-modules/muyu-system/src/main/resources/mapper/system/BookInfoMapper.xml
@@ -30,10 +30,12 @@
and author = #{author}
and type = #{type}
and images = #{images}
- and create_by = #{createBy}
+ and create_by = #{createBy}
and remak = #{remak}
and content = #{content}
and grounding = #{grounding}
+ and grounding > #{beginTime}
+ and grounding lt; #{endTime}
diff --git a/pom.xml b/pom.xml
index fc97f1d..1ac26d4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -206,6 +206,7 @@
${muyu.version}
+