HINOTOR 2 years ago
parent 026a9a1a8d
commit 7cace63c4f

@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

@ -0,0 +1,118 @@
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if (mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if (mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if (!outputFile.getParentFile().exists()) {
if (!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}

Binary file not shown.

@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

@ -0,0 +1,124 @@
2023-10-13 14:18:10.722 INFO 18908 --- [main] com.example.demo.RecommendApplication : Starting DemoApplication using Java 1.8.0_371 on LAPTOP-KF1N52RI with PID 18908 (D:\project\shareplatform-master\shareplatform-master\sharePlatform\target\classes started by hw in D:\project\shareplatform-master\shareplatform-master\sharePlatform)
2023-10-13 14:18:10.739 INFO 18908 --- [main] com.example.demo.RecommendApplication : No active profile set, falling back to default profiles: default
2023-10-13 14:18:11.599 INFO 18908 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2023-10-13 14:18:11.601 INFO 18908 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2023-10-13 14:18:11.715 INFO 18908 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 58 ms. Found 0 Redis repository interfaces.
2023-10-13 14:18:12.236 INFO 18908 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'shiroConfig' of type [config.com.example.demo.ShiroConfig$$EnhancerBySpringCGLIB$$71bbe] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:18:12.586 INFO 18908 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'hashedCredentialsMatcher' of type [org.apache.shiro.authc.credential.HashedCredentialsMatcher] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:18:12.639 INFO 18908 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'mybatis-plus-com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties' of type [com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:18:12.648 INFO 18908 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration' of type [com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration$$EnhancerBySpringCGLIB$$3ed966a] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:18:12.652 INFO 18908 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:18:12.663 INFO 18908 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:18:12.686 INFO 18908 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSource' of type [com.zaxxer.hikari.HikariDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:18:13.684 INFO 18908 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'sqlSessionFactory' of type [org.apache.ibatis.session.defaults.DefaultSqlSessionFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:18:13.692 INFO 18908 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'sqlSessionTemplate' of type [org.mybatis.spring.SqlSessionTemplate] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:18:13.699 INFO 18908 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'userMapper' of type [org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:18:13.703 INFO 18908 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'userMapper' of type [com.sun.proxy.$Proxy75] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:18:13.718 INFO 18908 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'userServiceImpl' of type [impl.service.com.example.demo.UserServiceImpl] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:18:13.781 INFO 18908 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'shiroRealm' of type [config.com.example.demo.EnceladusShiroRealm] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:18:13.799 INFO 18908 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'sessionManager' of type [config.com.example.demo.ShiroSession] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:18:13.806 INFO 18908 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'securityManager' of type [org.apache.shiro.web.mgt.DefaultWebSecurityManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:18:14.227 INFO 18908 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8088 (http)
2023-10-13 14:18:14.237 INFO 18908 --- [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2023-10-13 14:18:14.238 INFO 18908 --- [main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.46]
2023-10-13 14:18:14.375 INFO 18908 --- [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2023-10-13 14:18:14.375 INFO 18908 --- [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3563 ms
2023-10-13 14:18:15.382 WARN 18908 --- [main] arterDeprecationWarningAutoConfiguration : spring-boot-starter-redis is deprecated as of Spring Boot 1.4, please migrate to spring-boot-starter-data-redis
2023-10-13 14:18:15.438 INFO 18908 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8088 (http) with context path ''
2023-10-13 14:18:15.448 INFO 18908 --- [main] com.example.demo.RecommendApplication : Started DemoApplication in 5.203 seconds (JVM running for 7.019)
2023-10-13 14:18:15.450 INFO 18908 --- [main] o.s.b.a.ApplicationAvailabilityBean : Application availability state LivenessState changed to CORRECT
2023-10-13 14:18:15.451 INFO 18908 --- [main] o.s.b.a.ApplicationAvailabilityBean : Application availability state ReadinessState changed to ACCEPTING_TRAFFIC
2023-10-13 14:19:20.134 INFO 18804 --- [main] com.example.demo.RecommendApplication : Starting DemoApplication using Java 1.8.0_371 on LAPTOP-KF1N52RI with PID 18804 (D:\project\shareplatform-master\shareplatform-master\sharePlatform\target\classes started by hw in D:\project\shareplatform-master\shareplatform-master\sharePlatform)
2023-10-13 14:19:20.139 INFO 18804 --- [main] com.example.demo.RecommendApplication : No active profile set, falling back to default profiles: default
2023-10-13 14:19:21.161 INFO 18804 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2023-10-13 14:19:21.164 INFO 18804 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2023-10-13 14:19:21.215 INFO 18804 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 30 ms. Found 0 Redis repository interfaces.
2023-10-13 14:19:21.759 INFO 18804 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'shiroConfig' of type [config.com.example.demo.ShiroConfig$$EnhancerBySpringCGLIB$$9efaff5e] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:22.258 INFO 18804 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'hashedCredentialsMatcher' of type [org.apache.shiro.authc.credential.HashedCredentialsMatcher] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:22.322 INFO 18804 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'mybatis-plus-com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties' of type [com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:22.334 INFO 18804 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration' of type [com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration$$EnhancerBySpringCGLIB$$a2e17a0a] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:22.340 INFO 18804 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:22.355 INFO 18804 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:22.389 INFO 18804 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSource' of type [com.zaxxer.hikari.HikariDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:23.850 INFO 18804 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'sqlSessionFactory' of type [org.apache.ibatis.session.defaults.DefaultSqlSessionFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:23.859 INFO 18804 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'sqlSessionTemplate' of type [org.mybatis.spring.SqlSessionTemplate] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:23.865 INFO 18804 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'userMapper' of type [org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:23.870 INFO 18804 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'userMapper' of type [com.sun.proxy.$Proxy75] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:23.880 INFO 18804 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'userServiceImpl' of type [impl.service.com.example.demo.UserServiceImpl] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:23.927 INFO 18804 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'shiroRealm' of type [config.com.example.demo.EnceladusShiroRealm] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:23.939 INFO 18804 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'sessionManager' of type [config.com.example.demo.ShiroSession] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:23.950 INFO 18804 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'securityManager' of type [org.apache.shiro.web.mgt.DefaultWebSecurityManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:24.293 INFO 18804 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8088 (http)
2023-10-13 14:19:24.302 INFO 18804 --- [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2023-10-13 14:19:24.303 INFO 18804 --- [main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.46]
2023-10-13 14:19:24.424 INFO 18804 --- [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2023-10-13 14:19:24.431 INFO 18804 --- [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 4209 ms
2023-10-13 14:19:25.418 WARN 18804 --- [main] arterDeprecationWarningAutoConfiguration : spring-boot-starter-redis is deprecated as of Spring Boot 1.4, please migrate to spring-boot-starter-data-redis
2023-10-13 14:19:25.483 INFO 18804 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8088 (http) with context path ''
2023-10-13 14:19:25.495 INFO 18804 --- [main] com.example.demo.RecommendApplication : Started DemoApplication in 6.051 seconds (JVM running for 7.566)
2023-10-13 14:19:25.497 INFO 18804 --- [main] o.s.b.a.ApplicationAvailabilityBean : Application availability state LivenessState changed to CORRECT
2023-10-13 14:19:25.500 INFO 18804 --- [main] o.s.b.a.ApplicationAvailabilityBean : Application availability state ReadinessState changed to ACCEPTING_TRAFFIC
2023-10-13 14:19:38.919 INFO 2000 --- [main] com.example.demo.RecommendApplication : Starting DemoApplication using Java 1.8.0_371 on LAPTOP-KF1N52RI with PID 2000 (D:\project\shareplatform-master\shareplatform-master\sharePlatform\target\classes started by hw in D:\project\shareplatform-master\shareplatform-master\sharePlatform)
2023-10-13 14:19:38.923 INFO 2000 --- [main] com.example.demo.RecommendApplication : No active profile set, falling back to default profiles: default
2023-10-13 14:19:39.937 INFO 2000 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2023-10-13 14:19:39.940 INFO 2000 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2023-10-13 14:19:39.992 INFO 2000 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 31 ms. Found 0 Redis repository interfaces.
2023-10-13 14:19:40.545 INFO 2000 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'shiroConfig' of type [config.com.example.demo.ShiroConfig$$EnhancerBySpringCGLIB$$7fbd5c46] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:41.110 INFO 2000 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'hashedCredentialsMatcher' of type [org.apache.shiro.authc.credential.HashedCredentialsMatcher] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:41.183 INFO 2000 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'mybatis-plus-com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties' of type [com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:41.197 INFO 2000 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration' of type [com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration$$EnhancerBySpringCGLIB$$83a3d6f2] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:41.205 INFO 2000 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:41.222 INFO 2000 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:41.258 INFO 2000 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSource' of type [com.zaxxer.hikari.HikariDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:42.547 INFO 2000 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'sqlSessionFactory' of type [org.apache.ibatis.session.defaults.DefaultSqlSessionFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:42.556 INFO 2000 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'sqlSessionTemplate' of type [org.mybatis.spring.SqlSessionTemplate] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:42.562 INFO 2000 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'userMapper' of type [org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:42.567 INFO 2000 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'userMapper' of type [com.sun.proxy.$Proxy75] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:42.577 INFO 2000 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'userServiceImpl' of type [impl.service.com.example.demo.UserServiceImpl] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:42.621 INFO 2000 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'shiroRealm' of type [config.com.example.demo.EnceladusShiroRealm] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:42.632 INFO 2000 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'sessionManager' of type [config.com.example.demo.ShiroSession] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:42.638 INFO 2000 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'securityManager' of type [org.apache.shiro.web.mgt.DefaultWebSecurityManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 14:19:42.894 INFO 2000 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8088 (http)
2023-10-13 14:19:42.903 INFO 2000 --- [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2023-10-13 14:19:42.903 INFO 2000 --- [main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.46]
2023-10-13 14:19:43.047 INFO 2000 --- [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2023-10-13 14:19:43.047 INFO 2000 --- [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 4053 ms
2023-10-13 14:19:44.011 WARN 2000 --- [main] arterDeprecationWarningAutoConfiguration : spring-boot-starter-redis is deprecated as of Spring Boot 1.4, please migrate to spring-boot-starter-data-redis
2023-10-13 14:19:44.057 INFO 2000 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8088 (http) with context path ''
2023-10-13 14:19:44.066 INFO 2000 --- [main] com.example.demo.RecommendApplication : Started DemoApplication in 5.859 seconds (JVM running for 7.28)
2023-10-13 14:19:44.068 INFO 2000 --- [main] o.s.b.a.ApplicationAvailabilityBean : Application availability state LivenessState changed to CORRECT
2023-10-13 14:19:44.070 INFO 2000 --- [main] o.s.b.a.ApplicationAvailabilityBean : Application availability state ReadinessState changed to ACCEPTING_TRAFFIC
2023-10-13 19:59:01.121 INFO 17952 --- [main] com.example.demo.RecommendApplication : Starting RecommendApplication using Java 1.8.0_371 on LAPTOP-KF1N52RI with PID 17952 (D:\project\gitProject_recommend\src\backend\target\classes started by hw in D:\project\gitProject_recommend\src\backend)
2023-10-13 19:59:01.123 INFO 17952 --- [main] com.example.demo.RecommendApplication : No active profile set, falling back to default profiles: default
2023-10-13 19:59:01.805 INFO 17952 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2023-10-13 19:59:01.807 INFO 17952 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2023-10-13 19:59:01.844 INFO 17952 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 23 ms. Found 0 Redis repository interfaces.
2023-10-13 19:59:02.192 INFO 17952 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'shiroConfig' of type [com.example.demo.config.ShiroConfig$$EnhancerBySpringCGLIB$$f20c79e3] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 19:59:02.479 INFO 17952 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'hashedCredentialsMatcher' of type [org.apache.shiro.authc.credential.HashedCredentialsMatcher] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 19:59:02.521 INFO 17952 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'mybatis-plus-com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties' of type [com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 19:59:02.528 INFO 17952 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration' of type [com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration$$EnhancerBySpringCGLIB$$d0d48737] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 19:59:02.532 INFO 17952 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 19:59:02.541 INFO 17952 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 19:59:02.560 INFO 17952 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSource' of type [com.zaxxer.hikari.HikariDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 19:59:03.402 INFO 17952 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'sqlSessionFactory' of type [org.apache.ibatis.session.defaults.DefaultSqlSessionFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 19:59:03.408 INFO 17952 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'sqlSessionTemplate' of type [org.mybatis.spring.SqlSessionTemplate] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 19:59:03.412 INFO 17952 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'userMapper' of type [org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 19:59:03.416 INFO 17952 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'userMapper' of type [com.sun.proxy.$Proxy75] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 19:59:03.422 INFO 17952 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'userServiceImpl' of type [com.example.demo.service.impl.UserServiceImpl] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 19:59:03.456 INFO 17952 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'shiroRealm' of type [com.example.demo.config.EnceladusShiroRealm] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 19:59:03.466 INFO 17952 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'sessionManager' of type [com.example.demo.config.ShiroSession] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 19:59:03.472 INFO 17952 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'securityManager' of type [org.apache.shiro.web.mgt.DefaultWebSecurityManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2023-10-13 19:59:03.681 INFO 17952 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8088 (http)
2023-10-13 19:59:03.692 INFO 17952 --- [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2023-10-13 19:59:03.692 INFO 17952 --- [main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.46]
2023-10-13 19:59:03.809 INFO 17952 --- [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2023-10-13 19:59:03.810 INFO 17952 --- [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2637 ms
2023-10-13 19:59:04.578 WARN 17952 --- [main] arterDeprecationWarningAutoConfiguration : spring-boot-starter-redis is deprecated as of Spring Boot 1.4, please migrate to spring-boot-starter-data-redis
2023-10-13 19:59:04.622 INFO 17952 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8088 (http) with context path ''
2023-10-13 19:59:04.631 INFO 17952 --- [main] com.example.demo.RecommendApplication : Started RecommendApplication in 3.924 seconds (JVM running for 5.362)
2023-10-13 19:59:04.632 INFO 17952 --- [main] o.s.b.a.ApplicationAvailabilityBean : Application availability state LivenessState changed to CORRECT
2023-10-13 19:59:04.634 INFO 17952 --- [main] o.s.b.a.ApplicationAvailabilityBean : Application availability state ReadinessState changed to ACCEPTING_TRAFFIC
2023-10-13 19:59:21.088 INFO 17952 --- [http-nio-8088-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2023-10-13 19:59:21.088 INFO 17952 --- [http-nio-8088-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2023-10-13 19:59:21.088 INFO 17952 --- [http-nio-8088-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 0 ms
2023-10-13 19:59:21.106 INFO 17952 --- [http-nio-8088-exec-1] a.s.s.m.AbstractValidatingSessionManager : Enabling session validation scheduler...

322
src/backend/mvnw vendored

@ -0,0 +1,322 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ]; then
if [ -f /etc/mavenrc ]; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ]; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false
darwin=false
mingw=false
case "$(uname)" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true ;;
Darwin*)
darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="$(/usr/libexec/java_home)"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ]; then
if [ -r /etc/gentoo-release ]; then
JAVA_HOME=$(java-config --jre-home)
fi
fi
if [ -z "$M2_HOME" ]; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ]; do
ls=$(ls -ld "$PRG")
link=$(expr "$ls" : '.*-> \(.*\)$')
if expr "$link" : '/.*' >/dev/null; then
PRG="$link"
else
PRG="$(dirname "$PRG")/$link"
fi
done
saveddir=$(pwd)
M2_HOME=$(dirname "$PRG")/..
# make it fully qualified
M2_HOME=$(cd "$M2_HOME" && pwd)
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=$(cygpath --unix "$M2_HOME")
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=$(cygpath --unix "$JAVA_HOME")
[ -n "$CLASSPATH" ] &&
CLASSPATH=$(cygpath --path --unix "$CLASSPATH")
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw; then
[ -n "$M2_HOME" ] &&
M2_HOME="$( (
cd "$M2_HOME"
pwd
))"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="$( (
cd "$JAVA_HOME"
pwd
))"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="$(which javac)"
if [ -n "$javaExecutable" ] && ! [ "$(expr \"$javaExecutable\" : '\([^ ]*\)')" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=$(which readlink)
if [ ! $(expr "$readLink" : '\([^ ]*\)') = "no" ]; then
if $darwin; then
javaHome="$(dirname \"$javaExecutable\")"
javaExecutable="$(cd \"$javaHome\" && pwd -P)/javac"
else
javaExecutable="$(readlink -f \"$javaExecutable\")"
fi
javaHome="$(dirname \"$javaExecutable\")"
javaHome=$(expr "$javaHome" : '\(.*\)/bin')
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ]; then
if [ -n "$JAVA_HOME" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="$(which java)"
fi
fi
if [ ! -x "$JAVACMD" ]; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ]; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]; then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ]; do
if [ -d "$wdir"/.mvn ]; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=$(
cd "$wdir/.."
pwd
)
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' <"$1")"
fi
}
BASE_DIR=$(find_maven_basedir "$(pwd)")
if [ -z "$BASE_DIR" ]; then
exit 1
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
fi
while IFS="=" read key value; do
case "$key" in wrapperUrl)
jarUrl="$value"
break
;;
esac
done <"$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
fi
if command -v wget >/dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
fi
elif command -v curl >/dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=$(cygpath --path --windows "$javaClass")
fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=$(cygpath --path --windows "$M2_HOME")
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME")
[ -n "$CLASSPATH" ] &&
CLASSPATH=$(cygpath --path --windows "$CLASSPATH")
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR")
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

182
src/backend/mvnw.cmd vendored

@ -0,0 +1,182 @@
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%

@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>backed</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>example project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<!--mybatis-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.3.1.tmp</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.18</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.10</version>
</dependency>
<!-- 添加 模板引擎 依赖 -->
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-engine-core</artifactId>
<version>2.2</version>
</dependency>
<!-- 代码生成器-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
<version>3.3.1.tmp</version>
</dependency>
<!-- Swagger -->
<dependency>
<groupId>com.spring4all</groupId>
<artifactId>swagger-spring-boot-starter</artifactId>
<version>1.7.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--使用日志slf4j+logback-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</dependency>
<!--使用aop -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<!--spring整合shiro-->
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>1.4.0</version>
</dependency>
<!--fastjson Json处理工具包-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.76</version>
</dependency>
<!-- redis-->
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>3.6.3</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>2.5.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-redis</artifactId>
<version>RELEASE</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
</project>

@ -0,0 +1,406 @@
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for cart_item
-- ----------------------------
DROP TABLE IF EXISTS `cart_item`;
CREATE TABLE `cart_item` (
`cart_item_id` int NOT NULL AUTO_INCREMENT COMMENT '购物项id',
`user_id` int DEFAULT NULL COMMENT '用户id',
`goods_id` int DEFAULT NULL COMMENT '物品id',
`goods_count` int DEFAULT NULL COMMENT '物品数量',
`is_deleted` int DEFAULT NULL COMMENT '删除标识字段(0-未删除 1-已删除)',
`create_time` datetime DEFAULT NULL COMMENT '开始时间',
`end_time` datetime DEFAULT NULL COMMENT '结束时间',
`price` double DEFAULT NULL COMMENT '单项总价',
`goods_cover_img` varchar(255) DEFAULT NULL COMMENT '物品图片',
`goods_name` varchar(255) DEFAULT NULL COMMENT '物品名称',
PRIMARY KEY (`cart_item_id`)
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of cart_item
-- ----------------------------
BEGIN;
INSERT INTO `cart_item` VALUES (1, 10, 1, 10, 0, '2021-06-15 19:00:00', '2021-06-29 19:00:00', NULL, NULL, NULL);
INSERT INTO `cart_item` VALUES (3, 3, 1, 10, 0, '2021-06-15 19:00:00', '2021-06-29 19:00:00', NULL, NULL, NULL);
INSERT INTO `cart_item` VALUES (19, 12, 1, 1, 0, NULL, NULL, 100, '12', 'iphone12 手机');
INSERT INTO `cart_item` VALUES (22, 12, 9, 1, 0, NULL, NULL, 110, '8c5d5f5f-14e9-43b5-9d41-b69b31f2859a', 'rtx3080ti显卡');
COMMIT;
-- ----------------------------
-- Table structure for category
-- ----------------------------
DROP TABLE IF EXISTS `category`;
CREATE TABLE `category` (
`category_id` int NOT NULL AUTO_INCREMENT COMMENT '分类id',
`category_level` varchar(5) NOT NULL COMMENT '分类级别',
`parent_id` int NOT NULL COMMENT '父分类ID',
`category_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '分类名称',
`is_deleted` int DEFAULT NULL COMMENT '删除标识0-未删除1-已删除)',
`category_img` varchar(255) DEFAULT NULL COMMENT '图片id',
PRIMARY KEY (`category_id`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of category
-- ----------------------------
BEGIN;
INSERT INTO `category` VALUES (1, '1', 0, '手机相关', 0, '2');
INSERT INTO `category` VALUES (2, '1', 0, '电脑相关', 0, '2');
INSERT INTO `category` VALUES (3, '2', 1, '手机', 0, '2');
INSERT INTO `category` VALUES (4, '2', 1, '充电器', 0, '2');
INSERT INTO `category` VALUES (5, '2', 1, '数据线', 0, '2');
INSERT INTO `category` VALUES (6, '2', 2, '键盘', 0, '2');
INSERT INTO `category` VALUES (7, '2', 2, '鼠标', 0, '2');
INSERT INTO `category` VALUES (8, '2', 2, '显示器', 0, '2');
INSERT INTO `category` VALUES (9, '1', 0, '相机相关', 0, '2');
INSERT INTO `category` VALUES (10, '1', 0, '电视相关', 0, '2');
INSERT INTO `category` VALUES (11, '1', 0, '影音设备', 0, '2');
INSERT INTO `category` VALUES (12, '1', 0, '网络设备', 0, '2');
INSERT INTO `category` VALUES (13, '2', 1, '手机贴膜', 0, NULL);
INSERT INTO `category` VALUES (14, '2', 1, '手机壳', 0, NULL);
INSERT INTO `category` VALUES (15, '2', 1, '手机支架', 0, NULL);
INSERT INTO `category` VALUES (16, '2', 1, '苹果周边', 0, NULL);
INSERT INTO `category` VALUES (17, '2', 1, 'iphone', 0, NULL);
INSERT INTO `category` VALUES (18, '2', 2, '显卡', 0, NULL);
INSERT INTO `category` VALUES (19, '2', 2, '硬盘', 0, NULL);
INSERT INTO `category` VALUES (20, '2', 2, 'cpu', 0, NULL);
INSERT INTO `category` VALUES (21, '2', 2, '主板', 0, NULL);
INSERT INTO `category` VALUES (22, '2', 2, '内存', 0, NULL);
INSERT INTO `category` VALUES (23, '2', 9, '数码相机', 0, NULL);
INSERT INTO `category` VALUES (24, '2', 9, '微单相机', 0, NULL);
INSERT INTO `category` VALUES (25, '2', 9, '单反相机', 0, NULL);
INSERT INTO `category` VALUES (26, '2', 9, '存储卡', 0, NULL);
INSERT INTO `category` VALUES (27, '2', 9, '云台', 0, NULL);
INSERT INTO `category` VALUES (28, '2', 9, '索尼', 0, NULL);
INSERT INTO `category` VALUES (29, '2', 10, 'OLED电视', 0, NULL);
INSERT INTO `category` VALUES (30, '2', 11, '电脑音响', 0, NULL);
INSERT INTO `category` VALUES (31, '2', 12, '路由器', 0, NULL);
COMMIT;
-- ----------------------------
-- Table structure for entrust
-- ----------------------------
DROP TABLE IF EXISTS `entrust`;
CREATE TABLE `entrust` (
`entrust_id` int NOT NULL AUTO_INCREMENT COMMENT '委托id',
`e_goods_name` varchar(255) DEFAULT NULL COMMENT '委托物品名称',
`e_goods_intro` varchar(255) DEFAULT NULL COMMENT '物品简介',
`e_goods_category` int DEFAULT NULL COMMENT '物品分类id',
`e_goods_cover_img` varchar(255) DEFAULT NULL COMMENT '物品主图片',
`e_goods_carousel` varchar(255) DEFAULT NULL COMMENT '物品轮播图片',
`e_goods_detail_content` text COMMENT '物品详情',
`e_goods_price` double(10,2) DEFAULT NULL COMMENT '委托租赁单价 元/天',
`e_stock_num` int DEFAULT NULL COMMENT '委托数量',
PRIMARY KEY (`entrust_id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of entrust
-- ----------------------------
BEGIN;
INSERT INTO `entrust` VALUES (1, 'qqq11', 'qqq', 3, '173f2300-83a2-45ea-b613-09a894ab3be0', '8378118b-2727-46eb-82a9-c537b3d0fc7c', 'qwe', 123.00, 1);
INSERT INTO `entrust` VALUES (18, '索尼微单相机', '索尼微单相机', 24, 'b70a9afb-af55-46ea-b465-f557bed735da', '', '索尼微单相机', 100.00, 1);
COMMIT;
-- ----------------------------
-- Table structure for goods
-- ----------------------------
DROP TABLE IF EXISTS `goods`;
CREATE TABLE `goods` (
`goods_id` int NOT NULL AUTO_INCREMENT COMMENT '物品ID',
`goods_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '物品名称',
`goods_intro` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '物品简介',
`goods_category_id` int NOT NULL COMMENT '物品分类id',
`goods_cover_img` varchar(255) DEFAULT NULL COMMENT '物品主图片',
`goods_carousel` varchar(500) DEFAULT NULL COMMENT '物品轮播图片',
`goods_detail_content` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '物品详情',
`goods_price` double(10,2) DEFAULT NULL COMMENT '物品价格',
`stock_num` int DEFAULT NULL COMMENT '物品数量',
`goods_status` int DEFAULT NULL COMMENT '物品上架状态0下架1上架',
`goods_score` double DEFAULT NULL COMMENT '物品评价分数',
PRIMARY KEY (`goods_id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of goods
-- ----------------------------
BEGIN;
INSERT INTO `goods` VALUES (1, 'iphone12 手机', '苹果最新款手机', 3, '12', '21', '苹果最新款手机', 100.00, 100, 1, 3.4);
INSERT INTO `goods` VALUES (2, 'iphone11 手机', 'iphone11', 3, '13', '21', '111', 100.00, 100, 1, 1.3);
INSERT INTO `goods` VALUES (3, 'iphone12 pro 手机', 'iphone', 3, '19', '21', '111', 100.00, 100, 1, 4.9);
INSERT INTO `goods` VALUES (4, 'qqq11', 'qqq', 3, '173f2300-83a2-45ea-b613-09a894ab3be0', '8378118b-2727-46eb-82a9-c537b3d0fc7c', 'qwe', 123.00, 1, 1, 3.7);
INSERT INTO `goods` VALUES (5, 'rtx3060显卡', 'rtx3060显卡', 18, '984fb033-eea8-4174-ae17-025012ed3a4e', 'e6d78f17-267a-4173-88e6-93c330a9bfc4', 'rtx3060显卡', 50.00, 1, 1, 3.7);
INSERT INTO `goods` VALUES (6, 'rtx3060显卡', 'rtx3060显卡', 18, '984fb033-eea8-4174-ae17-025012ed3a4e', 'e6d78f17-267a-4173-88e6-93c330a9bfc4', 'rtx3060显卡', 50.00, 1, 1, 3.7);
INSERT INTO `goods` VALUES (7, 'rtx3070显卡', 'rtx3070显卡', 18, '3f41b68f-60d4-48fd-a079-ed9354111bea', '5a586e79-eb60-484c-b0cd-d003c2efad8e', 'rtx3070显卡', 80.00, 1, 1, 3.7);
INSERT INTO `goods` VALUES (8, 'rtx3080显卡', 'rtx3080显卡', 18, '4e8b8334-cfb7-451a-a673-91ba66c88411', '562e46cb-80c6-4691-b7f2-17c3fec80774', 'rtx3080显卡', 100.00, 1, 1, 3.7);
INSERT INTO `goods` VALUES (9, 'rtx3080ti显卡', 'rtx3080ti显卡', 18, '8c5d5f5f-14e9-43b5-9d41-b69b31f2859a', '9ab74473-df00-45e5-a894-0432289d84ac', 'rtx3080ti显卡', 110.00, 1, 1, 3.7);
INSERT INTO `goods` VALUES (10, '6700xt 显卡', '6700xt显卡', 18, '6700', '76fdb9d7-d7af-467c-8b7f-075cfb108faf', '6700xt', 80.00, 1, 1, 3.7);
INSERT INTO `goods` VALUES (11, '6800xt 显卡', '6800xt显卡', 18, '6800', 'cce21e0c-743b-46c0-b87d-9fa66483414b', '6800xt', 90.00, 1, 1, 3.7);
INSERT INTO `goods` VALUES (12, '6800xt 显卡', '6800xt显卡', 18, '6800', 'cce21e0c-743b-46c0-b87d-9fa66483414b', '6800xt', 90.00, 1, 1, 3.7);
INSERT INTO `goods` VALUES (13, '6900xt 显卡', '6900xt显卡', 18, '6900', '0afe5d80-3d83-4ea9-8d5b-60e5b45337e5', '6900xt', 110.00, 1, 1, 3.7);
INSERT INTO `goods` VALUES (14, 'rtx3060显卡', 'rtx3060显卡', 18, '3060', 'cebf2e7b-2828-4616-b15f-62fb372f6788', 'rtx3060显卡', 80.00, 1, 1, 3.7);
INSERT INTO `goods` VALUES (15, 'rtx3060显卡', 'rtx3060显卡', 18, '3060', 'd92b8308-7e39-4352-9dac-bff0919b6e4d', 'rtx3060显卡', 90.00, 1, 1, 3.7);
INSERT INTO `goods` VALUES (16, 'rtx3080显卡', 'rtx3080显卡', 18, '3080', '7d6267ef-762d-4038-9ff7-d5248c3e5a0e', 'rtx3080显卡', 110.00, 1, 1, 3.7);
INSERT INTO `goods` VALUES (17, 'rtx3080显卡', 'rtx3080显卡', 18, '3080', 'de29277a-32d5-4117-8de7-81e9882c634b', 'rtx3080显卡', 110.00, 1, 1, 3.7);
INSERT INTO `goods` VALUES (18, 'rtx3090显卡', 'rtx3090显卡', 18, '3090', '736d461f-fe38-43e3-a850-889dadb4cbd4', 'rtx3090显卡', 130.00, 1, 1, 3.7);
INSERT INTO `goods` VALUES (19, 'ipad 2021 pro平板电脑', 'ipad 2021 pro平板电脑', 16, 'ipad', 'ipadDetail', 'ipad 2021 pro平板电脑', 110.00, 1, 1, 3.7);
INSERT INTO `goods` VALUES (20, '索尼微单 A74', '索尼微单 A74', 24, 'a7r4', 'a7r4Detail', '索尼微单 A74', 190.00, 1, 1, 3.7);
INSERT INTO `goods` VALUES (21, '富士微单相机 xt4', '富士微单相机 xt4', 24, 'fujixt4', 'xt4Detail', '富士微单相机 xt4', 150.00, 1, 1, 3.7);
COMMIT;
-- ----------------------------
-- Table structure for index_config
-- ----------------------------
DROP TABLE IF EXISTS `index_config`;
CREATE TABLE `index_config` (
`config_id` int NOT NULL AUTO_INCREMENT COMMENT '首页配置项id',
`config_name` varchar(100) DEFAULT NULL COMMENT '显示字符',
`config_type` int DEFAULT NULL COMMENT '1-今日推荐 2-今日优惠 3-为您推荐',
`goods_id` int NOT NULL COMMENT '物品id',
`is_deleted` int DEFAULT NULL COMMENT '删除标识字段(0-未删除 1-已删除)',
`goods_cover_img` varchar(255) DEFAULT NULL COMMENT '物品图片',
PRIMARY KEY (`config_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of index_config
-- ----------------------------
BEGIN;
INSERT INTO `index_config` VALUES (1, 'iphone', 1, 0, 0, '3');
INSERT INTO `index_config` VALUES (2, 'ipad', 1, 0, 0, '4');
INSERT INTO `index_config` VALUES (3, '索尼微单', 2, 0, 0, '23');
INSERT INTO `index_config` VALUES (4, '富士微单', 2, 0, 0, '22');
INSERT INTO `index_config` VALUES (5, '戴尔显示器', 3, 0, 0, '24');
INSERT INTO `index_config` VALUES (6, 'LG显示器', 3, 0, 0, '25');
INSERT INTO `index_config` VALUES (7, 'macbook', 3, 0, 0, 'macbook');
INSERT INTO `index_config` VALUES (8, 'macmini', 3, 0, 0, 'macmini');
INSERT INTO `index_config` VALUES (9, 'xdr', 3, 0, 0, 'xdr');
COMMIT;
-- ----------------------------
-- Table structure for order_item
-- ----------------------------
DROP TABLE IF EXISTS `order_item`;
CREATE TABLE `order_item` (
`order_item_id` int NOT NULL AUTO_INCREMENT COMMENT '订单项id',
`order_id` int DEFAULT NULL COMMENT '关联订单id',
`goods_id` int DEFAULT NULL COMMENT '关联物品id',
`goods_name` varchar(100) DEFAULT NULL COMMENT '物品名称',
`goods_cover_img` varchar(255) DEFAULT NULL COMMENT '物品主图',
`price` double(10,2) DEFAULT NULL COMMENT '物品价格',
`goods_count` int DEFAULT NULL COMMENT '物品数量',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`end_time` datetime DEFAULT NULL COMMENT '结束租赁时间',
`user_id` int DEFAULT NULL,
PRIMARY KEY (`order_item_id`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of order_item
-- ----------------------------
BEGIN;
INSERT INTO `order_item` VALUES (3, 7, 1, 'iphone12', '1', 20970.00, 1, '2021-06-16 00:00:00', '2021-09-14 00:00:00', 10);
INSERT INTO `order_item` VALUES (4, 7, 1, 'iphone12', '1', 20000.00, 1, '2021-06-16 20:50:31', '2021-06-25 20:50:34', 10);
INSERT INTO `order_item` VALUES (5, 8, 1, 'iphone12', '12', 20970.00, 1, '2021-06-16 00:00:00', '2021-09-14 00:00:00', 11);
INSERT INTO `order_item` VALUES (6, 9, 2, 'iphone11', '13', 20970.00, 1, '2021-06-16 00:00:00', '2021-09-14 00:00:00', 12);
INSERT INTO `order_item` VALUES (7, 10, 3, 'iphone12 pro', '19', 12815.00, 1, '2021-06-16 00:00:00', '2021-08-10 00:00:00', 12);
INSERT INTO `order_item` VALUES (8, 11, 1, 'iphone12', '1', 11111.00, 1, '2021-06-17 11:27:51', '2021-06-17 11:27:54', 10);
INSERT INTO `order_item` VALUES (9, 11, 2, 'iphone11', '13', 13333.00, 1, '2021-06-17 11:28:17', '2021-06-17 11:28:20', 10);
INSERT INTO `order_item` VALUES (10, 12, 1, 'iphone12', '12', 20970.00, 1, '2021-06-17 00:00:00', '2021-09-15 00:00:00', 12);
INSERT INTO `order_item` VALUES (11, 19, 1, 'iphone12', '12', 1200.00, 1, '2021-06-17 00:00:00', '2021-06-29 00:00:00', NULL);
INSERT INTO `order_item` VALUES (12, 20, 1, 'iphone12', '12', 1200.00, 1, '2021-06-17 00:00:00', '2021-06-29 00:00:00', 12);
INSERT INTO `order_item` VALUES (13, 21, 1, 'iphone12', '12', 6000.00, 5, '2021-06-17 00:00:00', '2021-06-29 00:00:00', 12);
INSERT INTO `order_item` VALUES (14, 21, 2, 'iphone11', '13', 7200.00, 6, '2021-06-17 00:00:00', '2021-06-29 00:00:00', 12);
INSERT INTO `order_item` VALUES (15, 22, 5, 'rtx3060显卡', '984fb033-eea8-4174-ae17-025012ed3a4e', 9087.00, 1, '2021-06-18 00:00:00', '2021-07-27 00:00:00', 12);
INSERT INTO `order_item` VALUES (16, 23, 5, 'rtx3060显卡', '984fb033-eea8-4174-ae17-025012ed3a4e', 8621.00, 1, '2021-06-18 00:00:00', '2021-07-25 00:00:00', 12);
INSERT INTO `order_item` VALUES (17, 24, 7, 'rtx3070显卡', '3f41b68f-60d4-48fd-a079-ed9354111bea', 960.00, 1, '2021-06-17 00:00:00', '2021-06-29 00:00:00', 12);
INSERT INTO `order_item` VALUES (18, 25, 7, 'rtx3070显卡', '3f41b68f-60d4-48fd-a079-ed9354111bea', 960.00, 1, '2021-06-17 00:00:00', '2021-06-29 00:00:00', 12);
INSERT INTO `order_item` VALUES (19, 26, 7, 'rtx3070显卡', '3f41b68f-60d4-48fd-a079-ed9354111bea', 960.00, 1, '2021-06-17 00:00:00', '2021-06-29 00:00:00', 12);
INSERT INTO `order_item` VALUES (20, 27, 7, 'rtx3070显卡', '3f41b68f-60d4-48fd-a079-ed9354111bea', 2880.00, 3, '2021-06-17 00:00:00', '2021-06-29 00:00:00', 12);
INSERT INTO `order_item` VALUES (21, 28, 7, 'rtx3070显卡', '3f41b68f-60d4-48fd-a079-ed9354111bea', 960.00, 1, '2021-06-17 00:00:00', '2021-06-29 00:00:00', 12);
INSERT INTO `order_item` VALUES (22, 29, 1, 'iphone12 手机', '12', 4000.00, 5, '2021-06-21 00:00:00', '2021-06-29 00:00:00', 12);
INSERT INTO `order_item` VALUES (23, 30, 5, 'rtx3060显卡', '984fb033-eea8-4174-ae17-025012ed3a4e', 1500.00, 1, '2021-06-28 00:00:00', '2021-07-28 00:00:00', 12);
INSERT INTO `order_item` VALUES (24, 30, 5, 'rtx3060显卡', '984fb033-eea8-4174-ae17-025012ed3a4e', 1500.00, 1, '2021-06-28 00:00:00', '2021-07-28 00:00:00', 12);
INSERT INTO `order_item` VALUES (25, 31, 1, 'iphone12 手机', '12', 15000.00, 5, '2021-06-30 00:00:00', '2021-07-30 00:00:00', 11);
INSERT INTO `order_item` VALUES (26, 31, 2, 'iphone11 手机', '13', 15000.00, 5, '2021-06-30 00:00:00', '2021-07-30 00:00:00', 11);
INSERT INTO `order_item` VALUES (27, 32, 1, 'iphone12 手机', '12', 9000.00, 3, '2021-06-30 00:00:00', '2021-07-30 00:00:00', 15);
INSERT INTO `order_item` VALUES (28, 33, 1, 'iphone12 手机', '12', 2900.00, 1, '2021-06-30 00:00:00', '2021-07-29 00:00:00', 15);
INSERT INTO `order_item` VALUES (29, 34, 20, '索尼微单 A74', 'a7r4', 20970.00, 1, '2021-07-01 00:00:00', '2021-09-29 00:00:00', 15);
INSERT INTO `order_item` VALUES (30, 35, 19, 'ipad 2021 pro平板电脑', 'ipad', 3300.00, 1, '2021-06-30 00:00:00', '2021-07-30 00:00:00', 15);
INSERT INTO `order_item` VALUES (31, 35, 20, '索尼微单 A74', 'a7r4', 5700.00, 1, '2021-06-30 00:00:00', '2021-07-30 00:00:00', 15);
INSERT INTO `order_item` VALUES (32, 36, 5, 'rtx3060显卡', '984fb033-eea8-4174-ae17-025012ed3a4e', 20970.00, 1, '2021-07-01 00:00:00', '2021-09-29 00:00:00', 15);
COMMIT;
-- ----------------------------
-- Table structure for orderKK
-- ----------------------------
DROP TABLE IF EXISTS `orderKK`;
CREATE TABLE `orderKK` (
`order_id` int NOT NULL AUTO_INCREMENT COMMENT '订单表id',
`order_num` varchar(50) DEFAULT NULL COMMENT '订单号',
`user_id` int DEFAULT NULL COMMENT '用户id',
`total_price` double(10,2) DEFAULT NULL COMMENT '订单总价',
`pay_status` int DEFAULT NULL COMMENT '支付状态:0.未支付,1.支付成功,-1:支付失败',
`pay_time` datetime DEFAULT NULL COMMENT '支付时间',
`order_status` int DEFAULT NULL COMMENT '订单状态:0.待支付 1.已支付 2.配货完成 3:出库成功 4.交易成功 -1.手动关闭 -2.超时关闭 -3.商家关闭',
`extra_info` varchar(100) DEFAULT NULL COMMENT '订单内容描述',
`user_name` varchar(255) DEFAULT NULL COMMENT '收货人姓名',
`user_phone` varchar(255) DEFAULT NULL COMMENT '收货人手机号',
`user_address` varchar(255) DEFAULT NULL COMMENT '收货人地址',
`is_deleted` int DEFAULT NULL COMMENT '删除标识字段(0-未删除 1-已删除)',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`end_time` datetime DEFAULT NULL COMMENT '结束租赁时间',
PRIMARY KEY (`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of orderKK
-- ----------------------------
BEGIN;
INSERT INTO `orderKK` VALUES (7, '111', 10, 20970.00, 1, '2021-06-16 00:00:00', 1, NULL, 'test2', '111', '金湾区', NULL, '2021-06-16 00:00:00', '2021-09-14 00:00:00');
INSERT INTO `orderKK` VALUES (8, NULL, 11, 20970.00, 1, '2021-06-16 00:00:00', 1, NULL, 'test3', '111', 'qqq', NULL, '2021-06-16 00:00:00', '2021-09-14 00:00:00');
INSERT INTO `orderKK` VALUES (9, NULL, 12, 20970.00, 1, '2021-06-16 00:00:00', 1, NULL, 'test233', '15302634390', '金湾区', NULL, '2021-06-16 00:00:00', '2021-09-14 00:00:00');
INSERT INTO `orderKK` VALUES (10, NULL, 12, 12815.00, 1, '2021-06-16 00:00:00', 1, NULL, 'test233', '15302634390', '金湾区', NULL, '2021-06-16 00:00:00', '2021-08-10 00:00:00');
INSERT INTO `orderKK` VALUES (11, '113', 10, 20970.00, 1, '2021-06-17 11:26:05', 1, NULL, 'test2', '111', '金湾区', NULL, '2021-06-17 11:26:17', '2021-06-17 11:26:20');
INSERT INTO `orderKK` VALUES (12, '20210617185717383140', 12, 20970.00, 1, '2021-06-17 00:00:00', 1, NULL, 'test233', '15302634390', '金湾区', NULL, '2021-06-17 00:00:00', '2021-09-15 00:00:00');
INSERT INTO `orderKK` VALUES (19, '20210618002946125022', 12, 1200.00, 1, '2021-06-18 12:29:46', 1, NULL, 'test233', '15302634390', '金湾区', NULL, '2021-06-18 12:29:46', NULL);
INSERT INTO `orderKK` VALUES (20, '20210618003322619466', 12, 1200.00, 1, '2021-06-18 12:33:22', 1, NULL, 'test233', '15302634390', '金湾区', NULL, '2021-06-18 12:33:22', NULL);
INSERT INTO `orderKK` VALUES (21, '20210618003606983028', 12, 13200.00, 1, '2021-06-18 12:36:06', 1, NULL, 'test233', '15302634390', '金湾区', NULL, '2021-06-18 12:36:06', NULL);
INSERT INTO `orderKK` VALUES (22, '20210618013201115016', 12, 9087.00, 1, '2021-06-18 00:00:00', 1, NULL, 'test233', '15302634390', '金湾区', NULL, '2021-06-18 00:00:00', '2021-07-27 00:00:00');
INSERT INTO `orderKK` VALUES (23, '2021061801325558720', 12, 8621.00, 1, '2021-06-18 00:00:00', 1, NULL, 'test233', '15302634390', '金湾区', NULL, '2021-06-18 00:00:00', '2021-07-25 00:00:00');
INSERT INTO `orderKK` VALUES (24, '20210618013702386573', 12, 960.00, 1, '2021-06-18 01:37:02', 1, NULL, 'test233', '15302634390', '金湾区', NULL, '2021-06-18 01:37:02', NULL);
INSERT INTO `orderKK` VALUES (25, '20210618013703934027', 12, 960.00, 1, '2021-06-18 01:37:03', 1, NULL, 'test233', '15302634390', '金湾区', NULL, '2021-06-18 01:37:03', NULL);
INSERT INTO `orderKK` VALUES (26, '2021061801370464186', 12, 960.00, 1, '2021-06-18 01:37:04', 1, NULL, 'test233', '15302634390', '金湾区', NULL, '2021-06-18 01:37:04', NULL);
INSERT INTO `orderKK` VALUES (27, '20210618013803831934', 12, 2880.00, 1, '2021-06-18 01:38:03', 1, NULL, 'test233', '15302634390', '金湾区', NULL, '2021-06-18 01:38:03', NULL);
INSERT INTO `orderKK` VALUES (28, '20210618013841663674', 12, 960.00, 1, '2021-06-18 01:38:41', 1, NULL, 'test233', '15302634390', '金湾区', NULL, '2021-06-18 01:38:41', NULL);
INSERT INTO `orderKK` VALUES (29, '20210622223223241262', 12, 4000.00, 1, '2021-06-22 10:32:23', 1, NULL, 'test233', '15302634390', '金湾区', NULL, '2021-06-22 10:32:23', NULL);
INSERT INTO `orderKK` VALUES (30, '2021062915572843465', 12, 3000.00, 1, '2021-06-29 03:57:28', 1, NULL, 'test233', '15302634390', '金湾区', NULL, '2021-06-29 03:57:28', NULL);
INSERT INTO `orderKK` VALUES (31, '20210701162638816095', 11, 30000.00, 1, '2021-07-01 04:26:38', 1, NULL, 'test3', '66677788876', '333', NULL, '2021-07-01 04:26:38', NULL);
INSERT INTO `orderKK` VALUES (32, '20210701162950954060', 15, 9000.00, 1, '2021-07-01 04:29:50', 1, NULL, 'test232', '10086', 'qqq', NULL, '2021-07-01 04:29:50', NULL);
INSERT INTO `orderKK` VALUES (33, '20210701163001303859', 15, 2900.00, 1, '2021-07-01 04:30:01', 1, NULL, 'test232', '10086', 'qqq', NULL, '2021-07-01 04:30:01', NULL);
INSERT INTO `orderKK` VALUES (34, '20210701163027237993', 15, 20970.00, 1, '2021-07-01 00:00:00', 1, NULL, 'test232', '10086', 'qqq', NULL, '2021-07-01 00:00:00', '2021-09-29 00:00:00');
INSERT INTO `orderKK` VALUES (35, '20210701163057424313', 15, 9000.00, 1, '2021-07-01 04:30:57', 1, NULL, 'test232', '10086', 'qqq', NULL, '2021-07-01 04:30:57', NULL);
INSERT INTO `orderKK` VALUES (36, '20210701163116942651', 15, 20970.00, 1, '2021-07-01 00:00:00', 1, NULL, 'test232', '10086', 'qqq', NULL, '2021-07-01 00:00:00', '2021-09-29 00:00:00');
COMMIT;
-- ----------------------------
-- Table structure for permission
-- ----------------------------
DROP TABLE IF EXISTS `permission`;
CREATE TABLE `permission` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL COMMENT '权限名称',
`url` varchar(255) DEFAULT NULL COMMENT '接口路径',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of permission
-- ----------------------------
BEGIN;
INSERT INTO `permission` VALUES (1, 'memberPermission', '');
INSERT INTO `permission` VALUES (2, 'adminPermission', NULL);
COMMIT;
-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL COMMENT '角色名称',
`description` varchar(255) DEFAULT NULL COMMENT '描述',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of role
-- ----------------------------
BEGIN;
INSERT INTO `role` VALUES (1, 'member', '普通会员');
INSERT INTO `role` VALUES (2, 'admin', '管理员');
COMMIT;
-- ----------------------------
-- Table structure for role_permission
-- ----------------------------
DROP TABLE IF EXISTS `role_permission`;
CREATE TABLE `role_permission` (
`id` int NOT NULL AUTO_INCREMENT,
`role_id` int DEFAULT NULL COMMENT '角色id',
`permission_id` int DEFAULT NULL COMMENT '权限id',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of role_permission
-- ----------------------------
BEGIN;
INSERT INTO `role_permission` VALUES (1, 1, 1);
COMMIT;
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`user_id` int NOT NULL AUTO_INCREMENT COMMENT '用户主键id',
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '用户昵称',
`sex` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '性别',
`phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '电话号码',
`userName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '登录用户名',
`passWord` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'MD5加密后的密码',
`address` varchar(255) DEFAULT NULL COMMENT '收货地址',
`createTime` datetime DEFAULT NULL COMMENT '注册时间',
`salt` varchar(255) DEFAULT NULL COMMENT '加密盐',
PRIMARY KEY (`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES (1, 'jjk', '', '133', 'jjk', '123456', NULL, NULL, 'jjk');
INSERT INTO `user` VALUES (2, NULL, NULL, NULL, 'jjk332', '123456', NULL, NULL, NULL);
INSERT INTO `user` VALUES (3, NULL, NULL, NULL, 'jjk233', 'fe3cc6652d0e45d9afbac817cde3ead5', NULL, NULL, NULL);
INSERT INTO `user` VALUES (4, NULL, NULL, NULL, 'jjk233', 'ebd4a2f568c43c2efd338446ed97bab8', NULL, NULL, NULL);
INSERT INTO `user` VALUES (5, NULL, NULL, NULL, 'jjk233', '6fa88c345337dce86a7dca5b82a42567', NULL, NULL, 'e410dff56897cc44bf37e9cde02d4a3c');
INSERT INTO `user` VALUES (6, NULL, NULL, NULL, 'jjk233', 'ec91eb3b49981268db4431fdf689e2e9', NULL, NULL, '70fbbcdea6150cce9e2c1f2cc3fd576b');
INSERT INTO `user` VALUES (7, NULL, NULL, NULL, 'jjk333', '9cc4e2abfec86d7ff3986b83e41b2d9e', NULL, NULL, '370434581cb6b0cbdb36caf5392d6832');
INSERT INTO `user` VALUES (8, '111', '', '133', '111', '6f34cfc9032f744f3f4646c37e3e3383', '金湾区', '2021-06-14 23:57:26', '948fe69811fb7fdb26e51eab890fdfd1');
INSERT INTO `user` VALUES (9, 'test1', '', '13632926406', 'test1', '1d74cde43ded7b91b4f2eb5a6da43efe', '金湾区', '2021-06-15 00:05:29', '23e6e8b12170867dbd462a866a95a54e');
INSERT INTO `user` VALUES (10, 'test2', '', '1112435', 'test2', 'b5b0aa536a42b1585e183d51991f3e35', '金湾区', '2021-06-15 00:20:23', '8aa297f32a77cc58467977e7f2cedb7e');
INSERT INTO `user` VALUES (11, 'test3', '', '66677788876', 'test3', 'c8b3d9163f72f9d0bceee0e30262c16a', '333', '2021-06-16 23:42:45', 'f4836e5acf60176419a5a6726346a699');
INSERT INTO `user` VALUES (12, 'test233', '', '15302634390', 'test233', 'eab10ebab97b024ef47549d553664abd', '金湾区', '2021-06-16 23:55:00', 'b535741de2dd33287fd882a9a1cacdb6');
INSERT INTO `user` VALUES (13, 'test23333', '', '123', 'test23333', '85992e28350824b398c4ae9d3e21b66c', 'qqq', '2021-06-22 22:19:17', '7f63d1c9f1f00db2bb497bad1cedc456');
INSERT INTO `user` VALUES (14, 'test233333', '', '1111111', 'test233333', 'ca855d84405295841d252468b3a44813', 'qqq', '2021-06-22 22:20:24', 'eae27637af7f7f21928f766521a154e0');
INSERT INTO `user` VALUES (15, 'test232', '', '10086', 'test232', '0f7791c2f6ede4d964ad3bdbb195a678', 'qqq', '2021-06-22 22:21:08', 'e5e14c39ac108ffedb5024a5748cd4ba');
COMMIT;
-- ----------------------------
-- Table structure for user_role
-- ----------------------------
DROP TABLE IF EXISTS `user_role`;
CREATE TABLE `user_role` (
`id` int NOT NULL AUTO_INCREMENT,
`role_id` int DEFAULT NULL COMMENT '角色id',
`user_id` int DEFAULT NULL COMMENT '用户id',
`remarks` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of user_role
-- ----------------------------
BEGIN;
INSERT INTO `user_role` VALUES (1, 1, 1, '111');
INSERT INTO `user_role` VALUES (2, 2, 12, NULL);
INSERT INTO `user_role` VALUES (3, 1, 13, NULL);
INSERT INTO `user_role` VALUES (4, 1, 14, NULL);
INSERT INTO `user_role` VALUES (5, 1, 15, NULL);
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;

@ -0,0 +1,15 @@
package com.example.demo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
@SpringBootApplication
@MapperScan("com.example.demo.mapper")
@EnableCaching
public class RecommendApplication {
public static void main(String[] args) {
SpringApplication.run(RecommendApplication.class, args);
}
}

@ -0,0 +1,51 @@
package com.example.demo.config;
import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;
import org.springframework.http.HttpStatus;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
//过滤OPTINONS请求 继承shiro的form表单过滤器 对OPTIONS请求进行过滤 复杂请求中OPTIONS请求不带token信息 不能通过shiro认证
public class CORSAuthenticationFilter extends FormAuthenticationFilter {
private static final String REQUEST_TYPE = "OPTIONS";
public CORSAuthenticationFilter(){
super();
}
@Override
public boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue){
if (((HttpServletRequest) request).getMethod().toUpperCase().equals(REQUEST_TYPE)) {
return true;
}
return super.isAccessAllowed(request, response, mappedValue);
}
@Override
protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception{
HttpServletResponse res = (HttpServletResponse)response;
HttpServletRequest req = (HttpServletRequest)request;
res.addHeader("Access-Control-Allow-Origin", req.getHeader("origin"));
setHeader(req,res);
res.setStatus(HttpServletResponse.SC_OK);
res.setCharacterEncoding("UTF-8");
return false;
}
//为response设置header实现跨域
private void setHeader(HttpServletRequest request,HttpServletResponse response){
//跨域的header设置
response.setHeader("Access-control-Allow-Origin", request.getHeader("Origin"));
response.setHeader("Access-Control-Allow-Methods", request.getMethod());
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Headers", request.getHeader("Access-Control-Request-Headers"));
//防止乱码适用于传输JSON数据
//Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild
response.setHeader("Content-Type","application/json;charset=UTF-8");
response.setStatus(HttpStatus.OK.value());
}
}

@ -0,0 +1,33 @@
package com.example.demo.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
//跨域访问控制
@Configuration
public class CorsConfig {
private CorsConfiguration buildConfig(){
CorsConfiguration corsConfiguration=new CorsConfiguration();
//允许任何域名使用
corsConfiguration.addAllowedOriginPattern("*");
//允许任何请求头使用
corsConfiguration.addAllowedHeader("*");
//允许任何方法
corsConfiguration.addAllowedMethod("*");
//允许携带信息
corsConfiguration.setAllowCredentials(true);
return corsConfiguration;
}
@Bean
public CorsFilter corsFilter(){
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
//对接口配置跨域设置
source.registerCorsConfiguration("/**", buildConfig());
return new CorsFilter(source);
}
}

@ -0,0 +1,67 @@
package com.example.demo.config;
import com.example.demo.entity.Permission;
import com.example.demo.entity.Role;
import com.example.demo.entity.User;
import com.example.demo.service.UserService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.SimpleAuthenticationInfo;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;
import org.apache.shiro.util.ByteSource;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.List;
public class EnceladusShiroRealm extends AuthorizingRealm {
@Autowired
private UserService userService;
//进行权限校验时调用
@Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection){
SimpleAuthorizationInfo simpleAuthorizationInfo=new SimpleAuthorizationInfo();
String userName=(String) principalCollection.getPrimaryPrincipal();
User user=userService.findAllUserInfoByUsername(userName);
List<String> stringRoleList=new ArrayList<>();
List<String> stringPermissionList=new ArrayList<>();
List<Role> roleList=user.getRoleList();
for(Role role:roleList){
stringRoleList.add(role.getName());
List<Permission> permissionList=role.getPermissionList();
for(Permission p:permissionList){
if (null != p) {
stringPermissionList.add(p.getName());
}
}
}
simpleAuthorizationInfo.addRoles(stringRoleList);
simpleAuthorizationInfo.addStringPermissions(stringPermissionList);
SecurityUtils.getSubject().getSession().setAttribute("roleList", stringRoleList);
return simpleAuthorizationInfo;
}
//登录校验调用
@Override
protected SimpleAuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
String username=(String) token.getPrincipal();
System.out.println("principal:"+username);
User user=userService.findAllUserInfoByUsername(username);
System.out.println("principal password:"+user.getPassWord());
String passWord=user.getPassWord();
if(null==passWord|| "".equals(passWord)){
return null;
}
SimpleAuthenticationInfo authenticationInfo = new SimpleAuthenticationInfo(user.getUserName(), user.getPassWord(),
ByteSource.Util.bytes(user.getSalt()), getName());
return authenticationInfo;
}
}

@ -0,0 +1,89 @@
package com.example.demo.config;
import com.example.demo.util.PasswordHelper;
import org.apache.shiro.authc.credential.HashedCredentialsMatcher;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.session.mgt.SessionManager;
import org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO;
import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.servlet.Filter;
import java.util.LinkedHashMap;
import java.util.Map;
@Configuration
public class ShiroConfig {
@Bean
public ShiroFilterFactoryBean shiroFilterFactoryBean(SecurityManager securityManager){
ShiroFilterFactoryBean shiroFilterFactoryBean=new ShiroFilterFactoryBean();
shiroFilterFactoryBean.setSecurityManager(securityManager);
Map<String, Filter> customFilterMap = new LinkedHashMap<>();
customFilterMap.put("corsAuthenticationFilter",new CORSAuthenticationFilter());
shiroFilterFactoryBean.setFilters(customFilterMap);
Map<String,String> filterChainDefinitionMap=new LinkedHashMap<>();
//url定义必须通过认证才可以访问
//url可以匿名访问
shiroFilterFactoryBean.setLoginUrl("/login");
shiroFilterFactoryBean.setUnauthorizedUrl("/unauthor");
shiroFilterFactoryBean.setSuccessUrl("/home/index");
//过滤器:按照顺序进行拦截
//所有已登陆用户可访问
//roles有指定角色的用户可访问通过[ ]指定具体角色,这里的角色名称与数据库中配置一致
//perms有指定权限的用户可访问通过[ ]指定具体权限,这里的权限名称与数据库中配置一致
//anon所有用户可访问通常作为指定页面的静态资源时使用
//filterChainDefinitionMap.put("/authc/admin", "roles[admin]");
//filterChainDefinitionMap.put("/authc/renewable", "perms[Create,Update]");
//filterChainDefinitionMap.put("/authc/removable", "perms[Delete]");
filterChainDefinitionMap.put("/*", "anon");
filterChainDefinitionMap.put("/logout","logout");
filterChainDefinitionMap.put("/login","anon");
filterChainDefinitionMap.put("/cart","roles[member]");
filterChainDefinitionMap.put("/myOrder","roles[member]");
shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap);
return shiroFilterFactoryBean;
}
@Bean
public HashedCredentialsMatcher hashedCredentialsMatcher(){
HashedCredentialsMatcher hashedCredentialsMatcher=new HashedCredentialsMatcher();
hashedCredentialsMatcher.setHashAlgorithmName(PasswordHelper.ALGORITHM_NAME);
hashedCredentialsMatcher.setHashIterations(PasswordHelper.HASH_ITERATIONS);
return hashedCredentialsMatcher;
}
@Bean
public EnceladusShiroRealm shiroRealm(){
EnceladusShiroRealm enceladusShiroRealm=new EnceladusShiroRealm();
enceladusShiroRealm.setCredentialsMatcher(hashedCredentialsMatcher());
return enceladusShiroRealm;
}
@Bean
public SecurityManager securityManager(){
DefaultWebSecurityManager securityManager=new DefaultWebSecurityManager();
securityManager.setRealm(shiroRealm());
securityManager.setSessionManager(sessionManager());
return securityManager;
}
@Bean
public PasswordHelper passwordHelper(){
return new PasswordHelper();
}
//将重写的shiro session注册
@Bean
public SessionManager sessionManager(){
ShiroSession shiroSession=new ShiroSession();
shiroSession.setSessionDAO(new EnterpriseCacheSessionDAO());
return shiroSession;
}
}

@ -0,0 +1,39 @@
package com.example.demo.config;
import org.apache.shiro.web.servlet.ShiroHttpServletRequest;
import org.apache.shiro.web.session.mgt.DefaultWebSessionManager;
import org.apache.shiro.web.util.WebUtils;
import org.springframework.util.StringUtils;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import java.io.Serializable;
public class ShiroSession extends DefaultWebSessionManager {
//定义的请求头中使用的标记key用来传递token
private static final String AUTH_TOKEN = "authToken";
private static final String REFERENCED_SESSION_ID_SOURCE = "Stateless request";
public ShiroSession(){
super();
}
@Override
protected Serializable getSessionId(ServletRequest request, ServletResponse response){
//获取请求头中对token,值即为sessionId
String sessionId = WebUtils.toHttp(request).getHeader(AUTH_TOKEN);
System.out.println("请求头中的token:"+sessionId);
if(StringUtils.isEmpty(sessionId)){
//没有携带token,根据父类方法获取sessionId
return super.getSessionId(request,response);
}else {
//请求头中如果有 authToken, 则其值为sessionId
request.setAttribute(ShiroHttpServletRequest.REFERENCED_SESSION_ID_SOURCE, REFERENCED_SESSION_ID_SOURCE);
//sessionId
request.setAttribute(ShiroHttpServletRequest.REFERENCED_SESSION_ID, sessionId);
request.setAttribute(ShiroHttpServletRequest.REFERENCED_SESSION_ID_IS_VALID, Boolean.TRUE);
return sessionId;
}
}
}

@ -0,0 +1,15 @@
package com.example.demo.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
//配置图片路径
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
//和页面有关的图片放在项目的img目录下
registry.addResourceHandler("/img/**").addResourceLocations("classpath:/img/");
}
}

@ -0,0 +1,116 @@
package com.example.demo.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.entity.CartItem;
import com.example.demo.entity.Goods;
import com.example.demo.entity.User;
import com.example.demo.service.CartItemService;
import com.example.demo.service.GoodsService;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/cart")
public class CartItemController {
@Autowired
private CartItemService cartItemService;
@Autowired
private GoodsService goodsService;
//添加租赁物品到购物车
@RequestMapping("/add")
@Transactional(rollbackFor = {RuntimeException.class, Error.class})
public String add(@RequestBody Map<String,Object> map){
User user = (User) SecurityUtils.getSubject().getSession().getAttribute("user");
if(null!=user){
Integer goodsId= (Integer) map.get("goodsId");
QueryWrapper<Goods> goodsQueryWrapper=new QueryWrapper<>();
goodsQueryWrapper.eq("goods_id",goodsId);
Goods goods=goodsService.getOne(goodsQueryWrapper);
System.out.println(goods);
CartItem cartItem=new CartItem();
cartItem.setUserId(user.getUserId());
cartItem.setGoodsId(goods.getGoodsId());
cartItem.setGoodsCount(1);
cartItem.setIsDeleted(0);
cartItem.setPrice(goods.getGoodsPrice());
cartItem.setGoodsCoverImg(goods.getGoodsCoverImg());
cartItem.setGoodsName(goods.getGoodsName());
System.out.println(cartItem);
cartItemService.save(cartItem);
return cartItem.getCartItemId().toString();
}else {
return "fail";
}
}
//读取购物车
@RequestMapping("/list")
public String list(){
User user = (User) SecurityUtils.getSubject().getSession().getAttribute("user");
if(null!=user){
Integer id=user.getUserId();
System.out.println("id:"+id);
QueryWrapper<CartItem> wrapper = new QueryWrapper<>();
wrapper.eq("user_id",id);
List<CartItem> cartItemList=cartItemService.list(wrapper);
System.out.println(cartItemList.toString());
return JSON.toJSONString(cartItemList);
}else {
return "fail";
}
}
//删除购物车租赁物品
@RequestMapping("/delete")
public String delete(@RequestBody Map<String, Object> map){
Integer itemId= (Integer) map.get("cartItemId");
User user = (User) SecurityUtils.getSubject().getSession().getAttribute("user");
if(null!=user){
Integer id=user.getUserId();
System.out.println("id:"+id);
QueryWrapper<CartItem> wrapper = new QueryWrapper<>();
wrapper.and(i->i.eq("user_id",id).eq("cart_item_id",itemId));
boolean isDelete=cartItemService.remove(wrapper);
if(isDelete){
return "success";
}else {
return "fail";
}
}else {
return "fail";
}
}
//修改购物车项目
@RequestMapping("/update")
public String update(@RequestBody CartItem cartItem){
User user = (User) SecurityUtils.getSubject().getSession().getAttribute("user");
if(null!=user){
Integer id=user.getUserId();
Integer carItemId=cartItem.getCartItemId();
System.out.println("id:"+id);
QueryWrapper<CartItem> wrapper = new QueryWrapper<>();
wrapper.and(i->i.eq("user_id",id).eq("cart_item_id", carItemId));
boolean isUpdate=cartItemService.update(cartItem,wrapper);
if(isUpdate){
return "success";
}else {
return "fail";
}
}else {
return "fail";
}
}
}

@ -0,0 +1,46 @@
package com.example.demo.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.entity.Category;
import com.example.demo.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/category")
public class CategoryController {
@Autowired
private CategoryService categoryService;
//列出所有分类
@RequestMapping("/list")
public String list(){
QueryWrapper<Category> wrapper = new QueryWrapper<>();
QueryWrapper<Category> childrenWrapper = new QueryWrapper<>();
Map<String,Object> result=new HashMap<>();
wrapper.eq("parent_id", 0);
List<Category> categoryParentList=categoryService.list(wrapper);
childrenWrapper.ne("parent_id", 0);
List<Category> categoryChildrenList=categoryService.list(childrenWrapper);
result.put("categoryParentList",categoryParentList);
result.put("categoryChildrenList",categoryChildrenList);
return JSON.toJSONString(result);
}
//列出所有子分类
@RequestMapping("/listChildrenCategory")
public String listChildrenCategory(){
QueryWrapper<Category> childrenWrapper = new QueryWrapper<>();
childrenWrapper.eq("category_level", 2);
List<Category> categoryChildrenList=categoryService.list(childrenWrapper);
return JSON.toJSONString(categoryChildrenList);
}
}

@ -0,0 +1,84 @@
package com.example.demo.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.entity.Entrust;
import com.example.demo.entity.User;
import com.example.demo.service.EntrustService;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/entrust")
public class EntrustController {
@Autowired
private EntrustService entrustService;
//用户发布一个委托
@RequestMapping("/add")
public String add(@RequestBody Map<String,Object> entrustMap){
User user = (User) SecurityUtils.getSubject().getSession().getAttribute("user");
if(null!=user){
Entrust entrust=new Entrust();
entrust.setEGoodsName((String) entrustMap.get("eGoodsName"));
entrust.setEGoodsIntro((String) entrustMap.get("eGoodsIntro"));
entrust.setEGoodsCategory((Integer) entrustMap.get("eGoodsCategory"));
entrust.setEGoodsCoverImg((String) entrustMap.get("eGoodsCoverImg"));
entrust.setEGoodsCarousel((String) entrustMap.get("eGoodsCarousel"));
entrust.setEGoodsDetailContent((String) entrustMap.get("eGoodsDetailContent"));
entrust.setEGoodsPrice(Double.parseDouble((String) entrustMap.get("eGoodsPrice")));
entrust.setEStockNum((Integer) entrustMap.get("eStockNum"));
System.out.println(entrust);
entrustService.save(entrust);
return entrust.getEntrustId().toString();
}else {
return "fail";
}
}
//列出所有委托
@RequestMapping("/list")
public String list(){
User user = (User) SecurityUtils.getSubject().getSession().getAttribute("user");
boolean isAdmin=SecurityUtils.getSubject().hasRole("admin");
if(null!=user){
if(isAdmin){
List<Entrust> entrustList=entrustService.list();
return JSON.toJSONString(entrustList);
}else {
return "fail";
}
}else {
return "fail";
}
}
//根据用户id列出委托
@RequestMapping("/listById")
public String listById(@RequestBody Map<String,Object> map){
Integer id= (Integer) map.get("entrustId");
User user = (User) SecurityUtils.getSubject().getSession().getAttribute("user");
System.out.println("编辑委托:"+id);
boolean isAdmin=SecurityUtils.getSubject().hasRole("admin");
if(null!=user){
if(isAdmin){
QueryWrapper<Entrust> entrustQueryWrapper = new QueryWrapper<>();
entrustQueryWrapper.eq("entrust_id",id);
Entrust entrust=entrustService.getOne(entrustQueryWrapper);
return JSON.toJSONString(entrust);
}else {
return "fail";
}
}else {
return "fail";
}
}
}

@ -0,0 +1,55 @@
package com.example.demo.controller;
import com.example.demo.entity.User;
import org.apache.shiro.SecurityUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.UUID;
@RestController
@RequestMapping("/file")
public class FileController {
@RequestMapping("/upload")
public String fileUpload(@RequestParam(value = "img") MultipartFile file){
System.out.println("进入上传");
User user = (User) SecurityUtils.getSubject().getSession().getAttribute("user");
System.out.println(user);
if(null!=user){
if(file.isEmpty()){
System.out.println("文件是空的");
return "fail";
}
System.out.println("有文件");
//文件名
String fileName = file.getOriginalFilename();
System.out.println(fileName);
//后缀名
//String suffixName = fileName.substring(fileName.lastIndexOf("."));
//上传后的路径
String filePath = "/Users/maijiaqiang/IdeaProjects/sharePlatform/target/classes/img/";
//新文件名
UUID uuid=UUID.randomUUID();
fileName = uuid + ".jpg";
System.out.println(fileName);
File dest = new File(filePath + fileName);
if (!dest.getParentFile().exists()) {
dest.getParentFile().mkdirs();
}
try {
file.transferTo(dest);
} catch (IOException e) {
e.printStackTrace();
}
return uuid.toString();
}else {
System.out.println("没有用户");
}
return null;
}
}

@ -0,0 +1,92 @@
package com.example.demo.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.entity.Goods;
import com.example.demo.entity.User;
import com.example.demo.service.EntrustService;
import com.example.demo.service.GoodsService;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/goods")
public class GoodsController {
@Autowired
private GoodsService goodsService;
@Autowired
private EntrustService entrustService;
//根据关键字搜索租赁物品
@RequestMapping("/search")
@Cacheable(value = "platRedis",key = "#map")
public String search(@RequestBody Map<String,Object> map){
String key= (String) map.get("key");
QueryWrapper<Goods> wrapper = new QueryWrapper<>();
wrapper.like("goods_name",key);
System.out.println(key);
List<Goods> goodsList=goodsService.list(wrapper);
return JSON.toJSONString(goodsList);
}
//获取物品详情
@RequestMapping("/detail")
public String detail(@RequestBody Map<String,Object> map){
Integer key= (Integer) map.get("key");
QueryWrapper<Goods> wrapper = new QueryWrapper<>();
wrapper.eq("goods_id",key);
System.out.println(key);
Goods goods=goodsService.getOne(wrapper);
return JSON.toJSONString(goods);
}
//从委托添加租赁物品
@RequestMapping("/add")
@Transactional(rollbackFor = {RuntimeException.class, Error.class})
public String add(@RequestBody Map<String,Object> map){
Goods goods=JSON.parseObject(JSON.toJSONString(map.get("entrust")),Goods.class);
Double price=Double.valueOf((Integer)map.get("itPrice"));
Integer entrustId=(Integer)map.get("entrustId");
goods.setGoodsPrice(price);
System.out.println(price);
User user = (User) SecurityUtils.getSubject().getSession().getAttribute("user");
boolean isAdmin=SecurityUtils.getSubject().hasRole("admin");
if(null!=user){
if(isAdmin){
System.out.println(goods);
goods.setGoodsStatus(1);
goodsService.save(goods);
entrustService.removeById(entrustId);
return goods.getGoodsId().toString();
}else {
return "not admin";
}
}else {
return "fail";
}
}
@RequestMapping("/searchByOrder")
public String searchByOrder(@RequestBody Map<String,Object> map){
String key= (String) map.get("key");
String order= (String) map.get("order");
QueryWrapper<Goods> wrapper = new QueryWrapper<>();
wrapper.like("goods_name",key);
wrapper.orderByAsc(order);
System.out.println(key);
List<Goods> goodsList=goodsService.list(wrapper);
return JSON.toJSONString(goodsList);
}
}

@ -0,0 +1,89 @@
package com.example.demo.controller;
import com.example.demo.util.PasswordHelper;
import com.example.demo.entity.User;
import com.example.demo.entity.UserRole;
import com.example.demo.service.UserRoleService;
import com.example.demo.service.UserService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.IncorrectCredentialsException;
import org.apache.shiro.authc.UnknownAccountException;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
@RestController
@RequestMapping("/home")
public class HomeController {
@Autowired
private UserService userService;
@Autowired
private UserRoleService userRoleService;
@Autowired
public PasswordHelper passwordHelper;
//登录
@RequestMapping("/login")
public String login(@RequestBody Map<String,Object> map){
String userName= (String) map.get("userName");
String passWord= (String) map.get("passWord");
UsernamePasswordToken usernamePasswordToken=new UsernamePasswordToken(userName,passWord);
Subject subject= SecurityUtils.getSubject();
try{
System.out.println("执行login前:");
subject.login(usernamePasswordToken);
}catch (IncorrectCredentialsException ice){
return "password error!";
}catch (UnknownAccountException uae){
return "username error!";
}
User user=userService.findAllUserInfoByUsername(userName);
subject.getSession().setAttribute("user",user);
Serializable tokenId = subject.getSession().getId();
boolean isAdmin=SecurityUtils.getSubject().hasRole("admin");
System.out.println(isAdmin);
System.out.println(SecurityUtils.getSubject().getSession().getAttribute("roleList"));
return String.valueOf(tokenId);
}
//注册
@RequestMapping("/register")
@Transactional(rollbackFor = {RuntimeException.class, Error.class})
public String register(@RequestBody User user){
System.out.println(user);
Date d = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
user.setCreateTime(sdf.format(d));
passwordHelper.encryptPassword(user);
userService.register(user);
UserRole userRole=new UserRole();
userRole.setUserId(user.getUserId());
userRole.setRoleId(1);
userRoleService.save(userRole);
if(null!=user.getUserId()){
return "success";
}
return "fail";
}
//登出
@RequestMapping("/logout")
public String register(){
Subject subject = SecurityUtils.getSubject();
subject.logout();
return "logout success";
}
}

@ -0,0 +1,36 @@
package com.example.demo.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.entity.IndexConfig;
import com.example.demo.service.IndexConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/index-config")
public class IndexConfigController {
@Autowired
private IndexConfigService indexConfigService;
//获取推荐列表/
@RequestMapping("/list")
public String list(@RequestBody Map<String,Object> map){
Integer indexType= (Integer) map.get("indexType");
QueryWrapper<IndexConfig> indexConfigQueryWrapper=new QueryWrapper<>();
indexConfigQueryWrapper.eq("config_type",indexType);
List<IndexConfig> indexConfigList= indexConfigService.list(indexConfigQueryWrapper);
if(null!=indexConfigList){
return JSON.toJSONString(indexConfigList);
}else {
return "fail";
}
}
}

@ -0,0 +1,150 @@
package com.example.demo.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.entity.CartItem;
import com.example.demo.entity.Order;
import com.example.demo.entity.OrderItem;
import com.example.demo.entity.User;
import com.example.demo.service.CartItemService;
import com.example.demo.service.OrderItemService;
import com.example.demo.service.OrderService;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Random;
@RestController
@RequestMapping("/order")
public class OrderController {
@Autowired
private OrderService orderService;
@Autowired
private OrderItemService orderItemService;
@Autowired
private CartItemService cartItemService;
//添加订单
@RequestMapping("/add")
public String add(@RequestBody Order order){
User user = (User) SecurityUtils.getSubject().getSession().getAttribute("user");
if(null!=user){
System.out.println(order);
order.setUserId(user.getUserId());
order.setUserAddress(user.getAddress());
order.setUserName(user.getUserName());
order.setUserPhone(user.getPhone());
order.setOrderNum(createNum());
orderService.save(order);
return order.getOrderId().toString();
}else {
return "fail";
}
}
//根据用户列出订单列表
@RequestMapping("/listByUser")
public String listByUser(){
User user = (User) SecurityUtils.getSubject().getSession().getAttribute("user");
if(null!=user){
System.out.println(user.getUserId());
QueryWrapper<Order> wrapper = new QueryWrapper<>();
wrapper.eq("user_id",user.getUserId());
List<Order> orderList=orderService.list(wrapper);
for(Order order : orderList){
if(null!=order.getOrderId()){
QueryWrapper<OrderItem> orderItemWrapper = new QueryWrapper<>();
orderItemWrapper.eq("order_id",order.getOrderId());
List<OrderItem> orderItemList=orderItemService.list(orderItemWrapper);
order.setOrderItemList(orderItemList);
}
}
return JSON.toJSONString(orderList);
}else {
return "fail";
}
}
//随机生成订单号
private String createNum(){
// 获取当前时间
SimpleDateFormat dmDate = new SimpleDateFormat("yyyyMMddHHmmss");
// 定义随机数
Random random = new Random();
// 随机数长度位数
int ran = random.nextInt(1000000);
Date date = new Date();
String dateran = dmDate.format(date);
String randomMath = dateran+ran;
return randomMath;
}
//从购物车直接下单
@RequestMapping("/addOrderByCart")
@Transactional(rollbackFor = {RuntimeException.class, Error.class})
public String addOrderByCart(@RequestBody Map<String,Object> map) throws ParseException {
List<CartItem> cartItemList=JSON.parseArray(JSON.toJSONString(map.get("cartItemList")), CartItem.class);
Double totalPrice= Double.parseDouble((String) map.get("totalPrice"));
User user = (User) SecurityUtils.getSubject().getSession().getAttribute("user");
if(null!=user){
System.out.println(cartItemList);
System.out.println(totalPrice);
Order order=new Order();
order.setOrderNum(createNum());
order.setUserId(user.getUserId());
order.setTotalPrice(totalPrice);
order.setPayStatus(1);
Date dNow = new Date( );
SimpleDateFormat ft = new SimpleDateFormat ("yyyy-MM-dd hh:mm:ss");
order.setPayTime(ft.format(dNow));
order.setOrderStatus(1);
order.setUserName(user.getUserName());
order.setUserPhone(user.getPhone());
order.setUserAddress(user.getAddress());
order.setCreateTime(ft.format(dNow));
boolean isSaveOrder=orderService.save(order);
if(isSaveOrder){
Integer orderId=order.getOrderId();
for(CartItem item:cartItemList){
OrderItem tmp=new OrderItem();
tmp.setOrderId(orderId);
tmp.setGoodsId(item.getGoodsId());
tmp.setGoodsName(item.getGoodsName());
tmp.setGoodsCoverImg(item.getGoodsCoverImg());
tmp.setPrice(item.getSingleTotalPrice());
tmp.setGoodsCount(item.getGoodsCount());
String format = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
SimpleDateFormat sdf = new SimpleDateFormat(format);
tmp.setCreateTime(item.getCreateTime().split("T")[0]);
tmp.setEndTime(item.getEndTime().split("T")[0]);
tmp.setUserId(user.getUserId());
boolean isSaveOrderItem=orderItemService.save(tmp);
if(isSaveOrderItem){
QueryWrapper<CartItem> cartItemQueryWrapper=new QueryWrapper<>();
cartItemQueryWrapper.eq("cart_item_id",item.getCartItemId());
cartItemService.remove(cartItemQueryWrapper);
}else {
return "fail";
}
}
}
return "success";
}else {
return "fail";
}
}
}

@ -0,0 +1,68 @@
package com.example.demo.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.entity.OrderItem;
import com.example.demo.entity.User;
import com.example.demo.service.OrderItemService;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/orderItem")
public class OrderItemController {
@Autowired
private OrderItemService orderItemService;
//增加物品项
@RequestMapping("/add")
public String add(@RequestBody OrderItem orderItem){
User user = (User) SecurityUtils.getSubject().getSession().getAttribute("user");
if(null!=user){
System.out.println(orderItem);
orderItem.setUserId(user.getUserId());
orderItemService.save(orderItem);
return orderItem.getOrderItemId().toString();
}else {
return "fail";
}
}
//根据订单列出订单项
@RequestMapping("/listByOrder")
public String listByOrder(@RequestBody Map<String, Object> map){
Integer orderId= (Integer) map.get("orderId");
User user = (User) SecurityUtils.getSubject().getSession().getAttribute("user");
if(null!=user){
System.out.println(orderId);
QueryWrapper<OrderItem> wrapper = new QueryWrapper<>();
wrapper.eq("order_id",orderId);
List<OrderItem> orderItemList=orderItemService.list(wrapper);
return JSON.toJSONString(orderItemList);
}else {
return "fail";
}
}
//根据用户列出订单项
@RequestMapping("/listByUser")
public List<OrderItem> listByUser(){
User user = (User) SecurityUtils.getSubject().getSession().getAttribute("user");
if(null!=user){
QueryWrapper<OrderItem> wrapper = new QueryWrapper<>();
wrapper.eq("user_id",user.getUserId());
List<OrderItem> orderItemList=orderItemService.list(wrapper);
return orderItemList;
}else {
return null;
}
}
}

@ -0,0 +1,11 @@
package com.example.demo.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/demo/permission")
public class PermissionController {
}

@ -0,0 +1,11 @@
package com.example.demo.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/demo/role")
public class RoleController {
}

@ -0,0 +1,11 @@
package com.example.demo.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/demo/role-permission")
public class RolePermissionController {
}

@ -0,0 +1,66 @@
package com.example.demo.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.demo.service.UserService;
import com.example.demo.entity.User;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/user")
public class UserController {
@Autowired
private UserService userService;
//获取用户信息
@RequestMapping("/userInfo")
public String userInfo(){
User user = (User) SecurityUtils.getSubject().getSession().getAttribute("user");
String result;
if(null!=user){
User tmp=new User();
tmp.setName(user.getName());
tmp.setPhone(user.getPhone());
tmp.setAddress(user.getAddress());
tmp.setSex(user.getSex());
tmp.setUserId(user.getUserId());
result=JSON.toJSONString(tmp);
return result;
}
return "not login";
}
//判断是否为管理员
@RequestMapping("/isAdmin")
public boolean isAdmin(){
User user = (User) SecurityUtils.getSubject().getSession().getAttribute("user");
boolean isAdmin=SecurityUtils.getSubject().hasRole("admin");
return isAdmin;
}
@RequestMapping("/editUserInfo")
public String editUserInfo(@RequestBody User user){
User tmp = (User) SecurityUtils.getSubject().getSession().getAttribute("user");
String result;
System.out.println(user);
if(null!=user){
Integer id=tmp.getUserId();
QueryWrapper<User> userQueryWrapper=new QueryWrapper<>();
userQueryWrapper.eq("user_id",id);
boolean isEdit=userService.update(user,userQueryWrapper);
if(isEdit){
return "success";
}else {
return "fail";
}
}else {
return "fail";
}
}
}

@ -0,0 +1,11 @@
package com.example.demo.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/demo/user-role")
public class UserRoleController {
}

@ -0,0 +1,62 @@
package com.example.demo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="CartItem对象", description="")
public class CartItem implements Serializable {
private static final long serialVersionUID=1L;
@ApiModelProperty(value = "购物项id")
@TableId(value = "cart_item_id", type = IdType.AUTO)
private Integer cartItemId;
@ApiModelProperty(value = "用户id")
private Integer userId;
@ApiModelProperty(value = "物品id")
private Integer goodsId;
@ApiModelProperty(value = "物品数量")
private Integer goodsCount;
@ApiModelProperty(value = "删除标识字段(0-未删除 1-已删除)")
private Integer isDeleted;
@ApiModelProperty(value = "开始时间")
private String createTime;
@ApiModelProperty(value = "结束时间")
private String endTime;
@ApiModelProperty(value = "单项价")
private double price;
@ApiModelProperty(value = "物品图片")
private String goodsCoverImg;
@ApiModelProperty(value = "物品名称")
private String goodsName;
@ApiModelProperty(value = "总租赁天数")
@TableField(exist = false)
private Integer totalDay;
@ApiModelProperty(value = "单项总价")
@TableField(exist = false)
private double singleTotalPrice;
}

@ -0,0 +1,39 @@
package com.example.demo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Category对象", description="")
public class Category implements Serializable {
private static final long serialVersionUID=1L;
@ApiModelProperty(value = "分类id")
@TableId(value = "category_id", type = IdType.AUTO)
private Integer categoryId;
@ApiModelProperty(value = "分类级别")
private String categoryLevel;
@ApiModelProperty(value = "父分类ID")
private Integer parentId;
@ApiModelProperty(value = "分类名称")
private String categoryName;
@ApiModelProperty(value = "删除标识0-未删除1-已删除)")
private Integer isDeleted;
@ApiModelProperty(value = "图片id")
private String categoryImg;
}

@ -0,0 +1,48 @@
package com.example.demo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Entrust对象", description="")
public class Entrust implements Serializable {
private static final long serialVersionUID=1L;
@ApiModelProperty(value = "委托id")
@TableId(value = "entrust_id", type = IdType.AUTO)
private Integer entrustId;
@ApiModelProperty(value = "委托物品名称")
private String eGoodsName;
@ApiModelProperty(value = "物品简介")
private String eGoodsIntro;
@ApiModelProperty(value = "物品分类id")
private Integer eGoodsCategory;
@ApiModelProperty(value = "物品主图片")
private String eGoodsCoverImg;
@ApiModelProperty(value = "物品轮播图片")
private String eGoodsCarousel;
@ApiModelProperty(value = "物品详情")
private String eGoodsDetailContent;
@ApiModelProperty(value = "委托租赁单价 元/天")
private Double eGoodsPrice;
@ApiModelProperty(value = "委托数量")
private Integer eStockNum;
}

@ -0,0 +1,55 @@
package com.example.demo.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Goods对象", description="")
public class Goods implements Serializable {
private static final long serialVersionUID=1L;
@ApiModelProperty(value = "物品ID")
@TableId(value = "goods_id", type = IdType.AUTO)
private Integer goodsId;
@ApiModelProperty(value = "物品名称")
private String goodsName;
@ApiModelProperty(value = "物品简介")
private String goodsIntro;
@ApiModelProperty(value = "物品分类id")
private Integer goodsCategoryId;
@ApiModelProperty(value = "物品主图片")
private String goodsCoverImg;
@ApiModelProperty(value = "物品轮播图片")
private String goodsCarousel;
@ApiModelProperty(value = "物品详情")
private String goodsDetailContent;
@ApiModelProperty(value = "物品价格")
private double goodsPrice;
@ApiModelProperty(value = "物品数量")
private Integer stockNum;
@ApiModelProperty(value = "物品上架状态0下架1上架")
private Integer goodsStatus;
@ApiModelProperty(value = "物品评价分数满分5")
private double goodsScore;
}

@ -0,0 +1,39 @@
package com.example.demo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="IndexConfig对象", description="")
public class IndexConfig implements Serializable {
private static final long serialVersionUID=1L;
@ApiModelProperty(value = "首页配置项id")
@TableId(value = "config_id", type = IdType.AUTO)
private Integer configId;
@ApiModelProperty(value = "显示名称")
private String configName;
@ApiModelProperty(value = "1-今日推进 2-今日优惠 3-为您推荐")
private Integer configType;
@ApiModelProperty(value = "物品id")
private Integer goodsId;
@ApiModelProperty(value = "删除标识字段(0-未删除 1-已删除)")
private Integer isDeleted;
@ApiModelProperty(value = "物品图片")
private String goodsCoverImg;
}

@ -0,0 +1,73 @@
package com.example.demo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.List;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Order对象", description="")
@TableName(value = "orderKK")
public class Order implements Serializable {
private static final long serialVersionUID=1L;
@ApiModelProperty(value = "订单表id")
@TableId(value = "order_id", type = IdType.AUTO)
private Integer orderId;
@ApiModelProperty(value = "订单号")
private String orderNum;
@ApiModelProperty(value = "用户id")
private Integer userId;
@ApiModelProperty(value = "订单总价")
private Double totalPrice;
@ApiModelProperty(value = "支付状态:0.未支付,1.支付成功,-1:支付失败")
private Integer payStatus;
@ApiModelProperty(value = "支付时间")
private String payTime;
@ApiModelProperty(value = "订单状态:0.待支付 1.已支付 2.配货完成 3:出库成功 4.交易成功 -1.手动关闭 -2.超时关闭 -3.商家关闭")
private Integer orderStatus;
@ApiModelProperty(value = "订单内容描述")
private String extraInfo;
@ApiModelProperty(value = "收货人姓名")
private String userName;
@ApiModelProperty(value = "收货人手机号")
private String userPhone;
@ApiModelProperty(value = "收货人地址")
private String userAddress;
@ApiModelProperty(value = "删除标识字段(0-未删除 1-已删除)")
private Integer isDeleted;
@ApiModelProperty(value = "创建时间")
private String createTime;
@ApiModelProperty(value = "结束租赁时间")
private String endTime;
@ApiModelProperty(value = "订单项列表")
@TableField(exist = false) //非数据库字段
private List<OrderItem> orderItemList;
}

@ -0,0 +1,53 @@
package com.example.demo.entity;
import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="OrderItem对象", description="")
public class OrderItem implements Serializable {
private static final long serialVersionUID=1L;
@ApiModelProperty(value = "订单项id")
@TableId(value = "order_item_id", type = IdType.AUTO)
private Integer orderItemId;
@ApiModelProperty(value = "关联订单id")
private Integer orderId;
@ApiModelProperty(value = "关联物品id")
private Integer goodsId;
@ApiModelProperty(value = "物品名称")
private String goodsName;
@ApiModelProperty(value = "物品主图")
private String goodsCoverImg;
@ApiModelProperty(value = "物品价格")
private Double price;
@ApiModelProperty(value = "物品数量")
private Integer goodsCount;
@ApiModelProperty(value = "创建时间")
private String createTime;
@ApiModelProperty(value = "结束租赁时间")
private String endTime;
@ApiModelProperty(value = "用户id")
private Integer userId;
}

@ -0,0 +1,29 @@
package com.example.demo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Permission对象", description="")
public class Permission implements Serializable {
private static final long serialVersionUID=1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "权限名称")
private String name;
@ApiModelProperty(value = "接口路径")
private String url;
}

@ -0,0 +1,37 @@
package com.example.demo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Role对象", description="")
public class Role implements Serializable {
private static final long serialVersionUID=1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "角色名称")
private String name;
@ApiModelProperty(value = "描述")
private String description;
@ApiModelProperty(value = "权限集合")
@TableField(exist = false) //非数据库字段
private List<Permission> permissionList = new ArrayList<>();
}

@ -0,0 +1,29 @@
package com.example.demo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="RolePermission对象", description="")
public class RolePermission implements Serializable {
private static final long serialVersionUID=1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "角色id")
private Integer roleId;
@ApiModelProperty(value = "权限id")
private Integer permissionId;
}

@ -0,0 +1,62 @@
package com.example.demo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.ArrayList;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="User对象", description="")
public class User implements Serializable {
private static final long serialVersionUID=1L;
@ApiModelProperty(value = "用户主键id")
@TableId(value = "user_id", type = IdType.AUTO)
private Integer userId;
@ApiModelProperty(value = "用户昵称")
private String name;
@ApiModelProperty(value = "性别")
private String sex;
@ApiModelProperty(value = "电话号码")
private String phone;
@ApiModelProperty(value = "登录用户名")
@TableField("userName")
private String userName;
@ApiModelProperty(value = "MD5加密后的密码")
@TableField("passWord")
private String passWord;
@ApiModelProperty(value = "收货地址")
private String address;
@ApiModelProperty(value = "注册时间")
@TableField("createTime")
private String createTime;
@ApiModelProperty(value = "加密盐")
@TableField("createTime")
private String salt;
@ApiModelProperty(value = "角色集合")
@TableField(exist = false) //非数据库字段
private List<Role> roleList = new ArrayList<>();
}

@ -0,0 +1,31 @@
package com.example.demo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="UserRole对象", description="")
public class UserRole implements Serializable {
private static final long serialVersionUID=1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "角色id")
private Integer roleId;
@ApiModelProperty(value = "用户id")
private Integer userId;
private String remarks;
}

@ -0,0 +1,8 @@
package com.example.demo.mapper;
import com.example.demo.entity.CartItem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface CartItemMapper extends BaseMapper<CartItem> {
}

@ -0,0 +1,8 @@
package com.example.demo.mapper;
import com.example.demo.entity.Category;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface CategoryMapper extends BaseMapper<Category> {
}

@ -0,0 +1,8 @@
package com.example.demo.mapper;
import com.example.demo.entity.Entrust;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface EntrustMapper extends BaseMapper<Entrust> {
}

@ -0,0 +1,8 @@
package com.example.demo.mapper;
import com.example.demo.entity.Goods;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface GoodsMapper extends BaseMapper<Goods> {
}

@ -0,0 +1,8 @@
package com.example.demo.mapper;
import com.example.demo.entity.IndexConfig;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface IndexConfigMapper extends BaseMapper<IndexConfig> {
}

@ -0,0 +1,8 @@
package com.example.demo.mapper;
import com.example.demo.entity.OrderItem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface OrderItemMapper extends BaseMapper<OrderItem> {
}

@ -0,0 +1,8 @@
package com.example.demo.mapper;
import com.example.demo.entity.Order;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface OrderMapper extends BaseMapper<Order> {
}

@ -0,0 +1,8 @@
package com.example.demo.mapper;
import com.example.demo.entity.Permission;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface PermissionMapper extends BaseMapper<Permission> {
public Permission listPermissionCascadeByRole(Integer roleId);
}

@ -0,0 +1,10 @@
package com.example.demo.mapper;
import com.example.demo.entity.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
public interface RoleMapper extends BaseMapper<Role> {
public List<Role> listRoleCascadeByUser(Integer userId);
}

@ -0,0 +1,8 @@
package com.example.demo.mapper;
import com.example.demo.entity.RolePermission;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface RolePermissionMapper extends BaseMapper<RolePermission> {
}

@ -0,0 +1,11 @@
package com.example.demo.mapper;
import com.example.demo.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface UserMapper extends BaseMapper<User> {
public User findAllUserInfoByUsername(String userName);
public void register(User user);
}

@ -0,0 +1,8 @@
package com.example.demo.mapper;
import com.example.demo.entity.UserRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface UserRoleMapper extends BaseMapper<UserRole> {
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.demo.mapper.CartItemMapper">
</mapper>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.demo.mapper.CategoryMapper">
</mapper>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.demo.mapper.EntrustMapper">
</mapper>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.demo.mapper.GoodsMapper">
</mapper>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.demo.mapper.IndexConfigMapper">
</mapper>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.demo.mapper.OrderItemMapper">
</mapper>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.demo.mapper.OrderMapper">
</mapper>

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.demo.mapper.PermissionMapper">
<resultMap id="permissionResultMap" type="com.example.demo.entity.Permission">
<id column="id" property="id"/>
<result column="name" property="name"/>
<result column="url" property="url"/>
</resultMap>
<select id="listPermissionCascadeByRole" resultType="com.example.demo.entity.Permission">
select
permission.id id,permission.`name` name,permission.url url
from
role_permission
left join
permission
on
role_permission.permission_id=permission.id
where
role_permission.role_id=#{roleId}
</select>
</mapper>

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.demo.mapper.RoleMapper">
<resultMap id="roleResultMap" type="com.example.demo.entity.Role">
<id column="id" property="id"/>
<result column="name" property="name"/>
<result column="description" property="description"/>
<collection property="permissionList" select="com.example.demo.mapper.PermissionMapper.listPermissionCascadeByRole" column="{roleId=id}"/>
</resultMap>
<select id="listRoleCascadeByUser" resultMap="roleResultMap">
select
role.id id,
role.name name,
role.description description
from
user_role
left join
role
on
user_role.role_id=role.id
where
user_role.user_id=#{userId}
</select>
</mapper>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.demo.mapper.RolePermissionMapper">
</mapper>

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.demo.mapper.UserMapper">
<resultMap id="userResultMap" type="com.example.demo.entity.User">
<id column="user_id" property="userId" />
<result column="name" property="name"/>
<result column="sex" property="sex"/>
<result column="phone" property="phone"/>
<result column="userName" property="userName"/>
<result column="passWord" property="passWord"/>
<result column="address" property="address"/>
<result column="createTime" property="createTime"/>
<result column="salt" property="salt"/>
<collection property="roleList" select="com.example.demo.mapper.RoleMapper.listRoleCascadeByUser" column="{userId=user_id}"/>
</resultMap>
<select id="findAllUserInfoByUsername" resultMap="userResultMap">
select
*
from
user
where
userName=#{userName}
</select>
<insert id="register" useGeneratedKeys="true" keyProperty="userId" parameterType="com.example.demo.entity.User">
INSERT into user(`name`,`sex`,`phone`,userName,`passWord`,`address`,`createTime`,salt) VALUES(#{name},#{sex},#{phone},#{userName},#{passWord},#{address},#{createTime},#{salt});
</insert>
</mapper>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.demo.mapper.UserRoleMapper">
</mapper>

@ -0,0 +1,8 @@
package com.example.demo.service;
import com.example.demo.entity.CartItem;
import com.baomidou.mybatisplus.extension.service.IService;
public interface CartItemService extends IService<CartItem> {
}

@ -0,0 +1,8 @@
package com.example.demo.service;
import com.example.demo.entity.Category;
import com.baomidou.mybatisplus.extension.service.IService;
public interface CategoryService extends IService<Category> {
}

@ -0,0 +1,8 @@
package com.example.demo.service;
import com.example.demo.entity.Entrust;
import com.baomidou.mybatisplus.extension.service.IService;
public interface EntrustService extends IService<Entrust> {
}

@ -0,0 +1,8 @@
package com.example.demo.service;
import com.example.demo.entity.Goods;
import com.baomidou.mybatisplus.extension.service.IService;
public interface GoodsService extends IService<Goods> {
}

@ -0,0 +1,8 @@
package com.example.demo.service;
import com.example.demo.entity.IndexConfig;
import com.baomidou.mybatisplus.extension.service.IService;
public interface IndexConfigService extends IService<IndexConfig> {
}

@ -0,0 +1,8 @@
package com.example.demo.service;
import com.example.demo.entity.OrderItem;
import com.baomidou.mybatisplus.extension.service.IService;
public interface OrderItemService extends IService<OrderItem> {
}

@ -0,0 +1,8 @@
package com.example.demo.service;
import com.example.demo.entity.Order;
import com.baomidou.mybatisplus.extension.service.IService;
public interface OrderService extends IService<Order> {
}

@ -0,0 +1,8 @@
package com.example.demo.service;
import com.example.demo.entity.Permission;
import com.baomidou.mybatisplus.extension.service.IService;
public interface PermissionService extends IService<Permission> {
}

@ -0,0 +1,8 @@
package com.example.demo.service;
import com.example.demo.entity.RolePermission;
import com.baomidou.mybatisplus.extension.service.IService;
public interface RolePermissionService extends IService<RolePermission> {
}

@ -0,0 +1,8 @@
package com.example.demo.service;
import com.example.demo.entity.Role;
import com.baomidou.mybatisplus.extension.service.IService;
public interface RoleService extends IService<Role> {
}

@ -0,0 +1,8 @@
package com.example.demo.service;
import com.example.demo.entity.UserRole;
import com.baomidou.mybatisplus.extension.service.IService;
public interface UserRoleService extends IService<UserRole> {
}

@ -0,0 +1,11 @@
package com.example.demo.service;
import com.example.demo.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
public interface UserService extends IService<User> {
public User findAllUserInfoByUsername(String username);
public void register(User user);
}

@ -0,0 +1,12 @@
package com.example.demo.service.impl;
import com.example.demo.entity.CartItem;
import com.example.demo.mapper.CartItemMapper;
import com.example.demo.service.CartItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@Service
public class CartItemServiceImpl extends ServiceImpl<CartItemMapper, CartItem> implements CartItemService {
}

@ -0,0 +1,12 @@
package com.example.demo.service.impl;
import com.example.demo.entity.Category;
import com.example.demo.mapper.CategoryMapper;
import com.example.demo.service.CategoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@Service
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> implements CategoryService {
}

@ -0,0 +1,12 @@
package com.example.demo.service.impl;
import com.example.demo.entity.Entrust;
import com.example.demo.mapper.EntrustMapper;
import com.example.demo.service.EntrustService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@Service
public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> implements EntrustService {
}

@ -0,0 +1,12 @@
package com.example.demo.service.impl;
import com.example.demo.entity.Goods;
import com.example.demo.mapper.GoodsMapper;
import com.example.demo.service.GoodsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@Service
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements GoodsService {
}

@ -0,0 +1,12 @@
package com.example.demo.service.impl;
import com.example.demo.entity.IndexConfig;
import com.example.demo.mapper.IndexConfigMapper;
import com.example.demo.service.IndexConfigService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@Service
public class IndexConfigServiceImpl extends ServiceImpl<IndexConfigMapper, IndexConfig> implements IndexConfigService {
}

@ -0,0 +1,12 @@
package com.example.demo.service.impl;
import com.example.demo.entity.OrderItem;
import com.example.demo.mapper.OrderItemMapper;
import com.example.demo.service.OrderItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@Service
public class OrderItemServiceImpl extends ServiceImpl<OrderItemMapper, OrderItem> implements OrderItemService {
}

@ -0,0 +1,12 @@
package com.example.demo.service.impl;
import com.example.demo.entity.Order;
import com.example.demo.mapper.OrderMapper;
import com.example.demo.service.OrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {
}

@ -0,0 +1,12 @@
package com.example.demo.service.impl;
import com.example.demo.entity.Permission;
import com.example.demo.mapper.PermissionMapper;
import com.example.demo.service.PermissionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@Service
public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permission> implements PermissionService {
}

@ -0,0 +1,12 @@
package com.example.demo.service.impl;
import com.example.demo.entity.RolePermission;
import com.example.demo.mapper.RolePermissionMapper;
import com.example.demo.service.RolePermissionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@Service
public class RolePermissionServiceImpl extends ServiceImpl<RolePermissionMapper, RolePermission> implements RolePermissionService {
}

@ -0,0 +1,12 @@
package com.example.demo.service.impl;
import com.example.demo.entity.Role;
import com.example.demo.mapper.RoleMapper;
import com.example.demo.service.RoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {
}

@ -0,0 +1,12 @@
package com.example.demo.service.impl;
import com.example.demo.entity.UserRole;
import com.example.demo.mapper.UserRoleMapper;
import com.example.demo.service.UserRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@Service
public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> implements UserRoleService {
}

@ -0,0 +1,26 @@
package com.example.demo.service.impl;
import com.example.demo.entity.User;
import com.example.demo.mapper.UserMapper;
import com.example.demo.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
@Autowired
private UserMapper userMapper;
@Override
public User findAllUserInfoByUsername(String username){
return userMapper.findAllUserInfoByUsername(username);
}
@Override
public void register(User user) {
userMapper.register(user);
}
}

@ -0,0 +1,39 @@
package com.example.demo.util;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
//日志切面
@Component
@Aspect
public class LogAspect {
private final Logger logger= LoggerFactory.getLogger(LogAspect.class);
//controller包 所有类方法切入点
@Pointcut("execution(public * com.example.demo.controller..*.*(..))")
public void controllerLog(){};
//controller前置通知输出基本请求信息到日志
@Before("controllerLog()")
public void log(JoinPoint joinPoint){
RequestAttributes requestAttributes= RequestContextHolder.getRequestAttributes();
HttpServletRequest request=((ServletRequestAttributes)requestAttributes).getRequest();
logger.info("+++++++++请求地址:"+request.getRequestURL().toString()+"+++++++++");
logger.info("+++++++++方法:"+request.getMethod()+"+++++++++");
logger.info("+++++++++源ip地址:"+request.getRemoteAddr()+"+++++++++");
logger.info("+++++++++源端口:"+request.getRemotePort()+"+++++++++");
logger.info("+++++++++类与方法名 : " + joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName()+"+++++++++");
logger.info("+++++++++请求参数:"+ Arrays.toString(joinPoint.getArgs())+"+++++++++");
}
}

@ -0,0 +1,21 @@
package com.example.demo.util;
import com.example.demo.entity.User;
import org.apache.shiro.crypto.RandomNumberGenerator;
import org.apache.shiro.crypto.SecureRandomNumberGenerator;
import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;
//密码加密
public class PasswordHelper {
private RandomNumberGenerator randomNumberGenerator = new SecureRandomNumberGenerator();
public static final String ALGORITHM_NAME = "md5"; // 基础散列算法
public static final int HASH_ITERATIONS = 2; // 自定义散列次数
public void encryptPassword(User user) {
user.setSalt(randomNumberGenerator.nextBytes().toHex());
String newPassword = new SimpleHash(ALGORITHM_NAME, user.getPassWord(),
ByteSource.Util.bytes(user.getSalt()), HASH_ITERATIONS).toHex();
user.setPassWord(newPassword);
}
}

@ -0,0 +1,26 @@
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: 12345678
url: jdbc:mysql://localhost:3306/recommend?useUnicode=true&characterEncoding=utf8
redis:
database: 0
host: 127.0.0.1
port: 6379
jedis:
pool:
max-active: 8
max-wait: -1
max-idle: 8
min-idle: 0
timeout: 0
mybatis-plus:
mapperLocations: classpath*:com/example/**/xml/*Mapper.xml
typeAliasesPackage: com.example.demo.entity
server:
#端口号
port: 8088
logging:
file:
path: "./logs"

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save