commit da6d9c70d1fd94ba43643cfaaae889195dc66cb0
Author: pqh <2897412868@qq.com>
Date: Tue Nov 7 21:11:59 2023 +0800
初始化
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5ff6309
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store
\ No newline at end of file
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..35410ca
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,8 @@
+# 默认忽略的文件
+/shelf/
+/workspace.xml
+# 基于编辑器的 HTTP 客户端请求
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..a3d04d0
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/mavenServices.xml b/.idea/mavenServices.xml
new file mode 100644
index 0000000..ace6d4b
--- /dev/null
+++ b/.idea/mavenServices.xml
@@ -0,0 +1,9 @@
+
+
+
+ https://oss.sonatype.org/service/local/
+ https://repo.jfrog.org/artifactory/api/
+ https://repository.jboss.org/nexus/service/local/
+ http://124.223.23.100:8081/repository/maven-public/
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..82dbec8
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
new file mode 100644
index 0000000..2b63946
--- /dev/null
+++ b/.idea/uiDesigner.xml
@@ -0,0 +1,124 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/bwie-auth/.gitignore b/bwie-auth/.gitignore
new file mode 100644
index 0000000..5ff6309
--- /dev/null
+++ b/bwie-auth/.gitignore
@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store
\ No newline at end of file
diff --git a/bwie-auth/pom.xml b/bwie-auth/pom.xml
new file mode 100644
index 0000000..812e5a8
--- /dev/null
+++ b/bwie-auth/pom.xml
@@ -0,0 +1,34 @@
+
+
+ 4.0.0
+
+ com.bwie
+ zg6-month-exam-1107
+ 1.0-SNAPSHOT
+
+
+ bwie-auth
+
+
+ 17
+ 17
+ UTF-8
+
+
+
+
+
+
+ com.bwie
+ bwie-common
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+
diff --git a/bwie-auth/src/main/java/com/bwie/auth/AuthApplication.java b/bwie-auth/src/main/java/com/bwie/auth/AuthApplication.java
new file mode 100644
index 0000000..8e8ef2a
--- /dev/null
+++ b/bwie-auth/src/main/java/com/bwie/auth/AuthApplication.java
@@ -0,0 +1,19 @@
+package com.bwie.auth;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+
+/**
+ * @author : 李朋果
+ * @ClassName : AuthApplication
+ * @description : 描述说明该类的功能
+ * @createTime : 2023/11/7 9:14
+ */
+@SpringBootApplication
+@EnableFeignClients
+public class AuthApplication {
+ public static void main(String[] args) {
+ SpringApplication.run(AuthApplication.class);
+ }
+}
diff --git a/bwie-auth/src/main/java/com/bwie/auth/controller/AuthController.java b/bwie-auth/src/main/java/com/bwie/auth/controller/AuthController.java
new file mode 100644
index 0000000..df6c499
--- /dev/null
+++ b/bwie-auth/src/main/java/com/bwie/auth/controller/AuthController.java
@@ -0,0 +1,55 @@
+package com.bwie.auth.controller;
+
+import com.bwie.auth.service.AuthService;
+import com.bwie.common.domain.User;
+import com.bwie.common.domain.request.LoginRequest;
+import com.bwie.common.domain.response.JwtResponse;
+import com.bwie.common.result.Result;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author : 李朋果
+ * @ClassName : AuthController
+ * @description : 描述说明该类的功能
+ * @createTime : 2023/11/7 9:12
+ */
+@RestController
+public class AuthController {
+ private AuthService authService;
+
+ public AuthController(AuthService authService) {
+ this.authService = authService;
+ }
+
+ /**
+ * 根据用户名
+ * @param loginRequest
+ * @return
+ */
+ @PostMapping("/login")
+ public Result login(@RequestBody LoginRequest loginRequest) {
+ Result result=authService.login(loginRequest);
+ return result;
+ }
+
+ /**
+ * 获取用户信息
+ * @return
+ */
+ @GetMapping("/user/info")
+ public Result userInfo(){
+ User user = authService.userInfo();
+ return Result.success(user);
+ }
+ /**
+ * 登出
+ */
+ @PostMapping("/logout")
+ public Result logout() {
+ authService.logout();
+ return Result.success();
+ }
+}
diff --git a/bwie-auth/src/main/java/com/bwie/auth/feign/UserFeignService.java b/bwie-auth/src/main/java/com/bwie/auth/feign/UserFeignService.java
new file mode 100644
index 0000000..a88602b
--- /dev/null
+++ b/bwie-auth/src/main/java/com/bwie/auth/feign/UserFeignService.java
@@ -0,0 +1,19 @@
+package com.bwie.auth.feign;
+
+import com.bwie.common.domain.User;
+import com.bwie.common.result.Result;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+
+/**
+ * @author : 李朋果
+ * @ClassName : UserFeignService
+ * @description : 描述说明该类的功能
+ * @createTime : 2023/11/7 9:13
+ */
+@FeignClient(value = "bwie-user")
+public interface UserFeignService {
+ @PostMapping("/findByUserName/{username}")
+ public Result findByUserName(@PathVariable String username);
+}
diff --git a/bwie-auth/src/main/java/com/bwie/auth/service/AuthService.java b/bwie-auth/src/main/java/com/bwie/auth/service/AuthService.java
new file mode 100644
index 0000000..3e5db09
--- /dev/null
+++ b/bwie-auth/src/main/java/com/bwie/auth/service/AuthService.java
@@ -0,0 +1,21 @@
+package com.bwie.auth.service;
+
+import com.bwie.common.domain.User;
+import com.bwie.common.domain.request.LoginRequest;
+import com.bwie.common.domain.response.JwtResponse;
+import com.bwie.common.result.Result;
+
+/**
+ * @author : 李朋果
+ * @ClassName : AuthService
+ * @description : 描述说明该类的功能
+ * @createTime : 2023/11/7 9:13
+ */
+public interface AuthService {
+ User userInfo();
+
+ Result login(LoginRequest loginRequest);
+
+ void logout();
+
+}
diff --git a/bwie-auth/src/main/java/com/bwie/auth/service/impl/AuthServiceImpl.java b/bwie-auth/src/main/java/com/bwie/auth/service/impl/AuthServiceImpl.java
new file mode 100644
index 0000000..a16fa13
--- /dev/null
+++ b/bwie-auth/src/main/java/com/bwie/auth/service/impl/AuthServiceImpl.java
@@ -0,0 +1,87 @@
+package com.bwie.auth.service.impl;
+
+import cn.hutool.http.server.HttpServerRequest;
+import com.alibaba.fastjson.JSONObject;
+import com.bwie.auth.feign.UserFeignService;
+import com.bwie.auth.service.AuthService;
+import com.bwie.common.constants.JwtConstants;
+import com.bwie.common.constants.TokenConstants;
+import com.bwie.common.domain.User;
+import com.bwie.common.domain.request.LoginRequest;
+import com.bwie.common.domain.response.JwtResponse;
+import com.bwie.common.result.Result;
+import com.bwie.common.utils.JwtUtils;
+import com.bwie.common.utils.StringUtils;
+import org.springframework.data.redis.core.StringRedisTemplate;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
+import java.util.UUID;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author : 李朋果
+ * @ClassName : AuthServiceImpl
+ * @description : 描述说明该类的功能
+ * @createTime : 2023/11/7 9:13
+ */
+@Service
+public class AuthServiceImpl implements AuthService {
+ private UserFeignService userFeignService;
+ private StringRedisTemplate stringRedisTemplate;
+ private HttpServletRequest request;
+
+ public AuthServiceImpl(UserFeignService userFeignService, StringRedisTemplate stringRedisTemplate, HttpServletRequest request) {
+ this.userFeignService = userFeignService;
+ this.stringRedisTemplate = stringRedisTemplate;
+ this.request = request;
+ }
+
+
+
+
+ @Override
+ public Result login(LoginRequest loginRequest) {
+ if (StringUtils.isAllBlank(loginRequest.getUsername(),loginRequest.getPassword())) {
+ return Result.error("用户名或密码不正确");
+ }
+ Result byUserName = userFeignService.findByUserName(loginRequest.getUsername());
+ User loginUser = byUserName.getData();
+ if (null == loginUser) {
+ return Result.error("用户名不存在");
+ }
+
+ if (!loginRequest.getPassword().equals(loginUser.getPassword())) {
+ return Result.error("密码不正确");
+ }
+
+ //登录成功
+ String userKey = UUID.randomUUID().toString().replaceAll("-", "");
+ HashMap claims = new HashMap<>();
+ claims.put(JwtConstants.USER_KEY,userKey);
+ String token = JwtUtils.createToken(claims);
+ //存用户信息 loginUser
+ stringRedisTemplate.opsForValue().set(TokenConstants.LOGIN_TOKEN_KEY+userKey, JSONObject.toJSONString(loginUser),30, TimeUnit.MINUTES);
+ //返回数据
+ JwtResponse jwtResponse = new JwtResponse();
+ jwtResponse.setToken(token);
+ jwtResponse.setExpireTime("30MIN");
+
+ return Result.success(jwtResponse);
+ }
+ @Override
+ public User userInfo() {
+ String token = request.getHeader(TokenConstants.TOKEN);
+ String userKey = JwtUtils.getUserKey(token);
+ String s = stringRedisTemplate.opsForValue().get(TokenConstants.LOGIN_TOKEN_KEY + userKey);
+ return JSONObject.parseObject(s,User.class);
+ }
+ @Override
+ public void logout() {
+ String token = request.getHeader(TokenConstants.TOKEN);
+ String userKey = JwtUtils.getUserKey(token);
+ stringRedisTemplate.delete(TokenConstants.LOGIN_TOKEN_KEY + userKey);
+ }
+}
diff --git a/bwie-auth/src/main/resources/bootstrap.yml b/bwie-auth/src/main/resources/bootstrap.yml
new file mode 100644
index 0000000..91b928c
--- /dev/null
+++ b/bwie-auth/src/main/resources/bootstrap.yml
@@ -0,0 +1,30 @@
+# Tomcat
+server:
+ port: 9001
+# Spring
+spring:
+ main:
+ allow-circular-references: true
+ jackson:
+ date-format: yyyy-MM-dd HH:mm:ss
+ time-zone: GMT+8
+ application:
+ # 应用名称
+ name: bwie-auth
+ profiles:
+ # 环境配置
+ active: dev
+ cloud:
+ nacos:
+ discovery:
+ # 服务注册地址
+ server-addr: 124.223.23.100:8848
+ config:
+ # 配置中心地址
+ server-addr: 124.223.23.100:8848
+ # 配置文件格式
+ file-extension: yml
+ # 共享配置
+ shared-configs:
+ - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
+
diff --git a/bwie-common/.gitignore b/bwie-common/.gitignore
new file mode 100644
index 0000000..5ff6309
--- /dev/null
+++ b/bwie-common/.gitignore
@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store
\ No newline at end of file
diff --git a/bwie-common/pom.xml b/bwie-common/pom.xml
new file mode 100644
index 0000000..de76eb3
--- /dev/null
+++ b/bwie-common/pom.xml
@@ -0,0 +1,125 @@
+
+
+ 4.0.0
+
+ com.bwie
+ zg6-month-exam-1107
+ 1.0-SNAPSHOT
+
+
+ bwie-common
+
+
+ 17
+ 17
+ UTF-8
+
+
+
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-bootstrap
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-discovery
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-config
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-sentinel
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-loadbalancer
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-openfeign
+
+
+
+ io.jsonwebtoken
+ jjwt
+ 0.9.1
+
+
+
+ com.alibaba
+ fastjson
+ 1.2.80
+
+
+
+ org.springframework.boot
+ spring-boot-starter-data-redis
+
+
+
+ org.springframework.boot
+ spring-boot-starter-validation
+
+
+
+ org.apache.commons
+ commons-lang3
+
+
+
+ org.projectlombok
+ lombok
+
+
+
+ cn.hutool
+ hutool-all
+ 5.8.3
+
+
+
+ com.aliyun
+ dysmsapi20170525
+ 2.0.1
+
+
+
+ com.aliyun.oss
+ aliyun-sdk-oss
+ 3.12.0
+
+
+
+ org.springframework.boot
+ spring-boot-starter-amqp
+
+
+
+ com.github.tobato
+ fastdfs-client
+ 1.26.5
+
+
+
+ org.redisson
+ redisson
+ 3.16.0
+
+
+
+
diff --git a/bwie-common/src/main/java/com/bwie/common/config/RedisConfig.java b/bwie-common/src/main/java/com/bwie/common/config/RedisConfig.java
new file mode 100644
index 0000000..b62e4b1
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/config/RedisConfig.java
@@ -0,0 +1,40 @@
+package com.bwie.common.config;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.PropertyAccessor;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+@Configuration
+public class RedisConfig {
+
+ @Bean
+ public RedisTemplate redisTemplate(RedisConnectionFactory factory) {
+ RedisTemplate template = new RedisTemplate<>();
+ template.setConnectionFactory(factory);
+ Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new
+ Jackson2JsonRedisSerializer(Object.class);
+ ObjectMapper om = new ObjectMapper();
+ om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
+ om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+ jackson2JsonRedisSerializer.setObjectMapper(om);
+
+ StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
+ // key采用String的序列化方式
+ template.setKeySerializer(stringRedisSerializer);
+ // hash的key也采用String的序列化方式
+ template.setHashKeySerializer(stringRedisSerializer);
+ // value序列化方式采用jackson
+ template.setValueSerializer(jackson2JsonRedisSerializer);
+ // hash的value序列化方式采用jackson
+ template.setHashValueSerializer(jackson2JsonRedisSerializer);
+ template.afterPropertiesSet();
+
+ return template;
+ }
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/config/RedissonConfig.java b/bwie-common/src/main/java/com/bwie/common/config/RedissonConfig.java
new file mode 100644
index 0000000..548e164
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/config/RedissonConfig.java
@@ -0,0 +1,33 @@
+package com.bwie.common.config;
+
+import org.redisson.Redisson;
+import org.redisson.api.RedissonClient;
+import org.redisson.config.Config;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import java.io.IOException;
+
+/**
+ * @BelongsProject: demo02
+ * @BelongsPackage: com.bw.config
+ * @Author: zhupengfei
+ * @CreateTime: 2022-12-24 09:26
+ */
+
+@Configuration
+public class RedissonConfig {
+
+ @Bean(destroyMethod="shutdown") // 服务停止后调用 shutdown 方法。
+ public RedissonClient redisson() throws IOException {
+ System.out.println("配置类初始加载......");
+ // 1.创建配置
+ Config config = new Config();
+ // 集群模式
+ // config.useClusterServers().addNodeAddress("127.0.0.1:6379", "127.0.0.1:6378");
+ // 2.根据 Config 创建出 RedissonClient 实例。
+ config.useSingleServer().setAddress("redis://8.130.43.65:6379");
+ return Redisson.create(config);
+ }
+
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/constants/Constants.java b/bwie-common/src/main/java/com/bwie/common/constants/Constants.java
new file mode 100644
index 0000000..2fdc9fe
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/constants/Constants.java
@@ -0,0 +1,18 @@
+package com.bwie.common.constants;
+
+/**
+ * @description: 系统常量
+ * @author DongZl
+ */
+public class Constants {
+ /**
+ * 成功标记
+ */
+ public static final Integer SUCCESS = 200;
+ public static final String SUCCESS_MSG = "操作成功";
+ /**
+ * 失败标记
+ */
+ public static final Integer ERROR = 500;
+ public static final String ERROR_MSG = "操作异常";
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/constants/JwtConstants.java b/bwie-common/src/main/java/com/bwie/common/constants/JwtConstants.java
new file mode 100644
index 0000000..03692c1
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/constants/JwtConstants.java
@@ -0,0 +1,29 @@
+package com.bwie.common.constants;
+
+/**
+ * @author DongZl
+ * @description: Jwt常量
+ */
+public class JwtConstants {
+
+ /**
+ * 用户ID字段
+ */
+ public static final String DETAILS_USER_ID = "user_id";
+
+ /**
+ * 用户名字段
+ */
+ public static final String DETAILS_USERNAME = "username";
+
+ /**
+ * 用户标识
+ */
+ public static final String USER_KEY = "user_key";
+
+ /**
+ * 令牌秘钥
+ */
+ public final static String SECRET = "abcdefghijklmnopqrstuvwxyz";
+
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/constants/RabbitMQConstants.java b/bwie-common/src/main/java/com/bwie/common/constants/RabbitMQConstants.java
new file mode 100644
index 0000000..e442e68
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/constants/RabbitMQConstants.java
@@ -0,0 +1,11 @@
+package com.bwie.common.constants;
+
+/**
+ * @author : 李朋果
+ * @ClassName : RabbitMQConstants
+ * @description : 描述说明该类的功能
+ * @createTime : 2023/11/7 16:41
+ */
+public class RabbitMQConstants {
+
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/constants/RedisConstants.java b/bwie-common/src/main/java/com/bwie/common/constants/RedisConstants.java
new file mode 100644
index 0000000..e424c39
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/constants/RedisConstants.java
@@ -0,0 +1,15 @@
+package com.bwie.common.constants;
+
+import lombok.Data;
+
+/**
+ * @author : 李朋果
+ * @ClassName : RedisConstants
+ * @description : 描述说明该类的功能
+ * @createTime : 2023/11/7 16:41
+ */
+
+public class RedisConstants {
+
+ public static final String REDIS_KEY="redis_key";
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/constants/TokenConstants.java b/bwie-common/src/main/java/com/bwie/common/constants/TokenConstants.java
new file mode 100644
index 0000000..1871fb7
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/constants/TokenConstants.java
@@ -0,0 +1,24 @@
+package com.bwie.common.constants;
+
+/**
+ * @author DongZl
+ * @description: 令牌常量
+ */
+public class TokenConstants {
+ /**
+ * 缓存有效期,默认720(分钟)
+ */
+ public final static long EXPIRATION = 720;
+ /**
+ * 缓存刷新时间,默认120(分钟)
+ */
+ public final static long REFRESH_TIME = 120;
+ /**
+ * 权限缓存前缀
+ */
+ public final static String LOGIN_TOKEN_KEY = "login_tokens:";
+ /**
+ * token标识
+ */
+ public static final String TOKEN = "token";
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/domain/GoodsInfo.java b/bwie-common/src/main/java/com/bwie/common/domain/GoodsInfo.java
new file mode 100644
index 0000000..90dc9bd
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/domain/GoodsInfo.java
@@ -0,0 +1,59 @@
+package com.bwie.common.domain;
+
+import lombok.Data;
+
+/**
+ * @author : 李朋果
+ * @ClassName : GoodsInfo
+ * @description : 描述说明该类的功能
+ * @createTime : 2023/11/7 10:24
+ */
+@Data
+public class GoodsInfo {
+ /**
+ * 编号
+ */
+ private Long id;
+ /**
+ *商品名称
+ */
+ private String goodsName;
+ /**
+ *商品类别
+ */
+ private String goodsType;
+ /**
+ * 商品图片
+ */
+ private String goodsPic;
+ /**
+ * 商品简介
+ */
+ private String goodsDetails;
+ /**
+ *商品价格
+ */
+ private Double goodsPrice;
+ /**
+ * 砍价规则
+ */
+ private Integer bargainRuleId;
+ /**
+ * 成功砍价数量
+ */
+ private Integer successNum;
+ /**
+ * 正在砍价数量
+ */
+ private Integer beInNum;
+ /**
+ * 参与客户数量
+ */
+ private Integer joinClientNum;
+ /**
+ * 商品状态
+ */
+ private Integer goodsStatus;
+
+
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/domain/Rule.java b/bwie-common/src/main/java/com/bwie/common/domain/Rule.java
new file mode 100644
index 0000000..b1c03fe
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/domain/Rule.java
@@ -0,0 +1,29 @@
+package com.bwie.common.domain;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotEmpty;
+
+/**
+ * @author : 李朋果
+ * @ClassName : Rule
+ * @description : 规则信息
+ * @createTime : 2023/11/7 14:01
+ */
+@Data
+public class Rule {
+ /**
+ *
+ */
+ private Long id;
+ @NotEmpty(message = "砍价规则名称不能为空")
+ private String ruleName;
+ private Integer typeId;
+ private Integer startNum;
+ private Integer endNum;
+ private Double startRadius;
+ private Double endRadius;
+
+ private String typeName;
+
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/domain/TypeInfo.java b/bwie-common/src/main/java/com/bwie/common/domain/TypeInfo.java
new file mode 100644
index 0000000..12d941d
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/domain/TypeInfo.java
@@ -0,0 +1,15 @@
+package com.bwie.common.domain;
+
+import lombok.Data;
+
+/**
+ * @author : 李朋果
+ * @ClassName : TypeInfo
+ * @description : 砍价类型信息
+ * @createTime : 2023/11/7 16:33
+ */
+@Data
+public class TypeInfo {
+ private Long id;
+ private String typeName;
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/domain/User.java b/bwie-common/src/main/java/com/bwie/common/domain/User.java
new file mode 100644
index 0000000..d27c7cb
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/domain/User.java
@@ -0,0 +1,19 @@
+package com.bwie.common.domain;
+
+import lombok.Data;
+
+/**
+ * @author : 李朋果
+ * @ClassName : User
+ * @description : 描述说明该类的功能
+ * @createTime : 2023/11/7 9:14
+ */
+@Data
+public class User {
+ private Integer userId;
+ private String username;
+ private String password;
+ private String name;
+ private String phone;
+ private String role;
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/domain/request/GoodsRequest.java b/bwie-common/src/main/java/com/bwie/common/domain/request/GoodsRequest.java
new file mode 100644
index 0000000..82751a4
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/domain/request/GoodsRequest.java
@@ -0,0 +1,18 @@
+package com.bwie.common.domain.request;
+
+import lombok.Data;
+
+/**
+ * @author : 李朋果
+ * @ClassName : GoodsRequest
+ * @description : 描述说明该类的功能
+ * @createTime : 2023/11/7 10:58
+ */
+@Data
+public class GoodsRequest {
+ private Integer pageNum=1;
+ private Integer pageSize=10;
+
+ private String goodsName;
+ private String goodsType;
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/domain/request/LoginRequest.java b/bwie-common/src/main/java/com/bwie/common/domain/request/LoginRequest.java
new file mode 100644
index 0000000..e590429
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/domain/request/LoginRequest.java
@@ -0,0 +1,15 @@
+package com.bwie.common.domain.request;
+
+import lombok.Data;
+
+/**
+ * @author : 李朋果
+ * @ClassName : LoginRequest
+ * @description : 描述说明该类的功能
+ * @createTime : 2023/11/7 9:16
+ */
+@Data
+public class LoginRequest {
+ private String username;
+ private String password;
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/domain/response/JwtResponse.java b/bwie-common/src/main/java/com/bwie/common/domain/response/JwtResponse.java
new file mode 100644
index 0000000..b91c1fb
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/domain/response/JwtResponse.java
@@ -0,0 +1,16 @@
+package com.bwie.common.domain.response;
+
+import lombok.Data;
+
+/**
+ * @author : 李朋果
+ * @ClassName : JwtResponse
+ * @description : 描述说明该类的功能
+ * @createTime : 2023/11/7 9:16
+ */
+@Data
+public class JwtResponse {
+ private String token;
+ private String expireTime;
+}
+
diff --git a/bwie-common/src/main/java/com/bwie/common/result/PageResult.java b/bwie-common/src/main/java/com/bwie/common/result/PageResult.java
new file mode 100644
index 0000000..85ecdda
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/result/PageResult.java
@@ -0,0 +1,34 @@
+package com.bwie.common.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author DongZl
+ * @description: 列表返回结果集
+ */
+@Data
+public class PageResult implements Serializable {
+ /**
+ * 总条数
+ */
+ private long total;
+ /**
+ * 结果集合
+ */
+ private List list;
+ public PageResult() {
+ }
+ public PageResult(long total, List list) {
+ this.total = total;
+ this.list = list;
+ }
+ public static PageResult toPageResult(long total, List list){
+ return new PageResult(total , list);
+ }
+ public static Result> toResult(long total, List list){
+ return Result.success(PageResult.toPageResult(total,list));
+ }
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/result/Result.java b/bwie-common/src/main/java/com/bwie/common/result/Result.java
new file mode 100644
index 0000000..30b1e73
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/result/Result.java
@@ -0,0 +1,76 @@
+package com.bwie.common.result;
+
+import com.bwie.common.constants.Constants;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author DongZl
+ * @description: 响应信息主体
+ */
+@Data
+public class Result implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+ /**
+ * 成功
+ */
+ public static final int SUCCESS = Constants.SUCCESS;
+ /**
+ * 失败
+ */
+ public static final int FAIL = Constants.ERROR;
+ /**
+ * 返回状态码
+ */
+ private int code;
+ /**
+ * 响应信息
+ */
+ private String msg;
+ /**
+ * 响应数据
+ */
+ private T data;
+
+ public static Result success() {
+ return restResult(null, SUCCESS, Constants.SUCCESS_MSG);
+ }
+
+ public static Result success(T data) {
+ return restResult(data, SUCCESS, Constants.SUCCESS_MSG);
+ }
+
+ public static Result success(T data, String msg) {
+ return restResult(data, SUCCESS, msg);
+ }
+
+ public static Result error() {
+ return restResult(null, FAIL, Constants.ERROR_MSG);
+ }
+
+ public static Result error(String msg) {
+ return restResult(null, FAIL, msg);
+ }
+
+ public static Result error(T data) {
+ return restResult(data, FAIL, Constants.ERROR_MSG);
+ }
+
+ public static Result error(T data, String msg) {
+ return restResult(data, FAIL, msg);
+ }
+
+ public static Result error(int code, String msg) {
+ return restResult(null, code, msg);
+ }
+
+ private static Result restResult(T data, int code, String msg) {
+ Result apiResult = new Result<>();
+ apiResult.setCode(code);
+ apiResult.setData(data);
+ apiResult.setMsg(msg);
+ return apiResult;
+ }
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/utils/FastUtil.java b/bwie-common/src/main/java/com/bwie/common/utils/FastUtil.java
new file mode 100644
index 0000000..94b1722
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/utils/FastUtil.java
@@ -0,0 +1,55 @@
+package com.bwie.common.utils;
+
+import org.springframework.stereotype.Component;
+import com.github.tobato.fastdfs.domain.fdfs.StorePath;
+import com.github.tobato.fastdfs.service.FastFileStorageClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.util.StringUtils;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+
+/**
+ * @BelongsProject: 0107day02
+ * @BelongsPackage: com.bw.config
+ * @Author: zhupengfei
+ * @CreateTime: 2023-02-01 08:52
+ */
+@Component
+public class FastUtil {
+ private static final Logger log = LoggerFactory.getLogger(FastUtil.class);
+
+ @Resource
+ private FastFileStorageClient storageClient ;
+
+ /**
+ * 上传文件
+ */
+ public String upload(MultipartFile multipartFile) throws Exception{
+ String originalFilename = multipartFile.getOriginalFilename().
+ substring(multipartFile.getOriginalFilename().
+ lastIndexOf(".") + 1);
+ StorePath storePath = this.storageClient.uploadImageAndCrtThumbImage(
+ multipartFile.getInputStream(),
+ multipartFile.getSize(),originalFilename , null);
+ return storePath.getFullPath() ;
+ }
+ /**
+ * 删除文件
+ */
+ public String deleteFile(String fileUrl) {
+ if (StringUtils.isEmpty(fileUrl)) {
+ log.info("fileUrl == >>文件路径为空...");
+ return "文件路径不能为空";
+ }
+ try {
+ StorePath storePath = StorePath.parseFromUrl(fileUrl);
+ storageClient.deleteFile(storePath.getGroup(), storePath.getPath());
+ } catch (Exception e) {
+ log.error(e.getMessage());
+ }
+ return "删除成功";
+ }
+
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/utils/JwtUtils.java b/bwie-common/src/main/java/com/bwie/common/utils/JwtUtils.java
new file mode 100644
index 0000000..f560aa9
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/utils/JwtUtils.java
@@ -0,0 +1,109 @@
+package com.bwie.common.utils;
+
+import com.bwie.common.constants.JwtConstants;
+import io.jsonwebtoken.Claims;
+import io.jsonwebtoken.Jwts;
+import io.jsonwebtoken.SignatureAlgorithm;
+
+import java.util.Map;
+
+/**
+ * @description: Jwt工具类
+ * @author DongZl
+ */
+public class JwtUtils {
+
+ /**
+ * 秘钥
+ */
+ public static String secret = JwtConstants.SECRET;
+
+ /**
+ * 从数据声明生成令牌
+ *
+ * @param claims 数据声明
+ * @return 令牌
+ */
+ public static String createToken(Map claims){
+ String token = Jwts.builder().setClaims(claims).signWith(SignatureAlgorithm.HS512, secret).compact();
+ return token;
+ }
+
+ /**
+ * 从令牌中获取数据声明
+ *
+ * @param token 令牌
+ * @return 数据声明
+ */
+ public static Claims parseToken(String token){
+ return Jwts.parser().setSigningKey(secret).parseClaimsJws(token).getBody();
+ }
+ /**
+ * 根据令牌获取用户标识
+ *
+ * @param token 令牌
+ * @return 用户ID
+ */
+ public static String getUserKey(String token){
+ Claims claims = parseToken(token);
+ return getValue(claims, JwtConstants.USER_KEY);
+ }
+ /**
+ * 根据令牌获取用户标识
+ *
+ * @param claims 身份信息
+ * @return 用户ID
+ */
+ public static String getUserKey(Claims claims){
+ return getValue(claims, JwtConstants.USER_KEY);
+ }
+ /**
+ * 根据令牌获取用户ID
+ *
+ * @param token 令牌
+ * @return 用户ID
+ */
+ public static String getUserId(String token){
+ Claims claims = parseToken(token);
+ return getValue(claims, JwtConstants.DETAILS_USER_ID);
+ }
+ /**
+ * 根据身份信息获取用户ID
+ *
+ * @param claims 身份信息
+ * @return 用户ID
+ */
+ public static String getUserId(Claims claims){
+ return getValue(claims, JwtConstants.DETAILS_USER_ID);
+ }
+ /**
+ * 根据令牌获取用户名
+ *
+ * @param token 令牌
+ * @return 用户名
+ */
+ public static String getUserName(String token){
+ Claims claims = parseToken(token);
+ return getValue(claims, JwtConstants.DETAILS_USERNAME);
+ }
+ /**
+ * 根据身份信息获取用户名
+ *
+ * @param claims 身份信息
+ * @return 用户名
+ */
+ public static String getUserName(Claims claims){
+ return getValue(claims, JwtConstants.DETAILS_USERNAME);
+ }
+ /**
+ * 根据身份信息获取键值
+ *
+ * @param claims 身份信息
+ * @param key 键
+ * @return 值
+ */
+ public static String getValue(Claims claims, String key){
+ Object obj = claims.get(key);
+ return obj == null ? "" : obj.toString();
+ }
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/utils/OssUtil.java b/bwie-common/src/main/java/com/bwie/common/utils/OssUtil.java
new file mode 100644
index 0000000..9c1383f
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/utils/OssUtil.java
@@ -0,0 +1,153 @@
+package com.bwie.common.utils;
+
+import com.aliyun.oss.OSS;
+import com.aliyun.oss.OSSClientBuilder;
+import com.aliyun.oss.model.GetObjectRequest;
+import com.aliyun.oss.model.PutObjectRequest;
+import lombok.extern.log4j.Log4j2;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.*;
+import java.time.LocalDateTime;
+import java.util.UUID;
+
+/**
+ * Oss服务调用
+ */
+@Log4j2
+public class OssUtil {
+
+ /**
+ * Endpoint 存储对象概述 阿里云主账号AccessKey,accessKeySecret拥有所有API的访问权限 访问路径前缀 存储对象概述
+ */
+ private static String endPoint = "oss-cn-shanghai.aliyuncs.com";
+ private static String accessKeyId = "LTAI5tD2tppzLQ4Rb6yKYyph";
+ private static String accessKeySecret = "KEKNKwVvDq7PZLjE63NPBouqHXox4Q";
+ private static String accessPre = "https://dzlmuyu.oss-cn-shanghai.aliyuncs.com/";
+
+ /**
+ * bucket名称
+ * @return
+ */
+ private static String bucketName = "dzlmuyu";
+
+ private static OSS ossClient ;
+
+ static {
+ ossClient = new OSSClientBuilder().build(
+ endPoint,
+ accessKeyId,
+ accessKeySecret);
+ log.info("oss服务连接成功!");
+ }
+
+ /**
+ * 默认路径上传本地文件
+ * @param filePath
+ */
+ public static String uploadFile(String filePath){
+ return uploadFileForBucket(bucketName,getOssFilePath(filePath) ,filePath);
+ }
+
+ /**
+ * 默认路径上传multipartFile文件
+ * @param multipartFile
+ */
+ public static String uploadMultipartFile(MultipartFile multipartFile) {
+ return uploadMultipartFile(bucketName,getOssFilePath(multipartFile.getOriginalFilename()),multipartFile);
+ }
+ /**
+ * 上传 multipartFile 类型文件
+ * @param bucketName
+ * @param ossPath
+ * @param multipartFile
+ */
+ public static String uploadMultipartFile(String bucketName , String ossPath , MultipartFile multipartFile){
+ InputStream inputStream = null;
+ try {
+ inputStream = multipartFile.getInputStream();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ uploadFileInputStreamForBucket(bucketName, ossPath, inputStream);
+ return accessPre+ossPath;
+ }
+
+ /**
+ * 使用File上传PutObject上传文件 ** 程序默认使用次方法上传
+ * @param bucketName 实例名称
+ * @param ossPath oss存储路径
+ * @param filePath 本地文件路径
+ */
+ public static String uploadFileForBucket(String bucketName , String ossPath , String filePath) {
+ // 创建PutObjectRequest对象。
+ PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, ossPath, new File(filePath));
+
+ // 上传
+ ossClient.putObject(putObjectRequest);
+ return accessPre+ossPath;
+ }
+
+ /**
+ * 使用文件流上传到指定的bucket实例
+ * @param bucketName 实例名称
+ * @param ossPath oss存储路径
+ * @param filePath 本地文件路径
+ */
+ public static String uploadFileInputStreamForBucket(String bucketName , String ossPath , String filePath){
+
+ // 填写本地文件的完整路径。如果未指定本地路径,则默认从示例程序所属项目对应本地路径中上传文件流。
+ InputStream inputStream = null;
+ try {
+ inputStream = new FileInputStream(filePath);
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ }
+ // 填写Bucket名称和Object完整路径。Object完整路径中不能包含Bucket名称。
+ uploadFileInputStreamForBucket(bucketName, ossPath, inputStream);
+ return accessPre+ossPath;
+ }
+
+ public static void uploadFileInputStreamForBucket(String bucketName , String ossPath , InputStream inputStream ){
+ ossClient.putObject(bucketName, ossPath, inputStream);
+ }
+
+ /**
+ * 下载
+ * @param ossFilePath
+ * @param filePath
+ */
+ public static void downloadFile(String ossFilePath , String filePath ){
+ downloadFileForBucket(bucketName , ossFilePath , filePath);
+ }
+ /**
+ * 下载
+ * @param bucketName 实例名称
+ * @param ossFilePath oss存储路径
+ * @param filePath 本地文件路径
+ */
+ public static void downloadFileForBucket(String bucketName , String ossFilePath , String filePath ){
+ ossClient.getObject(new GetObjectRequest(bucketName, ossFilePath), new File(filePath));
+ }
+
+ /**
+ *
+ * @return
+ */
+ public static String getOssDefaultPath(){
+ LocalDateTime now = LocalDateTime.now();
+ String url =
+ now.getYear()+"/"+
+ now.getMonth()+"/"+
+ now.getDayOfMonth()+"/"+
+ now.getHour()+"/"+
+ now.getMinute()+"/";
+ return url;
+ }
+
+ public static String getOssFilePath(String filePath){
+ String fileSuf = filePath.substring(filePath.indexOf(".") + 1);
+ return getOssDefaultPath() + UUID.randomUUID().toString() + "." + fileSuf;
+ }
+
+}
diff --git a/bwie-common/src/main/java/com/bwie/common/utils/RedisUtils.java b/bwie-common/src/main/java/com/bwie/common/utils/RedisUtils.java
new file mode 100644
index 0000000..dd26d90
--- /dev/null
+++ b/bwie-common/src/main/java/com/bwie/common/utils/RedisUtils.java
@@ -0,0 +1,795 @@
+//package com.bwie.common.utils;
+//
+//import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.C;
+//import com.bwie.common.constants.MyConstant;
+//import com.bwie.common.utils.StringUtils;
+//import io.jsonwebtoken.lang.Collections;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.beans.factory.annotation.Qualifier;
+//import org.springframework.data.redis.core.RedisTemplate;
+//import org.springframework.stereotype.Component;
+//
+//import java.util.Collection;
+//import java.util.List;
+//import java.util.Map;
+//import java.util.Set;
+//import java.util.concurrent.TimeUnit;
+//
+///**
+// * @author : 李朋果
+// * @ClassName : Redis
+// * @description : redis工具类
+// * @createTime : 2023/10/31 20:34
+// */
+//@Component
+//public class RedisUtils {
+// public String itemCode = MyConstant.ITEM_CODE+"_";
+//
+//
+// @Autowired
+// @Qualifier("redisTemplate")
+// private RedisTemplate redisTemplate;
+//
+// /**
+// * 指定缓存失效时间
+// * @param key 键
+// * @param time 时间(秒)
+// * @return
+// */
+// public boolean expire(String key, long time) {
+// try {
+// if (time > 0) {
+// redisTemplate.expire(key, time, TimeUnit.SECONDS);
+// }
+// return true;
+// } catch (Exception e) {
+// e.printStackTrace();
+// return false;
+// }
+// }
+//
+// /**
+// * 根据key获取过期时间
+// * @param key 键 不能为null
+// * @return 时间(秒) 返回0代表为永久有效
+// */
+// public long getExpire(String key) {
+// return redisTemplate.getExpire(key, TimeUnit.SECONDS);
+// }
+//
+// /**
+// * 判断key 是否存在
+// * @param key 键
+// * @return true 存在 false 不存在
+// */
+// public boolean hasKey(String key) {
+// try {
+// return redisTemplate.hasKey(key);
+// } catch (Exception e) {
+// e.printStackTrace();
+// return false;
+// }
+// }
+//
+// /**
+// * 删除缓存
+// * @param key 可以传一个值或多个
+// */
+// public void del(String... key){
+// if (key != null && key.length > 0) {
+// if (key.length == 1) {
+// redisTemplate.delete(key[0]);
+// } else {
+// redisTemplate.delete((Collection) Collections.arrayToList(key));
+// }
+// }
+//
+// }
+//
+// public void del(Set keySet) {
+// redisTemplate.delete(keySet);
+// }
+//
+// /**
+// * 删除全部缓存
+// */
+// public void deleteAll(){
+// Set keys = redisTemplate.keys("*");
+// redisTemplate.delete(keys);
+// }
+//
+// /**
+// * 前缀
+// * 模糊查询key
+// * redis中模糊匹配key值
+// * @param key 键
+// * @return 值
+// */
+// public Set fuzzyQueryKeysStart(String key) {
+// Set keys = redisTemplate.keys(key+"*");
+// return keys;
+// }
+//
+// /**
+// * 模糊查询key
+// * redis中模糊匹配key值
+// * @param key 键
+// * @return 值
+// */
+// public Set fuzzyQueryKeys(String key) {
+// Set keys = redisTemplate.keys("*"+key+"*");
+// return keys;
+// }
+//
+// /**
+// * 后缀
+// * 模糊查询key
+// * redis中模糊匹配key值
+// * @param key 键
+// * @return 值
+// */
+// public Set fuzzyQueryKeysEnd(String key) {
+// Set keys = redisTemplate.keys("*"+key);
+// return keys;
+// }
+//
+// /**
+// * 普通缓存获取
+// * @param key 键
+// * @return 值
+// */
+// public Object get(String key) {
+// return key == null ? null : redisTemplate.opsForValue().get(key);
+// }
+//
+// /**
+// * 普通缓存放入
+// * @param key 键
+// * @param value 值
+// * @return true成功 false失败
+// */
+// public boolean set(String key, Object value) {
+// try {
+// redisTemplate.opsForValue().set(key, value);
+// return true;
+// } catch (Exception e) {
+// e.printStackTrace();
+// return false;
+// }
+// }
+//
+// /**
+// * 普通缓存放并设置时间
+// * @param key 键
+// * @param value 值
+// * @param time 时间(秒) time要大于0 如果time小于等于0将设置无限期
+// * @return true成功 false失败
+// */
+// public boolean set(String key, Object value, long time) {
+// try {
+// if (time > 0) {
+// redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
+// }
+// return true;
+// } catch (Exception e) {
+// e.printStackTrace();
+// return false;
+// }
+// }
+//
+// /**
+// * 递增
+// * @param key 键
+// * @param delta 要增加几
+// * @return
+// */
+// public Long incr(String key, long delta) {
+// if (delta < 0) {
+// throw new IllegalArgumentException("递增因子必须大于0");
+// }
+// return redisTemplate.opsForValue().increment(key, delta);
+// }
+//
+// /**
+// * 递减
+// * @param key 键
+// * @param delta 要减少几
+// * @return
+// */
+// public Long decr(String key, long delta) {
+// if (delta < 0) {
+// throw new IllegalArgumentException("递减因子必须大于0");
+// }
+// return redisTemplate.opsForValue().increment(key, -delta);
+// }
+//
+// /**
+// * HashGet
+// *
+// * @param key 键 不能为null
+// * @param item 项 不能为null
+// * @return 值
+// */
+// public Object hget(String key, String item) {
+// return redisTemplate.opsForHash().get(key, item);
+// }
+//
+// /**
+// * 获取hashKey对应的所有键值
+// *
+// * @param key 键
+// * @return 对应的多个键值
+// */
+// public Map