diff --git a/README.md b/README.md index 95fb0db..b5f2064 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,79 @@ -# Spring Boot精选课程 +# Spring Boot 精选课程 -[Spring Boot 中文索引](https://github.com/ityouknow/awesome-spring-boot) +[Spring Boot 中文索引](https://github.com/ityouknow/awesome-spring-boot) -[课程地址](http://gitbook.cn/gitchat/column/59f5daa149cd4330613605ba) +### 精通 Spring Boot 42 讲课程列表: -[码云地址](https://gitee.com/ityouknow/spring-boot-leaning) +**开篇** +- [开篇词:为什么要学 Spring Boot](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5b864c65e15aa17d68b5db58) -达人课内容: +**第一部分:快速认识 Spring Boot** -- [第01课:课程概要](http://gitbook.cn/gitchat/column/59f5daa149cd4330613605ba/topic/59f5e21449cd433061360883) -- [第02课:快速实战 Spring Boot](http://gitbook.cn/gitchat/column/59f5daa149cd4330613605ba/topic/59f68c4f49cd43306136301c) -- [第03课:快速体验 Web 开发](http://gitbook.cn/gitchat/column/59f5daa149cd4330613605ba/topic/59f6922549cd4330613634a4) -- [第04课:Spring Data JPA 的使用](http://gitbook.cn/gitchat/column/59f5daa149cd4330613605ba/topic/59f6a809a5beea6a3fd8a7f2) -- [第05课:模板引擎 Thymeleaf](http://gitbook.cn/gitchat/column/59f5daa149cd4330613605ba/topic/59f6d537a5beea6a3fd8c216) -- [第06课:JPA 和 Thymeleaf 实践](http://gitbook.cn/gitchat/column/59f5daa149cd4330613605ba/topic/59f6f2dba5beea6a3fd8d5b0) -- [第07课:Spring Boot 集成 MyBatis](http://gitbook.cn/gitchat/column/59f5daa149cd4330613605ba/topic/59f97e7e68673133615f7427) -- [第08课:MyBatis Druid 多数据源](http://gitbook.cn/gitchat/column/59f5daa149cd4330613605ba/topic/59f97ed968673133615f745f) -- [第09课:如何玩转 Redis](http://gitbook.cn/gitchat/column/59f5daa149cd4330613605ba/topic/59f97f0d68673133615f7481) -- [第10课:Redis 实现数据缓存和 Session 共享](http://gitbook.cn/gitchat/column/59f5daa149cd4330613605ba/topic/59f97f3f68673133615f749b) -- [第11课:RabbitMQ 详解](http://gitbook.cn/gitchat/column/59f5daa149cd4330613605ba/topic/59f97f9c68673133615f74de) -- [第12课:MongoDB 实战](http://gitbook.cn/gitchat/column/59f5daa149cd4330613605ba/topic/59f97fd568673133615f750e) -- [第13课:使用 Spring Boot 发送邮件](http://gitbook.cn/gitchat/column/59f5daa149cd4330613605ba/topic/59f9800d68673133615f7529) -- [第14课:Spring Boot 集成 Quartz](http://gitbook.cn/gitchat/column/59f5daa149cd4330613605ba/topic/59f9806168673133615f7564) -- [第15课:Spring Boot 集成测试和部署运维](http://gitbook.cn/gitchat/column/59f5daa149cd4330613605ba/topic/59f980e668673133615f75b9) -- [第16课:综合实战用户管理系统](http://gitbook.cn/gitchat/column/59f5daa149cd4330613605ba/topic/59f9810d68673133615f75ce) +- [第 1-1 课:Spring Boot 产生的背景和它的设计理念](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5b93c957780fdb5e97d2f35c) +- [第 1-2 课:Spring Boot 2.0 都更新了什么(上)](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5b93c99c780fdb5e97d2f365) +- [第 1-2 课:Spring Boot 2.0 都更新了什么(下)](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5b968861780fdb5e97d3e157) +- [第 1-3 课:Spring Boot 依赖环境和项目结构介绍](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5ba8556f0110e7701d25dd95) +- [第 1-4 课:写一个 Hello World 来感受 Spring Boot](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5bab5a670110e7701d268e21) +**第二部分:Spring Boot 与 Web 开发** -> 有问题可以在读者圈或者达人课文末给我留言。 +- [第 2-1 课:Spring Boot 对基础 Web 开发的支持(上)](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5baca42d80460e6b3d6f7a4d) +- [第 2-1 课:Spring Boot 对基础 Web 开发的支持(下)](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5baca87d80460e6b3d6f7abc) +- [第 2-2 课:Spring Boot 项目中使用 JSP](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5bbac47b9ccd7c1379f25eab) +- [第 2-3 课:模板引擎 Thymeleaf 基础使用](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5bbd7a209ccd7c1379f30479) +- [第 2-4 课:模板引擎 Thymeleaf 高阶用法](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5bc3fef8046eb7300661202e) +- [第 2-5 课:Thymeleaf 页面布局](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5bc6a9cd42d7d32f50f19a2a) +- [第 2-6 课:使用 Spring Boot 和 Thymeleaf 演示上传文件](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5bcd32eb211d0e68b1b70599) +- [第 2-7 课:使用 Spring Boot 上传文件到 FastDFS](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5bcfdff8211d0e68b1b7b079) +- [第 2-8 课:Spring Boot 构建一个 RESTful Web 服务](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5bd67b898b3f803a63ef9e70) +- [第 2-9 课:使用 Swagger 2 构建 RESTful APIs](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5bd910d38b3f803a63f02463) +- [第 2-10 课:使用 Spring Boot WebSocket 创建聊天室](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5bdfadb0665e8a7d7349ed2e) +**第三部分:Spring Boot 和数据库操作** +- [第 3-1 课:Spring Boot 使用 JDBC 操作数据库](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5be25f98d492a00c00b0ce17) +- [第 3-2 课:如何优雅的使用 MyBatis XML 配置版](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5be8f0552c33167c317c6a7f) +- [第 3-3 课:如何优雅的使用 MyBatis 注解版](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5beb9d502c33167c317cbe3b) +- [第 3-4 课:Spring Data JPA 的基本使用](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5bf22499b36fd43be4715f15) +- [第 3-5 课:Spring Data JPA 的高级用法](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5bf4c6eefae086212ccb20e4) +- [第 3-6 课:Spring Data JPA 多数据源的使用](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5bfb55ffae0e5f436e35c0fb) +- [第 3-7 课:Spring Boot 集成 Druid 监控数据源](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5bfe2f357d496f133969c52a) +- [第 3-8 课:Spring Data JPA 和 Thymeleaf 综合实践](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5c036e4db4075a37edf0f940) -关注公众号:纯洁的微笑,回复"springboot"进群交流 +**第四部分:Spring Boot 和 中间件** -![](http://www.ityouknow.com/assets/images/keeppuresmile.jpg) +- [第 4-1 课:Spring Boot 操作 Memcached](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5c05ffbfb4075a37edf18a7f) +- [第 4-2 课:Spring Boot 和 Redis 常用操作](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5c0886c8fa859f1cb51755d1) +- [第 4-3 课:使用 Redis 实现 Session 共享](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5c0d3825edba1b683458f2a5) +- [第 4-4 课:Spring Boot 中使用 Cache 缓存的使用](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5c0f4bda4595324572153973) +- [第 4-5 课:使用 Spring Boot 操作 ActiveMQ](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5c1072a91e59245d4d295584) +- [第 4-6 课:Spring Boot RabbitMQ 详解](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5c165ba61e59245d4d2a3e01) +- [第 4-7 课:Spring Boot 简单集成 MongoDB](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5c19099d1e59245d4d2ab843) +- [第 4-8 课:Spring Boot 集成 ElasticSearch](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5c1af2f31e59245d4d2af6f2) +- [第 4-9 课:Spring Boot 集成 Quartz](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5c1f7ad41e59245d4d2b9109) +- [第 4-10 课:Spring Boot 发送各种类型邮件](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5c21de564fcd483b0264f22f) + +**第五部分:综合实践** + +- [第 5-1 课:使用 Spring Boot Security 进行安全控制](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5c2327834fcd483b02652357) +- [第 5-2 课:使用 Spring Boot Actuator 监控应用](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5c25965e4fcd483b0265b15c) +- [第 5-3 课:Spring Boot Admin 的使用](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5c25a1fa4fcd483b0265b262) +- [第 5-4 课:Spring Boot 对测试的支持](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5c26f8964fcd483b0265facb) +- [第 5-5 课:如何打包部署 Spring Boot 项目](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5c319ae24fcd483b0271071e) +- [第 5-6 课:使用 Docker 部署 Spring Boot 项目](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5c342f1c4fcd483b0271897c) +- [第 5-7 课:综合实战客户管理系统(一)](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5c36c1e24fcd483b0271e9e8) +- [第 5-8 课:综合实战客户管理系统(二)](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a/topic/5c3ac51bbe5fed35a4e45388) + +**总结** + +- [结语:总结 Spring Boot 应用实战](https://gitbook.cn/gitchat/column/5b86228ce15aa17d68b5b55a) + + + +> 有问题可以在读者圈或给我留言。 + +关注公众号:纯洁的微笑,学习更多关于 Spring Boot 内容,公号内回复"666"进群交流。 + +![](http://www.ityouknow.com/assets/images/keeppuresmile_430.jpg) diff --git "a/\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/settings.xml" b/settings.xml similarity index 100% rename from "\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/settings.xml" rename to settings.xml diff --git "a/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/.gitignore" "b/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/.gitignore" new file mode 100644 index 0000000..82eca33 --- /dev/null +++ "b/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/.gitignore" @@ -0,0 +1,25 @@ +/target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/build/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ \ No newline at end of file diff --git "a/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/.mvn/wrapper/maven-wrapper.jar" "b/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/.mvn/wrapper/maven-wrapper.jar" new file mode 100644 index 0000000..9cc84ea Binary files /dev/null and "b/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/.mvn/wrapper/maven-wrapper.jar" differ diff --git "a/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/.mvn/wrapper/maven-wrapper.properties" "b/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/.mvn/wrapper/maven-wrapper.properties" new file mode 100644 index 0000000..6c8c0e0 --- /dev/null +++ "b/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/.mvn/wrapper/maven-wrapper.properties" @@ -0,0 +1 @@ +distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip diff --git "a/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/mvnw" "b/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/mvnw" new file mode 100644 index 0000000..5bf251c --- /dev/null +++ "b/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/mvnw" @@ -0,0 +1,225 @@ +#!/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 +# +# http://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. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven2 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 Migwn, 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)`" + # TODO classpath? +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 + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +echo $MAVEN_PROJECTBASEDIR +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 + +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 "$@" diff --git "a/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/mvnw.cmd" "b/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/mvnw.cmd" new file mode 100644 index 0000000..019bd74 --- /dev/null +++ "b/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/mvnw.cmd" @@ -0,0 +1,143 @@ +@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 http://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 Maven2 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 key stroke 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 enable echoing my 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 + +%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% diff --git "a/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/pom.xml" "b/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/pom.xml" new file mode 100644 index 0000000..f6c73ab --- /dev/null +++ "b/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/pom.xml" @@ -0,0 +1,55 @@ + + + 4.0.0 + + com.neo + hello + 0.0.1-SNAPSHOT + jar + + hello + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.0.5.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-devtools + runtime + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git "a/\347\254\25402\350\257\276\357\274\232\345\277\253\351\200\237\345\256\236\346\210\230Spring Boot/helloWorld/src/main/java/com/neo/helloWorld/HelloWorldApplication.java" "b/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/src/main/java/com/neo/hello/HelloApplication.java" similarity index 60% rename from "\347\254\25402\350\257\276\357\274\232\345\277\253\351\200\237\345\256\236\346\210\230Spring Boot/helloWorld/src/main/java/com/neo/helloWorld/HelloWorldApplication.java" rename to "\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/src/main/java/com/neo/hello/HelloApplication.java" index 266a979..10ac116 100644 --- "a/\347\254\25402\350\257\276\357\274\232\345\277\253\351\200\237\345\256\236\346\210\230Spring Boot/helloWorld/src/main/java/com/neo/helloWorld/HelloWorldApplication.java" +++ "b/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/src/main/java/com/neo/hello/HelloApplication.java" @@ -1,12 +1,12 @@ -package com.neo.helloWorld; +package com.neo.hello; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication -public class HelloWorldApplication { +public class HelloApplication { public static void main(String[] args) { - SpringApplication.run(HelloWorldApplication.class, args); + SpringApplication.run(HelloApplication.class, args); } } diff --git "a/\347\254\25402\350\257\276\357\274\232\345\277\253\351\200\237\345\256\236\346\210\230Spring Boot/helloWorld/src/main/resources/application.properties" "b/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/src/main/resources/application.properties" similarity index 100% rename from "\347\254\25402\350\257\276\357\274\232\345\277\253\351\200\237\345\256\236\346\210\230Spring Boot/helloWorld/src/main/resources/application.properties" rename to "\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/src/main/resources/application.properties" diff --git "a/\347\254\25402\350\257\276\357\274\232\345\277\253\351\200\237\345\256\236\346\210\230Spring Boot/helloWorld/src/test/java/com/neo/helloWorld/HelloWorldApplicationTests.java" "b/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/src/test/java/com/neo/hello/HelloApplicationTests.java" similarity index 79% rename from "\347\254\25402\350\257\276\357\274\232\345\277\253\351\200\237\345\256\236\346\210\230Spring Boot/helloWorld/src/test/java/com/neo/helloWorld/HelloWorldApplicationTests.java" rename to "\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/src/test/java/com/neo/hello/HelloApplicationTests.java" index a29d28c..8c7039e 100644 --- "a/\347\254\25402\350\257\276\357\274\232\345\277\253\351\200\237\345\256\236\346\210\230Spring Boot/helloWorld/src/test/java/com/neo/helloWorld/HelloWorldApplicationTests.java" +++ "b/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/hello/src/test/java/com/neo/hello/HelloApplicationTests.java" @@ -1,4 +1,4 @@ -package com.neo.helloWorld; +package com.neo.hello; import org.junit.Test; import org.junit.runner.RunWith; @@ -7,7 +7,7 @@ @RunWith(SpringRunner.class) @SpringBootTest -public class HelloWorldApplicationTests { +public class HelloApplicationTests { @Test public void contextLoads() { diff --git "a/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/settings.xml" "b/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/settings.xml" new file mode 100644 index 0000000..b24d3a9 --- /dev/null +++ "b/\347\254\254 1-3 \350\257\276 Spring Boot \344\276\235\350\265\226\347\216\257\345\242\203\345\222\214\351\241\271\347\233\256\347\273\223\346\236\204\344\273\213\347\273\215/settings.xml" @@ -0,0 +1,68 @@ + + + + D:\Common Files\maven\repository + true + false + + + + repo2 + central + spring2.0 for this Mirror. + https://repo.spring.io/libs-milestone + + + net-cn + central + Human Readable Name for this Mirror. + http://maven.net.cn/content/groups/public/ + + + ui + + central + Human Readable Name for this Mirror. + http://uk.maven.org/maven2/ + + + ibiblio + central + Human Readable Name for this Mirror. + http://mirrors.ibiblio.org/pub/mirrors/maven2/ + + + jboss-public-repository-group + central + JBoss Public Repository Group + http://repository.jboss.org/nexus/content/groups/public + + + + + + + neo + + true + 1.8 + + + + + spring-milestones + Spring Milestones + https://repo.spring.io/libs-milestone + + false + + + + + + + + neo + + + diff --git "a/\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/mvnw" "b/\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/mvnw" new file mode 100644 index 0000000..5bf251c --- /dev/null +++ "b/\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/mvnw" @@ -0,0 +1,225 @@ +#!/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 +# +# http://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. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven2 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 Migwn, 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)`" + # TODO classpath? +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 + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +echo $MAVEN_PROJECTBASEDIR +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 + +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 "$@" diff --git "a/\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/mvnw.cmd" "b/\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/mvnw.cmd" new file mode 100644 index 0000000..019bd74 --- /dev/null +++ "b/\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/mvnw.cmd" @@ -0,0 +1,143 @@ +@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 http://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 Maven2 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 key stroke 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 enable echoing my 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 + +%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% diff --git "a/\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/pom.xml" "b/\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/pom.xml" new file mode 100644 index 0000000..b48de28 --- /dev/null +++ "b/\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/pom.xml" @@ -0,0 +1,53 @@ + + + 4.0.0 + + com.neo + hello + 0.0.1-SNAPSHOT + jar + + hello + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.0.5.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-devtools + runtime + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git "a/\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/src/main/java/com/neo/hello/HelloApplication.java" "b/\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/src/main/java/com/neo/hello/HelloApplication.java" new file mode 100644 index 0000000..10ac116 --- /dev/null +++ "b/\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/src/main/java/com/neo/hello/HelloApplication.java" @@ -0,0 +1,12 @@ +package com.neo.hello; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class HelloApplication { + + public static void main(String[] args) { + SpringApplication.run(HelloApplication.class, args); + } +} diff --git "a/\347\254\25402\350\257\276\357\274\232\345\277\253\351\200\237\345\256\236\346\210\230Spring Boot/helloWorld/src/main/java/com/neo/helloWorld/web/HelloWorldController.java" "b/\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/src/main/java/com/neo/hello/web/HelloController.java" similarity index 67% rename from "\347\254\25402\350\257\276\357\274\232\345\277\253\351\200\237\345\256\236\346\210\230Spring Boot/helloWorld/src/main/java/com/neo/helloWorld/web/HelloWorldController.java" rename to "\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/src/main/java/com/neo/hello/web/HelloController.java" index ec8f102..cdfddec 100644 --- "a/\347\254\25402\350\257\276\357\274\232\345\277\253\351\200\237\345\256\236\346\210\230Spring Boot/helloWorld/src/main/java/com/neo/helloWorld/web/HelloWorldController.java" +++ "b/\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/src/main/java/com/neo/hello/web/HelloController.java" @@ -1,14 +1,14 @@ -package com.neo.helloWorld.web; +package com.neo.hello.web; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController -public class HelloWorldController { +public class HelloController { @RequestMapping("/hello") public String hello(String name) { - return "Hello World," +name; + return "hello world,"+name; } } \ No newline at end of file diff --git "a/\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-package-war/src/main/resources/application.properties" "b/\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/src/main/resources/application.properties" similarity index 100% rename from "\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-package-war/src/main/resources/application.properties" rename to "\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/src/main/resources/application.properties" diff --git "a/\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/src/test/java/com/neo/hello/HelloApplicationTests.java" "b/\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/src/test/java/com/neo/hello/HelloApplicationTests.java" new file mode 100644 index 0000000..587980d --- /dev/null +++ "b/\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/src/test/java/com/neo/hello/HelloApplicationTests.java" @@ -0,0 +1,17 @@ +package com.neo.hello; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class HelloApplicationTests { + + @Test + public void hello(){ + System.out.println("hello world"); + } + +} diff --git "a/\347\254\25402\350\257\276\357\274\232\345\277\253\351\200\237\345\256\236\346\210\230Spring Boot/helloWorld/src/test/java/com/neo/helloWorld/web/HelloTest.java" "b/\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/src/test/java/com/neo/hello/HelloTest.java" similarity index 60% rename from "\347\254\25402\350\257\276\357\274\232\345\277\253\351\200\237\345\256\236\346\210\230Spring Boot/helloWorld/src/test/java/com/neo/helloWorld/web/HelloTest.java" rename to "\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/src/test/java/com/neo/hello/HelloTest.java" index 0429c84..71d5ed1 100644 --- "a/\347\254\25402\350\257\276\357\274\232\345\277\253\351\200\237\345\256\236\346\210\230Spring Boot/helloWorld/src/test/java/com/neo/helloWorld/web/HelloTest.java" +++ "b/\347\254\254 1-4 \350\257\276\357\274\232\345\206\231\344\270\200\344\270\252 Hello World \346\235\245\346\204\237\345\217\227 Spring Boot/hello/src/test/java/com/neo/hello/HelloTest.java" @@ -1,14 +1,16 @@ -package com.neo.helloWorld.web; +package com.neo.hello; +import com.neo.hello.web.HelloController; +import org.hamcrest.Matchers; import org.junit.Before; import org.junit.Test; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; +import org.springframework.test.web.servlet.result.MockMvcResultMatchers; import org.springframework.test.web.servlet.setup.MockMvcBuilders; - -import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; +import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.*; @SpringBootTest public class HelloTest { @@ -17,13 +19,15 @@ public class HelloTest { @Before public void setUp() throws Exception { - mockMvc = MockMvcBuilders.standaloneSetup(new HelloWorldController()).build(); + mockMvc = MockMvcBuilders.standaloneSetup(new HelloController()).build(); } @Test public void getHello() throws Exception { mockMvc.perform(MockMvcRequestBuilders.post("/hello?name=小明") - .accept(MediaType.APPLICATION_JSON_UTF8)).andDo(print()); + .accept(MediaType.APPLICATION_JSON_UTF8))/*.andDo(print())*/ + .andExpect(MockMvcResultMatchers.content().string(Matchers.containsString("小明"))); } -} + +} \ No newline at end of file diff --git "a/\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/pom.xml" "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/pom.xml" similarity index 97% rename from "\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/pom.xml" rename to "\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/pom.xml" index 4afd388..7f49b28 100644 --- "a/\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/pom.xml" +++ "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/pom.xml" @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 1.5.8.RELEASE + 2.0.5.RELEASE diff --git "a/\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/main/java/com/neo/WebApplication.java" "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/WebApplication.java" similarity index 100% rename from "\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/main/java/com/neo/WebApplication.java" rename to "\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/WebApplication.java" diff --git "a/\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/main/java/com/neo/comm/NeoProperties.java" "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/comm/NeoProperties.java" similarity index 77% rename from "\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/main/java/com/neo/comm/NeoProperties.java" rename to "\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/comm/NeoProperties.java" index dbccf50..f6e07a7 100644 --- "a/\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/main/java/com/neo/comm/NeoProperties.java" +++ "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/comm/NeoProperties.java" @@ -1,13 +1,12 @@ package com.neo.comm; -import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; @Component +@ConfigurationProperties(prefix="neo") public class NeoProperties { - @Value("${com.neo.title}") private String title; - @Value("${com.neo.description}") private String description; public String getTitle() { diff --git "a/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/comm/OtherProperties.java" "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/comm/OtherProperties.java" new file mode 100644 index 0000000..718d909 --- /dev/null +++ "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/comm/OtherProperties.java" @@ -0,0 +1,29 @@ +package com.neo.comm; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Component; + +@Component +@ConfigurationProperties(prefix="other") +@PropertySource("classpath:other.properties") +public class OtherProperties { + private String title; + private String blog; + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getBlog() { + return blog; + } + + public void setBlog(String blog) { + this.blog = blog; + } +} \ No newline at end of file diff --git "a/\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/main/java/com/neo/filter/MyFilter.java" "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/filter/MyFilter.java" similarity index 88% rename from "\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/main/java/com/neo/filter/MyFilter.java" rename to "\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/filter/MyFilter.java" index 8b61a22..6bca3b3 100644 --- "a/\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/main/java/com/neo/filter/MyFilter.java" +++ "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/filter/MyFilter.java" @@ -5,9 +5,10 @@ import java.io.IOException; public class MyFilter implements Filter { - @Override - public void destroy() { - // TODO Auto-generated method stub + + @Override + public void init(FilterConfig arg0) throws ServletException { + // TODO Auto-generated method stub } @Override @@ -20,7 +21,8 @@ public void doFilter(ServletRequest srequest, ServletResponse sresponse, FilterC } @Override - public void init(FilterConfig arg0) throws ServletException { + public void destroy() { // TODO Auto-generated method stub } + } \ No newline at end of file diff --git "a/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/filter/MyFilter2.java" "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/filter/MyFilter2.java" new file mode 100644 index 0000000..012824d --- /dev/null +++ "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/filter/MyFilter2.java" @@ -0,0 +1,28 @@ +package com.neo.filter; + +import javax.servlet.*; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; + +public class MyFilter2 implements Filter { + + @Override + public void init(FilterConfig arg0) throws ServletException { + // TODO Auto-generated method stub + } + + @Override + public void doFilter(ServletRequest srequest, ServletResponse sresponse, FilterChain filterChain) + throws IOException, ServletException { + // TODO Auto-generated method stub + HttpServletRequest request = (HttpServletRequest) srequest; + System.out.println("this is MyFilter2,url :"+request.getRequestURI()); + filterChain.doFilter(srequest, sresponse); + } + + @Override + public void destroy() { + // TODO Auto-generated method stub + } + +} \ No newline at end of file diff --git "a/\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/main/java/com/neo/filter/WebConfiguration.java" "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/filter/WebConfiguration.java" similarity index 68% rename from "\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/main/java/com/neo/filter/WebConfiguration.java" rename to "\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/filter/WebConfiguration.java" index baf699a..6c515df 100644 --- "a/\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/main/java/com/neo/filter/WebConfiguration.java" +++ "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/filter/WebConfiguration.java" @@ -10,19 +10,23 @@ @Configuration public class WebConfiguration { - @Bean - public RemoteIpFilter remoteIpFilter() { - return new RemoteIpFilter(); - } - + @Bean public FilterRegistrationBean testFilterRegistration() { - FilterRegistrationBean registration = new FilterRegistrationBean(); registration.setFilter(new MyFilter()); registration.addUrlPatterns("/*"); - registration.addInitParameter("paramName", "paramValue"); registration.setName("MyFilter"); + registration.setOrder(6); + return registration; + } + + @Bean + public FilterRegistrationBean test2FilterRegistration() { + FilterRegistrationBean registration = new FilterRegistrationBean(); + registration.setFilter(new MyFilter2()); + registration.addUrlPatterns("/*"); + registration.setName("MyFilter2"); registration.setOrder(1); return registration; } diff --git "a/\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/main/java/com/neo/domain/User.java" "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/model/User.java" similarity index 89% rename from "\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/main/java/com/neo/domain/User.java" rename to "\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/model/User.java" index 2043e81..55cadbf 100644 --- "a/\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/main/java/com/neo/domain/User.java" +++ "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/model/User.java" @@ -1,11 +1,10 @@ -package com.neo.domain; +package com.neo.model; import org.hibernate.validator.constraints.Length; -import org.hibernate.validator.constraints.NotEmpty; import javax.validation.constraints.Max; import javax.validation.constraints.Min; -import javax.validation.constraints.Size; +import javax.validation.constraints.NotEmpty; public class User { @NotEmpty(message="姓名不能为空") diff --git "a/\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/main/java/com/neo/web/WebController.java" "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/web/WebController.java" similarity index 87% rename from "\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/main/java/com/neo/web/WebController.java" rename to "\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/web/WebController.java" index f46ac8c..fbb2611 100644 --- "a/\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/main/java/com/neo/web/WebController.java" +++ "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/java/com/neo/web/WebController.java" @@ -1,6 +1,6 @@ package com.neo.web; -import com.neo.domain.User; +import com.neo.model.User; import org.springframework.validation.BindingResult; import org.springframework.validation.ObjectError; import org.springframework.web.bind.annotation.PathVariable; @@ -15,7 +15,7 @@ @RestController public class WebController { - @RequestMapping(name="/getUser", method= RequestMethod.POST) + @RequestMapping(value="/getUser", method= RequestMethod.POST) public User getUser() { User user=new User(); user.setName("小明"); @@ -42,10 +42,8 @@ public List getUsers() { @RequestMapping(value="get/{name}", method=RequestMethod.GET) - public User get(@PathVariable String name) { - User user=new User(); - user.setName(name); - return user; + public String get(@PathVariable String name) { + return name; } diff --git "a/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/resources/application.properties" "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/resources/application.properties" new file mode 100644 index 0000000..1db9eed --- /dev/null +++ "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/resources/application.properties" @@ -0,0 +1,2 @@ +neo.title=\u7EAF\u6D01\u7684\u5FAE\u7B11 +neo.description=\u5206\u4EAB\u6280\u672F\uFF0C\u54C1\u5473\u751F\u6D3B \ No newline at end of file diff --git "a/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/resources/other.properties" "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/resources/other.properties" new file mode 100644 index 0000000..d237cb7 --- /dev/null +++ "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/main/resources/other.properties" @@ -0,0 +1,2 @@ +other.title=keep smile +other.blog=www.ityouknow.com \ No newline at end of file diff --git "a/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/test/java/com/neo/PropertiesTest.java" "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/test/java/com/neo/PropertiesTest.java" new file mode 100644 index 0000000..345b5cc --- /dev/null +++ "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/test/java/com/neo/PropertiesTest.java" @@ -0,0 +1,42 @@ +package com.neo; + +import com.neo.comm.NeoProperties; +import com.neo.comm.OtherProperties; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import javax.annotation.Resource; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class PropertiesTest { + @Value("${neo.title}") + private String title; + @Resource + private NeoProperties properties; + @Resource + private OtherProperties otherProperties; + + @Test + public void testSingle() { + System.out.println("title:"+properties.getTitle()); + Assert.assertEquals(title,"纯洁的微笑"); + } + + @Test + public void testMore() throws Exception { + System.out.println("title:"+properties.getTitle()); + System.out.println("description:"+properties.getDescription()); + } + + @Test + public void testOther() throws Exception { + System.out.println("title:"+otherProperties.getTitle()); + System.out.println("blog:"+otherProperties.getBlog()); + } + +} diff --git "a/\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/test/java/com/neo/WebApplicationTests.java" "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/test/java/com/neo/WebApplicationTests.java" similarity index 100% rename from "\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/test/java/com/neo/WebApplicationTests.java" rename to "\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/test/java/com/neo/WebApplicationTests.java" diff --git "a/\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/test/java/com/neo/web/WebControllerTest.java" "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/test/java/com/neo/web/WebControllerTest.java" similarity index 68% rename from "\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/test/java/com/neo/web/WebControllerTest.java" rename to "\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/test/java/com/neo/web/WebControllerTest.java" index 1ac6cf7..4baa325 100644 --- "a/\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/test/java/com/neo/web/WebControllerTest.java" +++ "b/\347\254\254 2-1 \350\257\276\357\274\232 Spring Boot \345\257\271\345\237\272\347\241\200 Web \345\274\200\345\217\221\346\224\257\346\214\201/spring-boot-web/src/test/java/com/neo/web/WebControllerTest.java" @@ -1,21 +1,12 @@ package com.neo.web; -import com.neo.domain.User; import org.springframework.boot.test.context.SpringBootTest; -import com.neo.web.WebController; import org.junit.Before; import org.junit.Test; -import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import org.springframework.util.MultiValueMap; - -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Set; import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; @@ -31,12 +22,16 @@ public void setUp() throws Exception { @Test public void getUser() throws Exception { - mockMvc.perform(MockMvcRequestBuilders.get("/getUser")).andDo(print()); + String responseString = mockMvc.perform(MockMvcRequestBuilders.post("/getUser")) + .andReturn().getResponse().getContentAsString(); + System.out.println("result : "+responseString); } @Test public void getUsers() throws Exception { - mockMvc.perform(MockMvcRequestBuilders.post("/getUsers")).andDo(print()); + String responseString = mockMvc.perform(MockMvcRequestBuilders.get("/getUsers")) + .andReturn().getResponse().getContentAsString(); + System.out.println("result : "+responseString); } @@ -46,7 +41,7 @@ public void saveUsers() throws Exception { .param("name","") .param("age","666") .param("pass","test") - ).andDo(print()); + ); } diff --git "a/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/pom.xml" "b/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/pom.xml" new file mode 100644 index 0000000..4d7eca5 --- /dev/null +++ "b/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/pom.xml" @@ -0,0 +1,53 @@ + + + 4.0.0 + + com.neo + spring-boot-websocket + 1.0.0 + jar + + spring-boot-websocket + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-websocket + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git "a/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/java/com/neo/ChatRoomServerEndpoint.java" "b/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/java/com/neo/ChatRoomServerEndpoint.java" new file mode 100644 index 0000000..0d466fa --- /dev/null +++ "b/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/java/com/neo/ChatRoomServerEndpoint.java" @@ -0,0 +1,58 @@ +package com.neo; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.RestController; + +import javax.websocket.*; +import javax.websocket.server.PathParam; +import javax.websocket.server.ServerEndpoint; +import java.io.IOException; + +import static com.neo.utils.WebSocketUtils.ONLINE_USER_SESSIONS; +import static com.neo.utils.WebSocketUtils.sendMessageAll; + +@RestController +@ServerEndpoint("/chat-room/{username}") +public class ChatRoomServerEndpoint { + private static final Logger logger = LoggerFactory.getLogger(ChatRoomServerEndpoint.class); + + @OnOpen + public void openSession(@PathParam("username") String username, Session session) { + ONLINE_USER_SESSIONS.put(username, session); + String message = "欢迎用户[" + username + "] 来到聊天室!"; + logger.info("用户登录:"+message); + sendMessageAll(message); + } + + @OnMessage + public void onMessage(@PathParam("username") String username, String message) { + logger.info("发送消息:"+message); + sendMessageAll("用户[" + username + "] : " + message); + } + + @OnClose + public void onClose(@PathParam("username") String username, Session session) { + //当前的Session 移除 + ONLINE_USER_SESSIONS.remove(username); + //并且通知其他人当前用户已经离开聊天室了 + sendMessageAll("用户[" + username + "] 已经离开聊天室了!"); + try { + session.close(); + } catch (IOException e) { + logger.error("onClose error",e); + } + } + + @OnError + public void onError(Session session, Throwable throwable) { + try { + session.close(); + } catch (IOException e) { + logger.error("onError excepiton",e); + } + logger.info("Throwable msg "+throwable.getMessage()); + } + + +} \ No newline at end of file diff --git "a/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/java/com/neo/WebSocketApplication.java" "b/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/java/com/neo/WebSocketApplication.java" new file mode 100644 index 0000000..08fc240 --- /dev/null +++ "b/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/java/com/neo/WebSocketApplication.java" @@ -0,0 +1,21 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.web.socket.config.annotation.EnableWebSocket; +import org.springframework.web.socket.server.standard.ServerEndpointExporter; + +@EnableWebSocket +@SpringBootApplication +public class WebSocketApplication { + + public static void main(String[] args) { + SpringApplication.run(WebSocketApplication.class, args); + } + + @Bean + public ServerEndpointExporter serverEndpointExporter() { + return new ServerEndpointExporter(); + } +} diff --git "a/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/java/com/neo/utils/WebSocketUtils.java" "b/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/java/com/neo/utils/WebSocketUtils.java" new file mode 100644 index 0000000..e533214 --- /dev/null +++ "b/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/java/com/neo/utils/WebSocketUtils.java" @@ -0,0 +1,41 @@ +package com.neo.utils; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.websocket.RemoteEndpoint; +import javax.websocket.Session; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +public final class WebSocketUtils { + private static final Logger logger = LoggerFactory.getLogger(WebSocketUtils.class); + + // 存储 websocket session + public static final Map ONLINE_USER_SESSIONS = new ConcurrentHashMap<>(); + + /** + * @param session 用户 session + * @param message 发送内容 + */ + public static void sendMessage(Session session, String message) { + if (session == null) { + return; + } + final RemoteEndpoint.Basic basic = session.getBasicRemote(); + if (basic == null) { + return; + } + try { + basic.sendText(message); + } catch (IOException e) { + logger.error("sendMessage IOException ",e); + } + } + + public static void sendMessageAll(String message) { + ONLINE_USER_SESSIONS.forEach((sessionId, session) -> sendMessage(session, message)); + } + +} \ No newline at end of file diff --git "a/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/resources/application.properties" "b/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/resources/application.properties" new file mode 100644 index 0000000..eacee2f --- /dev/null +++ "b/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/resources/application.properties" @@ -0,0 +1,6 @@ +# \u8D44\u6E90\u7F13\u5B58\u65F6\u95F4\uFF0C\u5355\u4F4D\u79D2 +spring.resources.cache.period=6000 +# \u5F00\u542Fgzip\u538B\u7F29 +spring.resources.chain.compressed=true +# \u542F\u7528\u7F13\u5B58 +spring.resources.chain.cache=false \ No newline at end of file diff --git "a/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/resources/static/bootstrap.min.css" "b/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/resources/static/bootstrap.min.css" new file mode 100644 index 0000000..6561b6f --- /dev/null +++ "b/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/resources/static/bootstrap.min.css" @@ -0,0 +1,7 @@ +/*! + * Bootstrap v4.0.0 (https://getbootstrap.com) + * Copyright 2011-2018 The Bootstrap Authors + * Copyright 2011-2018 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-family:inherit;font-weight:500;line-height:1.2;color:inherit}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem;font-weight:300;line-height:1.2}.display-2{font-size:5.5rem;font-weight:300;line-height:1.2}.display-3{font-size:4.5rem;font-weight:300;line-height:1.2}.display-4{font-size:3.5rem;font-weight:300;line-height:1.2}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote-footer{display:block;font-size:80%;color:#6c757d}.blockquote-footer::before{content:"\2014 \00A0"}.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #dee2e6;border-radius:.25rem;max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:90%;color:#6c757d}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}code{font-size:87.5%;color:#e83e8c;word-break:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:87.5%;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;font-size:87.5%;color:#212529}pre code{font-size:inherit;color:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1140px}}.container-fluid{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-auto,.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{position:relative;width:100%;min-height:1px;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-1{-webkit-box-flex:0;-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-2{-webkit-box-flex:0;-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-webkit-box-flex:0;-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-5{-webkit-box-flex:0;-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-7{-webkit-box-flex:0;-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-8{-webkit-box-flex:0;-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-webkit-box-flex:0;-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-11{-webkit-box-flex:0;-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-1{margin-left:8.333333%}.offset-2{margin-left:16.666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.333333%}.offset-5{margin-left:41.666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.333333%}.offset-8{margin-left:66.666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.333333%}.offset-11{margin-left:91.666667%}@media (min-width:576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-sm-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-sm-1{-webkit-box-flex:0;-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-sm-2{-webkit-box-flex:0;-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-webkit-box-flex:0;-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-sm-5{-webkit-box-flex:0;-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-sm-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-webkit-box-flex:0;-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-sm-8{-webkit-box-flex:0;-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-sm-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-webkit-box-flex:0;-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-sm-11{-webkit-box-flex:0;-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-sm-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-sm-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-sm-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-sm-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-sm-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-sm-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-sm-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-sm-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-sm-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-sm-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-sm-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-sm-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-sm-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-sm-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-sm-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.333333%}.offset-sm-2{margin-left:16.666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.333333%}.offset-sm-5{margin-left:41.666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.333333%}.offset-sm-8{margin-left:66.666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.333333%}.offset-sm-11{margin-left:91.666667%}}@media (min-width:768px){.col-md{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-md-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-md-1{-webkit-box-flex:0;-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-md-2{-webkit-box-flex:0;-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-md-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-md-4{-webkit-box-flex:0;-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-md-5{-webkit-box-flex:0;-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-md-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-md-7{-webkit-box-flex:0;-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-md-8{-webkit-box-flex:0;-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-md-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-md-10{-webkit-box-flex:0;-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-md-11{-webkit-box-flex:0;-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-md-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-md-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-md-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-md-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-md-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-md-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-md-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-md-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-md-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-md-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-md-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-md-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-md-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-md-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-md-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-md-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.333333%}.offset-md-2{margin-left:16.666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.333333%}.offset-md-5{margin-left:41.666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.333333%}.offset-md-8{margin-left:66.666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.333333%}.offset-md-11{margin-left:91.666667%}}@media (min-width:992px){.col-lg{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-lg-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-lg-1{-webkit-box-flex:0;-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-lg-2{-webkit-box-flex:0;-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-lg-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-lg-4{-webkit-box-flex:0;-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-lg-5{-webkit-box-flex:0;-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-lg-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-lg-7{-webkit-box-flex:0;-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-lg-8{-webkit-box-flex:0;-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-lg-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-lg-10{-webkit-box-flex:0;-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-lg-11{-webkit-box-flex:0;-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-lg-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-lg-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-lg-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-lg-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-lg-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-lg-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-lg-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-lg-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-lg-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-lg-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-lg-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-lg-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-lg-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-lg-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-lg-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-lg-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.333333%}.offset-lg-2{margin-left:16.666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.333333%}.offset-lg-5{margin-left:41.666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.333333%}.offset-lg-8{margin-left:66.666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.333333%}.offset-lg-11{margin-left:91.666667%}}@media (min-width:1200px){.col-xl{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-xl-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-xl-1{-webkit-box-flex:0;-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-xl-2{-webkit-box-flex:0;-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-xl-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-xl-4{-webkit-box-flex:0;-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-xl-5{-webkit-box-flex:0;-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-xl-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-xl-7{-webkit-box-flex:0;-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-xl-8{-webkit-box-flex:0;-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-xl-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-xl-10{-webkit-box-flex:0;-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-xl-11{-webkit-box-flex:0;-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-xl-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-xl-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-xl-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-xl-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-xl-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-xl-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-xl-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-xl-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-xl-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-xl-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-xl-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-xl-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-xl-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-xl-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-xl-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-xl-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.333333%}.offset-xl-2{margin-left:16.666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.333333%}.offset-xl-5{margin-left:41.666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.333333%}.offset-xl-8{margin-left:66.666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.333333%}.offset-xl-11{margin-left:91.666667%}}.table{width:100%;max-width:100%;margin-bottom:1rem;background-color:transparent}.table td,.table th{padding:.75rem;vertical-align:top;border-top:1px solid #dee2e6}.table thead th{vertical-align:bottom;border-bottom:2px solid #dee2e6}.table tbody+tbody{border-top:2px solid #dee2e6}.table .table{background-color:#fff}.table-sm td,.table-sm th{padding:.3rem}.table-bordered{border:1px solid #dee2e6}.table-bordered td,.table-bordered th{border:1px solid #dee2e6}.table-bordered thead td,.table-bordered thead th{border-bottom-width:2px}.table-striped tbody tr:nth-of-type(odd){background-color:rgba(0,0,0,.05)}.table-hover tbody tr:hover{background-color:rgba(0,0,0,.075)}.table-primary,.table-primary>td,.table-primary>th{background-color:#b8daff}.table-hover .table-primary:hover{background-color:#9fcdff}.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#9fcdff}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#d6d8db}.table-hover .table-secondary:hover{background-color:#c8cbcf}.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#c8cbcf}.table-success,.table-success>td,.table-success>th{background-color:#c3e6cb}.table-hover .table-success:hover{background-color:#b1dfbb}.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#b1dfbb}.table-info,.table-info>td,.table-info>th{background-color:#bee5eb}.table-hover .table-info:hover{background-color:#abdde5}.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#abdde5}.table-warning,.table-warning>td,.table-warning>th{background-color:#ffeeba}.table-hover .table-warning:hover{background-color:#ffe8a1}.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#ffe8a1}.table-danger,.table-danger>td,.table-danger>th{background-color:#f5c6cb}.table-hover .table-danger:hover{background-color:#f1b0b7}.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#f1b0b7}.table-light,.table-light>td,.table-light>th{background-color:#fdfdfe}.table-hover .table-light:hover{background-color:#ececf6}.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#ececf6}.table-dark,.table-dark>td,.table-dark>th{background-color:#c6c8ca}.table-hover .table-dark:hover{background-color:#b9bbbe}.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#b9bbbe}.table-active,.table-active>td,.table-active>th{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table .thead-dark th{color:#fff;background-color:#212529;border-color:#32383e}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#dee2e6}.table-dark{color:#fff;background-color:#212529}.table-dark td,.table-dark th,.table-dark thead th{border-color:#32383e}.table-dark.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:rgba(255,255,255,.05)}.table-dark.table-hover tbody tr:hover{background-color:rgba(255,255,255,.075)}@media (max-width:575.98px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-sm>.table-bordered{border:0}}@media (max-width:767.98px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-md>.table-bordered{border:0}}@media (max-width:991.98px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-lg>.table-bordered{border:0}}@media (max-width:1199.98px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-xl>.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive>.table-bordered{border:0}.form-control{display:block;width:100%;padding:.375rem .75rem;font-size:1rem;line-height:1.5;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.form-control::-ms-expand{background-color:transparent;border:0}.form-control:focus{color:#495057;background-color:#fff;border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.form-control::-webkit-input-placeholder{color:#6c757d;opacity:1}.form-control::-moz-placeholder{color:#6c757d;opacity:1}.form-control:-ms-input-placeholder{color:#6c757d;opacity:1}.form-control::-ms-input-placeholder{color:#6c757d;opacity:1}.form-control::placeholder{color:#6c757d;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#e9ecef;opacity:1}select.form-control:not([size]):not([multiple]){height:calc(2.25rem + 2px)}select.form-control:focus::-ms-value{color:#495057;background-color:#fff}.form-control-file,.form-control-range{display:block;width:100%}.col-form-label{padding-top:calc(.375rem + 1px);padding-bottom:calc(.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(.5rem + 1px);padding-bottom:calc(.5rem + 1px);font-size:1.25rem;line-height:1.5}.col-form-label-sm{padding-top:calc(.25rem + 1px);padding-bottom:calc(.25rem + 1px);font-size:.875rem;line-height:1.5}.form-control-plaintext{display:block;width:100%;padding-top:.375rem;padding-bottom:.375rem;margin-bottom:0;line-height:1.5;background-color:transparent;border:solid transparent;border-width:1px 0}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm,.input-group-lg>.form-control-plaintext.form-control,.input-group-lg>.input-group-append>.form-control-plaintext.btn,.input-group-lg>.input-group-append>.form-control-plaintext.input-group-text,.input-group-lg>.input-group-prepend>.form-control-plaintext.btn,.input-group-lg>.input-group-prepend>.form-control-plaintext.input-group-text,.input-group-sm>.form-control-plaintext.form-control,.input-group-sm>.input-group-append>.form-control-plaintext.btn,.input-group-sm>.input-group-append>.form-control-plaintext.input-group-text,.input-group-sm>.input-group-prepend>.form-control-plaintext.btn,.input-group-sm>.input-group-prepend>.form-control-plaintext.input-group-text{padding-right:0;padding-left:0}.form-control-sm,.input-group-sm>.form-control,.input-group-sm>.input-group-append>.btn,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-prepend>.input-group-text{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.input-group-sm>.input-group-append>select.btn:not([size]):not([multiple]),.input-group-sm>.input-group-append>select.input-group-text:not([size]):not([multiple]),.input-group-sm>.input-group-prepend>select.btn:not([size]):not([multiple]),.input-group-sm>.input-group-prepend>select.input-group-text:not([size]):not([multiple]),.input-group-sm>select.form-control:not([size]):not([multiple]),select.form-control-sm:not([size]):not([multiple]){height:calc(1.8125rem + 2px)}.form-control-lg,.input-group-lg>.form-control,.input-group-lg>.input-group-append>.btn,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-prepend>.input-group-text{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.input-group-lg>.input-group-append>select.btn:not([size]):not([multiple]),.input-group-lg>.input-group-append>select.input-group-text:not([size]):not([multiple]),.input-group-lg>.input-group-prepend>select.btn:not([size]):not([multiple]),.input-group-lg>.input-group-prepend>select.input-group-text:not([size]):not([multiple]),.input-group-lg>select.form-control:not([size]):not([multiple]),select.form-control-lg:not([size]):not([multiple]){height:calc(2.875rem + 2px)}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:.25rem}.form-row{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*=col-]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;padding-left:1.25rem}.form-check-input{position:absolute;margin-top:.3rem;margin-left:-1.25rem}.form-check-input:disabled~.form-check-label{color:#6c757d}.form-check-label{margin-bottom:0}.form-check-inline{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-left:0;margin-right:.75rem}.form-check-inline .form-check-input{position:static;margin-top:0;margin-right:.3125rem;margin-left:0}.valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#28a745}.valid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.5rem;margin-top:.1rem;font-size:.875rem;line-height:1;color:#fff;background-color:rgba(40,167,69,.8);border-radius:.2rem}.custom-select.is-valid,.form-control.is-valid,.was-validated .custom-select:valid,.was-validated .form-control:valid{border-color:#28a745}.custom-select.is-valid:focus,.form-control.is-valid:focus,.was-validated .custom-select:valid:focus,.was-validated .form-control:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.custom-select.is-valid~.valid-feedback,.custom-select.is-valid~.valid-tooltip,.form-control.is-valid~.valid-feedback,.form-control.is-valid~.valid-tooltip,.was-validated .custom-select:valid~.valid-feedback,.was-validated .custom-select:valid~.valid-tooltip,.was-validated .form-control:valid~.valid-feedback,.was-validated .form-control:valid~.valid-tooltip{display:block}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:#28a745}.form-check-input.is-valid~.valid-feedback,.form-check-input.is-valid~.valid-tooltip,.was-validated .form-check-input:valid~.valid-feedback,.was-validated .form-check-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid~.custom-control-label,.was-validated .custom-control-input:valid~.custom-control-label{color:#28a745}.custom-control-input.is-valid~.custom-control-label::before,.was-validated .custom-control-input:valid~.custom-control-label::before{background-color:#71dd8a}.custom-control-input.is-valid~.valid-feedback,.custom-control-input.is-valid~.valid-tooltip,.was-validated .custom-control-input:valid~.valid-feedback,.was-validated .custom-control-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid:checked~.custom-control-label::before,.was-validated .custom-control-input:valid:checked~.custom-control-label::before{background-color:#34ce57}.custom-control-input.is-valid:focus~.custom-control-label::before,.was-validated .custom-control-input:valid:focus~.custom-control-label::before{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(40,167,69,.25)}.custom-file-input.is-valid~.custom-file-label,.was-validated .custom-file-input:valid~.custom-file-label{border-color:#28a745}.custom-file-input.is-valid~.custom-file-label::before,.was-validated .custom-file-input:valid~.custom-file-label::before{border-color:inherit}.custom-file-input.is-valid~.valid-feedback,.custom-file-input.is-valid~.valid-tooltip,.was-validated .custom-file-input:valid~.valid-feedback,.was-validated .custom-file-input:valid~.valid-tooltip{display:block}.custom-file-input.is-valid:focus~.custom-file-label,.was-validated .custom-file-input:valid:focus~.custom-file-label{box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.5rem;margin-top:.1rem;font-size:.875rem;line-height:1;color:#fff;background-color:rgba(220,53,69,.8);border-radius:.2rem}.custom-select.is-invalid,.form-control.is-invalid,.was-validated .custom-select:invalid,.was-validated .form-control:invalid{border-color:#dc3545}.custom-select.is-invalid:focus,.form-control.is-invalid:focus,.was-validated .custom-select:invalid:focus,.was-validated .form-control:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.custom-select.is-invalid~.invalid-feedback,.custom-select.is-invalid~.invalid-tooltip,.form-control.is-invalid~.invalid-feedback,.form-control.is-invalid~.invalid-tooltip,.was-validated .custom-select:invalid~.invalid-feedback,.was-validated .custom-select:invalid~.invalid-tooltip,.was-validated .form-control:invalid~.invalid-feedback,.was-validated .form-control:invalid~.invalid-tooltip{display:block}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#dc3545}.form-check-input.is-invalid~.invalid-feedback,.form-check-input.is-invalid~.invalid-tooltip,.was-validated .form-check-input:invalid~.invalid-feedback,.was-validated .form-check-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid~.custom-control-label,.was-validated .custom-control-input:invalid~.custom-control-label{color:#dc3545}.custom-control-input.is-invalid~.custom-control-label::before,.was-validated .custom-control-input:invalid~.custom-control-label::before{background-color:#efa2a9}.custom-control-input.is-invalid~.invalid-feedback,.custom-control-input.is-invalid~.invalid-tooltip,.was-validated .custom-control-input:invalid~.invalid-feedback,.was-validated .custom-control-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid:checked~.custom-control-label::before,.was-validated .custom-control-input:invalid:checked~.custom-control-label::before{background-color:#e4606d}.custom-control-input.is-invalid:focus~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus~.custom-control-label::before{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(220,53,69,.25)}.custom-file-input.is-invalid~.custom-file-label,.was-validated .custom-file-input:invalid~.custom-file-label{border-color:#dc3545}.custom-file-input.is-invalid~.custom-file-label::before,.was-validated .custom-file-input:invalid~.custom-file-label::before{border-color:inherit}.custom-file-input.is-invalid~.invalid-feedback,.custom-file-input.is-invalid~.invalid-tooltip,.was-validated .custom-file-input:invalid~.invalid-feedback,.was-validated .custom-file-input:invalid~.invalid-tooltip{display:block}.custom-file-input.is-invalid:focus~.custom-file-label,.was-validated .custom-file-input:invalid:focus~.custom-file-label{box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-inline{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.form-inline .form-check{width:100%}@media (min-width:576px){.form-inline label{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-bottom:0}.form-inline .form-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:0}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .input-group{width:auto}.form-inline .form-check{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:auto;padding-left:0}.form-inline .form-check-input{position:relative;margin-top:0;margin-right:.25rem;margin-left:0}.form-inline .custom-control{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.form-inline .custom-control-label{margin-bottom:0}}.btn{display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}.btn:focus,.btn:hover{text-decoration:none}.btn.focus,.btn:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.btn.disabled,.btn:disabled{opacity:.65}.btn:not(:disabled):not(.disabled){cursor:pointer}.btn:not(:disabled):not(.disabled).active,.btn:not(:disabled):not(.disabled):active{background-image:none}a.btn.disabled,fieldset:disabled a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:hover{color:#fff;background-color:#0069d9;border-color:#0062cc}.btn-primary.focus,.btn-primary:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#0062cc;border-color:#005cbf}.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-secondary{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:hover{color:#fff;background-color:#5a6268;border-color:#545b62}.btn-secondary.focus,.btn-secondary:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-secondary.disabled,.btn-secondary:disabled{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:not(:disabled):not(.disabled).active,.btn-secondary:not(:disabled):not(.disabled):active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#545b62;border-color:#4e555b}.btn-secondary:not(:disabled):not(.disabled).active:focus,.btn-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-success{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:hover{color:#fff;background-color:#218838;border-color:#1e7e34}.btn-success.focus,.btn-success:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-success.disabled,.btn-success:disabled{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:not(:disabled):not(.disabled).active,.btn-success:not(:disabled):not(.disabled):active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#1e7e34;border-color:#1c7430}.btn-success:not(:disabled):not(.disabled).active:focus,.btn-success:not(:disabled):not(.disabled):active:focus,.show>.btn-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-info{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:hover{color:#fff;background-color:#138496;border-color:#117a8b}.btn-info.focus,.btn-info:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-info.disabled,.btn-info:disabled{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:not(:disabled):not(.disabled).active,.btn-info:not(:disabled):not(.disabled):active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#117a8b;border-color:#10707f}.btn-info:not(:disabled):not(.disabled).active:focus,.btn-info:not(:disabled):not(.disabled):active:focus,.show>.btn-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-warning{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:hover{color:#212529;background-color:#e0a800;border-color:#d39e00}.btn-warning.focus,.btn-warning:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-warning.disabled,.btn-warning:disabled{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:not(:disabled):not(.disabled).active,.btn-warning:not(:disabled):not(.disabled):active,.show>.btn-warning.dropdown-toggle{color:#212529;background-color:#d39e00;border-color:#c69500}.btn-warning:not(:disabled):not(.disabled).active:focus,.btn-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-danger{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:hover{color:#fff;background-color:#c82333;border-color:#bd2130}.btn-danger.focus,.btn-danger:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-danger.disabled,.btn-danger:disabled{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:not(:disabled):not(.disabled).active,.btn-danger:not(:disabled):not(.disabled):active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#bd2130;border-color:#b21f2d}.btn-danger:not(:disabled):not(.disabled).active:focus,.btn-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-light{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5}.btn-light.focus,.btn-light:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-light.disabled,.btn-light:disabled{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:not(:disabled):not(.disabled).active,.btn-light:not(:disabled):not(.disabled):active,.show>.btn-light.dropdown-toggle{color:#212529;background-color:#dae0e5;border-color:#d3d9df}.btn-light:not(:disabled):not(.disabled).active:focus,.btn-light:not(:disabled):not(.disabled):active:focus,.show>.btn-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-dark{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:hover{color:#fff;background-color:#23272b;border-color:#1d2124}.btn-dark.focus,.btn-dark:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-dark.disabled,.btn-dark:disabled{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:not(:disabled):not(.disabled).active,.btn-dark:not(:disabled):not(.disabled):active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#1d2124;border-color:#171a1d}.btn-dark:not(:disabled):not(.disabled).active:focus,.btn-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-outline-primary{color:#007bff;background-color:transparent;background-image:none;border-color:#007bff}.btn-outline-primary:hover{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary.focus,.btn-outline-primary:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#007bff;background-color:transparent}.btn-outline-primary:not(:disabled):not(.disabled).active,.btn-outline-primary:not(:disabled):not(.disabled):active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-secondary{color:#6c757d;background-color:transparent;background-image:none;border-color:#6c757d}.btn-outline-secondary:hover{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary.focus,.btn-outline-secondary:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#6c757d;background-color:transparent}.btn-outline-secondary:not(:disabled):not(.disabled).active,.btn-outline-secondary:not(:disabled):not(.disabled):active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-success{color:#28a745;background-color:transparent;background-image:none;border-color:#28a745}.btn-outline-success:hover{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success.focus,.btn-outline-success:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#28a745;background-color:transparent}.btn-outline-success:not(:disabled):not(.disabled).active,.btn-outline-success:not(:disabled):not(.disabled):active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success:not(:disabled):not(.disabled).active:focus,.btn-outline-success:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-info{color:#17a2b8;background-color:transparent;background-image:none;border-color:#17a2b8}.btn-outline-info:hover{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info.focus,.btn-outline-info:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#17a2b8;background-color:transparent}.btn-outline-info:not(:disabled):not(.disabled).active,.btn-outline-info:not(:disabled):not(.disabled):active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info:not(:disabled):not(.disabled).active:focus,.btn-outline-info:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-warning{color:#ffc107;background-color:transparent;background-image:none;border-color:#ffc107}.btn-outline-warning:hover{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning.focus,.btn-outline-warning:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffc107;background-color:transparent}.btn-outline-warning:not(:disabled):not(.disabled).active,.btn-outline-warning:not(:disabled):not(.disabled):active,.show>.btn-outline-warning.dropdown-toggle{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-danger{color:#dc3545;background-color:transparent;background-image:none;border-color:#dc3545}.btn-outline-danger:hover{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger.focus,.btn-outline-danger:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#dc3545;background-color:transparent}.btn-outline-danger:not(:disabled):not(.disabled).active,.btn-outline-danger:not(:disabled):not(.disabled):active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-light{color:#f8f9fa;background-color:transparent;background-image:none;border-color:#f8f9fa}.btn-outline-light:hover{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light.focus,.btn-outline-light:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#f8f9fa;background-color:transparent}.btn-outline-light:not(:disabled):not(.disabled).active,.btn-outline-light:not(:disabled):not(.disabled):active,.show>.btn-outline-light.dropdown-toggle{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:not(:disabled):not(.disabled).active:focus,.btn-outline-light:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-dark{color:#343a40;background-color:transparent;background-image:none;border-color:#343a40}.btn-outline-dark:hover{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark.focus,.btn-outline-dark:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#343a40;background-color:transparent}.btn-outline-dark:not(:disabled):not(.disabled).active,.btn-outline-dark:not(:disabled):not(.disabled):active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-link{font-weight:400;color:#007bff;background-color:transparent}.btn-link:hover{color:#0056b3;text-decoration:underline;background-color:transparent;border-color:transparent}.btn-link.focus,.btn-link:focus{text-decoration:underline;border-color:transparent;box-shadow:none}.btn-link.disabled,.btn-link:disabled{color:#6c757d}.btn-group-lg>.btn,.btn-lg{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.btn-group-sm>.btn,.btn-sm{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:.5rem}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;transition:opacity .15s linear}.fade.show{opacity:1}.collapse{display:none}.collapse.show{display:block}tr.collapse.show{display:table-row}tbody.collapse.show{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;transition:height .35s ease}.dropdown,.dropup{position:relative}.dropdown-toggle::after{display:inline-block;width:0;height:0;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle:empty::after{margin-left:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:1rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropup .dropdown-menu{margin-top:0;margin-bottom:.125rem}.dropup .dropdown-toggle::after{display:inline-block;width:0;height:0;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropup .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-menu{margin-top:0;margin-left:.125rem}.dropright .dropdown-toggle::after{display:inline-block;width:0;height:0;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-bottom:.3em solid transparent;border-left:.3em solid}.dropright .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-toggle::after{vertical-align:0}.dropleft .dropdown-menu{margin-top:0;margin-right:.125rem}.dropleft .dropdown-toggle::after{display:inline-block;width:0;height:0;margin-left:.255em;vertical-align:.255em;content:""}.dropleft .dropdown-toggle::after{display:none}.dropleft .dropdown-toggle::before{display:inline-block;width:0;height:0;margin-right:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:.3em solid;border-bottom:.3em solid transparent}.dropleft .dropdown-toggle:empty::after{margin-left:0}.dropleft .dropdown-toggle::before{vertical-align:0}.dropdown-divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item{display:block;width:100%;padding:.25rem 1.5rem;clear:both;font-weight:400;color:#212529;text-align:inherit;white-space:nowrap;background-color:transparent;border:0}.dropdown-item:focus,.dropdown-item:hover{color:#16181b;text-decoration:none;background-color:#f8f9fa}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#007bff}.dropdown-item.disabled,.dropdown-item:disabled{color:#6c757d;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:.5rem 1.5rem;margin-bottom:0;font-size:.875rem;color:#6c757d;white-space:nowrap}.btn-group,.btn-group-vertical{position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto}.btn-group-vertical>.btn:hover,.btn-group>.btn:hover{z-index:1}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus{z-index:1}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group,.btn-group-vertical .btn+.btn,.btn-group-vertical .btn+.btn-group,.btn-group-vertical .btn-group+.btn,.btn-group-vertical .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.dropdown-toggle-split::after{margin-left:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.btn-group-vertical .btn,.btn-group-vertical .btn-group{width:100%}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.btn-group-toggle>.btn,.btn-group-toggle>.btn-group>.btn{margin-bottom:0}.btn-group-toggle>.btn input[type=checkbox],.btn-group-toggle>.btn input[type=radio],.btn-group-toggle>.btn-group>.btn input[type=checkbox],.btn-group-toggle>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;width:100%}.input-group>.custom-file,.input-group>.custom-select,.input-group>.form-control{position:relative;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;width:1%;margin-bottom:0}.input-group>.custom-file:focus,.input-group>.custom-select:focus,.input-group>.form-control:focus{z-index:3}.input-group>.custom-file+.custom-file,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.form-control,.input-group>.custom-select+.custom-file,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.form-control,.input-group>.form-control+.custom-file,.input-group>.form-control+.custom-select,.input-group>.form-control+.form-control{margin-left:-1px}.input-group>.custom-select:not(:last-child),.input-group>.form-control:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-select:not(:first-child),.input-group>.form-control:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.custom-file{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.input-group>.custom-file:not(:last-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label::before{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-file:not(:first-child) .custom-file-label,.input-group>.custom-file:not(:first-child) .custom-file-label::before{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-append,.input-group-prepend{display:-webkit-box;display:-ms-flexbox;display:flex}.input-group-append .btn,.input-group-prepend .btn{position:relative;z-index:2}.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.btn,.input-group-append .input-group-text+.input-group-text,.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-prepend .input-group-text+.input-group-text{margin-left:-1px}.input-group-prepend{margin-right:-1px}.input-group-append{margin-left:-1px}.input-group-text{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:.375rem .75rem;margin-bottom:0;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;text-align:center;white-space:nowrap;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem}.input-group-text input[type=checkbox],.input-group-text input[type=radio]{margin-top:0}.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child),.input-group>.input-group-append:not(:last-child)>.btn,.input-group>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child),.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text{border-top-left-radius:0;border-bottom-left-radius:0}.custom-control{position:relative;display:block;min-height:1.5rem;padding-left:1.5rem}.custom-control-inline{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;margin-right:1rem}.custom-control-input{position:absolute;z-index:-1;opacity:0}.custom-control-input:checked~.custom-control-label::before{color:#fff;background-color:#007bff}.custom-control-input:focus~.custom-control-label::before{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-control-input:active~.custom-control-label::before{color:#fff;background-color:#b3d7ff}.custom-control-input:disabled~.custom-control-label{color:#6c757d}.custom-control-input:disabled~.custom-control-label::before{background-color:#e9ecef}.custom-control-label{margin-bottom:0}.custom-control-label::before{position:absolute;top:.25rem;left:0;display:block;width:1rem;height:1rem;pointer-events:none;content:"";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#dee2e6}.custom-control-label::after{position:absolute;top:.25rem;left:0;display:block;width:1rem;height:1rem;content:"";background-repeat:no-repeat;background-position:center center;background-size:50% 50%}.custom-checkbox .custom-control-label::before{border-radius:.25rem}.custom-checkbox .custom-control-input:checked~.custom-control-label::before{background-color:#007bff}.custom-checkbox .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E")}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::before{background-color:#007bff}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='%23fff' d='M0 2h4'/%3E%3C/svg%3E")}.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-checkbox .custom-control-input:disabled:indeterminate~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-radio .custom-control-label::before{border-radius:50%}.custom-radio .custom-control-input:checked~.custom-control-label::before{background-color:#007bff}.custom-radio .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E")}.custom-radio .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-select{display:inline-block;width:100%;height:calc(2.25rem + 2px);padding:.375rem 1.75rem .375rem .75rem;line-height:1.5;color:#495057;vertical-align:middle;background:#fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right .75rem center;background-size:8px 10px;border:1px solid #ced4da;border-radius:.25rem;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:inset 0 1px 2px rgba(0,0,0,.075),0 0 5px rgba(128,189,255,.5)}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-select[multiple],.custom-select[size]:not([size="1"]){height:auto;padding-right:.75rem;background-image:none}.custom-select:disabled{color:#6c757d;background-color:#e9ecef}.custom-select::-ms-expand{opacity:0}.custom-select-sm{height:calc(1.8125rem + 2px);padding-top:.375rem;padding-bottom:.375rem;font-size:75%}.custom-select-lg{height:calc(2.875rem + 2px);padding-top:.375rem;padding-bottom:.375rem;font-size:125%}.custom-file{position:relative;display:inline-block;width:100%;height:calc(2.25rem + 2px);margin-bottom:0}.custom-file-input{position:relative;z-index:2;width:100%;height:calc(2.25rem + 2px);margin:0;opacity:0}.custom-file-input:focus~.custom-file-control{border-color:#80bdff;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-file-input:focus~.custom-file-control::before{border-color:#80bdff}.custom-file-input:lang(en)~.custom-file-label::after{content:"Browse"}.custom-file-label{position:absolute;top:0;right:0;left:0;z-index:1;height:calc(2.25rem + 2px);padding:.375rem .75rem;line-height:1.5;color:#495057;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem}.custom-file-label::after{position:absolute;top:0;right:0;bottom:0;z-index:3;display:block;height:calc(calc(2.25rem + 2px) - 1px * 2);padding:.375rem .75rem;line-height:1.5;color:#495057;content:"Browse";background-color:#e9ecef;border-left:1px solid #ced4da;border-radius:0 .25rem .25rem 0}.nav{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem}.nav-link:focus,.nav-link:hover{text-decoration:none}.nav-link.disabled{color:#6c757d}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #dee2e6}.nav-tabs .nav-link.disabled{color:#6c757d;background-color:transparent;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#007bff}.nav-fill .nav-item{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;text-align:center}.nav-justified .nav-item{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:.5rem 1rem}.navbar>.container,.navbar>.container-fluid{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.3125rem;padding-bottom:.3125rem;margin-right:1rem;font-size:1.25rem;line-height:inherit;white-space:nowrap}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-nav{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:.5rem;padding-bottom:.5rem}.navbar-collapse{-ms-flex-preferred-size:100%;flex-basis:100%;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.navbar-toggler{padding:.25rem .75rem;font-size:1.25rem;line-height:1;background-color:transparent;border:1px solid transparent;border-radius:.25rem}.navbar-toggler:focus,.navbar-toggler:hover{text-decoration:none}.navbar-toggler:not(:disabled):not(.disabled){cursor:pointer}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:no-repeat center center;background-size:100% 100%}@media (max-width:575.98px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:576px){.navbar-expand-sm{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-sm .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-sm .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-sm .navbar-collapse{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}.navbar-expand-sm .dropup .dropdown-menu{top:auto;bottom:100%}}@media (max-width:767.98px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:768px){.navbar-expand-md{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-md .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-md .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-md .navbar-collapse{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}.navbar-expand-md .dropup .dropdown-menu{top:auto;bottom:100%}}@media (max-width:991.98px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:992px){.navbar-expand-lg{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-lg .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-lg .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-lg .navbar-collapse{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}.navbar-expand-lg .dropup .dropdown-menu{top:auto;bottom:100%}}@media (max-width:1199.98px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:1200px){.navbar-expand-xl{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-xl .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-xl .navbar-collapse{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}.navbar-expand-xl .dropup .dropdown-menu{top:auto;bottom:100%}}.navbar-expand{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand .navbar-collapse{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-expand .dropup .dropdown-menu{top:auto;bottom:100%}.navbar-light .navbar-brand{color:rgba(0,0,0,.9)}.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.5);border-color:rgba(0,0,0,.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-light .navbar-text{color:rgba(0,0,0,.5)}.navbar-light .navbar-text a{color:rgba(0,0,0,.9)}.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand{color:#fff}.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:rgba(255,255,255,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:rgba(255,255,255,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:rgba(255,255,255,.25)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:rgba(255,255,255,.5);border-color:rgba(255,255,255,.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-dark .navbar-text{color:rgba(255,255,255,.5)}.navbar-dark .navbar-text a{color:#fff}.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}.card>hr{margin-right:0;margin-left:0}.card>.list-group:first-child .list-group-item:first-child{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.card>.list-group:last-child .list-group-item:last-child{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.card-body{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;padding:1.25rem}.card-title{margin-bottom:.75rem}.card-subtitle{margin-top:-.375rem;margin-bottom:0}.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card-header{padding:.75rem 1.25rem;margin-bottom:0;background-color:rgba(0,0,0,.03);border-bottom:1px solid rgba(0,0,0,.125)}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-header+.list-group .list-group-item:first-child{border-top:0}.card-footer{padding:.75rem 1.25rem;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.125)}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-right:-.625rem;margin-bottom:-.75rem;margin-left:-.625rem;border-bottom:0}.card-header-pills{margin-right:-.625rem;margin-left:-.625rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem}.card-img{width:100%;border-radius:calc(.25rem - 1px)}.card-img-top{width:100%;border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img-bottom{width:100%;border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-deck{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.card-deck .card{margin-bottom:15px}@media (min-width:576px){.card-deck{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck .card{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1 0 0%;flex:1 0 0%;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin-right:15px;margin-bottom:0;margin-left:15px}}.card-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.card-group>.card{margin-bottom:15px}@media (min-width:576px){.card-group{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap}.card-group>.card{-webkit-box-flex:1;-ms-flex:1 0 0%;flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:first-child .card-header,.card-group>.card:first-child .card-img-top{border-top-right-radius:0}.card-group>.card:first-child .card-footer,.card-group>.card:first-child .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:last-child .card-header,.card-group>.card:last-child .card-img-top{border-top-left-radius:0}.card-group>.card:last-child .card-footer,.card-group>.card:last-child .card-img-bottom{border-bottom-left-radius:0}.card-group>.card:only-child{border-radius:.25rem}.card-group>.card:only-child .card-header,.card-group>.card:only-child .card-img-top{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.card-group>.card:only-child .card-footer,.card-group>.card:only-child .card-img-bottom{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.card-group>.card:not(:first-child):not(:last-child):not(:only-child){border-radius:0}.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-footer,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-header,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-img-bottom,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-img-top{border-radius:0}}.card-columns .card{margin-bottom:.75rem}@media (min-width:576px){.card-columns{-webkit-column-count:3;-moz-column-count:3;column-count:3;-webkit-column-gap:1.25rem;-moz-column-gap:1.25rem;column-gap:1.25rem}.card-columns .card{display:inline-block;width:100%}}.breadcrumb{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#e9ecef;border-radius:.25rem}.breadcrumb-item+.breadcrumb-item::before{display:inline-block;padding-right:.5rem;padding-left:.5rem;color:#6c757d;content:"/"}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:underline}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:none}.breadcrumb-item.active{color:#6c757d}.pagination{display:-webkit-box;display:-ms-flexbox;display:flex;padding-left:0;list-style:none;border-radius:.25rem}.page-link{position:relative;display:block;padding:.5rem .75rem;margin-left:-1px;line-height:1.25;color:#007bff;background-color:#fff;border:1px solid #dee2e6}.page-link:hover{color:#0056b3;text-decoration:none;background-color:#e9ecef;border-color:#dee2e6}.page-link:focus{z-index:2;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.page-link:not(:disabled):not(.disabled){cursor:pointer}.page-item:first-child .page-link{margin-left:0;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.page-item:last-child .page-link{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.page-item.active .page-link{z-index:1;color:#fff;background-color:#007bff;border-color:#007bff}.page-item.disabled .page-link{color:#6c757d;pointer-events:none;cursor:auto;background-color:#fff;border-color:#dee2e6}.pagination-lg .page-link{padding:.75rem 1.5rem;font-size:1.25rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem}.pagination-sm .page-link{padding:.25rem .5rem;font-size:.875rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:.2rem;border-bottom-right-radius:.2rem}.badge{display:inline-block;padding:.25em .4em;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:.6em;padding-left:.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#007bff}.badge-primary[href]:focus,.badge-primary[href]:hover{color:#fff;text-decoration:none;background-color:#0062cc}.badge-secondary{color:#fff;background-color:#6c757d}.badge-secondary[href]:focus,.badge-secondary[href]:hover{color:#fff;text-decoration:none;background-color:#545b62}.badge-success{color:#fff;background-color:#28a745}.badge-success[href]:focus,.badge-success[href]:hover{color:#fff;text-decoration:none;background-color:#1e7e34}.badge-info{color:#fff;background-color:#17a2b8}.badge-info[href]:focus,.badge-info[href]:hover{color:#fff;text-decoration:none;background-color:#117a8b}.badge-warning{color:#212529;background-color:#ffc107}.badge-warning[href]:focus,.badge-warning[href]:hover{color:#212529;text-decoration:none;background-color:#d39e00}.badge-danger{color:#fff;background-color:#dc3545}.badge-danger[href]:focus,.badge-danger[href]:hover{color:#fff;text-decoration:none;background-color:#bd2130}.badge-light{color:#212529;background-color:#f8f9fa}.badge-light[href]:focus,.badge-light[href]:hover{color:#212529;text-decoration:none;background-color:#dae0e5}.badge-dark{color:#fff;background-color:#343a40}.badge-dark[href]:focus,.badge-dark[href]:hover{color:#fff;text-decoration:none;background-color:#1d2124}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#e9ecef;border-radius:.3rem}@media (min-width:576px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{position:relative;padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:4rem}.alert-dismissible .close{position:absolute;top:0;right:0;padding:.75rem 1.25rem;color:inherit}.alert-primary{color:#004085;background-color:#cce5ff;border-color:#b8daff}.alert-primary hr{border-top-color:#9fcdff}.alert-primary .alert-link{color:#002752}.alert-secondary{color:#383d41;background-color:#e2e3e5;border-color:#d6d8db}.alert-secondary hr{border-top-color:#c8cbcf}.alert-secondary .alert-link{color:#202326}.alert-success{color:#155724;background-color:#d4edda;border-color:#c3e6cb}.alert-success hr{border-top-color:#b1dfbb}.alert-success .alert-link{color:#0b2e13}.alert-info{color:#0c5460;background-color:#d1ecf1;border-color:#bee5eb}.alert-info hr{border-top-color:#abdde5}.alert-info .alert-link{color:#062c33}.alert-warning{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.alert-warning hr{border-top-color:#ffe8a1}.alert-warning .alert-link{color:#533f03}.alert-danger{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.alert-danger hr{border-top-color:#f1b0b7}.alert-danger .alert-link{color:#491217}.alert-light{color:#818182;background-color:#fefefe;border-color:#fdfdfe}.alert-light hr{border-top-color:#ececf6}.alert-light .alert-link{color:#686868}.alert-dark{color:#1b1e21;background-color:#d6d8d9;border-color:#c6c8ca}.alert-dark hr{border-top-color:#b9bbbe}.alert-dark .alert-link{color:#040505}@-webkit-keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}.progress{display:-webkit-box;display:-ms-flexbox;display:flex;height:1rem;overflow:hidden;font-size:.75rem;background-color:#e9ecef;border-radius:.25rem}.progress-bar{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;color:#fff;text-align:center;background-color:#007bff;transition:width .6s ease}.progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem}.progress-bar-animated{-webkit-animation:progress-bar-stripes 1s linear infinite;animation:progress-bar-stripes 1s linear infinite}.media{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.media-body{-webkit-box-flex:1;-ms-flex:1;flex:1}.list-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0}.list-group-item-action{width:100%;color:#495057;text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{color:#495057;text-decoration:none;background-color:#f8f9fa}.list-group-item-action:active{color:#212529;background-color:#e9ecef}.list-group-item{position:relative;display:block;padding:.75rem 1.25rem;margin-bottom:-1px;background-color:#fff;border:1px solid rgba(0,0,0,.125)}.list-group-item:first-child{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.list-group-item:focus,.list-group-item:hover{z-index:1;text-decoration:none}.list-group-item.disabled,.list-group-item:disabled{color:#6c757d;background-color:#fff}.list-group-item.active{z-index:2;color:#fff;background-color:#007bff;border-color:#007bff}.list-group-flush .list-group-item{border-right:0;border-left:0;border-radius:0}.list-group-flush:first-child .list-group-item:first-child{border-top:0}.list-group-flush:last-child .list-group-item:last-child{border-bottom:0}.list-group-item-primary{color:#004085;background-color:#b8daff}.list-group-item-primary.list-group-item-action:focus,.list-group-item-primary.list-group-item-action:hover{color:#004085;background-color:#9fcdff}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#004085;border-color:#004085}.list-group-item-secondary{color:#383d41;background-color:#d6d8db}.list-group-item-secondary.list-group-item-action:focus,.list-group-item-secondary.list-group-item-action:hover{color:#383d41;background-color:#c8cbcf}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#383d41;border-color:#383d41}.list-group-item-success{color:#155724;background-color:#c3e6cb}.list-group-item-success.list-group-item-action:focus,.list-group-item-success.list-group-item-action:hover{color:#155724;background-color:#b1dfbb}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#155724;border-color:#155724}.list-group-item-info{color:#0c5460;background-color:#bee5eb}.list-group-item-info.list-group-item-action:focus,.list-group-item-info.list-group-item-action:hover{color:#0c5460;background-color:#abdde5}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#0c5460;border-color:#0c5460}.list-group-item-warning{color:#856404;background-color:#ffeeba}.list-group-item-warning.list-group-item-action:focus,.list-group-item-warning.list-group-item-action:hover{color:#856404;background-color:#ffe8a1}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#856404;border-color:#856404}.list-group-item-danger{color:#721c24;background-color:#f5c6cb}.list-group-item-danger.list-group-item-action:focus,.list-group-item-danger.list-group-item-action:hover{color:#721c24;background-color:#f1b0b7}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#721c24;border-color:#721c24}.list-group-item-light{color:#818182;background-color:#fdfdfe}.list-group-item-light.list-group-item-action:focus,.list-group-item-light.list-group-item-action:hover{color:#818182;background-color:#ececf6}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#818182;border-color:#818182}.list-group-item-dark{color:#1b1e21;background-color:#c6c8ca}.list-group-item-dark.list-group-item-action:focus,.list-group-item-dark.list-group-item-action:hover{color:#1b1e21;background-color:#b9bbbe}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#1b1e21;border-color:#1b1e21}.close{float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.close:focus,.close:hover{color:#000;text-decoration:none;opacity:.75}.close:not(:disabled):not(.disabled){cursor:pointer}button.close{padding:0;background-color:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;outline:0}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:.5rem;pointer-events:none}.modal.fade .modal-dialog{transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out;-webkit-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.show .modal-dialog{-webkit-transform:translate(0,0);transform:translate(0,0)}.modal-dialog-centered{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-height:calc(100% - (.5rem * 2))}.modal-content{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;width:100%;pointer-events:auto;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:.5}.modal-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:1rem;border-bottom:1px solid #e9ecef;border-top-left-radius:.3rem;border-top-right-radius:.3rem}.modal-header .close{padding:1rem;margin:-1rem -1rem -1rem auto}.modal-title{margin-bottom:0;line-height:1.5}.modal-body{position:relative;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.modal-footer{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;padding:1rem;border-top:1px solid #e9ecef}.modal-footer>:not(:first-child){margin-left:.25rem}.modal-footer>:not(:last-child){margin-right:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:576px){.modal-dialog{max-width:500px;margin:1.75rem auto}.modal-dialog-centered{min-height:calc(100% - (1.75rem * 2))}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg{max-width:800px}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;opacity:0}.tooltip.show{opacity:.9}.tooltip .arrow{position:absolute;display:block;width:.8rem;height:.4rem}.tooltip .arrow::before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-auto[x-placement^=top],.bs-tooltip-top{padding:.4rem 0}.bs-tooltip-auto[x-placement^=top] .arrow,.bs-tooltip-top .arrow{bottom:0}.bs-tooltip-auto[x-placement^=top] .arrow::before,.bs-tooltip-top .arrow::before{top:0;border-width:.4rem .4rem 0;border-top-color:#000}.bs-tooltip-auto[x-placement^=right],.bs-tooltip-right{padding:0 .4rem}.bs-tooltip-auto[x-placement^=right] .arrow,.bs-tooltip-right .arrow{left:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=right] .arrow::before,.bs-tooltip-right .arrow::before{right:0;border-width:.4rem .4rem .4rem 0;border-right-color:#000}.bs-tooltip-auto[x-placement^=bottom],.bs-tooltip-bottom{padding:.4rem 0}.bs-tooltip-auto[x-placement^=bottom] .arrow,.bs-tooltip-bottom .arrow{top:0}.bs-tooltip-auto[x-placement^=bottom] .arrow::before,.bs-tooltip-bottom .arrow::before{bottom:0;border-width:0 .4rem .4rem;border-bottom-color:#000}.bs-tooltip-auto[x-placement^=left],.bs-tooltip-left{padding:0 .4rem}.bs-tooltip-auto[x-placement^=left] .arrow,.bs-tooltip-left .arrow{right:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=left] .arrow::before,.bs-tooltip-left .arrow::before{left:0;border-width:.4rem 0 .4rem .4rem;border-left-color:#000}.tooltip-inner{max-width:200px;padding:.25rem .5rem;color:#fff;text-align:center;background-color:#000;border-radius:.25rem}.popover{position:absolute;top:0;left:0;z-index:1060;display:block;max-width:276px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.popover .arrow{position:absolute;display:block;width:1rem;height:.5rem;margin:0 .3rem}.popover .arrow::after,.popover .arrow::before{position:absolute;display:block;content:"";border-color:transparent;border-style:solid}.bs-popover-auto[x-placement^=top],.bs-popover-top{margin-bottom:.5rem}.bs-popover-auto[x-placement^=top] .arrow,.bs-popover-top .arrow{bottom:calc((.5rem + 1px) * -1)}.bs-popover-auto[x-placement^=top] .arrow::after,.bs-popover-auto[x-placement^=top] .arrow::before,.bs-popover-top .arrow::after,.bs-popover-top .arrow::before{border-width:.5rem .5rem 0}.bs-popover-auto[x-placement^=top] .arrow::before,.bs-popover-top .arrow::before{bottom:0;border-top-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=top] .arrow::after,.bs-popover-top .arrow::after{bottom:1px;border-top-color:#fff}.bs-popover-auto[x-placement^=right],.bs-popover-right{margin-left:.5rem}.bs-popover-auto[x-placement^=right] .arrow,.bs-popover-right .arrow{left:calc((.5rem + 1px) * -1);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=right] .arrow::after,.bs-popover-auto[x-placement^=right] .arrow::before,.bs-popover-right .arrow::after,.bs-popover-right .arrow::before{border-width:.5rem .5rem .5rem 0}.bs-popover-auto[x-placement^=right] .arrow::before,.bs-popover-right .arrow::before{left:0;border-right-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=right] .arrow::after,.bs-popover-right .arrow::after{left:1px;border-right-color:#fff}.bs-popover-auto[x-placement^=bottom],.bs-popover-bottom{margin-top:.5rem}.bs-popover-auto[x-placement^=bottom] .arrow,.bs-popover-bottom .arrow{top:calc((.5rem + 1px) * -1)}.bs-popover-auto[x-placement^=bottom] .arrow::after,.bs-popover-auto[x-placement^=bottom] .arrow::before,.bs-popover-bottom .arrow::after,.bs-popover-bottom .arrow::before{border-width:0 .5rem .5rem .5rem}.bs-popover-auto[x-placement^=bottom] .arrow::before,.bs-popover-bottom .arrow::before{top:0;border-bottom-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=bottom] .arrow::after,.bs-popover-bottom .arrow::after{top:1px;border-bottom-color:#fff}.bs-popover-auto[x-placement^=bottom] .popover-header::before,.bs-popover-bottom .popover-header::before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-.5rem;content:"";border-bottom:1px solid #f7f7f7}.bs-popover-auto[x-placement^=left],.bs-popover-left{margin-right:.5rem}.bs-popover-auto[x-placement^=left] .arrow,.bs-popover-left .arrow{right:calc((.5rem + 1px) * -1);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=left] .arrow::after,.bs-popover-auto[x-placement^=left] .arrow::before,.bs-popover-left .arrow::after,.bs-popover-left .arrow::before{border-width:.5rem 0 .5rem .5rem}.bs-popover-auto[x-placement^=left] .arrow::before,.bs-popover-left .arrow::before{right:0;border-left-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=left] .arrow::after,.bs-popover-left .arrow::after{right:1px;border-left-color:#fff}.popover-header{padding:.5rem .75rem;margin-bottom:0;font-size:1rem;color:inherit;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:.5rem .75rem;color:#212529}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-item{position:relative;display:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;transition:-webkit-transform .6s ease;transition:transform .6s ease;transition:transform .6s ease,-webkit-transform .6s ease;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.carousel-item-next,.carousel-item-prev{position:absolute;top:0}.carousel-item-next.carousel-item-left,.carousel-item-prev.carousel-item-right{-webkit-transform:translateX(0);transform:translateX(0)}@supports ((-webkit-transform-style:preserve-3d) or (transform-style:preserve-3d)){.carousel-item-next.carousel-item-left,.carousel-item-prev.carousel-item-right{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.active.carousel-item-right,.carousel-item-next{-webkit-transform:translateX(100%);transform:translateX(100%)}@supports ((-webkit-transform-style:preserve-3d) or (transform-style:preserve-3d)){.active.carousel-item-right,.carousel-item-next{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}.active.carousel-item-left,.carousel-item-prev{-webkit-transform:translateX(-100%);transform:translateX(-100%)}@supports ((-webkit-transform-style:preserve-3d) or (transform-style:preserve-3d)){.active.carousel-item-left,.carousel-item-prev{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:15%;color:#fff;text-align:center;opacity:.5}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:20px;height:20px;background:transparent no-repeat center center;background-size:100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E")}.carousel-control-next-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E")}.carousel-indicators{position:absolute;right:0;bottom:10px;left:0;z-index:15;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{position:relative;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;background-color:rgba(255,255,255,.5)}.carousel-indicators li::before{position:absolute;top:-10px;left:0;display:inline-block;width:100%;height:10px;content:""}.carousel-indicators li::after{position:absolute;bottom:-10px;left:0;display:inline-block;width:100%;height:10px;content:""}.carousel-indicators .active{background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.bg-primary{background-color:#007bff!important}a.bg-primary:focus,a.bg-primary:hover,button.bg-primary:focus,button.bg-primary:hover{background-color:#0062cc!important}.bg-secondary{background-color:#6c757d!important}a.bg-secondary:focus,a.bg-secondary:hover,button.bg-secondary:focus,button.bg-secondary:hover{background-color:#545b62!important}.bg-success{background-color:#28a745!important}a.bg-success:focus,a.bg-success:hover,button.bg-success:focus,button.bg-success:hover{background-color:#1e7e34!important}.bg-info{background-color:#17a2b8!important}a.bg-info:focus,a.bg-info:hover,button.bg-info:focus,button.bg-info:hover{background-color:#117a8b!important}.bg-warning{background-color:#ffc107!important}a.bg-warning:focus,a.bg-warning:hover,button.bg-warning:focus,button.bg-warning:hover{background-color:#d39e00!important}.bg-danger{background-color:#dc3545!important}a.bg-danger:focus,a.bg-danger:hover,button.bg-danger:focus,button.bg-danger:hover{background-color:#bd2130!important}.bg-light{background-color:#f8f9fa!important}a.bg-light:focus,a.bg-light:hover,button.bg-light:focus,button.bg-light:hover{background-color:#dae0e5!important}.bg-dark{background-color:#343a40!important}a.bg-dark:focus,a.bg-dark:hover,button.bg-dark:focus,button.bg-dark:hover{background-color:#1d2124!important}.bg-white{background-color:#fff!important}.bg-transparent{background-color:transparent!important}.border{border:1px solid #dee2e6!important}.border-top{border-top:1px solid #dee2e6!important}.border-right{border-right:1px solid #dee2e6!important}.border-bottom{border-bottom:1px solid #dee2e6!important}.border-left{border-left:1px solid #dee2e6!important}.border-0{border:0!important}.border-top-0{border-top:0!important}.border-right-0{border-right:0!important}.border-bottom-0{border-bottom:0!important}.border-left-0{border-left:0!important}.border-primary{border-color:#007bff!important}.border-secondary{border-color:#6c757d!important}.border-success{border-color:#28a745!important}.border-info{border-color:#17a2b8!important}.border-warning{border-color:#ffc107!important}.border-danger{border-color:#dc3545!important}.border-light{border-color:#f8f9fa!important}.border-dark{border-color:#343a40!important}.border-white{border-color:#fff!important}.rounded{border-radius:.25rem!important}.rounded-top{border-top-left-radius:.25rem!important;border-top-right-radius:.25rem!important}.rounded-right{border-top-right-radius:.25rem!important;border-bottom-right-radius:.25rem!important}.rounded-bottom{border-bottom-right-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-left{border-top-left-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-circle{border-radius:50%!important}.rounded-0{border-radius:0!important}.clearfix::after{display:block;clear:both;content:""}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-sm-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-md-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-lg-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-xl-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media print{.d-print-none{display:none!important}.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-print-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive::before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9::before{padding-top:42.857143%}.embed-responsive-16by9::before{padding-top:56.25%}.embed-responsive-4by3::before{padding-top:75%}.embed-responsive-1by1::before{padding-top:100%}.flex-row{-webkit-box-orient:horizontal!important;-webkit-box-direction:normal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-column{-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}@media (min-width:576px){.flex-sm-row{-webkit-box-orient:horizontal!important;-webkit-box-direction:normal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-sm-column{-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-sm-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-sm-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-sm-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-sm-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-sm-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-sm-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-sm-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-sm-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-sm-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-sm-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-sm-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-sm-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-sm-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-sm-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-sm-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-sm-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-sm-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-sm-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-sm-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-sm-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-sm-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-sm-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-sm-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-sm-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-sm-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-sm-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-sm-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:768px){.flex-md-row{-webkit-box-orient:horizontal!important;-webkit-box-direction:normal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-md-column{-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-md-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-md-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-md-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-md-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-md-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-md-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-md-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-md-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-md-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-md-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-md-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-md-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-md-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-md-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-md-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-md-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-md-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-md-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-md-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-md-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-md-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-md-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-md-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-md-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-md-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-md-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-md-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:992px){.flex-lg-row{-webkit-box-orient:horizontal!important;-webkit-box-direction:normal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-lg-column{-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-lg-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-lg-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-lg-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-lg-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-lg-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-lg-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-lg-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-lg-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-lg-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-lg-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-lg-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-lg-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-lg-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-lg-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-lg-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-lg-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-lg-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-lg-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-lg-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-lg-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-lg-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-lg-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-lg-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-lg-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-lg-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-lg-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-lg-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{-webkit-box-orient:horizontal!important;-webkit-box-direction:normal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-xl-column{-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-xl-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-xl-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-xl-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-xl-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-xl-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-xl-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-xl-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-xl-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-xl-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-xl-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-xl-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-xl-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-xl-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-xl-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-xl-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-xl-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-xl-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-xl-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-xl-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-xl-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-xl-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-xl-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-xl-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-xl-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-xl-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-xl-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-xl-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}.float-left{float:left!important}.float-right{float:right!important}.float-none{float:none!important}@media (min-width:576px){.float-sm-left{float:left!important}.float-sm-right{float:right!important}.float-sm-none{float:none!important}}@media (min-width:768px){.float-md-left{float:left!important}.float-md-right{float:right!important}.float-md-none{float:none!important}}@media (min-width:992px){.float-lg-left{float:left!important}.float-lg-right{float:right!important}.float-lg-none{float:none!important}}@media (min-width:1200px){.float-xl-left{float:left!important}.float-xl-right{float:right!important}.float-xl-none{float:none!important}}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:-webkit-sticky!important;position:sticky!important}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}@supports ((position:-webkit-sticky) or (position:sticky)){.sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;-webkit-clip-path:inset(50%);clip-path:inset(50%);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal;-webkit-clip-path:none;clip-path:none}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.mw-100{max-width:100%!important}.mh-100{max-height:100%!important}.m-0{margin:0!important}.mt-0,.my-0{margin-top:0!important}.mr-0,.mx-0{margin-right:0!important}.mb-0,.my-0{margin-bottom:0!important}.ml-0,.mx-0{margin-left:0!important}.m-1{margin:.25rem!important}.mt-1,.my-1{margin-top:.25rem!important}.mr-1,.mx-1{margin-right:.25rem!important}.mb-1,.my-1{margin-bottom:.25rem!important}.ml-1,.mx-1{margin-left:.25rem!important}.m-2{margin:.5rem!important}.mt-2,.my-2{margin-top:.5rem!important}.mr-2,.mx-2{margin-right:.5rem!important}.mb-2,.my-2{margin-bottom:.5rem!important}.ml-2,.mx-2{margin-left:.5rem!important}.m-3{margin:1rem!important}.mt-3,.my-3{margin-top:1rem!important}.mr-3,.mx-3{margin-right:1rem!important}.mb-3,.my-3{margin-bottom:1rem!important}.ml-3,.mx-3{margin-left:1rem!important}.m-4{margin:1.5rem!important}.mt-4,.my-4{margin-top:1.5rem!important}.mr-4,.mx-4{margin-right:1.5rem!important}.mb-4,.my-4{margin-bottom:1.5rem!important}.ml-4,.mx-4{margin-left:1.5rem!important}.m-5{margin:3rem!important}.mt-5,.my-5{margin-top:3rem!important}.mr-5,.mx-5{margin-right:3rem!important}.mb-5,.my-5{margin-bottom:3rem!important}.ml-5,.mx-5{margin-left:3rem!important}.p-0{padding:0!important}.pt-0,.py-0{padding-top:0!important}.pr-0,.px-0{padding-right:0!important}.pb-0,.py-0{padding-bottom:0!important}.pl-0,.px-0{padding-left:0!important}.p-1{padding:.25rem!important}.pt-1,.py-1{padding-top:.25rem!important}.pr-1,.px-1{padding-right:.25rem!important}.pb-1,.py-1{padding-bottom:.25rem!important}.pl-1,.px-1{padding-left:.25rem!important}.p-2{padding:.5rem!important}.pt-2,.py-2{padding-top:.5rem!important}.pr-2,.px-2{padding-right:.5rem!important}.pb-2,.py-2{padding-bottom:.5rem!important}.pl-2,.px-2{padding-left:.5rem!important}.p-3{padding:1rem!important}.pt-3,.py-3{padding-top:1rem!important}.pr-3,.px-3{padding-right:1rem!important}.pb-3,.py-3{padding-bottom:1rem!important}.pl-3,.px-3{padding-left:1rem!important}.p-4{padding:1.5rem!important}.pt-4,.py-4{padding-top:1.5rem!important}.pr-4,.px-4{padding-right:1.5rem!important}.pb-4,.py-4{padding-bottom:1.5rem!important}.pl-4,.px-4{padding-left:1.5rem!important}.p-5{padding:3rem!important}.pt-5,.py-5{padding-top:3rem!important}.pr-5,.px-5{padding-right:3rem!important}.pb-5,.py-5{padding-bottom:3rem!important}.pl-5,.px-5{padding-left:3rem!important}.m-auto{margin:auto!important}.mt-auto,.my-auto{margin-top:auto!important}.mr-auto,.mx-auto{margin-right:auto!important}.mb-auto,.my-auto{margin-bottom:auto!important}.ml-auto,.mx-auto{margin-left:auto!important}@media (min-width:576px){.m-sm-0{margin:0!important}.mt-sm-0,.my-sm-0{margin-top:0!important}.mr-sm-0,.mx-sm-0{margin-right:0!important}.mb-sm-0,.my-sm-0{margin-bottom:0!important}.ml-sm-0,.mx-sm-0{margin-left:0!important}.m-sm-1{margin:.25rem!important}.mt-sm-1,.my-sm-1{margin-top:.25rem!important}.mr-sm-1,.mx-sm-1{margin-right:.25rem!important}.mb-sm-1,.my-sm-1{margin-bottom:.25rem!important}.ml-sm-1,.mx-sm-1{margin-left:.25rem!important}.m-sm-2{margin:.5rem!important}.mt-sm-2,.my-sm-2{margin-top:.5rem!important}.mr-sm-2,.mx-sm-2{margin-right:.5rem!important}.mb-sm-2,.my-sm-2{margin-bottom:.5rem!important}.ml-sm-2,.mx-sm-2{margin-left:.5rem!important}.m-sm-3{margin:1rem!important}.mt-sm-3,.my-sm-3{margin-top:1rem!important}.mr-sm-3,.mx-sm-3{margin-right:1rem!important}.mb-sm-3,.my-sm-3{margin-bottom:1rem!important}.ml-sm-3,.mx-sm-3{margin-left:1rem!important}.m-sm-4{margin:1.5rem!important}.mt-sm-4,.my-sm-4{margin-top:1.5rem!important}.mr-sm-4,.mx-sm-4{margin-right:1.5rem!important}.mb-sm-4,.my-sm-4{margin-bottom:1.5rem!important}.ml-sm-4,.mx-sm-4{margin-left:1.5rem!important}.m-sm-5{margin:3rem!important}.mt-sm-5,.my-sm-5{margin-top:3rem!important}.mr-sm-5,.mx-sm-5{margin-right:3rem!important}.mb-sm-5,.my-sm-5{margin-bottom:3rem!important}.ml-sm-5,.mx-sm-5{margin-left:3rem!important}.p-sm-0{padding:0!important}.pt-sm-0,.py-sm-0{padding-top:0!important}.pr-sm-0,.px-sm-0{padding-right:0!important}.pb-sm-0,.py-sm-0{padding-bottom:0!important}.pl-sm-0,.px-sm-0{padding-left:0!important}.p-sm-1{padding:.25rem!important}.pt-sm-1,.py-sm-1{padding-top:.25rem!important}.pr-sm-1,.px-sm-1{padding-right:.25rem!important}.pb-sm-1,.py-sm-1{padding-bottom:.25rem!important}.pl-sm-1,.px-sm-1{padding-left:.25rem!important}.p-sm-2{padding:.5rem!important}.pt-sm-2,.py-sm-2{padding-top:.5rem!important}.pr-sm-2,.px-sm-2{padding-right:.5rem!important}.pb-sm-2,.py-sm-2{padding-bottom:.5rem!important}.pl-sm-2,.px-sm-2{padding-left:.5rem!important}.p-sm-3{padding:1rem!important}.pt-sm-3,.py-sm-3{padding-top:1rem!important}.pr-sm-3,.px-sm-3{padding-right:1rem!important}.pb-sm-3,.py-sm-3{padding-bottom:1rem!important}.pl-sm-3,.px-sm-3{padding-left:1rem!important}.p-sm-4{padding:1.5rem!important}.pt-sm-4,.py-sm-4{padding-top:1.5rem!important}.pr-sm-4,.px-sm-4{padding-right:1.5rem!important}.pb-sm-4,.py-sm-4{padding-bottom:1.5rem!important}.pl-sm-4,.px-sm-4{padding-left:1.5rem!important}.p-sm-5{padding:3rem!important}.pt-sm-5,.py-sm-5{padding-top:3rem!important}.pr-sm-5,.px-sm-5{padding-right:3rem!important}.pb-sm-5,.py-sm-5{padding-bottom:3rem!important}.pl-sm-5,.px-sm-5{padding-left:3rem!important}.m-sm-auto{margin:auto!important}.mt-sm-auto,.my-sm-auto{margin-top:auto!important}.mr-sm-auto,.mx-sm-auto{margin-right:auto!important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto!important}.ml-sm-auto,.mx-sm-auto{margin-left:auto!important}}@media (min-width:768px){.m-md-0{margin:0!important}.mt-md-0,.my-md-0{margin-top:0!important}.mr-md-0,.mx-md-0{margin-right:0!important}.mb-md-0,.my-md-0{margin-bottom:0!important}.ml-md-0,.mx-md-0{margin-left:0!important}.m-md-1{margin:.25rem!important}.mt-md-1,.my-md-1{margin-top:.25rem!important}.mr-md-1,.mx-md-1{margin-right:.25rem!important}.mb-md-1,.my-md-1{margin-bottom:.25rem!important}.ml-md-1,.mx-md-1{margin-left:.25rem!important}.m-md-2{margin:.5rem!important}.mt-md-2,.my-md-2{margin-top:.5rem!important}.mr-md-2,.mx-md-2{margin-right:.5rem!important}.mb-md-2,.my-md-2{margin-bottom:.5rem!important}.ml-md-2,.mx-md-2{margin-left:.5rem!important}.m-md-3{margin:1rem!important}.mt-md-3,.my-md-3{margin-top:1rem!important}.mr-md-3,.mx-md-3{margin-right:1rem!important}.mb-md-3,.my-md-3{margin-bottom:1rem!important}.ml-md-3,.mx-md-3{margin-left:1rem!important}.m-md-4{margin:1.5rem!important}.mt-md-4,.my-md-4{margin-top:1.5rem!important}.mr-md-4,.mx-md-4{margin-right:1.5rem!important}.mb-md-4,.my-md-4{margin-bottom:1.5rem!important}.ml-md-4,.mx-md-4{margin-left:1.5rem!important}.m-md-5{margin:3rem!important}.mt-md-5,.my-md-5{margin-top:3rem!important}.mr-md-5,.mx-md-5{margin-right:3rem!important}.mb-md-5,.my-md-5{margin-bottom:3rem!important}.ml-md-5,.mx-md-5{margin-left:3rem!important}.p-md-0{padding:0!important}.pt-md-0,.py-md-0{padding-top:0!important}.pr-md-0,.px-md-0{padding-right:0!important}.pb-md-0,.py-md-0{padding-bottom:0!important}.pl-md-0,.px-md-0{padding-left:0!important}.p-md-1{padding:.25rem!important}.pt-md-1,.py-md-1{padding-top:.25rem!important}.pr-md-1,.px-md-1{padding-right:.25rem!important}.pb-md-1,.py-md-1{padding-bottom:.25rem!important}.pl-md-1,.px-md-1{padding-left:.25rem!important}.p-md-2{padding:.5rem!important}.pt-md-2,.py-md-2{padding-top:.5rem!important}.pr-md-2,.px-md-2{padding-right:.5rem!important}.pb-md-2,.py-md-2{padding-bottom:.5rem!important}.pl-md-2,.px-md-2{padding-left:.5rem!important}.p-md-3{padding:1rem!important}.pt-md-3,.py-md-3{padding-top:1rem!important}.pr-md-3,.px-md-3{padding-right:1rem!important}.pb-md-3,.py-md-3{padding-bottom:1rem!important}.pl-md-3,.px-md-3{padding-left:1rem!important}.p-md-4{padding:1.5rem!important}.pt-md-4,.py-md-4{padding-top:1.5rem!important}.pr-md-4,.px-md-4{padding-right:1.5rem!important}.pb-md-4,.py-md-4{padding-bottom:1.5rem!important}.pl-md-4,.px-md-4{padding-left:1.5rem!important}.p-md-5{padding:3rem!important}.pt-md-5,.py-md-5{padding-top:3rem!important}.pr-md-5,.px-md-5{padding-right:3rem!important}.pb-md-5,.py-md-5{padding-bottom:3rem!important}.pl-md-5,.px-md-5{padding-left:3rem!important}.m-md-auto{margin:auto!important}.mt-md-auto,.my-md-auto{margin-top:auto!important}.mr-md-auto,.mx-md-auto{margin-right:auto!important}.mb-md-auto,.my-md-auto{margin-bottom:auto!important}.ml-md-auto,.mx-md-auto{margin-left:auto!important}}@media (min-width:992px){.m-lg-0{margin:0!important}.mt-lg-0,.my-lg-0{margin-top:0!important}.mr-lg-0,.mx-lg-0{margin-right:0!important}.mb-lg-0,.my-lg-0{margin-bottom:0!important}.ml-lg-0,.mx-lg-0{margin-left:0!important}.m-lg-1{margin:.25rem!important}.mt-lg-1,.my-lg-1{margin-top:.25rem!important}.mr-lg-1,.mx-lg-1{margin-right:.25rem!important}.mb-lg-1,.my-lg-1{margin-bottom:.25rem!important}.ml-lg-1,.mx-lg-1{margin-left:.25rem!important}.m-lg-2{margin:.5rem!important}.mt-lg-2,.my-lg-2{margin-top:.5rem!important}.mr-lg-2,.mx-lg-2{margin-right:.5rem!important}.mb-lg-2,.my-lg-2{margin-bottom:.5rem!important}.ml-lg-2,.mx-lg-2{margin-left:.5rem!important}.m-lg-3{margin:1rem!important}.mt-lg-3,.my-lg-3{margin-top:1rem!important}.mr-lg-3,.mx-lg-3{margin-right:1rem!important}.mb-lg-3,.my-lg-3{margin-bottom:1rem!important}.ml-lg-3,.mx-lg-3{margin-left:1rem!important}.m-lg-4{margin:1.5rem!important}.mt-lg-4,.my-lg-4{margin-top:1.5rem!important}.mr-lg-4,.mx-lg-4{margin-right:1.5rem!important}.mb-lg-4,.my-lg-4{margin-bottom:1.5rem!important}.ml-lg-4,.mx-lg-4{margin-left:1.5rem!important}.m-lg-5{margin:3rem!important}.mt-lg-5,.my-lg-5{margin-top:3rem!important}.mr-lg-5,.mx-lg-5{margin-right:3rem!important}.mb-lg-5,.my-lg-5{margin-bottom:3rem!important}.ml-lg-5,.mx-lg-5{margin-left:3rem!important}.p-lg-0{padding:0!important}.pt-lg-0,.py-lg-0{padding-top:0!important}.pr-lg-0,.px-lg-0{padding-right:0!important}.pb-lg-0,.py-lg-0{padding-bottom:0!important}.pl-lg-0,.px-lg-0{padding-left:0!important}.p-lg-1{padding:.25rem!important}.pt-lg-1,.py-lg-1{padding-top:.25rem!important}.pr-lg-1,.px-lg-1{padding-right:.25rem!important}.pb-lg-1,.py-lg-1{padding-bottom:.25rem!important}.pl-lg-1,.px-lg-1{padding-left:.25rem!important}.p-lg-2{padding:.5rem!important}.pt-lg-2,.py-lg-2{padding-top:.5rem!important}.pr-lg-2,.px-lg-2{padding-right:.5rem!important}.pb-lg-2,.py-lg-2{padding-bottom:.5rem!important}.pl-lg-2,.px-lg-2{padding-left:.5rem!important}.p-lg-3{padding:1rem!important}.pt-lg-3,.py-lg-3{padding-top:1rem!important}.pr-lg-3,.px-lg-3{padding-right:1rem!important}.pb-lg-3,.py-lg-3{padding-bottom:1rem!important}.pl-lg-3,.px-lg-3{padding-left:1rem!important}.p-lg-4{padding:1.5rem!important}.pt-lg-4,.py-lg-4{padding-top:1.5rem!important}.pr-lg-4,.px-lg-4{padding-right:1.5rem!important}.pb-lg-4,.py-lg-4{padding-bottom:1.5rem!important}.pl-lg-4,.px-lg-4{padding-left:1.5rem!important}.p-lg-5{padding:3rem!important}.pt-lg-5,.py-lg-5{padding-top:3rem!important}.pr-lg-5,.px-lg-5{padding-right:3rem!important}.pb-lg-5,.py-lg-5{padding-bottom:3rem!important}.pl-lg-5,.px-lg-5{padding-left:3rem!important}.m-lg-auto{margin:auto!important}.mt-lg-auto,.my-lg-auto{margin-top:auto!important}.mr-lg-auto,.mx-lg-auto{margin-right:auto!important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto!important}.ml-lg-auto,.mx-lg-auto{margin-left:auto!important}}@media (min-width:1200px){.m-xl-0{margin:0!important}.mt-xl-0,.my-xl-0{margin-top:0!important}.mr-xl-0,.mx-xl-0{margin-right:0!important}.mb-xl-0,.my-xl-0{margin-bottom:0!important}.ml-xl-0,.mx-xl-0{margin-left:0!important}.m-xl-1{margin:.25rem!important}.mt-xl-1,.my-xl-1{margin-top:.25rem!important}.mr-xl-1,.mx-xl-1{margin-right:.25rem!important}.mb-xl-1,.my-xl-1{margin-bottom:.25rem!important}.ml-xl-1,.mx-xl-1{margin-left:.25rem!important}.m-xl-2{margin:.5rem!important}.mt-xl-2,.my-xl-2{margin-top:.5rem!important}.mr-xl-2,.mx-xl-2{margin-right:.5rem!important}.mb-xl-2,.my-xl-2{margin-bottom:.5rem!important}.ml-xl-2,.mx-xl-2{margin-left:.5rem!important}.m-xl-3{margin:1rem!important}.mt-xl-3,.my-xl-3{margin-top:1rem!important}.mr-xl-3,.mx-xl-3{margin-right:1rem!important}.mb-xl-3,.my-xl-3{margin-bottom:1rem!important}.ml-xl-3,.mx-xl-3{margin-left:1rem!important}.m-xl-4{margin:1.5rem!important}.mt-xl-4,.my-xl-4{margin-top:1.5rem!important}.mr-xl-4,.mx-xl-4{margin-right:1.5rem!important}.mb-xl-4,.my-xl-4{margin-bottom:1.5rem!important}.ml-xl-4,.mx-xl-4{margin-left:1.5rem!important}.m-xl-5{margin:3rem!important}.mt-xl-5,.my-xl-5{margin-top:3rem!important}.mr-xl-5,.mx-xl-5{margin-right:3rem!important}.mb-xl-5,.my-xl-5{margin-bottom:3rem!important}.ml-xl-5,.mx-xl-5{margin-left:3rem!important}.p-xl-0{padding:0!important}.pt-xl-0,.py-xl-0{padding-top:0!important}.pr-xl-0,.px-xl-0{padding-right:0!important}.pb-xl-0,.py-xl-0{padding-bottom:0!important}.pl-xl-0,.px-xl-0{padding-left:0!important}.p-xl-1{padding:.25rem!important}.pt-xl-1,.py-xl-1{padding-top:.25rem!important}.pr-xl-1,.px-xl-1{padding-right:.25rem!important}.pb-xl-1,.py-xl-1{padding-bottom:.25rem!important}.pl-xl-1,.px-xl-1{padding-left:.25rem!important}.p-xl-2{padding:.5rem!important}.pt-xl-2,.py-xl-2{padding-top:.5rem!important}.pr-xl-2,.px-xl-2{padding-right:.5rem!important}.pb-xl-2,.py-xl-2{padding-bottom:.5rem!important}.pl-xl-2,.px-xl-2{padding-left:.5rem!important}.p-xl-3{padding:1rem!important}.pt-xl-3,.py-xl-3{padding-top:1rem!important}.pr-xl-3,.px-xl-3{padding-right:1rem!important}.pb-xl-3,.py-xl-3{padding-bottom:1rem!important}.pl-xl-3,.px-xl-3{padding-left:1rem!important}.p-xl-4{padding:1.5rem!important}.pt-xl-4,.py-xl-4{padding-top:1.5rem!important}.pr-xl-4,.px-xl-4{padding-right:1.5rem!important}.pb-xl-4,.py-xl-4{padding-bottom:1.5rem!important}.pl-xl-4,.px-xl-4{padding-left:1.5rem!important}.p-xl-5{padding:3rem!important}.pt-xl-5,.py-xl-5{padding-top:3rem!important}.pr-xl-5,.px-xl-5{padding-right:3rem!important}.pb-xl-5,.py-xl-5{padding-bottom:3rem!important}.pl-xl-5,.px-xl-5{padding-left:3rem!important}.m-xl-auto{margin:auto!important}.mt-xl-auto,.my-xl-auto{margin-top:auto!important}.mr-xl-auto,.mx-xl-auto{margin-right:auto!important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto!important}.ml-xl-auto,.mx-xl-auto{margin-left:auto!important}}.text-justify{text-align:justify!important}.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left!important}.text-right{text-align:right!important}.text-center{text-align:center!important}@media (min-width:576px){.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.text-md-left{text-align:left!important}.text-md-right{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.text-lg-left{text-align:left!important}.text-lg-right{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.text-xl-left{text-align:left!important}.text-xl-right{text-align:right!important}.text-xl-center{text-align:center!important}}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.font-weight-light{font-weight:300!important}.font-weight-normal{font-weight:400!important}.font-weight-bold{font-weight:700!important}.font-italic{font-style:italic!important}.text-white{color:#fff!important}.text-primary{color:#007bff!important}a.text-primary:focus,a.text-primary:hover{color:#0062cc!important}.text-secondary{color:#6c757d!important}a.text-secondary:focus,a.text-secondary:hover{color:#545b62!important}.text-success{color:#28a745!important}a.text-success:focus,a.text-success:hover{color:#1e7e34!important}.text-info{color:#17a2b8!important}a.text-info:focus,a.text-info:hover{color:#117a8b!important}.text-warning{color:#ffc107!important}a.text-warning:focus,a.text-warning:hover{color:#d39e00!important}.text-danger{color:#dc3545!important}a.text-danger:focus,a.text-danger:hover{color:#bd2130!important}.text-light{color:#f8f9fa!important}a.text-light:focus,a.text-light:hover{color:#dae0e5!important}.text-dark{color:#343a40!important}a.text-dark:focus,a.text-dark:hover{color:#1d2124!important}.text-muted{color:#6c757d!important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.visible{visibility:visible!important}.invisible{visibility:hidden!important}@media print{*,::after,::before{text-shadow:none!important;box-shadow:none!important}a:not(.btn){text-decoration:underline}abbr[title]::after{content:" (" attr(title) ")"}pre{white-space:pre-wrap!important}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}@page{size:a3}body{min-width:992px!important}.container{min-width:992px!important}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}} +/*# sourceMappingURL=bootstrap.min.css.map */ \ No newline at end of file diff --git "a/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/resources/static/index.html" "b/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/resources/static/index.html" new file mode 100644 index 0000000..2e91973 --- /dev/null +++ "b/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/resources/static/index.html" @@ -0,0 +1,71 @@ + + + + + chat room websocket + + + + +

+
聊天室
+ +
+
+ +
+ + +
+
+ +
+ +
+ + + + + \ No newline at end of file diff --git "a/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/resources/static/jquery-3.2.1.min.js" "b/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/resources/static/jquery-3.2.1.min.js" new file mode 100644 index 0000000..342c54a --- /dev/null +++ "b/\347\254\254 2-10 \350\257\276\357\274\232 \344\275\277\347\224\250 Spring Boot WebSocket \345\210\233\345\273\272\350\201\212\345\244\251\345\256\244/spring-boot-websocket/src/main/resources/static/jquery-3.2.1.min.js" @@ -0,0 +1,4 @@ +/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext;function B(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,D=/^.[^:#\[\.,]*$/;function E(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):D.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(E(this,a||[],!1))},not:function(a){return this.pushStack(E(this,a||[],!0))},is:function(a){return!!E(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var F,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||F,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:G.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),C.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};H.prototype=r.fn,F=r(d);var I=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function K(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return K(a,"nextSibling")},prev:function(a){return K(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return B(a,"iframe")?a.contentDocument:(B(a,"template")&&(a=a.content||a),r.merge([],a.childNodes))}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(J[a]||r.uniqueSort(e),I.test(a)&&e.reverse()),this.pushStack(e)}});var L=/[^\x20\t\r\n\f]+/g;function M(a){var b={};return r.each(a.match(L)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?M(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=e||a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function N(a){return a}function O(a){throw a}function P(a,b,c,d){var e;try{a&&r.isFunction(e=a.promise)?e.call(a).done(b).fail(c):a&&r.isFunction(e=a.then)?e.call(a,b,c):b.apply(void 0,[a].slice(d))}catch(a){c.apply(void 0,[a])}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==O&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:N,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:N)),c[2][3].add(g(0,a,r.isFunction(d)?d:O))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(P(a,g.done(h(c)).resolve,g.reject,!b),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)P(e[c],h(c),g.reject);return g.promise()}});var Q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&Q.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var R=r.Deferred();r.fn.ready=function(a){return R.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||R.resolveWith(d,[r]))}}),r.ready.then=R.then;function S(){d.removeEventListener("DOMContentLoaded",S), + a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,la=/^$|\/(?:java|ecma)script/i,ma={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ma.optgroup=ma.option,ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead,ma.th=ma.td;function na(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&B(a,b)?r.merge([a],c):c}function oa(a,b){for(var c=0,d=a.length;c-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=na(l.appendChild(f),"script"),j&&oa(g),c){k=0;while(f=g[k++])la.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ra=d.documentElement,sa=/^key/,ta=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ua=/^([^.]*)(?:\.(.+)|)/;function va(){return!0}function wa(){return!1}function xa(){try{return d.activeElement}catch(a){}}function ya(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ya(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=wa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(ra,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(L)||[""],j=b.length;while(j--)h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.hasData(a)&&W.get(a);if(q&&(i=q.events)){b=(b||"").match(L)||[""],j=b.length;while(j--)if(h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&W.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(W.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i\x20\t\r\n\f]*)[^>]*)\/>/gi,Aa=/\s*$/g;function Ea(a,b){return B(a,"table")&&B(11!==b.nodeType?b:b.firstChild,"tr")?r(">tbody",a)[0]||a:a}function Fa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ga(a){var b=Ca.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ha(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(W.hasData(a)&&(f=W.access(a),g=W.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c1&&"string"==typeof q&&!o.checkClone&&Ba.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ja(f,b,c,d)});if(m&&(e=qa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(na(e,"script"),Fa),i=h.length;l")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=na(h),f=na(a),d=0,e=f.length;d0&&oa(g,!i&&na(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(U(c)){if(b=c[W.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[W.expando]=void 0}c[X.expando]&&(c[X.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ka(this,a,!0)},remove:function(a){return Ka(this,a)},text:function(a){return T(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.appendChild(a)}})},prepend:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(na(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return T(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Aa.test(a)&&!ma[(ka.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c1)}});function _a(a,b,c,d,e){return new _a.prototype.init(a,b,c,d,e)}r.Tween=_a,_a.prototype={constructor:_a,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=_a.propHooks[this.prop];return a&&a.get?a.get(this):_a.propHooks._default.get(this)},run:function(a){var b,c=_a.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):_a.propHooks._default.set(this),this}},_a.prototype.init.prototype=_a.prototype,_a.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},_a.propHooks.scrollTop=_a.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=_a.prototype.init,r.fx.step={};var ab,bb,cb=/^(?:toggle|show|hide)$/,db=/queueHooks$/;function eb(){bb&&(d.hidden===!1&&a.requestAnimationFrame?a.requestAnimationFrame(eb):a.setTimeout(eb,r.fx.interval),r.fx.tick())}function fb(){return a.setTimeout(function(){ab=void 0}),ab=r.now()}function gb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ca[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function hb(a,b,c){for(var d,e=(kb.tweeners[b]||[]).concat(kb.tweeners["*"]),f=0,g=e.length;f1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?lb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b), + null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=mb[g],mb[g]=e,e=null!=c(a,b,d)?g:null,mb[g]=f),e}});var nb=/^(?:input|select|textarea|button)$/i,ob=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):nb.test(a.nodeName)||ob.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function pb(a){var b=a.match(L)||[];return b.join(" ")}function qb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,qb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,qb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,qb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=qb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+pb(qb(c))+" ").indexOf(b)>-1)return!0;return!1}});var rb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:pb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!sb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,sb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(W.get(h,"events")||{})[b.type]&&W.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&U(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!U(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=W.access(d,b);e||d.addEventListener(a,c,!0),W.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=W.access(d,b)-1;e?W.access(d,b,e):(d.removeEventListener(a,c,!0),W.remove(d,b))}}});var tb=a.location,ub=r.now(),vb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(Array.isArray(b))r.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(Array.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!ja.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:Array.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}});var Bb=/%20/g,Cb=/#.*$/,Db=/([?&])_=[^&]*/,Eb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Fb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Gb=/^(?:GET|HEAD)$/,Hb=/^\/\//,Ib={},Jb={},Kb="*/".concat("*"),Lb=d.createElement("a");Lb.href=tb.href;function Mb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(L)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nb(a,b,c,d){var e={},f=a===Jb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ob(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Pb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Qb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tb.href,type:"GET",isLocal:Fb.test(tb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ob(Ob(a,r.ajaxSettings),b):Ob(r.ajaxSettings,a)},ajaxPrefilter:Mb(Ib),ajaxTransport:Mb(Jb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Eb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||tb.href)+"").replace(Hb,tb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(L)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Lb.protocol+"//"+Lb.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Nb(Ib,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Gb.test(o.type),f=o.url.replace(Cb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(Bb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(vb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Db,"$1"),n=(vb.test(f)?"&":"?")+"_="+ub++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Kb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Nb(Jb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Pb(o,y,d)),v=Qb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Rb={0:200,1223:204},Sb=r.ajaxSettings.xhr();o.cors=!!Sb&&"withCredentials"in Sb,o.ajax=Sb=!!Sb,r.ajaxTransport(function(b){var c,d;if(o.cors||Sb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Rb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r(" + \ No newline at end of file diff --git "a/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/main/resources/templates/list.html" "b/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/main/resources/templates/list.html" new file mode 100644 index 0000000..017c65e --- /dev/null +++ "b/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/main/resources/templates/list.html" @@ -0,0 +1,20 @@ + + + + + Example If/Unless + + +
+

for 循环

+ + + + + + + +
neo6213index
+
+ + \ No newline at end of file diff --git "a/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/main/resources/templates/object.html" "b/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/main/resources/templates/object.html" new file mode 100644 index 0000000..9ef61b1 --- /dev/null +++ "b/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/main/resources/templates/object.html" @@ -0,0 +1,16 @@ + + + + + Example 基本对象 + + +
+

基本对象

+

+
+

+ Established locale country: CN. +
+ + \ No newline at end of file diff --git "a/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/main/resources/templates/string.html" "b/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/main/resources/templates/string.html" new file mode 100644 index 0000000..7a2e3f6 --- /dev/null +++ "b/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/main/resources/templates/string.html" @@ -0,0 +1,16 @@ + + + + + Example String + + +
+

text

+

neo

+ +
+ +
+ + \ No newline at end of file diff --git "a/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/main/resources/templates/switch.html" "b/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/main/resources/templates/switch.html" new file mode 100644 index 0000000..aef5a30 --- /dev/null +++ "b/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/main/resources/templates/switch.html" @@ -0,0 +1,17 @@ + + + + + Example switch + + +
+
+

她是一个姑娘...

+

这是一个爷们!

+ +

未知性别的一个家伙。

+
+
+ + \ No newline at end of file diff --git "a/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/main/resources/templates/url.html" "b/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/main/resources/templates/url.html" new file mode 100644 index 0000000..ded5268 --- /dev/null +++ "b/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/main/resources/templates/url.html" @@ -0,0 +1,19 @@ + + + + + Example If/Unless + + +
+

URL

+ link1 +
+ view +
+
+


+
+
+ + \ No newline at end of file diff --git "a/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/main/resources/templates/utility.html" "b/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/main/resources/templates/utility.html" new file mode 100644 index 0000000..ba48c4c --- /dev/null +++ "b/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/main/resources/templates/utility.html" @@ -0,0 +1,30 @@ + + + + + Example 内嵌变量 + + +
+

内嵌变量

+ + +

neo

+ +

neo

+ +

neo

+ +

userName

+ +

userName

+ +

userName

+ +

+ +

userName

+
+
+ + \ No newline at end of file diff --git "a/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/test/java/com/neo/ThymeleafApplicationTests.java" "b/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/test/java/com/neo/ThymeleafApplicationTests.java" new file mode 100644 index 0000000..3ccf7f4 --- /dev/null +++ "b/\347\254\254 2-4 \350\257\276 \346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf \351\253\230\351\230\266\347\224\250\346\263\225/spring-boot-thymeleaf/src/test/java/com/neo/ThymeleafApplicationTests.java" @@ -0,0 +1,16 @@ +package com.neo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class ThymeleafApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git "a/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/pom.xml" "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/pom.xml" new file mode 100644 index 0000000..7336638 --- /dev/null +++ "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/pom.xml" @@ -0,0 +1,66 @@ + + + 4.0.0 + + com.neo + spring-boot-thymeleaf-layout + 0.0.1-SNAPSHOT + jar + + spring-boot-thymeleaf-layout + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.0.5.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + nz.net.ultraq.thymeleaf + thymeleaf-layout-dialect + + + org.springframework.boot + spring-boot-devtools + runtime + true + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + + + + + diff --git "a/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/java/com/neo/TLayoutApplication.java" "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/java/com/neo/TLayoutApplication.java" new file mode 100644 index 0000000..0e4e29a --- /dev/null +++ "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/java/com/neo/TLayoutApplication.java" @@ -0,0 +1,13 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class TLayoutApplication { + + public static void main(String[] args) { + SpringApplication.run(TLayoutApplication.class, args); + } + +} diff --git "a/\347\254\25406\350\257\276\357\274\232\346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf/spring-boot-thymeleaf/src/main/java/com/neo/web/IndexController.java" "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/java/com/neo/web/IndexController.java" similarity index 83% rename from "\347\254\25406\350\257\276\357\274\232\346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf/spring-boot-thymeleaf/src/main/java/com/neo/web/IndexController.java" rename to "\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/java/com/neo/web/IndexController.java" index 36bf9f0..3b25541 100644 --- "a/\347\254\25406\350\257\276\357\274\232\346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf/spring-boot-thymeleaf/src/main/java/com/neo/web/IndexController.java" +++ "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/java/com/neo/web/IndexController.java" @@ -12,15 +12,20 @@ public String index() { return "index"; } + @RequestMapping("/fragment") + public String fragment() { + return "fragment"; + } + @RequestMapping("/layout") public String layout() { return "layout"; } - @RequestMapping("/home") public String home() { return "home"; } + } \ No newline at end of file diff --git "a/\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/main/resources/application.properties" "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/application.properties" similarity index 100% rename from "\347\254\25404\350\257\276\357\274\232\345\277\253\351\200\237\344\275\223\351\252\214 Web \345\274\200\345\217\221/spring-boot-web/src/main/resources/application.properties" rename to "\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/application.properties" diff --git "a/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/base.html" "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/base.html" new file mode 100644 index 0000000..6a49119 --- /dev/null +++ "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/base.html" @@ -0,0 +1,15 @@ + + + + comm title + + + + + + + + + + + \ No newline at end of file diff --git "a/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/fragment.html" "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/fragment.html" new file mode 100644 index 0000000..bb65abe --- /dev/null +++ "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/fragment.html" @@ -0,0 +1,11 @@ + + + + Fragment - Page + + + + + + + \ No newline at end of file diff --git "a/\347\254\25406\350\257\276\357\274\232\346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/home.html" "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/home.html" similarity index 55% rename from "\347\254\25406\350\257\276\357\274\232\346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/home.html" rename to "\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/home.html" index b0a94ab..bd0de80 100644 --- "a/\347\254\25406\350\257\276\357\274\232\346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/home.html" +++ "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/home.html" @@ -1,5 +1,8 @@ - - + + + + Home +

个性化的内容

diff --git "a/\347\254\25406\350\257\276\357\274\232\346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/index.html" "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/index.html" similarity index 79% rename from "\347\254\25406\350\257\276\357\274\232\346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/index.html" rename to "\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/index.html" index a74393f..40d3657 100644 --- "a/\347\254\25406\350\257\276\357\274\232\346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/index.html" +++ "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/index.html" @@ -5,7 +5,7 @@ Index -
+
\ No newline at end of file diff --git "a/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/layout.html" "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/layout.html" new file mode 100644 index 0000000..4bc09f3 --- /dev/null +++ "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/layout.html" @@ -0,0 +1,15 @@ + + + + + Layout + + +
+
+
+
content
+
+
+ + \ No newline at end of file diff --git "a/\347\254\25406\350\257\276\357\274\232\346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/layout/copyright.html" "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/layout/copyright.html" similarity index 93% rename from "\347\254\25406\350\257\276\357\274\232\346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/layout/copyright.html" rename to "\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/layout/copyright.html" index 882f145..223de9f 100644 --- "a/\347\254\25406\350\257\276\357\274\232\346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/layout/copyright.html" +++ "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/layout/copyright.html" @@ -6,7 +6,7 @@ - © 2017 + © 2018 \ No newline at end of file diff --git "a/\347\254\25406\350\257\276\357\274\232\346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/layout/footer.html" "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/layout/footer.html" similarity index 88% rename from "\347\254\25406\350\257\276\357\274\232\346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/layout/footer.html" rename to "\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/layout/footer.html" index 4671f84..48a9c7d 100644 --- "a/\347\254\25406\350\257\276\357\274\232\346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/layout/footer.html" +++ "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/layout/footer.html" @@ -2,12 +2,11 @@ - Title + footer

我是 尾部

- \ No newline at end of file diff --git "a/\347\254\25406\350\257\276\357\274\232\346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/layout/header.html" "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/layout/header.html" similarity index 88% rename from "\347\254\25406\350\257\276\357\274\232\346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/layout/header.html" rename to "\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/layout/header.html" index 4aff21d..adc6b8c 100644 --- "a/\347\254\25406\350\257\276\357\274\232\346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/layout/header.html" +++ "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/layout/header.html" @@ -2,7 +2,7 @@ - Title + header
diff --git "a/\347\254\25406\350\257\276\357\274\232\346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/layout/left.html" "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/layout/left.html" similarity index 100% rename from "\347\254\25406\350\257\276\357\274\232\346\250\241\346\235\277\345\274\225\346\223\216 Thymeleaf/spring-boot-thymeleaf/src/main/resources/templates/layout/left.html" rename to "\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/main/resources/templates/layout/left.html" diff --git "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/test/java/com/neo/MultiJpaApplicationTests.java" "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/test/java/com/neo/TLayoutApplicationTests.java" similarity index 87% rename from "\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/test/java/com/neo/MultiJpaApplicationTests.java" rename to "\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/test/java/com/neo/TLayoutApplicationTests.java" index e0a5112..3e1b0ab 100644 --- "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/test/java/com/neo/MultiJpaApplicationTests.java" +++ "b/\347\254\254 2-5 \350\257\276 Thymeleaf \351\241\265\351\235\242\345\270\203\345\261\200/spring-boot-thymeleaf-layout/src/test/java/com/neo/TLayoutApplicationTests.java" @@ -7,7 +7,7 @@ @RunWith(SpringRunner.class) @SpringBootTest -public class MultiJpaApplicationTests { +public class TLayoutApplicationTests { @Test public void contextLoads() { diff --git "a/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/pom.xml" "b/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/pom.xml" new file mode 100644 index 0000000..11532db --- /dev/null +++ "b/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/pom.xml" @@ -0,0 +1,48 @@ + + 4.0.0 + + com.neo + spring-boot-file-upload + jar + 1.0 + + + org.springframework.boot + spring-boot-starter-parent + 2.0.5.RELEASE + + + + 1.8 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-devtools + true + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git "a/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/java/com/neo/FileUploadWebApplication.java" "b/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/java/com/neo/FileUploadWebApplication.java" new file mode 100644 index 0000000..059ae73 --- /dev/null +++ "b/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/java/com/neo/FileUploadWebApplication.java" @@ -0,0 +1,30 @@ +package com.neo; + +import org.apache.coyote.http11.AbstractHttp11Protocol; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer; +import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; +import org.springframework.context.annotation.Bean; + +@SpringBootApplication +public class FileUploadWebApplication { + + public static void main(String[] args) throws Exception { + SpringApplication.run(FileUploadWebApplication.class, args); + } + + //Tomcat large file upload connection reset + @Bean + public TomcatServletWebServerFactory tomcatEmbedded() { + TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory(); + tomcat.addConnectorCustomizers((TomcatConnectorCustomizer) connector -> { + if ((connector.getProtocolHandler() instanceof AbstractHttp11Protocol)) { + //-1 means unlimited + ((AbstractHttp11Protocol) connector.getProtocolHandler()).setMaxSwallowSize(-1); + } + }); + return tomcat; + } + +} \ No newline at end of file diff --git "a/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/java/com/neo/controller/GlobalExceptionHandler.java" "b/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/java/com/neo/controller/GlobalExceptionHandler.java" new file mode 100644 index 0000000..53ee43a --- /dev/null +++ "b/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/java/com/neo/controller/GlobalExceptionHandler.java" @@ -0,0 +1,16 @@ +package com.neo.controller; + +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.multipart.MultipartException; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; + +@ControllerAdvice +public class GlobalExceptionHandler { + + @ExceptionHandler(MultipartException.class) + public String handleError1(MultipartException e, RedirectAttributes redirectAttributes) { + redirectAttributes.addFlashAttribute("message", e.getCause().getMessage()); + return "redirect:/uploadStatus"; + } +} diff --git "a/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/java/com/neo/controller/UploadController.java" "b/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/java/com/neo/controller/UploadController.java" new file mode 100644 index 0000000..6efdfd9 --- /dev/null +++ "b/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/java/com/neo/controller/UploadController.java" @@ -0,0 +1,75 @@ +package com.neo.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +@Controller +public class UploadController { + private static String UPLOADED_FOLDER = "E://temp//"; + + @GetMapping("/") + public String index() { + return "upload"; + } + + @GetMapping("/more") + public String uploadMore() { + return "uploadMore"; + } + + @PostMapping("/upload") + public String singleFileUpload(@RequestParam("file") MultipartFile file, + RedirectAttributes redirectAttributes) { + if (file.isEmpty()) { + redirectAttributes.addFlashAttribute("message", "Please select a file to upload"); + return "redirect:uploadStatus"; + } + try { + byte[] bytes = file.getBytes(); + Path path = Paths.get(UPLOADED_FOLDER + file.getOriginalFilename()); + Files.write(path, bytes); + + redirectAttributes.addFlashAttribute("message", + "You successfully uploaded '" + file.getOriginalFilename() + "'"); + } catch (IOException e) { + e.printStackTrace(); + } + return "redirect:/uploadStatus"; + } + + + @PostMapping("/uploadMore") + public String moreFileUpload(@RequestParam("file") MultipartFile[] files, + RedirectAttributes redirectAttributes) { + if (files.length==0) { + redirectAttributes.addFlashAttribute("message", "Please select a file to upload"); + return "redirect:uploadStatus"; + } + for(MultipartFile file:files){ + try { + byte[] bytes = file.getBytes(); + Path path = Paths.get(UPLOADED_FOLDER + file.getOriginalFilename()); + Files.write(path, bytes); + } catch (IOException e) { + e.printStackTrace(); + } + } + redirectAttributes.addFlashAttribute("message", "You successfully uploaded all"); + return "redirect:/uploadStatus"; + } + + @GetMapping("/uploadStatus") + public String uploadStatus() { + return "uploadStatus"; + } + +} \ No newline at end of file diff --git "a/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/resources/application.properties" "b/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/resources/application.properties" new file mode 100644 index 0000000..350fbc2 --- /dev/null +++ "b/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/resources/application.properties" @@ -0,0 +1,4 @@ +#http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#common-application-properties +#search multipart +spring.servlet.multipart.max-file-size=10MB +spring.servlet.multipart.max-request-size=10MB diff --git "a/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/resources/logback.xml" "b/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/resources/logback.xml" new file mode 100644 index 0000000..0c0f833 --- /dev/null +++ "b/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/resources/logback.xml" @@ -0,0 +1,24 @@ + + + + + + + %d{yyyy-MM-dd HH:mm:ss} %-5level %logger{36} - %msg%n + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/resources/templates/upload.html" "b/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/resources/templates/upload.html" new file mode 100644 index 0000000..2e93a58 --- /dev/null +++ "b/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/resources/templates/upload.html" @@ -0,0 +1,13 @@ + + + + +

Spring Boot file upload example

+ +
+

+ +
+ + + diff --git "a/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/resources/templates/uploadMore.html" "b/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/resources/templates/uploadMore.html" new file mode 100644 index 0000000..a6e0d0d --- /dev/null +++ "b/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/resources/templates/uploadMore.html" @@ -0,0 +1,15 @@ + + + + +

Spring Boot file upload example

+ +
+ 文件1:

+ 文件2:

+ 文件3:

+ +
+ + + diff --git "a/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/resources/templates/uploadStatus.html" "b/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/resources/templates/uploadStatus.html" new file mode 100644 index 0000000..71fb76d --- /dev/null +++ "b/\347\254\254 2-6 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\222\214 Thymeleaf \346\274\224\347\244\272\344\270\212\344\274\240\346\226\207\344\273\266/spring-boot-file-upload/src/main/resources/templates/uploadStatus.html" @@ -0,0 +1,12 @@ + + + + +

Spring Boot - Upload Status

+ +
+

+

+ + + \ No newline at end of file diff --git "a/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/pom.xml" "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/pom.xml" new file mode 100644 index 0000000..b7ca08c --- /dev/null +++ "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/pom.xml" @@ -0,0 +1,54 @@ + + 4.0.0 + + com.neo + spring-boot-fastDFS + jar + 1.0 + + + org.springframework.boot + spring-boot-starter-parent + 2.0.5.RELEASE + + + + UTF-8 + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.csource + fastdfs-client-java + 1.27-SNAPSHOT + + + org.springframework.boot + spring-boot-devtools + true + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git "a/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/java/com/neo/FastDFSApplication.java" "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/java/com/neo/FastDFSApplication.java" new file mode 100644 index 0000000..197c982 --- /dev/null +++ "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/java/com/neo/FastDFSApplication.java" @@ -0,0 +1,30 @@ +package com.neo; + +import org.apache.coyote.http11.AbstractHttp11Protocol; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer; +import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; +import org.springframework.context.annotation.Bean; + +@SpringBootApplication +public class FastDFSApplication { + + public static void main(String[] args) throws Exception { + SpringApplication.run(FastDFSApplication.class, args); + } + + //Tomcat large file upload connection reset + @Bean + public TomcatServletWebServerFactory tomcatEmbedded() { + TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory(); + tomcat.addConnectorCustomizers((TomcatConnectorCustomizer) connector -> { + if ((connector.getProtocolHandler() instanceof AbstractHttp11Protocol)) { + //-1 means unlimited + ((AbstractHttp11Protocol) connector.getProtocolHandler()).setMaxSwallowSize(-1); + } + }); + return tomcat; + } + +} \ No newline at end of file diff --git "a/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/java/com/neo/controller/GlobalExceptionHandler.java" "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/java/com/neo/controller/GlobalExceptionHandler.java" new file mode 100644 index 0000000..6d71e59 --- /dev/null +++ "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/java/com/neo/controller/GlobalExceptionHandler.java" @@ -0,0 +1,17 @@ +package com.neo.controller; + +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.multipart.MultipartException; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; + +@ControllerAdvice +public class GlobalExceptionHandler { + + @ExceptionHandler(MultipartException.class) + public String handleError1(MultipartException e, RedirectAttributes redirectAttributes) { + redirectAttributes.addFlashAttribute("message", e.getCause().getMessage()); + return "redirect:/uploadStatus"; + + } +} diff --git "a/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/java/com/neo/controller/UploadController.java" "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/java/com/neo/controller/UploadController.java" new file mode 100644 index 0000000..64bae0e --- /dev/null +++ "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/java/com/neo/controller/UploadController.java" @@ -0,0 +1,78 @@ +package com.neo.controller; + +import com.neo.fastdfs.FastDFSClient; +import com.neo.fastdfs.FastDFSFile; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; + +import java.io.IOException; +import java.io.InputStream; + +@Controller +public class UploadController { + private static Logger logger = LoggerFactory.getLogger(UploadController.class); + + @GetMapping("/") + public String index() { + return "upload"; + } + + @PostMapping("/upload") + public String singleFileUpload(@RequestParam("file") MultipartFile file, + RedirectAttributes redirectAttributes) { + if (file.isEmpty()) { + redirectAttributes.addFlashAttribute("message", "Please select a file to upload"); + return "redirect:uploadStatus"; + } + try { + String path=saveFile(file); + redirectAttributes.addFlashAttribute("message", + "You successfully uploaded '" + file.getOriginalFilename() + "'"); + redirectAttributes.addFlashAttribute("path", "file path url '" + path + "'"); + } catch (Exception e) { + logger.error("upload file failed",e); + } + return "redirect:/uploadStatus"; + } + + @GetMapping("/uploadStatus") + public String uploadStatus() { + return "uploadStatus"; + } + + /** + * @param multipartFile + * @return + * @throws IOException + */ + public String saveFile(MultipartFile multipartFile) throws IOException { + String[] fileAbsolutePath={}; + String fileName=multipartFile.getOriginalFilename(); + String ext = fileName.substring(fileName.lastIndexOf(".") + 1); + byte[] file_buff = null; + InputStream inputStream=multipartFile.getInputStream(); + if(inputStream!=null){ + int len1 = inputStream.available(); + file_buff = new byte[len1]; + inputStream.read(file_buff); + } + inputStream.close(); + FastDFSFile file = new FastDFSFile(fileName, file_buff, ext); + try { + fileAbsolutePath = FastDFSClient.upload(file); //upload to fastdfs + } catch (Exception e) { + logger.error("upload file Exception!",e); + } + if (fileAbsolutePath==null) { + logger.error("upload file failed,please upload again!"); + } + String path=FastDFSClient.getTrackerUrl()+fileAbsolutePath[0]+ "/"+fileAbsolutePath[1]; + return path; + } +} \ No newline at end of file diff --git "a/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/java/com/neo/fastdfs/FastDFSClient.java" "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/java/com/neo/fastdfs/FastDFSClient.java" new file mode 100644 index 0000000..223fdfe --- /dev/null +++ "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/java/com/neo/fastdfs/FastDFSClient.java" @@ -0,0 +1,111 @@ +package com.neo.fastdfs; + +import org.csource.common.NameValuePair; +import org.csource.fastdfs.*; +import org.slf4j.LoggerFactory; +import org.springframework.core.io.ClassPathResource; +import org.springframework.core.io.Resource; + +import java.io.*; + +public class FastDFSClient { + private static org.slf4j.Logger logger = LoggerFactory.getLogger(FastDFSClient.class); + + static { + try { + String filePath = new ClassPathResource("fdfs_client.conf").getFile().getAbsolutePath();; + ClientGlobal.init(filePath); + } catch (Exception e) { + logger.error("FastDFS Client Init Fail!",e); + } + } + + public static String[] upload(FastDFSFile file) { + logger.info("File Name: " + file.getName() + "File Length:" + file.getContent().length); + + NameValuePair[] meta_list = new NameValuePair[1]; + meta_list[0] = new NameValuePair("author", file.getAuthor()); + + long startTime = System.currentTimeMillis(); + String[] uploadResults = null; + StorageClient storageClient=null; + try { + storageClient = getStorageClient(); + uploadResults = storageClient.upload_file(file.getContent(), file.getExt(), meta_list); + } catch (IOException e) { + logger.error("IO Exception when uploadind the file:" + file.getName(), e); + } catch (Exception e) { + logger.error("Non IO Exception when uploadind the file:" + file.getName(), e); + } + logger.info("upload_file time used:" + (System.currentTimeMillis() - startTime) + " ms"); + + if (uploadResults == null && storageClient!=null) { + logger.error("upload file fail, error code:" + storageClient.getErrorCode()); + } + logger.info("upload file successfully!!!" + "group_name:" + uploadResults[0] + ", remoteFileName:" + " " + uploadResults[1]); + return uploadResults; + } + + public static FileInfo getFile(String groupName, String remoteFileName) { + try { + StorageClient storageClient = getStorageClient(); + return storageClient.get_file_info(groupName, remoteFileName); + } catch (IOException e) { + logger.error("IO Exception: Get File from Fast DFS failed", e); + } catch (Exception e) { + logger.error("Non IO Exception: Get File from Fast DFS failed", e); + } + return null; + } + + public static InputStream downFile(String groupName, String remoteFileName) { + try { + StorageClient storageClient = getStorageClient(); + byte[] fileByte = storageClient.download_file(groupName, remoteFileName); + InputStream ins = new ByteArrayInputStream(fileByte); + return ins; + } catch (IOException e) { + logger.error("IO Exception: Get File from Fast DFS failed", e); + } catch (Exception e) { + logger.error("Non IO Exception: Get File from Fast DFS failed", e); + } + return null; + } + + public static void deleteFile(String groupName, String remoteFileName) + throws Exception { + StorageClient storageClient = getStorageClient(); + int i = storageClient.delete_file(groupName, remoteFileName); + logger.info("delete file successfully!!!" + i); + } + + public static StorageServer[] getStoreStorages(String groupName) + throws IOException { + TrackerClient trackerClient = new TrackerClient(); + TrackerServer trackerServer = trackerClient.getConnection(); + return trackerClient.getStoreStorages(trackerServer, groupName); + } + + public static ServerInfo[] getFetchStorages(String groupName, + String remoteFileName) throws IOException { + TrackerClient trackerClient = new TrackerClient(); + TrackerServer trackerServer = trackerClient.getConnection(); + return trackerClient.getFetchStorages(trackerServer, groupName, remoteFileName); + } + + public static String getTrackerUrl() throws IOException { + return "http://"+getTrackerServer().getInetSocketAddress().getHostString()+":"+ClientGlobal.getG_tracker_http_port()+"/"; + } + + private static StorageClient getStorageClient() throws IOException { + TrackerServer trackerServer = getTrackerServer(); + StorageClient storageClient = new StorageClient(trackerServer, null); + return storageClient; + } + + private static TrackerServer getTrackerServer() throws IOException { + TrackerClient trackerClient = new TrackerClient(); + TrackerServer trackerServer = trackerClient.getConnection(); + return trackerServer; + } +} \ No newline at end of file diff --git "a/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/java/com/neo/fastdfs/FastDFSFile.java" "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/java/com/neo/fastdfs/FastDFSFile.java" new file mode 100644 index 0000000..adee175 --- /dev/null +++ "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/java/com/neo/fastdfs/FastDFSFile.java" @@ -0,0 +1,70 @@ +package com.neo.fastdfs; + +public class FastDFSFile { + private String name; + + private byte[] content; + + private String ext; + + private String md5; + + private String author; + + public FastDFSFile(String name, byte[] content, String ext, String height, + String width, String author) { + super(); + this.name = name; + this.content = content; + this.ext = ext; + this.author = author; + } + + public FastDFSFile(String name, byte[] content, String ext) { + super(); + this.name = name; + this.content = content; + this.ext = ext; + + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public byte[] getContent() { + return content; + } + + public void setContent(byte[] content) { + this.content = content; + } + + public String getExt() { + return ext; + } + + public void setExt(String ext) { + this.ext = ext; + } + + public String getMd5() { + return md5; + } + + public void setMd5(String md5) { + this.md5 = md5; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } +} \ No newline at end of file diff --git "a/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/resources/application.properties" "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/resources/application.properties" new file mode 100644 index 0000000..a67278d --- /dev/null +++ "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/resources/application.properties" @@ -0,0 +1,5 @@ +#http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#common-application-properties +#search multipart +spring.servlet.multipart.max-file-size=10MB +spring.servlet.multipart.max-request-size=10MB + diff --git "a/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/resources/fdfs_client.conf" "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/resources/fdfs_client.conf" new file mode 100644 index 0000000..95cb59c --- /dev/null +++ "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/resources/fdfs_client.conf" @@ -0,0 +1,9 @@ +connect_timeout = 60 +network_timeout = 60 +charset = UTF-8 +http.tracker_http_port = 8080 +http.anti_steal_token = no +http.secret_key = 123456 + +tracker_server = 192.168.53.85:22122 +tracker_server = 192.168.53.86:22122 diff --git "a/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/resources/logback.xml" "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/resources/logback.xml" new file mode 100644 index 0000000..0c0f833 --- /dev/null +++ "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/resources/logback.xml" @@ -0,0 +1,24 @@ + + + + + + + %d{yyyy-MM-dd HH:mm:ss} %-5level %logger{36} - %msg%n + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/resources/templates/upload.html" "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/resources/templates/upload.html" new file mode 100644 index 0000000..2e93a58 --- /dev/null +++ "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/resources/templates/upload.html" @@ -0,0 +1,13 @@ + + + + +

Spring Boot file upload example

+ +
+

+ +
+ + + diff --git "a/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/resources/templates/uploadStatus.html" "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/resources/templates/uploadStatus.html" new file mode 100644 index 0000000..bcdab68 --- /dev/null +++ "b/\347\254\254 2-7 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \344\270\212\344\274\240\346\226\207\344\273\266\345\210\260 FastDFS/spring-boot-fastDFS/src/main/resources/templates/uploadStatus.html" @@ -0,0 +1,16 @@ + + + + +

Spring Boot - Upload Status

+ +
+

+

+ +
+

+

+ + + \ No newline at end of file diff --git "a/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/pom.xml" "b/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/pom.xml" new file mode 100644 index 0000000..c5cb43f --- /dev/null +++ "b/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/pom.xml" @@ -0,0 +1,37 @@ + + + 4.0.0 + spring-boot-web-restful + Spring Boot Web restful Sample + Spring Boot Web restful Sample + + + org.springframework.boot + spring-boot-starter-parent + 2.0.6.RELEASE + + + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + diff --git "a/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/main/java/com/neo/RestfulApplication.java" "b/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/main/java/com/neo/RestfulApplication.java" new file mode 100644 index 0000000..00c87f6 --- /dev/null +++ "b/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/main/java/com/neo/RestfulApplication.java" @@ -0,0 +1,20 @@ + +package com.neo; + +import com.neo.model.Message; +import com.neo.repository.InMemoryMessageRepository; +import com.neo.repository.MessageRepository; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.core.convert.converter.Converter; + + +@SpringBootApplication +public class RestfulApplication { + + public static void main(String[] args) { + SpringApplication.run(RestfulApplication.class, args); + } + +} diff --git "a/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/main/java/com/neo/controller/MessageController.java" "b/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/main/java/com/neo/controller/MessageController.java" new file mode 100644 index 0000000..a03bbac --- /dev/null +++ "b/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/main/java/com/neo/controller/MessageController.java" @@ -0,0 +1,55 @@ + +package com.neo.controller; + +import com.neo.model.Message; +import com.neo.repository.MessageRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@RequestMapping("/") +public class MessageController { + + @Autowired + private MessageRepository messageRepository; + + @GetMapping(value = "messages") + public List list() { + List messages = this.messageRepository.findAll(); + return messages; + } + + @PostMapping(value = "message") + public Message create(Message message) { + message = this.messageRepository.save(message); + return message; + } + + @PutMapping(value = "message") + public Message modify(Message message) { + Message messageResult=this.messageRepository.update(message); + return messageResult; + } + + @PatchMapping(value="/message/text") + public Message patch(Message message) { + Message messageResult=this.messageRepository.updateText(message); + return messageResult; + } + + @GetMapping(value = "message/{id}") + public Message get(@PathVariable Long id) { + Message message = this.messageRepository.findMessage(id); + return message; + } + + @DeleteMapping(value = "message/{id}") + public void delete(@PathVariable("id") Long id) { + this.messageRepository.deleteMessage(id); + } + + + +} diff --git "a/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/main/java/com/neo/model/Message.java" "b/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/main/java/com/neo/model/Message.java" new file mode 100644 index 0000000..401a681 --- /dev/null +++ "b/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/main/java/com/neo/model/Message.java" @@ -0,0 +1,46 @@ +package com.neo.model; + +import java.util.Calendar; + +import javax.validation.constraints.NotEmpty; + + +public class Message { + private Long id; + private String text; + private String summary; + private Calendar created = Calendar.getInstance(); + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public Calendar getCreated() { + return this.created; + } + + public void setCreated(Calendar created) { + this.created = created; + } + + public String getText() { + return this.text; + } + + public void setText(String text) { + this.text = text; + } + + public String getSummary() { + return this.summary; + } + + public void setSummary(String summary) { + this.summary = summary; + } + +} diff --git "a/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/main/java/com/neo/repository/InMemoryMessageRepository.java" "b/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/main/java/com/neo/repository/InMemoryMessageRepository.java" new file mode 100644 index 0000000..c550ebb --- /dev/null +++ "b/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/main/java/com/neo/repository/InMemoryMessageRepository.java" @@ -0,0 +1,59 @@ +package com.neo.repository; + +import com.neo.model.Message; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.atomic.AtomicLong; + +@Service("messageRepository") +public class InMemoryMessageRepository implements MessageRepository { + + private static AtomicLong counter = new AtomicLong(); + private final ConcurrentMap messages = new ConcurrentHashMap<>(); + + @Override + public List findAll() { + List messages = new ArrayList(this.messages.values()); + return messages; + } + + @Override + public Message save(Message message) { + Long id = message.getId(); + if (id == null) { + id = counter.incrementAndGet(); + message.setId(id); + } + this.messages.put(id, message); + return message; + } + + @Override + public Message update(Message message) { + this.messages.put(message.getId(), message); + return message; + } + + @Override + public Message updateText(Message message) { + Message msg=this.messages.get(message.getId()); + msg.setText(message.getText()); + this.messages.put(msg.getId(), msg); + return msg; + } + + @Override + public Message findMessage(Long id) { + return this.messages.get(id); + } + + @Override + public void deleteMessage(Long id) { + this.messages.remove(id); + } + +} diff --git "a/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/main/java/com/neo/repository/MessageRepository.java" "b/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/main/java/com/neo/repository/MessageRepository.java" new file mode 100644 index 0000000..99549b5 --- /dev/null +++ "b/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/main/java/com/neo/repository/MessageRepository.java" @@ -0,0 +1,22 @@ + +package com.neo.repository; + +import com.neo.model.Message; + +import java.util.List; + +public interface MessageRepository { + + List findAll(); + + Message save(Message message); + + Message update(Message message); + + Message updateText(Message message); + + Message findMessage(Long id); + + void deleteMessage(Long id); + +} diff --git "a/\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-test/src/main/resources/application.properties" "b/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/main/resources/application.properties" similarity index 100% rename from "\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-test/src/main/resources/application.properties" rename to "\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/main/resources/application.properties" diff --git "a/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/main/resources/logback.xml" "b/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/main/resources/logback.xml" new file mode 100644 index 0000000..620db4a --- /dev/null +++ "b/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/main/resources/logback.xml" @@ -0,0 +1,8 @@ + + + + + + + + diff --git "a/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/test/java/com/neo/RestfulApplicationTests.java" "b/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/test/java/com/neo/RestfulApplicationTests.java" new file mode 100644 index 0000000..aa960c7 --- /dev/null +++ "b/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/test/java/com/neo/RestfulApplicationTests.java" @@ -0,0 +1,14 @@ + +package com.neo; + + + +import org.junit.Test; + +public class RestfulApplicationTests { + + @Test + public void test() { + } + +} diff --git "a/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/test/java/com/neo/web/MessageControllerTest.java" "b/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/test/java/com/neo/web/MessageControllerTest.java" new file mode 100644 index 0000000..365211f --- /dev/null +++ "b/\347\254\254 2-8 \350\257\276\357\274\232 Spring Boot \346\236\204\345\273\272\344\270\200\344\270\252 RESTful Web \346\234\215\345\212\241/spring-boot-web-restful/src/test/java/com/neo/web/MessageControllerTest.java" @@ -0,0 +1,104 @@ +package com.neo.web; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.MvcResult; +import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.context.WebApplicationContext; + +import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.*; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class MessageControllerTest { + + @Autowired + private WebApplicationContext wac; + + private MockMvc mockMvc; + + @Before + public void setup() { + this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build(); + saveMessages(); + } + + @Test + public void saveMessage() throws Exception { + final MultiValueMap params = new LinkedMultiValueMap<>(); + params.add("text", "text"); + params.add("summary", "summary"); + String mvcResult= mockMvc.perform(MockMvcRequestBuilders.post("/message") + .params(params)).andReturn().getResponse().getContentAsString(); + System.out.println("Result === "+mvcResult); + } + + @Test + public void getAllMessages() throws Exception { + String mvcResult= mockMvc.perform(MockMvcRequestBuilders.get("/messages")) + .andReturn().getResponse().getContentAsString(); + System.out.println("Result === "+mvcResult); + } + + @Test + public void getMessage() throws Exception { + String mvcResult= mockMvc.perform(MockMvcRequestBuilders.get("/message/6")) + .andReturn().getResponse().getContentAsString(); + System.out.println("Result === "+mvcResult); + } + + @Test + public void modifyMessage() throws Exception { + final MultiValueMap params = new LinkedMultiValueMap<>(); + params.add("id", "6"); + params.add("text", "text"); + params.add("summary", "summary"); + String mvcResult= mockMvc.perform(MockMvcRequestBuilders.put("/message").params(params)) + .andReturn().getResponse().getContentAsString(); + System.out.println("Result === "+mvcResult); + } + + @Test + public void patchMessage() throws Exception { + final MultiValueMap params = new LinkedMultiValueMap<>(); + params.add("id", "6"); + params.add("text", "text"); + String mvcResult= mockMvc.perform(MockMvcRequestBuilders.patch("/message/text").params(params)) + .andReturn().getResponse().getContentAsString(); + System.out.println("Result === "+mvcResult); + } + + @Test + public void deleteMessage() throws Exception { + mockMvc.perform(MockMvcRequestBuilders.delete("/message/6")) + .andReturn(); + String mvcResult= mockMvc.perform(MockMvcRequestBuilders.get("/messages")) + .andReturn().getResponse().getContentAsString(); + System.out.println("Result === "+mvcResult); + } + + private void saveMessages() { + for (int i=1;i<10;i++){ + final MultiValueMap params = new LinkedMultiValueMap<>(); + params.add("text", "text"+i); + params.add("summary", "summary"+i); + try { + MvcResult mvcResult= mockMvc.perform(MockMvcRequestBuilders.post("/message") + .params(params)).andReturn(); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + +} diff --git "a/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/pom.xml" "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/pom.xml" new file mode 100644 index 0000000..d001164 --- /dev/null +++ "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/pom.xml" @@ -0,0 +1,58 @@ + + + 4.0.0 + spring-boot-swagger + Spring Boot swagger Sample + Spring Boot swagger Sample + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + + + org.springframework.boot + spring-boot-starter-web + + + io.springfox + springfox-swagger2 + 2.9.2 + + + io.springfox + springfox-swagger-ui + 2.9.2 + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-devtools + runtime + true + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + + + + diff --git "a/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/SwaggerApplication.java" "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/SwaggerApplication.java" new file mode 100644 index 0000000..7f12e1b --- /dev/null +++ "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/SwaggerApplication.java" @@ -0,0 +1,15 @@ + +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +@SpringBootApplication +public class SwaggerApplication { + + public static void main(String[] args) { + SpringApplication.run(SwaggerApplication.class, args); + } + +} diff --git "a/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/config/BaseResult.java" "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/config/BaseResult.java" new file mode 100644 index 0000000..4e3363f --- /dev/null +++ "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/config/BaseResult.java" @@ -0,0 +1,112 @@ +package com.neo.config; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * 通用响应对象 + */ +@ApiModel(description = "响应对象") +public class BaseResult { + private static final int SUCCESS_CODE = 0; + private static final String SUCCESS_MESSAGE = "成功"; + + @ApiModelProperty(value = "响应码", name = "code", required = true, example = "" + SUCCESS_CODE) + private int code; + + @ApiModelProperty(value = "响应消息", name = "msg", required = true, example = SUCCESS_MESSAGE) + private String msg; + + @ApiModelProperty(value = "响应数据", name = "data") + private T data; + + private BaseResult(int code, String msg, T data) { + this.code = code; + this.msg = msg; + this.data = data; + } + + private BaseResult() { + this(SUCCESS_CODE, SUCCESS_MESSAGE); + } + + private BaseResult(int code, String msg) { + this(code, msg, null); + } + + private BaseResult(T data) { + this(SUCCESS_CODE, SUCCESS_MESSAGE, data); + } + + public static BaseResult success() { + return new BaseResult<>(); + } + + public static BaseResult successWithData(T data) { + return new BaseResult<>(data); + } + + public static BaseResult failWithCodeAndMsg(int code, String msg) { + return new BaseResult<>(code, msg, null); + } + + public static BaseResult buildWithParam(ResponseParam param) { + return new BaseResult<>(param.getCode(), param.getMsg(), null); + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } + + + + public static class ResponseParam { + private int code; + private String msg; + + private ResponseParam(int code, String msg) { + this.code = code; + this.msg = msg; + } + + public static ResponseParam buildParam(int code, String msg) { + return new ResponseParam(code, msg); + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + } +} diff --git "a/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/config/SwaggerConfig.java" "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/config/SwaggerConfig.java" new file mode 100644 index 0000000..babb224 --- /dev/null +++ "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/config/SwaggerConfig.java" @@ -0,0 +1,39 @@ +package com.neo.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@Configuration +@EnableSwagger2 +public class SwaggerConfig { + + @Bean + public Docket api() { + return new Docket(DocumentationType.SWAGGER_2) + .apiInfo(apiInfo()) + .select() + // 自行修改为自己的包路径 + .apis(RequestHandlerSelectors.basePackage("com.neo.controller")) + .paths(PathSelectors.any()) + .build(); + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("客户管理") + .description("客户管理中心 API 1.0 操作文档") + //服务条款网址 + .termsOfServiceUrl("http://www.ityouknow.com/") + .version("1.0") + .contact(new Contact("纯洁的微笑", "http://www.ityouknow.com/", "ityouknow@126.com")) + .build(); + } +} \ No newline at end of file diff --git "a/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/controller/MessageController.java" "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/controller/MessageController.java" new file mode 100644 index 0000000..f4ee8b8 --- /dev/null +++ "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/controller/MessageController.java" @@ -0,0 +1,85 @@ + +package com.neo.controller; + +import com.neo.config.BaseResult; +import com.neo.model.Message; +import com.neo.repository.MessageRepository; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@Api(value = "消息", description = "消息操作 API", position = 100, protocols = "http") +@RestController +@RequestMapping("/") +public class MessageController { + + @Autowired + private MessageRepository messageRepository; + + @ApiOperation( + value = "消息列表", + notes = "完整的消息内容列表", + produces="application/json, application/xml", + consumes="application/json, application/xml", + response = List.class) + @GetMapping(value = "messages") + public List list() { + List messages = this.messageRepository.findAll(); + return messages; + } + + @ApiOperation( + value = "添加消息", + notes = "根据参数创建消息" + ) + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "消息 ID", required = true, dataType = "Long", paramType = "query"), + @ApiImplicitParam(name = "text", value = "正文", required = true, dataType = "String", paramType = "query"), + @ApiImplicitParam(name = "summary", value = "摘要", required = false, dataType = "String", paramType = "query"), + }) + @PostMapping(value = "message") + public Message create(Message message) { + System.out.println("message===="+message.toString()); + message = this.messageRepository.save(message); + return message; + } + + @ApiOperation( + value = "修改消息", + notes = "根据参数修改消息" + ) + @PutMapping(value = "message") + @ApiResponses({ + @ApiResponse(code = 100, message = "请求参数有误"), + @ApiResponse(code = 101, message = "未授权"), + @ApiResponse(code = 103, message = "禁止访问"), + @ApiResponse(code = 104, message = "请求路径不存在"), + @ApiResponse(code = 200, message = "服务器内部错误") + }) + public Message modify(Message message) { + Message messageResult=this.messageRepository.update(message); + return messageResult; + } + + @PatchMapping(value="/message/text") + public BaseResult patch(Message message) { + Message messageResult=this.messageRepository.updateText(message); + return BaseResult.successWithData(messageResult); + } + + @GetMapping(value = "message/{id}") + public Message get(@PathVariable Long id) { + Message message = this.messageRepository.findMessage(id); + return message; + } + + @DeleteMapping(value = "message/{id}") + public void delete(@PathVariable("id") Long id) { + this.messageRepository.deleteMessage(id); + } + + + +} diff --git "a/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/controller/UserController.java" "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/controller/UserController.java" new file mode 100644 index 0000000..74723d0 --- /dev/null +++ "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/controller/UserController.java" @@ -0,0 +1,76 @@ +package com.neo.controller; + +import com.neo.config.BaseResult; +import com.neo.model.User; +import io.swagger.annotations.*; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.*; + + +@Api(value = "用户管理", description = "用户管理API", position = 100, protocols = "http") +@RestController +@RequestMapping(value = "/user") +public class UserController { + static Map users = Collections.synchronizedMap(new HashMap<>()); + + @ApiOperation(value = "获取用户列表", notes = "查询用户列表") + @RequestMapping(value = {""}, method = RequestMethod.GET) + @ApiResponses({ + @ApiResponse(code = 100, message = "异常数据") + }) + public List getUserList() { + return new ArrayList<>(users.values()); + } + + @ApiOperation(value = "创建用户", notes = "根据User对象创建用户") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "用户ID", required = true, dataType = "Long", paramType = "query"), + @ApiImplicitParam(name = "name", value = "用户名", required = true, dataType = "String", paramType = "query"), + @ApiImplicitParam(name = "age", value = "年龄", required = true, dataType = "String", paramType = "query"), + @ApiImplicitParam(name = "ipAddr", value = "ip哟", required = false, dataType = "String", paramType = "query") + }) + @RequestMapping(value = "", method = RequestMethod.POST) + public BaseResult postUser(@ApiIgnore User user) { + users.put(user.getId(), user); + return BaseResult.successWithData(user); + } + + @ApiOperation(value = "获取用户详细信息", notes = "根据url的id来获取用户详细信息") + @ApiImplicitParam(name = "id", value = "用户ID", required = true, dataType = "Long", paramType = "path") + @RequestMapping(value = "/{id}", method = RequestMethod.GET) + public User getUser(@PathVariable Long id) { + return users.get(id); + } + + @ApiOperation(value = "更新用户信息", notes = "根据用户ID更新信息") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "用户ID", required = true, dataType = "Long", paramType = "query"), + @ApiImplicitParam(name = "name", value = "用户名", required = true, dataType = "String", paramType = "query"), + @ApiImplicitParam(name = "age", value = "年龄", required = true, dataType = "String", paramType = "query") + }) + @RequestMapping(value = "/{id}", method = RequestMethod.PUT) + public BaseResult putUser(@PathVariable Long id, @ApiIgnore User user) { + User u = users.get(id); + u.setName(user.getName()); + u.setAge(user.getAge()); + users.put(id, u); + return BaseResult.successWithData(u); + } + + @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) + public String deleteUser(@PathVariable Long id) { + users.remove(id); + return "success"; + } + + @RequestMapping(value = "/ignoreMe/{id}", method = RequestMethod.DELETE) + public String ignoreMe(@PathVariable Long id) { + users.remove(id); + return "success"; + } +} \ No newline at end of file diff --git "a/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/model/Message.java" "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/model/Message.java" new file mode 100644 index 0000000..c218fff --- /dev/null +++ "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/model/Message.java" @@ -0,0 +1,60 @@ +package com.neo.model; + +import io.swagger.annotations.ApiModelProperty; + +import java.util.Calendar; +import java.util.Date; + +import javax.validation.constraints.NotEmpty; + + +public class Message { + private Long id; + @ApiModelProperty(value = "消息体") + private String text; + @ApiModelProperty(value = "消息总结") + private String summary; + private Date createDate; + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public String getText() { + return this.text; + } + + public void setText(String text) { + this.text = text; + } + + public String getSummary() { + return this.summary; + } + + public void setSummary(String summary) { + this.summary = summary; + } + + @Override + public String toString() { + return "Message{" + + "id=" + id + + ", text='" + text + '\'' + + ", summary='" + summary + '\'' + + ", createDate=" + createDate + + '}'; + } +} diff --git "a/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/model/User.java" "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/model/User.java" new file mode 100644 index 0000000..fde335a --- /dev/null +++ "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/model/User.java" @@ -0,0 +1,31 @@ +package com.neo.model; + +public class User { + private Long id; + private String name; + private int age; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } +} diff --git "a/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/repository/InMemoryMessageRepository.java" "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/repository/InMemoryMessageRepository.java" new file mode 100644 index 0000000..c550ebb --- /dev/null +++ "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/repository/InMemoryMessageRepository.java" @@ -0,0 +1,59 @@ +package com.neo.repository; + +import com.neo.model.Message; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.atomic.AtomicLong; + +@Service("messageRepository") +public class InMemoryMessageRepository implements MessageRepository { + + private static AtomicLong counter = new AtomicLong(); + private final ConcurrentMap messages = new ConcurrentHashMap<>(); + + @Override + public List findAll() { + List messages = new ArrayList(this.messages.values()); + return messages; + } + + @Override + public Message save(Message message) { + Long id = message.getId(); + if (id == null) { + id = counter.incrementAndGet(); + message.setId(id); + } + this.messages.put(id, message); + return message; + } + + @Override + public Message update(Message message) { + this.messages.put(message.getId(), message); + return message; + } + + @Override + public Message updateText(Message message) { + Message msg=this.messages.get(message.getId()); + msg.setText(message.getText()); + this.messages.put(msg.getId(), msg); + return msg; + } + + @Override + public Message findMessage(Long id) { + return this.messages.get(id); + } + + @Override + public void deleteMessage(Long id) { + this.messages.remove(id); + } + +} diff --git "a/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/repository/MessageRepository.java" "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/repository/MessageRepository.java" new file mode 100644 index 0000000..99549b5 --- /dev/null +++ "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/java/com/neo/repository/MessageRepository.java" @@ -0,0 +1,22 @@ + +package com.neo.repository; + +import com.neo.model.Message; + +import java.util.List; + +public interface MessageRepository { + + List findAll(); + + Message save(Message message); + + Message update(Message message); + + Message updateText(Message message); + + Message findMessage(Long id); + + void deleteMessage(Long id); + +} diff --git "a/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/resources/application.properties" "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/resources/application.properties" new file mode 100644 index 0000000..a942fc8 --- /dev/null +++ "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/resources/application.properties" @@ -0,0 +1 @@ +logging.level.io.swagger.models.parameters.AbstractSerializableParameter=error \ No newline at end of file diff --git "a/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/resources/logback.xml" "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/resources/logback.xml" new file mode 100644 index 0000000..620db4a --- /dev/null +++ "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/main/resources/logback.xml" @@ -0,0 +1,8 @@ + + + + + + + + diff --git "a/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/test/java/com/neo/SwaggerApplicationTests.java" "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/test/java/com/neo/SwaggerApplicationTests.java" new file mode 100644 index 0000000..8b6b178 --- /dev/null +++ "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/test/java/com/neo/SwaggerApplicationTests.java" @@ -0,0 +1,14 @@ + +package com.neo; + + + +import org.junit.Test; + +public class SwaggerApplicationTests { + + @Test + public void test() { + } + +} diff --git "a/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/test/java/com/neo/web/MessageControllerTest.java" "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/test/java/com/neo/web/MessageControllerTest.java" new file mode 100644 index 0000000..0aead73 --- /dev/null +++ "b/\347\254\254 2-9 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Swagger2 \346\236\204\345\273\272 RESTful APIs/spring-boot-swagger/src/test/java/com/neo/web/MessageControllerTest.java" @@ -0,0 +1,105 @@ +package com.neo.web; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.MvcResult; +import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.context.WebApplicationContext; + +import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.*; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class MessageControllerTest { + + @Autowired + private WebApplicationContext wac; + + private MockMvc mockMvc; + + @Before + public void setup() { + this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build(); + saveMessages(); + } + + @Test + public void saveMessage() throws Exception { + final MultiValueMap params = new LinkedMultiValueMap<>(); + params.add("text", "text"); + params.add("summary", "summary"); + String mvcResult= mockMvc.perform(MockMvcRequestBuilders.post("/message") + .params(params)).andReturn().getResponse().getContentAsString(); + System.out.println("Result === "+mvcResult); + } + + @Test + public void getAllMessages() throws Exception { + String mvcResult= mockMvc.perform(MockMvcRequestBuilders.get("/messages")) + .andReturn().getResponse().getContentAsString(); + System.out.println("Result === "+mvcResult); + } + + @Test + public void getMessage() throws Exception { + String mvcResult= mockMvc.perform(MockMvcRequestBuilders.get("/message/6")) + .andReturn().getResponse().getContentAsString(); + System.out.println("Result === "+mvcResult); + } + + @Test + public void modifyMessage() throws Exception { + final MultiValueMap params = new LinkedMultiValueMap<>(); + params.add("id", "6"); + params.add("text", "text"); + params.add("summary", "summary"); + String mvcResult= mockMvc.perform(MockMvcRequestBuilders.put("/message").params(params)) + .andReturn().getResponse().getContentAsString(); + System.out.println("Result === "+mvcResult); + } + + @Test + public void patchMessage() throws Exception { + final MultiValueMap params = new LinkedMultiValueMap<>(); + params.add("id", "6"); + params.add("text", "text"); + String mvcResult= mockMvc.perform(MockMvcRequestBuilders.patch("/message/text").params(params)) + .andReturn().getResponse().getContentAsString(); + System.out.println("Result === "+mvcResult); + } + + @Test + public void deleteMessage() throws Exception { + mockMvc.perform(MockMvcRequestBuilders.delete("/message/6")) + .andReturn(); + String mvcResult= mockMvc.perform(MockMvcRequestBuilders.get("/messages")) + .andReturn().getResponse().getContentAsString(); + System.out.println("Result === "+mvcResult); + } + + private void saveMessages() { + for (int i=1;i<10;i++){ + final MultiValueMap params = new LinkedMultiValueMap<>(); + params.add("id",""+i); + params.add("text", "text"+i); + params.add("summary", "summary"+i); + try { + MvcResult mvcResult= mockMvc.perform(MockMvcRequestBuilders.post("/message") + .params(params)).andReturn(); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + +} diff --git "a/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/pom.xml" "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/pom.xml" new file mode 100644 index 0000000..806aac1 --- /dev/null +++ "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/pom.xml" @@ -0,0 +1,53 @@ + + + 4.0.0 + + com.neo + spring-boot-jdbc + 1.0.0 + jar + + spring-boot-jdbc + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-jdbc + + + mysql + mysql-connector-java + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git "a/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/main/java/com/neo/JdbcApplication.java" "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/main/java/com/neo/JdbcApplication.java" new file mode 100644 index 0000000..7f6b835 --- /dev/null +++ "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/main/java/com/neo/JdbcApplication.java" @@ -0,0 +1,12 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class JdbcApplication { + + public static void main(String[] args) { + SpringApplication.run(JdbcApplication.class, args); + } +} diff --git "a/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/main/java/com/neo/model/User.java" "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/main/java/com/neo/model/User.java" new file mode 100644 index 0000000..b4e6535 --- /dev/null +++ "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/main/java/com/neo/model/User.java" @@ -0,0 +1,60 @@ +package com.neo.model; + +public class User { + + private Long id; + private String name; + private String password; + private int age; + + public User() { + } + + public User(String name, String password, int age) { + this.name = name; + this.password = password; + this.age = age; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + @Override + public String toString() { + return "User{" + + "id=" + id + + ", name='" + name + '\'' + + ", password='" + password + '\'' + + ", age=" + age + + '}'; + } +} diff --git "a/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/main/java/com/neo/repository/UserRepository.java" "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/main/java/com/neo/repository/UserRepository.java" new file mode 100644 index 0000000..a6d394d --- /dev/null +++ "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/main/java/com/neo/repository/UserRepository.java" @@ -0,0 +1,17 @@ +package com.neo.repository; + +import com.neo.model.User; +import java.util.List; + +public interface UserRepository { + + int save(User user); + + int update(User user); + + int delete(long id); + + List findALL(); + + User findById(long id); +} \ No newline at end of file diff --git "a/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/main/java/com/neo/repository/impl/UserRepositoryImpl.java" "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/main/java/com/neo/repository/impl/UserRepositoryImpl.java" new file mode 100644 index 0000000..0ab8878 --- /dev/null +++ "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/main/java/com/neo/repository/impl/UserRepositoryImpl.java" @@ -0,0 +1,62 @@ +package com.neo.repository.impl; + +import com.neo.model.User; +import com.neo.repository.UserRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.core.BeanPropertyRowMapper; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.core.RowMapper; +import org.springframework.stereotype.Repository; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.List; + +@Repository +public class UserRepositoryImpl implements UserRepository { + + @Autowired + private JdbcTemplate jdbcTemplate; + + @Override + public int save(User user) { + return jdbcTemplate.update("INSERT INTO users(name, password, age) values(?, ?, ?)", + user.getName(), user.getPassword(), user.getAge()); + } + + @Override + public int update(User user) { + return jdbcTemplate.update("UPDATE users SET name = ? , password = ? , age = ? WHERE id=?", + user.getName(), user.getPassword(), user.getAge(), user.getId()); + } + + @Override + public int delete(long id) { + return jdbcTemplate.update("DELETE FROM users where id = ? ",id); + + } + + @Override + public User findById(long id) { + return jdbcTemplate.queryForObject("SELECT * FROM users WHERE id=?", new Object[] { id }, new BeanPropertyRowMapper(User.class)); + } + + @Override + public List findALL() { + return jdbcTemplate.query("SELECT * FROM users", new UserRowMapper()); + // return jdbcTemplate.query("SELECT * FROM users", new BeanPropertyRowMapper(User.class)); + } + + class UserRowMapper implements RowMapper { + @Override + public User mapRow(ResultSet rs, int rowNum) throws SQLException { + User user = new User(); + user.setId(rs.getLong("id")); + user.setName(rs.getString("name")); + user.setPassword(rs.getString("password")); + user.setAge(rs.getInt("age")); + return user; + } + } + +} diff --git "a/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/main/resources/application.properties" "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/main/resources/application.properties" new file mode 100644 index 0000000..950ce0a --- /dev/null +++ "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/main/resources/application.properties" @@ -0,0 +1,4 @@ +spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.username=root +spring.datasource.password=root +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver diff --git "a/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/test/java/com/neo/JdbcApplicationTests.java" "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/test/java/com/neo/JdbcApplicationTests.java" new file mode 100644 index 0000000..fae3b77 --- /dev/null +++ "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/test/java/com/neo/JdbcApplicationTests.java" @@ -0,0 +1,16 @@ +package com.neo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class JdbcApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git "a/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/test/java/com/neo/repository/UserRepositoryTests.java" "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/test/java/com/neo/repository/UserRepositoryTests.java" new file mode 100644 index 0000000..cac6be8 --- /dev/null +++ "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/src/test/java/com/neo/repository/UserRepositoryTests.java" @@ -0,0 +1,51 @@ +package com.neo.repository; + +import com.neo.model.User; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.List; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class UserRepositoryTests { + + @Autowired + private UserRepository userRepository; + + @Test + public void testSave() { + User user =new User("neo","123456",30); + userRepository.save(user); + } + + @Test + public void testUpdate() { + User user =new User("neo","123456",18); + user.setId(1L); + userRepository.update(user); + } + + @Test + public void testDetele() { + userRepository.delete(1L); + } + + @Test + public void testQueryOne() { + User user=userRepository.findById(2L); + System.out.println("user == "+user.toString()); + } + + @Test + public void testQueryAll() { + List users=userRepository.findALL(); + for (User user:users){ + System.out.println("user == "+user.toString()); + } + } + +} \ No newline at end of file diff --git "a/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/users.sql" "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/users.sql" new file mode 100644 index 0000000..2a0f63d --- /dev/null +++ "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-jdbc/users.sql" @@ -0,0 +1,16 @@ + + +SET FOREIGN_KEY_CHECKS=0; + +-- ---------------------------- +-- Table structure for `users` +-- ---------------------------- +DROP TABLE IF EXISTS `users`; +CREATE TABLE `users` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id', + `name` varchar(32) DEFAULT NULL COMMENT '用户名', + `password` varchar(32) DEFAULT NULL COMMENT '密码', + `age` int DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; + diff --git "a/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/pom.xml" "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/pom.xml" new file mode 100644 index 0000000..fbf4b71 --- /dev/null +++ "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/pom.xml" @@ -0,0 +1,53 @@ + + + 4.0.0 + + com.neo + spring-boot-multi-jdbc + 1.0.0 + jar + + spring-boot-multi-jdbc + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-jdbc + + + mysql + mysql-connector-java + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git "a/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/main/java/com/neo/MultiJdbcApplication.java" "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/main/java/com/neo/MultiJdbcApplication.java" new file mode 100644 index 0000000..9a8ce5f --- /dev/null +++ "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/main/java/com/neo/MultiJdbcApplication.java" @@ -0,0 +1,12 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class MultiJdbcApplication { + + public static void main(String[] args) { + SpringApplication.run(MultiJdbcApplication.class, args); + } +} diff --git "a/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/main/java/com/neo/config/DataSourceConfig.java" "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/main/java/com/neo/config/DataSourceConfig.java" new file mode 100644 index 0000000..a97a61d --- /dev/null +++ "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/main/java/com/neo/config/DataSourceConfig.java" @@ -0,0 +1,44 @@ +package com.neo.config; + +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.jdbc.DataSourceBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.jdbc.core.JdbcTemplate; + +import javax.sql.DataSource; + +@Configuration +public class DataSourceConfig { + @Primary + @Bean(name = "primaryDataSource") + @Qualifier("primaryDataSource") + @ConfigurationProperties(prefix="spring.datasource.primary") + public DataSource primaryDataSource() { + return DataSourceBuilder.create().build(); + } + + + @Bean(name = "secondaryDataSource") + @Qualifier("secondaryDataSource") + @ConfigurationProperties(prefix="spring.datasource.secondary") + public DataSource secondaryDataSource() { + return DataSourceBuilder.create().build(); + } + + + @Bean(name="primaryJdbcTemplate") + public JdbcTemplate primaryJdbcTemplate ( + @Qualifier("primaryDataSource") DataSource dataSource ) { + return new JdbcTemplate(dataSource); + } + + @Bean(name="secondaryJdbcTemplate") + public JdbcTemplate secondaryJdbcTemplate( + @Qualifier("secondaryDataSource") DataSource dataSource) { + return new JdbcTemplate(dataSource); + } + +} \ No newline at end of file diff --git "a/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/main/java/com/neo/model/User.java" "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/main/java/com/neo/model/User.java" new file mode 100644 index 0000000..b4e6535 --- /dev/null +++ "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/main/java/com/neo/model/User.java" @@ -0,0 +1,60 @@ +package com.neo.model; + +public class User { + + private Long id; + private String name; + private String password; + private int age; + + public User() { + } + + public User(String name, String password, int age) { + this.name = name; + this.password = password; + this.age = age; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + @Override + public String toString() { + return "User{" + + "id=" + id + + ", name='" + name + '\'' + + ", password='" + password + '\'' + + ", age=" + age + + '}'; + } +} diff --git "a/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/main/java/com/neo/repository/UserRepository.java" "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/main/java/com/neo/repository/UserRepository.java" new file mode 100644 index 0000000..ef981f4 --- /dev/null +++ "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/main/java/com/neo/repository/UserRepository.java" @@ -0,0 +1,19 @@ +package com.neo.repository; + +import com.neo.model.User; +import org.springframework.jdbc.core.JdbcTemplate; + +import java.util.List; + +public interface UserRepository { + + int save(User user,JdbcTemplate jdbcTemplate); + + int update(User user,JdbcTemplate jdbcTemplate); + + int delete(long id,JdbcTemplate jdbcTemplate); + + List findALL(JdbcTemplate jdbcTemplate); + + User findById(long id,JdbcTemplate jdbcTemplate); +} \ No newline at end of file diff --git "a/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/main/java/com/neo/repository/impl/UserRepositoryImpl.java" "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/main/java/com/neo/repository/impl/UserRepositoryImpl.java" new file mode 100644 index 0000000..1294eb1 --- /dev/null +++ "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/main/java/com/neo/repository/impl/UserRepositoryImpl.java" @@ -0,0 +1,76 @@ +package com.neo.repository.impl; + +import com.neo.model.User; +import com.neo.repository.UserRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.core.BeanPropertyRowMapper; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.core.RowMapper; +import org.springframework.stereotype.Repository; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.List; + +@Repository +public class UserRepositoryImpl implements UserRepository { + @Autowired + private JdbcTemplate primaryJdbcTemplate; + + @Override + public int save(User user,JdbcTemplate jdbcTemplate) { + if(jdbcTemplate == null){ + jdbcTemplate= primaryJdbcTemplate; + } + return jdbcTemplate.update("INSERT INTO users(name, password, age) values(?, ?, ?)", + user.getName(), user.getPassword(), user.getAge()); + } + + @Override + public int update(User user,JdbcTemplate jdbcTemplate) { + if(jdbcTemplate==null){ + jdbcTemplate= primaryJdbcTemplate; + } + return jdbcTemplate.update("UPDATE users SET name = ? , password = ? , age = ? WHERE id=?", + user.getName(), user.getPassword(), user.getAge(), user.getId()); + } + + @Override + public int delete(long id,JdbcTemplate jdbcTemplate) { + if(jdbcTemplate==null){ + jdbcTemplate= primaryJdbcTemplate; + } + return jdbcTemplate.update("DELETE FROM users where id = ? ",id); + + } + + @Override + public User findById(long id,JdbcTemplate jdbcTemplate) { + if(jdbcTemplate==null){ + jdbcTemplate= primaryJdbcTemplate; + } + return jdbcTemplate.queryForObject("SELECT * FROM users WHERE id=?", new Object[] { id }, new BeanPropertyRowMapper(User.class)); + } + + @Override + public List findALL(JdbcTemplate jdbcTemplate) { + if(jdbcTemplate==null){ + jdbcTemplate= primaryJdbcTemplate; + } + return jdbcTemplate.query("SELECT * FROM users", new UserRowMapper()); + // return jdbcTemplate.query("SELECT * FROM users", new BeanPropertyRowMapper(User.class)); + } + + class UserRowMapper implements RowMapper { + @Override + public User mapRow(ResultSet rs, int rowNum) throws SQLException { + User user = new User(); + user.setId(rs.getLong("id")); + user.setName(rs.getString("name")); + user.setPassword(rs.getString("password")); + user.setAge(rs.getInt("age")); + return user; + } + } + +} diff --git "a/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/main/resources/application.properties" "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/main/resources/application.properties" new file mode 100644 index 0000000..b3254c9 --- /dev/null +++ "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/main/resources/application.properties" @@ -0,0 +1,12 @@ +spring.datasource.primary.jdbc-url=jdbc:mysql://localhost:3306/test1?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.primary.username=root +spring.datasource.primary.password=root +spring.datasource.primary.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.datasource.secondary.jdbc-url=jdbc:mysql://localhost:3306/test2?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.secondary.username=root +spring.datasource.secondary.password=root +spring.datasource.secondary.driver-class-name=com.mysql.cj.jdbc.Driver + + +spring.server.maxThreads=600 diff --git "a/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/test/java/com/neo/MultiJdbcApplicationTests.java" "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/test/java/com/neo/MultiJdbcApplicationTests.java" new file mode 100644 index 0000000..c01fd99 --- /dev/null +++ "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/test/java/com/neo/MultiJdbcApplicationTests.java" @@ -0,0 +1,16 @@ +package com.neo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class MultiJdbcApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git "a/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/test/java/com/neo/repository/UserRepositoryTests.java" "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/test/java/com/neo/repository/UserRepositoryTests.java" new file mode 100644 index 0000000..3078fc3 --- /dev/null +++ "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/src/test/java/com/neo/repository/UserRepositoryTests.java" @@ -0,0 +1,28 @@ +package com.neo.repository; + +import com.neo.model.User; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class UserRepositoryTests { + @Autowired + private UserRepository userRepository; + @Autowired + private JdbcTemplate primaryJdbcTemplate; + @Autowired + private JdbcTemplate secondaryJdbcTemplate; + + @Test + public void testSave() { + User user =new User("smile","123456",30); + userRepository.save(user,primaryJdbcTemplate); + userRepository.save(user,secondaryJdbcTemplate); + } + +} \ No newline at end of file diff --git "a/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/users.sql" "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/users.sql" new file mode 100644 index 0000000..2a0f63d --- /dev/null +++ "b/\347\254\254 3-1 \350\257\276\357\274\232 Spring Boot \344\275\277\347\224\250 JDBC \346\223\215\344\275\234\346\225\260\346\215\256\345\272\223/spring-boot-multi-jdbc/users.sql" @@ -0,0 +1,16 @@ + + +SET FOREIGN_KEY_CHECKS=0; + +-- ---------------------------- +-- Table structure for `users` +-- ---------------------------- +DROP TABLE IF EXISTS `users`; +CREATE TABLE `users` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id', + `name` varchar(32) DEFAULT NULL COMMENT '用户名', + `password` varchar(32) DEFAULT NULL COMMENT '密码', + `age` int DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; + diff --git "a/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/pom.xml" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/pom.xml" new file mode 100644 index 0000000..02e4e56 --- /dev/null +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/pom.xml" @@ -0,0 +1,65 @@ + + + 4.0.0 + + com.neo + spring-boot-multi-mybatis-xml + 1.0.0 + jar + + spring-boot-multi-mybatis-xml + Demo project for Spring Boot and mybatis + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + 1.3.2 + + + mysql + mysql-connector-java + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-devtools + true + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + + + + + diff --git "a/\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-package-war/src/main/java/com/neo/Application.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/MMXApplication.java" similarity index 71% rename from "\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-package-war/src/main/java/com/neo/Application.java" rename to "\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/MMXApplication.java" index 6cda50c..dcf94fb 100644 --- "a/\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-package-war/src/main/java/com/neo/Application.java" +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/MMXApplication.java" @@ -4,9 +4,9 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication -public class Application { +public class MMXApplication { public static void main(String[] args) { - SpringApplication.run(Application.class, args); + SpringApplication.run(MMXApplication.class, args); } } diff --git "a/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/datasource/DataSource1Config.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/datasource/DataSource1Config.java" new file mode 100644 index 0000000..371d5eb --- /dev/null +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/datasource/DataSource1Config.java" @@ -0,0 +1,51 @@ +package com.neo.datasource; + +import org.apache.ibatis.session.SqlSessionFactory; +import org.mybatis.spring.SqlSessionFactoryBean; +import org.mybatis.spring.SqlSessionTemplate; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.jdbc.DataSourceBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.jdbc.datasource.DataSourceTransactionManager; + +import javax.sql.DataSource; + + +@Configuration +@MapperScan(basePackages = "com.neo.mapper.one", sqlSessionTemplateRef = "oneSqlSessionTemplate") +public class DataSource1Config { + + @Bean(name = "oneDataSource") + @ConfigurationProperties(prefix = "spring.datasource.one") + @Primary + public DataSource testDataSource() { + return DataSourceBuilder.create().build(); + } + + @Bean(name = "oneSqlSessionFactory") + @Primary + public SqlSessionFactory testSqlSessionFactory(@Qualifier("oneDataSource") DataSource dataSource) throws Exception { + SqlSessionFactoryBean bean = new SqlSessionFactoryBean(); + bean.setDataSource(dataSource); + bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mybatis/mapper/one/*.xml")); + return bean.getObject(); + } + + @Bean(name = "oneTransactionManager") + @Primary + public DataSourceTransactionManager testTransactionManager(@Qualifier("oneDataSource") DataSource dataSource) { + return new DataSourceTransactionManager(dataSource); + } + + @Bean(name = "oneSqlSessionTemplate") + @Primary + public SqlSessionTemplate testSqlSessionTemplate(@Qualifier("oneSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception { + return new SqlSessionTemplate(sqlSessionFactory); + } + +} diff --git "a/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/datasource/DataSource2Config.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/datasource/DataSource2Config.java" new file mode 100644 index 0000000..7d455b1 --- /dev/null +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/datasource/DataSource2Config.java" @@ -0,0 +1,46 @@ +package com.neo.datasource; + +import org.apache.ibatis.session.SqlSessionFactory; +import org.mybatis.spring.SqlSessionFactoryBean; +import org.mybatis.spring.SqlSessionTemplate; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.jdbc.DataSourceBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.jdbc.datasource.DataSourceTransactionManager; + +import javax.sql.DataSource; + + +@Configuration +@MapperScan(basePackages = "com.neo.mapper.two", sqlSessionTemplateRef = "twoSqlSessionTemplate") +public class DataSource2Config { + + @Bean(name = "twoDataSource") + @ConfigurationProperties(prefix = "spring.datasource.two") + public DataSource testDataSource() { + return DataSourceBuilder.create().build(); + } + + @Bean(name = "twoSqlSessionFactory") + public SqlSessionFactory testSqlSessionFactory(@Qualifier("twoDataSource") DataSource dataSource) throws Exception { + SqlSessionFactoryBean bean = new SqlSessionFactoryBean(); + bean.setDataSource(dataSource); + bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mybatis/mapper/two/*.xml")); + return bean.getObject(); + } + + @Bean(name = "twoTransactionManager") + public DataSourceTransactionManager testTransactionManager(@Qualifier("twoDataSource") DataSource dataSource) { + return new DataSourceTransactionManager(dataSource); + } + + @Bean(name = "twoSqlSessionTemplate") + public SqlSessionTemplate testSqlSessionTemplate(@Qualifier("twoSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception { + return new SqlSessionTemplate(sqlSessionFactory); + } + +} diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/enums/UserSexEnum.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/enums/UserSexEnum.java" similarity index 100% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/enums/UserSexEnum.java" rename to "\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/enums/UserSexEnum.java" diff --git "a/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/mapper/one/User1Mapper.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/mapper/one/User1Mapper.java" new file mode 100644 index 0000000..63b5a32 --- /dev/null +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/mapper/one/User1Mapper.java" @@ -0,0 +1,19 @@ +package com.neo.mapper.one; + +import com.neo.model.User; + +import java.util.List; + +public interface User1Mapper { + + List getAll(); + + User getOne(Long id); + + void insert(User user); + + void update(User user); + + void delete(Long id); + +} \ No newline at end of file diff --git "a/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/mapper/two/User2Mapper.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/mapper/two/User2Mapper.java" new file mode 100644 index 0000000..a42ebdc --- /dev/null +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/mapper/two/User2Mapper.java" @@ -0,0 +1,19 @@ +package com.neo.mapper.two; + +import java.util.List; + +import com.neo.model.User; + +public interface User2Mapper { + + List getAll(); + + User getOne(Long id); + + void insert(User user); + + void update(User user); + + void delete(Long id); + +} \ No newline at end of file diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/entity/UserEntity.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/model/User.java" similarity index 78% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/entity/UserEntity.java" rename to "\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/model/User.java" index 0a88b17..de50165 100644 --- "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/entity/UserEntity.java" +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/model/User.java" @@ -1,11 +1,10 @@ -package com.neo.entity; +package com.neo.model; import java.io.Serializable; import com.neo.enums.UserSexEnum; -import org.apache.commons.lang3.builder.ToStringBuilder; -public class UserEntity implements Serializable { +public class User implements Serializable { private static final long serialVersionUID = 1L; private Long id; @@ -14,11 +13,11 @@ public class UserEntity implements Serializable { private UserSexEnum userSex; private String nickName; - public UserEntity() { + public User() { super(); } - public UserEntity(String userName, String passWord, UserSexEnum userSex) { + public User(String userName, String passWord, UserSexEnum userSex) { super(); this.passWord = passWord; this.userName = userName; @@ -67,7 +66,8 @@ public void setNickName(String nickName) { @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + // TODO Auto-generated method stub + return "userName " + this.userName + ", pasword " + this.passWord + "sex " + userSex.name(); } } \ No newline at end of file diff --git "a/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/web/UserController.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/web/UserController.java" new file mode 100644 index 0000000..c87bd3d --- /dev/null +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/java/com/neo/web/UserController.java" @@ -0,0 +1,51 @@ +package com.neo.web; + +import java.util.List; + +import com.neo.mapper.one.User1Mapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.neo.model.User; +import com.neo.mapper.two.User2Mapper; + +@RestController +public class UserController { + + @Autowired + private User1Mapper user1Mapper; + + @Autowired + private User2Mapper user2Mapper; + + @RequestMapping("/getUsers") + public List getUsers() { + List users=user1Mapper.getAll(); + return users; + } + + @RequestMapping("/getUser") + public User getUser(Long id) { + User user=user2Mapper.getOne(id); + return user; + } + + @RequestMapping("/add") + public void save(User user) { + user2Mapper.insert(user); + } + + @RequestMapping(value="update") + public void update(User user) { + user2Mapper.update(user); + } + + @RequestMapping(value="/delete/{id}") + public void delete(@PathVariable("id") Long id) { + user1Mapper.delete(id); + } + + +} \ No newline at end of file diff --git "a/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/resources/application.properties" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/resources/application.properties" new file mode 100644 index 0000000..4be6401 --- /dev/null +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/resources/application.properties" @@ -0,0 +1,12 @@ +mybatis.config-location=classpath:mybatis/mybatis-config.xml + +spring.datasource.one.jdbc-url=jdbc:mysql://localhost:3306/test1?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.one.username=root +spring.datasource.one.password=root +spring.datasource.one.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.datasource.two.jdbc-url=jdbc:mysql://localhost:3306/test2?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.two.username=root +spring.datasource.two.password=root +spring.datasource.two.driver-class-name=com.mysql.cj.jdbc.Driver + diff --git "a/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/resources/mybatis/mapper/one/UserMapper.xml" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/resources/mybatis/mapper/one/UserMapper.xml" new file mode 100644 index 0000000..0b136bf --- /dev/null +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/resources/mybatis/mapper/one/UserMapper.xml" @@ -0,0 +1,55 @@ + + + + + + + + + + + + + id, userName, passWord, user_sex, nick_name + + + + + + + + INSERT INTO + users + (userName,passWord,user_sex) + VALUES + (#{userName}, #{passWord}, #{userSex}) + + + + UPDATE + users + SET + userName = #{userName}, + passWord = #{passWord}, + nick_name = #{nickName} + WHERE + id = #{id} + + + + DELETE FROM + users + WHERE + id =#{id} + + + \ No newline at end of file diff --git "a/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/resources/mybatis/mapper/two/UserMapper.xml" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/resources/mybatis/mapper/two/UserMapper.xml" new file mode 100644 index 0000000..be27af4 --- /dev/null +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/resources/mybatis/mapper/two/UserMapper.xml" @@ -0,0 +1,55 @@ + + + + + + + + + + + + + id, userName, passWord, user_sex, nick_name + + + + + + + + INSERT INTO + users + (userName,passWord,user_sex) + VALUES + (#{userName}, #{passWord}, #{userSex}) + + + + UPDATE + users + SET + userName = #{userName}, + passWord = #{passWord}, + nick_name = #{nickName} + WHERE + id = #{id} + + + + DELETE FROM + users + WHERE + id =#{id} + + + \ No newline at end of file diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/resources/mybatis/mybatis-config.xml" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/resources/mybatis/mybatis-config.xml" similarity index 100% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/resources/mybatis/mybatis-config.xml" rename to "\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/main/resources/mybatis/mybatis-config.xml" diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/test/java/com/neo/ApplicationTests.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/test/java/com/neo/MMXApplicationTests.java" similarity index 90% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/test/java/com/neo/ApplicationTests.java" rename to "\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/test/java/com/neo/MMXApplicationTests.java" index 569db81..ca62e20 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/test/java/com/neo/ApplicationTests.java" +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/test/java/com/neo/MMXApplicationTests.java" @@ -7,7 +7,7 @@ @RunWith(SpringRunner.class) @SpringBootTest -public class ApplicationTests { +public class MMXApplicationTests { @Test public void contextLoads() { diff --git "a/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/test/java/com/neo/mapper/User1MapperTest.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/test/java/com/neo/mapper/User1MapperTest.java" new file mode 100644 index 0000000..dab7c28 --- /dev/null +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/test/java/com/neo/mapper/User1MapperTest.java" @@ -0,0 +1,53 @@ +package com.neo.mapper; + +import java.util.List; + +import com.neo.mapper.one.User1Mapper; +import com.neo.mapper.one.User1Mapper; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import com.neo.model.User; +import com.neo.enums.UserSexEnum; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class User1MapperTest { + + @Autowired + private User1Mapper userMapper; + + @Test + public void testInsert() throws Exception { + userMapper.insert(new User("aammx", "a123456", UserSexEnum.MAN)); + userMapper.insert(new User("bbmmx", "b123456", UserSexEnum.WOMAN)); + userMapper.insert(new User("ccmmx", "b123456", UserSexEnum.WOMAN)); + +// Assert.assertEquals(3, userMapper.getAll().size()); + } + + @Test + public void testQuery() throws Exception { + List users = userMapper.getAll(); + if(users==null || users.size()==0){ + System.out.println("is null"); + }else{ + System.out.println(users.size()); + } + } + + + @Test + public void testUpdate() throws Exception { + User user = userMapper.getOne(40L); + System.out.println(user.toString()); + user.setNickName("smile"); + userMapper.update(user); + Assert.assertTrue(("smile".equals(userMapper.getOne(40l).getNickName()))); + } + +} \ No newline at end of file diff --git "a/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/test/java/com/neo/mapper/User2MapperTest.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/test/java/com/neo/mapper/User2MapperTest.java" new file mode 100644 index 0000000..8a4aa98 --- /dev/null +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/test/java/com/neo/mapper/User2MapperTest.java" @@ -0,0 +1,51 @@ +package com.neo.mapper; + +import com.neo.model.User; +import com.neo.enums.UserSexEnum; +import com.neo.mapper.two.User2Mapper; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.List; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class User2MapperTest { + + @Autowired + private User2Mapper userMapper; + + @Test + public void testInsert() throws Exception { + userMapper.insert(new User("aammx2", "a123456", UserSexEnum.MAN)); + userMapper.insert(new User("bbmmx2", "b123456", UserSexEnum.WOMAN)); + userMapper.insert(new User("ccmmx2", "b123456", UserSexEnum.WOMAN)); + +// Assert.assertEquals(3, userMapper.getAll().size()); + } + + @Test + public void testQuery() throws Exception { + List users = userMapper.getAll(); + if(users==null || users.size()==0){ + System.out.println("is null"); + }else{ + System.out.println(users.toString()); + } + } + + + @Test + public void testUpdate() throws Exception { + User user = userMapper.getOne(30l); + System.out.println(user.toString()); + user.setNickName("neo"); + userMapper.update(user); + Assert.assertTrue(("neo".equals(userMapper.getOne(6l).getNickName()))); + } + +} \ No newline at end of file diff --git "a/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/test/java/com/neo/mapper/UserMapperTest.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/test/java/com/neo/mapper/UserMapperTest.java" new file mode 100644 index 0000000..2d52203 --- /dev/null +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/src/test/java/com/neo/mapper/UserMapperTest.java" @@ -0,0 +1,27 @@ +package com.neo.mapper; + +import com.neo.enums.UserSexEnum; +import com.neo.mapper.one.User1Mapper; +import com.neo.mapper.two.User2Mapper; +import com.neo.model.User; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class UserMapperTest { + @Autowired + private User1Mapper user1Mapper; + @Autowired + private User2Mapper user2Mapper; + + @Test + public void testInsert() throws Exception { + user1Mapper.insert(new User("aa111", "a123456", UserSexEnum.MAN)); + user1Mapper.insert(new User("bb111", "b123456", UserSexEnum.WOMAN)); + user2Mapper.insert(new User("cc222", "b123456", UserSexEnum.MAN)); + } +} diff --git "a/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/users.sql" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/users.sql" new file mode 100644 index 0000000..660b8b8 --- /dev/null +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-multi-mybatis-xml/users.sql" @@ -0,0 +1,15 @@ +SET FOREIGN_KEY_CHECKS=0; + +-- ---------------------------- +-- Table structure for `users` +-- ---------------------------- +DROP TABLE IF EXISTS `users`; +CREATE TABLE `users` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id', + `userName` varchar(32) DEFAULT NULL COMMENT '用户名', + `passWord` varchar(32) DEFAULT NULL COMMENT '密码', + `user_sex` varchar(32) DEFAULT NULL, + `nick_name` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; + diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/pom.xml" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/pom.xml" similarity index 85% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/pom.xml" rename to "\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/pom.xml" index 6d8803f..aa93752 100644 --- "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/pom.xml" +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/pom.xml" @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 1.5.8.RELEASE + 2.1.0.RELEASE @@ -24,15 +24,6 @@ - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-test - test - org.springframework.boot spring-boot-starter-web @@ -40,16 +31,16 @@ org.mybatis.spring.boot mybatis-spring-boot-starter - 1.3.1 + 1.3.2 mysql mysql-connector-java - org.apache.commons - commons-lang3 - 3.6 + org.springframework.boot + spring-boot-starter-test + test org.springframework.boot diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/java/com/neo/Application.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/MXApplication.java" similarity index 78% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/java/com/neo/Application.java" rename to "\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/MXApplication.java" index 8f280fe..5caeec4 100644 --- "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/java/com/neo/Application.java" +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/MXApplication.java" @@ -6,9 +6,9 @@ @SpringBootApplication @MapperScan("com.neo.mapper") -public class Application { +public class MXApplication { public static void main(String[] args) { - SpringApplication.run(Application.class, args); + SpringApplication.run(MXApplication.class, args); } } diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/java/com/neo/enums/UserSexEnum.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/enums/UserSexEnum.java" similarity index 100% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/java/com/neo/enums/UserSexEnum.java" rename to "\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/enums/UserSexEnum.java" diff --git "a/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/mapper/UserMapper.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/mapper/UserMapper.java" new file mode 100644 index 0000000..2b92d3a --- /dev/null +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/mapper/UserMapper.java" @@ -0,0 +1,24 @@ +package com.neo.mapper; + +import java.util.List; + +import com.neo.model.User; +import com.neo.param.UserParam; + +public interface UserMapper { + + List getAll(); + + List getList(UserParam userParam); + + int getCount(UserParam userParam); + + User getOne(Long id); + + void insert(User user); + + int update(User user); + + int delete(Long id); + +} \ No newline at end of file diff --git "a/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/model/User.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/model/User.java" new file mode 100644 index 0000000..561fbdd --- /dev/null +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/model/User.java" @@ -0,0 +1,77 @@ +package com.neo.model; + +import java.io.Serializable; + +import com.neo.enums.UserSexEnum; + +public class User implements Serializable { + + private static final long serialVersionUID = 1L; + private Long id; + private String userName; + private String passWord; + private UserSexEnum userSex; + private String nickName; + + public User() { + super(); + } + + public User(String userName, String passWord, UserSexEnum userSex) { + super(); + this.passWord = passWord; + this.userName = userName; + this.userSex = userSex; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getPassWord() { + return passWord; + } + + public void setPassWord(String passWord) { + this.passWord = passWord; + } + + public UserSexEnum getUserSex() { + return userSex; + } + + public void setUserSex(UserSexEnum userSex) { + this.userSex = userSex; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + @Override + public String toString() { + return "UserEntity{" + + "id=" + id + + ", userName='" + userName + '\'' + + ", passWord='" + passWord + '\'' + + ", userSex=" + userSex + + ", nickName='" + nickName + '\'' + + '}'; + } +} \ No newline at end of file diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/param/PageParam.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/param/PageParam.java" similarity index 77% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/param/PageParam.java" rename to "\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/param/PageParam.java" index ae979ab..1fbad44 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/param/PageParam.java" +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/param/PageParam.java" @@ -1,7 +1,5 @@ package com.neo.param; -import org.apache.commons.lang3.builder.ToStringBuilder; - public class PageParam { private int beginLine; //起始行 private Integer pageSize = 3; @@ -27,9 +25,12 @@ public void setCurrentPage(Integer currentPage) { this.currentPage = currentPage; } - @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + return "PageParam{" + + "beginLine=" + beginLine + + ", pageSize=" + pageSize + + ", currentPage=" + currentPage + + '}'; } } diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/param/UserParam.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/param/UserParam.java" similarity index 100% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/param/UserParam.java" rename to "\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/param/UserParam.java" diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/java/com/neo/result/Page.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/result/Page.java" similarity index 91% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/java/com/neo/result/Page.java" rename to "\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/result/Page.java" index d6b6aa4..63bca7e 100644 --- "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/java/com/neo/result/Page.java" +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/result/Page.java" @@ -2,7 +2,6 @@ import com.neo.param.PageParam; -import org.apache.commons.lang3.builder.ToStringBuilder; import java.io.Serializable; import java.util.ArrayList; @@ -90,6 +89,11 @@ public void setList(List list) { @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + return "Page{" + + "currentPage=" + currentPage + + ", totalPage=" + totalPage + + ", totalNumber=" + totalNumber + + ", list=" + list + + '}'; } } diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/java/com/neo/web/UserController.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/web/UserController.java" similarity index 68% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/java/com/neo/web/UserController.java" rename to "\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/web/UserController.java" index 9e709d3..538f1ba 100644 --- "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/java/com/neo/web/UserController.java" +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/java/com/neo/web/UserController.java" @@ -2,14 +2,13 @@ import java.util.List; +import com.neo.model.User; import com.neo.param.UserParam; import com.neo.result.Page; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import com.neo.entity.UserEntity; import com.neo.mapper.UserMapper; import javax.annotation.Resource; @@ -21,32 +20,32 @@ public class UserController { private UserMapper userMapper; @RequestMapping("/getUsers") - public List getUsers() { - List users=userMapper.getAll(); + public List getUsers() { + List users=userMapper.getAll(); return users; } @RequestMapping("/getList") - public Page getList(UserParam userParam) { - List users=userMapper.getList(userParam); + public Page getList(UserParam userParam) { + List users=userMapper.getList(userParam); long count=userMapper.getCount(userParam); Page page = new Page(userParam,count,users); return page; } @RequestMapping("/getUser") - public UserEntity getUser(Long id) { - UserEntity user=userMapper.getOne(id); + public User getUser(Long id) { + User user=userMapper.getOne(id); return user; } @RequestMapping("/add") - public void save(UserEntity user) { + public void save(User user) { userMapper.insert(user); } @RequestMapping(value="update") - public void update(UserEntity user) { + public void update(User user) { userMapper.update(user); } diff --git "a/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/resources/application.properties" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/resources/application.properties" new file mode 100644 index 0000000..d11f618 --- /dev/null +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/resources/application.properties" @@ -0,0 +1,10 @@ +mybatis.config-location=classpath:mybatis/mybatis-config.xml +mybatis.mapper-locations=classpath:mybatis/mapper/*.xml +mybatis.type-aliases-package=com.neo.model + +spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.username=root +spring.datasource.password=root +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +logging.level.com.neo.mapper=debug \ No newline at end of file diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/resources/mybatis/mapper/UserMapper.xml" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/resources/mybatis/mapper/UserMapper.xml" similarity index 92% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/resources/mybatis/mapper/UserMapper.xml" rename to "\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/resources/mybatis/mapper/UserMapper.xml" index fade284..6002e5d 100644 --- "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/resources/mybatis/mapper/UserMapper.xml" +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/resources/mybatis/mapper/UserMapper.xml" @@ -1,7 +1,7 @@ - + @@ -53,7 +53,7 @@ WHERE id = #{id} - + INSERT INTO users (userName,passWord,user_sex) @@ -61,7 +61,7 @@ (#{userName}, #{passWord}, #{userSex}) - + UPDATE users SET diff --git "a/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/resources/mybatis/mybatis-config.xml" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/resources/mybatis/mybatis-config.xml" new file mode 100644 index 0000000..56097ff --- /dev/null +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/main/resources/mybatis/mybatis-config.xml" @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/test/java/com/neo/ApplicationTests.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/test/java/com/neo/MXApplicationTests.java" similarity index 90% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/test/java/com/neo/ApplicationTests.java" rename to "\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/test/java/com/neo/MXApplicationTests.java" index 569db81..83c6b0b 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/test/java/com/neo/ApplicationTests.java" +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/test/java/com/neo/MXApplicationTests.java" @@ -7,7 +7,7 @@ @RunWith(SpringRunner.class) @SpringBootTest -public class ApplicationTests { +public class MXApplicationTests { @Test public void contextLoads() { diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/test/java/com/neo/mapper/UserMapperTest.java" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/test/java/com/neo/mapper/UserMapperTest.java" similarity index 60% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/test/java/com/neo/mapper/UserMapperTest.java" rename to "\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/test/java/com/neo/mapper/UserMapperTest.java" index b9179e5..117a9a7 100644 --- "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/test/java/com/neo/mapper/UserMapperTest.java" +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/src/test/java/com/neo/mapper/UserMapperTest.java" @@ -2,16 +2,15 @@ import java.util.List; +import com.neo.model.User; import com.neo.param.UserParam; import com.neo.result.Page; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; -import com.neo.entity.UserEntity; import com.neo.enums.UserSexEnum; import javax.annotation.Resource; @@ -23,30 +22,45 @@ public class UserMapperTest { @Resource private UserMapper userMapper; + + @Test + public void testUser() { + //增加 + userMapper.insert(new User("aa", "a123456", UserSexEnum.MAN)); + //删除 + int count=userMapper.delete(2l); + User user = userMapper.getOne(1l); + user.setNickName("smile"); + //修改 + userMapper.update(user); + //查询 + List users = userMapper.getAll(); + } + @Test public void testInsert() { - userMapper.insert(new UserEntity("aa", "a123456", UserSexEnum.MAN)); - userMapper.insert(new UserEntity("bb", "b123456", UserSexEnum.WOMAN)); - userMapper.insert(new UserEntity("cc", "b123456", UserSexEnum.WOMAN)); + userMapper.insert(new User("aa", "a123456", UserSexEnum.MAN)); + userMapper.insert(new User("bb", "b123456", UserSexEnum.WOMAN)); + userMapper.insert(new User("cc", "b123456", UserSexEnum.WOMAN)); Assert.assertEquals(3, userMapper.getAll().size()); } @Test public void testQuery() { - List users = userMapper.getAll(); + List users = userMapper.getAll(); if(users==null || users.size()==0){ System.out.println("is null"); }else{ - System.out.println(users.toString()); + System.out.println("users list is :"+users.toString()); } } @Test public void testUpdate() { - long id=30l; - UserEntity user = userMapper.getOne(id); + long id=1l; + User user = userMapper.getOne(id); if(user!=null){ System.out.println(user.toString()); user.setNickName("neo"); @@ -72,11 +86,11 @@ public void testDelete() { @Test public void testPage() { UserParam userParam=new UserParam(); - userParam.setUserSex("WOMAN"); - userParam.setCurrentPage(1); - List users=userMapper.getList(userParam); +// userParam.setUserSex("WOMAN"); + userParam.setCurrentPage(0);//0 是第一页,1 是第二页 依次类推 + List users=userMapper.getList(userParam); long count=userMapper.getCount(userParam); Page page = new Page(userParam,count,users); - System.out.println(page); + System.out.println("page == " +page); } } \ No newline at end of file diff --git "a/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/users.sql" "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/users.sql" new file mode 100644 index 0000000..e331f03 --- /dev/null +++ "b/\347\254\254 3-2 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis XML \351\205\215\347\275\256\347\211\210/spring-boot-mybatis-xml/users.sql" @@ -0,0 +1,17 @@ + + +SET FOREIGN_KEY_CHECKS=0; + +-- ---------------------------- +-- Table structure for `users` +-- ---------------------------- +DROP TABLE IF EXISTS `users`; +CREATE TABLE `users` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id', + `userName` varchar(32) DEFAULT NULL COMMENT '用户名', + `passWord` varchar(32) DEFAULT NULL COMMENT '密码', + `user_sex` varchar(32) DEFAULT NULL, + `nick_name` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; + diff --git "a/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/pom.xml" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/pom.xml" new file mode 100644 index 0000000..304582a --- /dev/null +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/pom.xml" @@ -0,0 +1,65 @@ + + + 4.0.0 + + com.neo + spring-boot-multi-mybatis-annotation + 1.0.0 + jar + + spring-boot-multi-mybatis-annotation + Demo project for Spring Boot and mybatis with annotation + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + 1.3.2 + + + mysql + mysql-connector-java + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-devtools + true + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + + + + + diff --git "a/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/MMAApplication.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/MMAApplication.java" new file mode 100644 index 0000000..71f2ed1 --- /dev/null +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/MMAApplication.java" @@ -0,0 +1,12 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class MMAApplication { + + public static void main(String[] args) { + SpringApplication.run(MMAApplication.class, args); + } +} diff --git "a/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/datasource/DataSource1Config.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/datasource/DataSource1Config.java" new file mode 100644 index 0000000..d590215 --- /dev/null +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/datasource/DataSource1Config.java" @@ -0,0 +1,48 @@ +package com.neo.datasource; + +import org.apache.ibatis.session.SqlSessionFactory; +import org.mybatis.spring.SqlSessionFactoryBean; +import org.mybatis.spring.SqlSessionTemplate; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.jdbc.DataSourceBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.jdbc.datasource.DataSourceTransactionManager; + +import javax.sql.DataSource; + +@Configuration +@MapperScan(basePackages = "com.neo.mapper.test1", sqlSessionTemplateRef = "test1SqlSessionTemplate") +public class DataSource1Config { + + @Bean(name = "test1DataSource") + @ConfigurationProperties(prefix = "spring.datasource.test1") + @Primary + public DataSource testDataSource() { + return DataSourceBuilder.create().build(); + } + + @Bean(name = "test1SqlSessionFactory") + @Primary + public SqlSessionFactory testSqlSessionFactory(@Qualifier("test1DataSource") DataSource dataSource) throws Exception { + SqlSessionFactoryBean bean = new SqlSessionFactoryBean(); + bean.setDataSource(dataSource); + return bean.getObject(); + } + + @Bean(name = "test1TransactionManager") + @Primary + public DataSourceTransactionManager testTransactionManager(@Qualifier("test1DataSource") DataSource dataSource) { + return new DataSourceTransactionManager(dataSource); + } + + @Bean(name = "test1SqlSessionTemplate") + @Primary + public SqlSessionTemplate testSqlSessionTemplate(@Qualifier("test1SqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception { + return new SqlSessionTemplate(sqlSessionFactory); + } + +} diff --git "a/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/datasource/DataSource2Config.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/datasource/DataSource2Config.java" new file mode 100644 index 0000000..02bbe33 --- /dev/null +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/datasource/DataSource2Config.java" @@ -0,0 +1,43 @@ +package com.neo.datasource; + +import org.apache.ibatis.session.SqlSessionFactory; +import org.mybatis.spring.SqlSessionFactoryBean; +import org.mybatis.spring.SqlSessionTemplate; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.jdbc.DataSourceBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.jdbc.datasource.DataSourceTransactionManager; + +import javax.sql.DataSource; + +@Configuration +@MapperScan(basePackages = "com.neo.mapper.test2", sqlSessionTemplateRef = "test2SqlSessionTemplate") +public class DataSource2Config { + + @Bean(name = "test2DataSource") + @ConfigurationProperties(prefix = "spring.datasource.test2") + public DataSource testDataSource() { + return DataSourceBuilder.create().build(); + } + + @Bean(name = "test2SqlSessionFactory") + public SqlSessionFactory testSqlSessionFactory(@Qualifier("test2DataSource") DataSource dataSource) throws Exception { + SqlSessionFactoryBean bean = new SqlSessionFactoryBean(); + bean.setDataSource(dataSource); + return bean.getObject(); + } + + @Bean(name = "test2TransactionManager") + public DataSourceTransactionManager testTransactionManager(@Qualifier("test2DataSource") DataSource dataSource) { + return new DataSourceTransactionManager(dataSource); + } + + @Bean(name = "test2SqlSessionTemplate") + public SqlSessionTemplate testSqlSessionTemplate(@Qualifier("test2SqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception { + return new SqlSessionTemplate(sqlSessionFactory); + } + +} diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/enums/UserSexEnum.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/enums/UserSexEnum.java" similarity index 100% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/enums/UserSexEnum.java" rename to "\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/enums/UserSexEnum.java" diff --git "a/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/mapper/test1/User1Mapper.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/mapper/test1/User1Mapper.java" new file mode 100644 index 0000000..e054571 --- /dev/null +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/mapper/test1/User1Mapper.java" @@ -0,0 +1,34 @@ +package com.neo.mapper.test1; + +import com.neo.model.User; +import com.neo.enums.UserSexEnum; +import org.apache.ibatis.annotations.*; + +import java.util.List; + +public interface User1Mapper { + + @Select("SELECT * FROM users") + @Results({ + @Result(property = "userSex", column = "user_sex", javaType = UserSexEnum.class), + @Result(property = "nickName", column = "nick_name") + }) + List getAll(); + + @Select("SELECT * FROM users WHERE id = #{id}") + @Results({ + @Result(property = "userSex", column = "user_sex", javaType = UserSexEnum.class), + @Result(property = "nickName", column = "nick_name") + }) + User getOne(Long id); + + @Insert("INSERT INTO users(userName,passWord,user_sex) VALUES(#{userName}, #{passWord}, #{userSex})") + void insert(User user); + + @Update("UPDATE users SET userName=#{userName},nick_name=#{nickName} WHERE id =#{id}") + void update(User user); + + @Delete("DELETE FROM users WHERE id =#{id}") + void delete(Long id); + +} \ No newline at end of file diff --git "a/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/mapper/test2/User2Mapper.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/mapper/test2/User2Mapper.java" new file mode 100644 index 0000000..3b43853 --- /dev/null +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/mapper/test2/User2Mapper.java" @@ -0,0 +1,34 @@ +package com.neo.mapper.test2; + +import java.util.List; + +import com.neo.model.User; +import com.neo.enums.UserSexEnum; +import org.apache.ibatis.annotations.*; + +public interface User2Mapper { + + @Select("SELECT * FROM users") + @Results({ + @Result(property = "userSex", column = "user_sex", javaType = UserSexEnum.class), + @Result(property = "nickName", column = "nick_name") + }) + List getAll(); + + @Select("SELECT * FROM users WHERE id = #{id}") + @Results({ + @Result(property = "userSex", column = "user_sex", javaType = UserSexEnum.class), + @Result(property = "nickName", column = "nick_name") + }) + User getOne(Long id); + + @Insert("INSERT INTO users(userName,passWord,user_sex) VALUES(#{userName}, #{passWord}, #{userSex})") + void insert(User user); + + @Update("UPDATE users SET userName=#{userName},nick_name=#{nickName} WHERE id =#{id}") + void update(User user); + + @Delete("DELETE FROM users WHERE id =#{id}") + void delete(Long id); + +} \ No newline at end of file diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/entity/UserEntity.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/model/User.java" similarity index 78% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/entity/UserEntity.java" rename to "\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/model/User.java" index 0a88b17..de50165 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/entity/UserEntity.java" +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/model/User.java" @@ -1,11 +1,10 @@ -package com.neo.entity; +package com.neo.model; import java.io.Serializable; import com.neo.enums.UserSexEnum; -import org.apache.commons.lang3.builder.ToStringBuilder; -public class UserEntity implements Serializable { +public class User implements Serializable { private static final long serialVersionUID = 1L; private Long id; @@ -14,11 +13,11 @@ public class UserEntity implements Serializable { private UserSexEnum userSex; private String nickName; - public UserEntity() { + public User() { super(); } - public UserEntity(String userName, String passWord, UserSexEnum userSex) { + public User(String userName, String passWord, UserSexEnum userSex) { super(); this.passWord = passWord; this.userName = userName; @@ -67,7 +66,8 @@ public void setNickName(String nickName) { @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + // TODO Auto-generated method stub + return "userName " + this.userName + ", pasword " + this.passWord + "sex " + userSex.name(); } } \ No newline at end of file diff --git "a/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/web/UserController.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/web/UserController.java" new file mode 100644 index 0000000..f5e4810 --- /dev/null +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/java/com/neo/web/UserController.java" @@ -0,0 +1,50 @@ +package com.neo.web; + +import java.util.List; + +import com.neo.mapper.test1.User1Mapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.neo.model.User; +import com.neo.mapper.test2.User2Mapper; + +@RestController +public class UserController { + + @Autowired + private User1Mapper user1Mapper; + + @Autowired + private User2Mapper user2Mapper; + + @RequestMapping("/getUsers") + public List getUsers() { + List users=user1Mapper.getAll(); + return users; + } + + @RequestMapping("/getUser") + public User getUser(Long id) { + User user=user2Mapper.getOne(id); + return user; + } + + @RequestMapping("/add") + public void save(User user) { + user2Mapper.insert(user); + } + + @RequestMapping(value="update") + public void update(User user) { + user2Mapper.update(user); + } + + @RequestMapping(value="/delete/{id}") + public void delete(@PathVariable("id") Long id) { + user1Mapper.delete(id); + } + +} \ No newline at end of file diff --git "a/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/resources/application.properties" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/resources/application.properties" new file mode 100644 index 0000000..819d06c --- /dev/null +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/main/resources/application.properties" @@ -0,0 +1,12 @@ +mybatis.type-aliases-package=com.neo.model + +spring.datasource.test1.jdbc-url=jdbc:mysql://localhost:3306/test1?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.test1.username=root +spring.datasource.test1.password=root +spring.datasource.test1.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.datasource.test2.jdbc-url=jdbc:mysql://localhost:3306/test2?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.test2.username=root +spring.datasource.test2.password=root +spring.datasource.test2.driver-class-name=com.mysql.cj.jdbc.Driver + diff --git "a/\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-scheduler/src/test/java/com/neo/SchedulerApplicationTests.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/test/java/com/neo/MMAApplicationTests.java" similarity index 88% rename from "\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-scheduler/src/test/java/com/neo/SchedulerApplicationTests.java" rename to "\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/test/java/com/neo/MMAApplicationTests.java" index 9a627ba..9bb44dd 100644 --- "a/\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-scheduler/src/test/java/com/neo/SchedulerApplicationTests.java" +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/test/java/com/neo/MMAApplicationTests.java" @@ -7,7 +7,7 @@ @RunWith(SpringRunner.class) @SpringBootTest -public class SchedulerApplicationTests { +public class MMAApplicationTests { @Test public void contextLoads() { diff --git "a/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/test/java/com/neo/mapper/User1MapperTest.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/test/java/com/neo/mapper/User1MapperTest.java" new file mode 100644 index 0000000..3960d2c --- /dev/null +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/test/java/com/neo/mapper/User1MapperTest.java" @@ -0,0 +1,52 @@ +package com.neo.mapper; + +import java.util.List; + +import com.neo.mapper.test1.User1Mapper; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import com.neo.model.User; +import com.neo.enums.UserSexEnum; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class User1MapperTest { + + @Autowired + private User1Mapper userMapper; + + @Test + public void testInsert() throws Exception { + userMapper.insert(new User("aa", "a123456", UserSexEnum.MAN)); + userMapper.insert(new User("bb", "b123456", UserSexEnum.WOMAN)); + userMapper.insert(new User("cc", "b123456", UserSexEnum.WOMAN)); + +// Assert.assertEquals(3, userMapper.getAll().size()); + } + + @Test + public void testQuery() throws Exception { + List users = userMapper.getAll(); + if(users==null || users.size()==0){ + System.out.println("is null"); + }else{ + System.out.println("users.size === "+users.size()); + } + } + + + @Test + public void testUpdate() throws Exception { + User user = userMapper.getOne(6l); + System.out.println(user.toString()); + user.setNickName("neo"); + userMapper.update(user); + Assert.assertTrue(("neo".equals(userMapper.getOne(6l).getNickName()))); + } + +} \ No newline at end of file diff --git "a/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/test/java/com/neo/mapper/User2MapperTest.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/test/java/com/neo/mapper/User2MapperTest.java" new file mode 100644 index 0000000..8c2f85c --- /dev/null +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/test/java/com/neo/mapper/User2MapperTest.java" @@ -0,0 +1,51 @@ +package com.neo.mapper; + +import com.neo.model.User; +import com.neo.enums.UserSexEnum; +import com.neo.mapper.test2.User2Mapper; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.List; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class User2MapperTest { + + @Autowired + private User2Mapper userMapper; + + @Test + public void testInsert() throws Exception { + userMapper.insert(new User("aa", "a123456", UserSexEnum.MAN)); + userMapper.insert(new User("bb", "b123456", UserSexEnum.WOMAN)); + userMapper.insert(new User("cc", "b123456", UserSexEnum.WOMAN)); + + Assert.assertEquals(3, userMapper.getAll().size()); + } + + @Test + public void testQuery() throws Exception { + List users = userMapper.getAll(); + if(users==null || users.size()==0){ + System.out.println("is null"); + }else{ + System.out.println(users.toString()); + } + } + + + @Test + public void testUpdate() throws Exception { + User user = userMapper.getOne(30L); + System.out.println(user.toString()); + user.setNickName("neo"); + userMapper.update(user); + Assert.assertTrue(("neo".equals(userMapper.getOne(30L).getNickName()))); + } + +} \ No newline at end of file diff --git "a/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/test/java/com/neo/mapper/UserMapperTest.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/test/java/com/neo/mapper/UserMapperTest.java" new file mode 100644 index 0000000..7edd2dd --- /dev/null +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-multi-mybatis-annotation/src/test/java/com/neo/mapper/UserMapperTest.java" @@ -0,0 +1,27 @@ +package com.neo.mapper; + +import com.neo.enums.UserSexEnum; +import com.neo.mapper.test1.User1Mapper; +import com.neo.mapper.test2.User2Mapper; +import com.neo.model.User; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class UserMapperTest { + @Autowired + private User1Mapper user1Mapper; + @Autowired + private User2Mapper user2Mapper; + + @Test + public void testInsert() throws Exception { + user1Mapper.insert(new User("aa111", "a123456", UserSexEnum.MAN)); + user1Mapper.insert(new User("bb111", "b123456", UserSexEnum.WOMAN)); + user2Mapper.insert(new User("cc222", "b123456", UserSexEnum.MAN)); + } +} diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/pom.xml" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/pom.xml" similarity index 85% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/pom.xml" rename to "\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/pom.xml" index 754ee05..cdfcc71 100644 --- "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/pom.xml" +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/pom.xml" @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 1.5.8.RELEASE + 2.1.0.RELEASE @@ -24,10 +24,6 @@ - - org.springframework.boot - spring-boot-starter - org.springframework.boot spring-boot-starter-test @@ -40,17 +36,12 @@ org.mybatis.spring.boot mybatis-spring-boot-starter - 1.3.1 + 1.3.2 mysql mysql-connector-java - - org.apache.commons - commons-lang3 - 3.6 - org.springframework.boot spring-boot-devtools diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/Application.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/MAApplication.java" similarity index 78% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/Application.java" rename to "\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/MAApplication.java" index 8f280fe..f2fed1d 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/Application.java" +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/MAApplication.java" @@ -6,9 +6,9 @@ @SpringBootApplication @MapperScan("com.neo.mapper") -public class Application { +public class MAApplication { public static void main(String[] args) { - SpringApplication.run(Application.class, args); + SpringApplication.run(MAApplication.class, args); } } diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/enums/UserSexEnum.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/enums/UserSexEnum.java" similarity index 100% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/enums/UserSexEnum.java" rename to "\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/enums/UserSexEnum.java" diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/mapper/UserMapper.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/mapper/UserMapper.java" similarity index 58% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/mapper/UserMapper.java" rename to "\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/mapper/UserMapper.java" index 15274cb..90b71fa 100644 --- "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/mapper/UserMapper.java" +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/mapper/UserMapper.java" @@ -1,11 +1,12 @@ package com.neo.mapper; import java.util.List; +import java.util.Map; import com.neo.param.UserParam; import org.apache.ibatis.annotations.*; -import com.neo.entity.UserEntity; +import com.neo.model.User; import com.neo.enums.UserSexEnum; public interface UserMapper { @@ -15,10 +16,16 @@ public interface UserMapper { @Result(property = "userSex", column = "user_sex", javaType = UserSexEnum.class), @Result(property = "nickName", column = "nick_name") }) - List getAll(); + List getAll(); @SelectProvider(type = UserSql.class, method = "getList") - List getList(UserParam userParam); + List getList(UserParam userParam); + + @Select("SELECT * FROM users WHERE user_sex = #{user_sex}") + List getListByUserSex(@Param("user_sex") String userSex); + + @Select("SELECT * FROM users WHERE username=#{username} AND user_sex = #{user_sex}") + List getListByNameAndSex(Map map); @SelectProvider(type = UserSql.class, method = "getCount") int getCount(UserParam userParam); @@ -28,13 +35,23 @@ public interface UserMapper { @Result(property = "userSex", column = "user_sex", javaType = UserSexEnum.class), @Result(property = "nickName", column = "nick_name") }) - UserEntity getOne(Long id); + User getOne(Long id); @Insert("INSERT INTO users(userName,passWord,user_sex) VALUES(#{userName}, #{passWord}, #{userSex})") - void insert(UserEntity user); + void insert(User user); @Update("UPDATE users SET userName=#{userName},nick_name=#{nickName} WHERE id =#{id}") - void update(UserEntity user); + void update(User user); + + @Update({""}) + void updateUser(User user); @Delete("DELETE FROM users WHERE id =#{id}") void delete(Long id); diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/mapper/UserSql.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/mapper/UserSql.java" similarity index 81% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/mapper/UserSql.java" rename to "\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/mapper/UserSql.java" index f1dc0cb..9cfcc43 100644 --- "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/mapper/UserSql.java" +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/mapper/UserSql.java" @@ -1,10 +1,10 @@ package com.neo.mapper; import com.neo.param.UserParam; -import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.jdbc.SQL; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.util.StringUtils; public class UserSql { @@ -14,10 +14,10 @@ public String getList(UserParam userParam) { StringBuffer sql = new StringBuffer("select id, userName, passWord, user_sex as userSex, nick_name as nickName"); sql.append(" from users where 1=1 "); if (userParam != null) { - if (StringUtils.isNotBlank(userParam.getUserName())) { + if (!StringUtils.isEmpty(userParam.getUserName())) { sql.append(" and userName = #{userName}"); } - if (StringUtils.isNotBlank(userParam.getUserSex())) { + if (!StringUtils.isEmpty(userParam.getUserSex())) { sql.append(" and user_sex = #{userSex}"); } } @@ -31,10 +31,10 @@ public String getCount(UserParam userParam) { String sql= new SQL(){{ SELECT("count(1)"); FROM("users"); - if (StringUtils.isNotBlank(userParam.getUserName())) { + if (!StringUtils.isEmpty(userParam.getUserName())) { WHERE("userName = #{userName}"); } - if (StringUtils.isNotBlank(userParam.getUserSex())) { + if (!StringUtils.isEmpty(userParam.getUserSex())) { WHERE("user_sex = #{userSex}"); } //从这个toString可以看出,其内部使用高效的StringBuilder实现SQL拼接 diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/entity/UserEntity.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/model/User.java" similarity index 74% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/entity/UserEntity.java" rename to "\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/model/User.java" index 0a88b17..a459a82 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/entity/UserEntity.java" +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/model/User.java" @@ -1,11 +1,10 @@ -package com.neo.entity; +package com.neo.model; import java.io.Serializable; import com.neo.enums.UserSexEnum; -import org.apache.commons.lang3.builder.ToStringBuilder; -public class UserEntity implements Serializable { +public class User implements Serializable { private static final long serialVersionUID = 1L; private Long id; @@ -14,11 +13,11 @@ public class UserEntity implements Serializable { private UserSexEnum userSex; private String nickName; - public UserEntity() { + public User() { super(); } - public UserEntity(String userName, String passWord, UserSexEnum userSex) { + public User(String userName, String passWord, UserSexEnum userSex) { super(); this.passWord = passWord; this.userName = userName; @@ -67,7 +66,12 @@ public void setNickName(String nickName) { @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + return "User{" + + "id=" + id + + ", userName='" + userName + '\'' + + ", passWord='" + passWord + '\'' + + ", userSex=" + userSex + + ", nickName='" + nickName + '\'' + + '}'; } - } \ No newline at end of file diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/param/PageParam.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/param/PageParam.java" similarity index 77% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/param/PageParam.java" rename to "\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/param/PageParam.java" index ae979ab..af9f546 100644 --- "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/param/PageParam.java" +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/param/PageParam.java" @@ -1,6 +1,5 @@ package com.neo.param; -import org.apache.commons.lang3.builder.ToStringBuilder; public class PageParam { private int beginLine; //起始行 @@ -27,9 +26,12 @@ public void setCurrentPage(Integer currentPage) { this.currentPage = currentPage; } - @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + return "PageParam{" + + "beginLine=" + beginLine + + ", pageSize=" + pageSize + + ", currentPage=" + currentPage + + '}'; } } diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/param/UserParam.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/param/UserParam.java" similarity index 100% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/param/UserParam.java" rename to "\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/param/UserParam.java" diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/result/Page.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/result/Page.java" similarity index 89% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/result/Page.java" rename to "\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/result/Page.java" index d6b6aa4..450037c 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/result/Page.java" +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/result/Page.java" @@ -2,7 +2,6 @@ import com.neo.param.PageParam; -import org.apache.commons.lang3.builder.ToStringBuilder; import java.io.Serializable; import java.util.ArrayList; @@ -16,7 +15,7 @@ public class Page implements Serializable { private static final long serialVersionUID = -2020350783443768083L; - private int currentPage = 1; //当前页数 + private int currentPage = 0; //当前页数 private long totalPage; //总页数 private long totalNumber; //总记录数 private List list; //数据集 @@ -90,6 +89,11 @@ public void setList(List list) { @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + return "Page{" + + "currentPage=" + currentPage + + ", totalPage=" + totalPage + + ", totalNumber=" + totalNumber + + ", list=" + list + + '}'; } } diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/web/UserController.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/web/UserController.java" similarity index 72% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/web/UserController.java" rename to "\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/web/UserController.java" index 31b355e..802002d 100644 --- "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/web/UserController.java" +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/java/com/neo/web/UserController.java" @@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import com.neo.entity.UserEntity; +import com.neo.model.User; import com.neo.mapper.UserMapper; @RestController @@ -19,32 +19,32 @@ public class UserController { private UserMapper userMapper; @RequestMapping("/getUsers") - public List getUsers() { - List users=userMapper.getAll(); + public List getUsers() { + List users=userMapper.getAll(); return users; } @RequestMapping("/getList") - public Page getList(UserParam userParam) { - List users=userMapper.getList(userParam); + public Page getList(UserParam userParam) { + List users=userMapper.getList(userParam); long count=userMapper.getCount(userParam); Page page = new Page(userParam,count,users); return page; } @RequestMapping("/getUser") - public UserEntity getUser(Long id) { - UserEntity user=userMapper.getOne(id); + public User getUser(Long id) { + User user=userMapper.getOne(id); return user; } @RequestMapping("/add") - public void save(UserEntity user) { + public void save(User user) { userMapper.insert(user); } @RequestMapping(value="update") - public void update(UserEntity user) { + public void update(User user) { userMapper.update(user); } diff --git "a/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/resources/application.properties" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/resources/application.properties" new file mode 100644 index 0000000..30aedb1 --- /dev/null +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/main/resources/application.properties" @@ -0,0 +1,6 @@ +mybatis.type-aliases-package=com.neo.model + +spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.username=root +spring.datasource.password=root +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/test/java/com/neo/ApplicationTests.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/test/java/com/neo/ApplicationTests.java" similarity index 100% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/test/java/com/neo/ApplicationTests.java" rename to "\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/test/java/com/neo/ApplicationTests.java" diff --git "a/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/test/java/com/neo/mapper/UserMapperTest.java" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/test/java/com/neo/mapper/UserMapperTest.java" new file mode 100644 index 0000000..65c988a --- /dev/null +++ "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/src/test/java/com/neo/mapper/UserMapperTest.java" @@ -0,0 +1,71 @@ +package com.neo.mapper; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.neo.param.UserParam; +import com.neo.result.Page; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import com.neo.model.User; +import com.neo.enums.UserSexEnum; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class UserMapperTest { + + @Autowired + private UserMapper userMapper; + + @Test + public void testInsert() throws Exception { + userMapper.insert(new User("aa", "a123456", UserSexEnum.MAN)); + userMapper.insert(new User("bb", "b123456", UserSexEnum.WOMAN)); + userMapper.insert(new User("cc", "b123456", UserSexEnum.WOMAN)); + +// Assert.assertEquals(3, userMapper.getAll().size()); + } + + @Test + public void testQuery() throws Exception { +// List users = userMapper.getAll(); +// List users = userMapper.getListByUserSex("MAN"); + Map param= new HashMap(); + param.put("username","aa"); + param.put("user_sex","MAN"); + List users = userMapper.getListByNameAndSex(param); + + System.out.println("testQuery:"+users.toString()); + } + + + @Test + public void testUpdate() throws Exception { + User user = userMapper.getOne(28L); + System.out.println("user :"+user.toString()); + user.setNickName("it"); + user.setUserName("youknow"); +// userMapper.update(user); + userMapper.updateUser(user); +// Assert.assertTrue(("neo".equals(user.getNickName()))); + } + + + @Test + public void testPage() { + UserParam userParam=new UserParam(); + userParam.setUserSex("WOMAN"); +// userParam.setUserName("neo"); + userParam.setCurrentPage(0); + List users=userMapper.getList(userParam); + long count=userMapper.getCount(userParam); + Page page = new Page(userParam,count,users); + System.out.println("page === "+page); + } +} \ No newline at end of file diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/users.sql" "b/\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/users.sql" similarity index 100% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/users.sql" rename to "\347\254\254 3-3 \350\257\276\357\274\232 \345\246\202\344\275\225\344\274\230\351\233\205\347\232\204\344\275\277\347\224\250 MyBatis \346\263\250\350\247\243\347\211\210/spring-boot-mybatis-annotation/users.sql" diff --git "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-Jpa/pom.xml" "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/pom.xml" similarity index 95% rename from "\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-Jpa/pom.xml" rename to "\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/pom.xml" index fe84963..b42ead5 100644 --- "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-Jpa/pom.xml" +++ "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/pom.xml" @@ -5,7 +5,7 @@ com.neo spring-boot-Jpa - 0.0.1-SNAPSHOT + 1.0.0 jar spring-boot-Jpa @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 1.5.8.RELEASE + 2.1.0.RELEASE @@ -49,5 +49,4 @@ - diff --git "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-Jpa/src/main/java/com/neo/JpaApplication.java" "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/JpaApplication.java" similarity index 100% rename from "\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-Jpa/src/main/java/com/neo/JpaApplication.java" rename to "\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/JpaApplication.java" diff --git "a/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/model/Address.java" "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/model/Address.java" new file mode 100644 index 0000000..883ea20 --- /dev/null +++ "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/model/Address.java" @@ -0,0 +1,59 @@ +package com.neo.model; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; + +@Entity +public class Address { + + @Id + @GeneratedValue + private Long id; + @Column(nullable = false) + private Long userId; + private String province; + private String city; + private String street; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getProvince() { + return province; + } + + public void setProvince(String province) { + this.province = province; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getStreet() { + return street; + } + + public void setStreet(String street) { + this.street = street; + } +} diff --git "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/domain/User.java" "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/model/User.java" similarity index 93% rename from "\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/domain/User.java" rename to "\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/model/User.java" index 76234d4..7ec1e8b 100644 --- "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/domain/User.java" +++ "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/model/User.java" @@ -1,4 +1,4 @@ -package com.neo.domain; +package com.neo.model; @@ -10,9 +10,8 @@ import java.io.Serializable; @Entity -public class User implements Serializable { +public class User { - private static final long serialVersionUID = 1L; @Id @GeneratedValue private Long id; diff --git "a/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/model/UserDetail.java" "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/model/UserDetail.java" new file mode 100644 index 0000000..4f3c67d --- /dev/null +++ "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/model/UserDetail.java" @@ -0,0 +1,102 @@ +package com.neo.model; + + +import org.hibernate.annotations.Fetch; +import org.hibernate.annotations.FetchMode; + +import javax.persistence.*; +import java.io.Serializable; + +@Entity +public class UserDetail { + + @Id + @GeneratedValue + private Long id; + @Column(nullable = false, unique = true) + private Long userId; + private Integer age; + private String realName; + private String status; + private String hobby; + private String introduction; + private String lastLoginIp; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Integer getAge() { + return age; + } + + public void setAge(Integer age) { + this.age = age; + } + + public String getRealName() { + return realName; + } + + public void setRealName(String realName) { + this.realName = realName; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getHobby() { + return hobby; + } + + public void setHobby(String hobby) { + this.hobby = hobby; + } + + public String getIntroduction() { + return introduction; + } + + public void setIntroduction(String introduction) { + this.introduction = introduction; + } + + public String getLastLoginIp() { + return lastLoginIp; + } + + public void setLastLoginIp(String lastLoginIp) { + this.lastLoginIp = lastLoginIp; + } + + @Override + public String toString() { + return "UserDetail{" + + "id=" + id + + ", userId=" + userId + + ", age=" + age + + ", realName='" + realName + '\'' + + ", status='" + status + '\'' + + ", hobby='" + hobby + '\'' + + ", introduction='" + introduction + '\'' + + ", lastLoginIp='" + lastLoginIp + '\'' + + '}'; + } +} diff --git "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-Jpa/src/main/java/com/neo/domain/UserInfo.java" "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/model/UserInfo.java" similarity index 65% rename from "\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-Jpa/src/main/java/com/neo/domain/UserInfo.java" rename to "\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/model/UserInfo.java" index 996de7d..5a5ae5e 100644 --- "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-Jpa/src/main/java/com/neo/domain/UserInfo.java" +++ "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/model/UserInfo.java" @@ -1,8 +1,8 @@ -package com.neo.domain; +package com.neo.model; public interface UserInfo { String getUserName(); String getEmail(); - String getAddress(); String getHobby(); + String getIntroduction(); } \ No newline at end of file diff --git "a/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/param/UserDetailParam.java" "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/param/UserDetailParam.java" new file mode 100644 index 0000000..0f7a497 --- /dev/null +++ "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/param/UserDetailParam.java" @@ -0,0 +1,65 @@ +package com.neo.param; + + +import com.neo.model.Address; +import org.hibernate.annotations.Fetch; +import org.hibernate.annotations.FetchMode; + +import javax.persistence.*; + +public class UserDetailParam { + private String userId; + private Integer minAge; + private Integer maxAge; + private String realName; + private String introduction; + private String city; + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public Integer getMinAge() { + return minAge; + } + + public void setMinAge(Integer minAge) { + this.minAge = minAge; + } + + public Integer getMaxAge() { + return maxAge; + } + + public void setMaxAge(Integer maxAge) { + this.maxAge = maxAge; + } + + public String getRealName() { + return realName; + } + + public void setRealName(String realName) { + this.realName = realName; + } + + public String getIntroduction() { + return introduction; + } + + public void setIntroduction(String introduction) { + this.introduction = introduction; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } +} diff --git "a/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/repository/AddressRepository.java" "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/repository/AddressRepository.java" new file mode 100644 index 0000000..3bba027 --- /dev/null +++ "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/repository/AddressRepository.java" @@ -0,0 +1,7 @@ +package com.neo.repository; + +import com.neo.model.Address; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface AddressRepository extends JpaRepository { +} \ No newline at end of file diff --git "a/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/repository/UserDetailRepository.java" "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/repository/UserDetailRepository.java" new file mode 100644 index 0000000..e133b05 --- /dev/null +++ "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/repository/UserDetailRepository.java" @@ -0,0 +1,20 @@ +package com.neo.repository; + +import com.neo.model.User; +import com.neo.model.UserDetail; +import com.neo.model.UserInfo; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; + +import java.util.List; + + +public interface UserDetailRepository extends JpaSpecificationExecutor,JpaRepository { + + UserDetail findByHobby(String hobby); + + @Query("select u.userName as userName, u.email as email, d.introduction as introduction , d.hobby as hobby from User u , UserDetail d " + + "where u.id=d.userId and d.hobby = ?1 ") + List findUserInfo(String hobby); +} \ No newline at end of file diff --git "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-Jpa/src/main/java/com/neo/repository/UserRepository.java" "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/repository/UserRepository.java" similarity index 86% rename from "\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-Jpa/src/main/java/com/neo/repository/UserRepository.java" rename to "\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/repository/UserRepository.java" index 4894f3a..8318068 100644 --- "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-Jpa/src/main/java/com/neo/repository/UserRepository.java" +++ "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/repository/UserRepository.java" @@ -1,18 +1,19 @@ package com.neo.repository; -import com.neo.domain.User; +import com.neo.model.User; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Slice; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.transaction.annotation.Transactional; -import java.util.List; - public interface UserRepository extends JpaRepository { + User findByUserName(String userName); + User findByUserNameOrEmail(String username, String email); @Transactional(timeout = 10) @@ -30,6 +31,10 @@ public interface UserRepository extends JpaRepository { @Query("select u from User u") Page findALL(Pageable pageable); + Page findByNickName(String nickName, Pageable pageable); + Slice findByNickNameAndEmail(String nickName, String email,Pageable pageable); + + } \ No newline at end of file diff --git "a/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/service/UserDetailService.java" "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/service/UserDetailService.java" new file mode 100644 index 0000000..a5d14ea --- /dev/null +++ "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/service/UserDetailService.java" @@ -0,0 +1,10 @@ +package com.neo.service; + +import com.neo.model.UserDetail; +import com.neo.param.UserDetailParam; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; + +public interface UserDetailService { + public Page findByCondition(UserDetailParam detailParam, Pageable pageable); +} diff --git "a/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/service/UserDetailServiceImpl.java" "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/service/UserDetailServiceImpl.java" new file mode 100644 index 0000000..18eaba9 --- /dev/null +++ "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/java/com/neo/service/UserDetailServiceImpl.java" @@ -0,0 +1,48 @@ +package com.neo.service; + +import com.mysql.cj.util.StringUtils; +import com.neo.model.UserDetail; +import com.neo.param.UserDetailParam; +import com.neo.repository.UserDetailRepository; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.persistence.criteria.Predicate; +import java.util.ArrayList; +import java.util.List; + +@Service +public class UserDetailServiceImpl implements UserDetailService{ + + @Resource + private UserDetailRepository userDetailRepository; + + @Override + public Page findByCondition(UserDetailParam detailParam, Pageable pageable){ + + return userDetailRepository.findAll((root, query, cb) -> { + List predicates = new ArrayList(); + //equal 示例 + if (!StringUtils.isNullOrEmpty(detailParam.getIntroduction())){ + predicates.add(cb.equal(root.get("introduction"),detailParam.getIntroduction())); + } + //like 示例 + if (!StringUtils.isNullOrEmpty(detailParam.getRealName())){ + predicates.add(cb.like(root.get("realName"),"%"+detailParam.getRealName()+"%")); + } + //between 示例 + if (detailParam.getMinAge()!=null && detailParam.getMaxAge()!=null) { + Predicate agePredicate = cb.between(root.get("age"), detailParam.getMinAge(), detailParam.getMaxAge()); + predicates.add(agePredicate); + } + //greaterThan 大于等于示例 + if (detailParam.getMinAge()!=null){ + predicates.add(cb.greaterThan(root.get("age"),detailParam.getMinAge())); + } + return query.where(predicates.toArray(new Predicate[predicates.size()])).getRestriction(); + }, pageable); + + } +} diff --git "a/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/resources/application.properties" "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/resources/application.properties" new file mode 100644 index 0000000..b0b5ebe --- /dev/null +++ "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/main/resources/application.properties" @@ -0,0 +1,11 @@ +spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.username=root +spring.datasource.password=root +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.properties.hibernate.hbm2ddl.auto=create +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect +#sql\u8F93\u51FA +spring.jpa.show-sql=true +#format\u4E00\u4E0Bsql\u8FDB\u884C\u8F93\u51FA +spring.jpa.properties.hibernate.format_sql=true \ No newline at end of file diff --git "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-Jpa/src/test/java/com/neo/JpaApplicationTests.java" "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/test/java/com/neo/JpaApplicationTests.java" similarity index 100% rename from "\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-Jpa/src/test/java/com/neo/JpaApplicationTests.java" rename to "\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/test/java/com/neo/JpaApplicationTests.java" diff --git "a/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/test/java/com/neo/repository/JpaSpecificationTests.java" "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/test/java/com/neo/repository/JpaSpecificationTests.java" new file mode 100644 index 0000000..751b7d3 --- /dev/null +++ "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/test/java/com/neo/repository/JpaSpecificationTests.java" @@ -0,0 +1,40 @@ +package com.neo.repository; + +import com.neo.model.UserDetail; +import com.neo.param.UserDetailParam; +import com.neo.service.UserDetailService; +import com.neo.service.UserDetailServiceImpl; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.test.context.junit4.SpringRunner; + +import javax.annotation.Resource; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class JpaSpecificationTests { + + @Resource + private UserDetailService userDetailService; + + @Test + public void testFindByCondition() { + int page=0,size=10; + Sort sort = new Sort(Sort.Direction.DESC, "id"); + Pageable pageable = PageRequest.of(page, size, sort); + UserDetailParam param=new UserDetailParam(); + param.setIntroduction("程序员"); + param.setMinAge(10); + param.setMaxAge(30); + Page page1=userDetailService.findByCondition(param,pageable); + for (UserDetail userDetail:page1){ + System.out.println("userDetail: "+userDetail.toString()); + } + } + +} \ No newline at end of file diff --git "a/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/test/java/com/neo/repository/UserDetailRepositoryTests.java" "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/test/java/com/neo/repository/UserDetailRepositoryTests.java" new file mode 100644 index 0000000..679efb1 --- /dev/null +++ "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/test/java/com/neo/repository/UserDetailRepositoryTests.java" @@ -0,0 +1,59 @@ +package com.neo.repository; + +import com.neo.model.Address; +import com.neo.model.User; +import com.neo.model.UserDetail; +import com.neo.model.UserInfo; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.test.context.junit4.SpringRunner; + +import javax.annotation.Resource; +import java.text.DateFormat; +import java.util.Date; +import java.util.List; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class UserDetailRepositoryTests { + + @Resource + private AddressRepository addressRepository; + @Resource + private UserDetailRepository userDetailRepository; + + @Test + public void testSaveAddress() { + Address address=new Address(); + address.setUserId(1L); + address.setCity("北京"); + address.setProvince("北京"); + address.setStreet("分钟寺"); + addressRepository.save(address); + } + + @Test + public void testSaveUserDetail() { + Date date = new Date(); + DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG); + String formattedDate = dateFormat.format(date); + UserDetail userDetail=new UserDetail(); + userDetail.setUserId(3L); + userDetail.setHobby("吃鸡游戏"); + userDetail.setAge(28); + userDetail.setIntroduction("一个爱玩的人"); + userDetailRepository.save(userDetail); + } + + @Test + public void testUserInfo() { + List userInfos=userDetailRepository.findUserInfo("钓鱼"); + for (UserInfo userInfo:userInfos){ + System.out.println("userInfo: "+userInfo.getUserName()+"-"+userInfo.getEmail()+"-"+userInfo.getHobby()+"-"+userInfo.getIntroduction()); + } + } +} \ No newline at end of file diff --git "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-Jpa/src/test/java/com/neo/repository/UserRepositoryTests.java" "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/test/java/com/neo/repository/UserRepositoryTests.java" similarity index 73% rename from "\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-Jpa/src/test/java/com/neo/repository/UserRepositoryTests.java" rename to "\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/test/java/com/neo/repository/UserRepositoryTests.java" index bcbee16..c689ce5 100644 --- "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-Jpa/src/test/java/com/neo/repository/UserRepositoryTests.java" +++ "b/\347\254\254 3-4 \350\257\276\357\274\232 Spring Data JPA \347\232\204\345\237\272\346\234\254\344\275\277\347\224\250/spring-boot-jpa/src/test/java/com/neo/repository/UserRepositoryTests.java" @@ -1,10 +1,8 @@ package com.neo.repository; -import com.neo.domain.User; -import org.junit.Assert; +import com.neo.model.User; import org.junit.Test; import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; @@ -32,8 +30,8 @@ public void testSave() { userRepository.save(new User("bb", "bb123456","bb@126.com", "bb", formattedDate)); userRepository.save(new User("cc", "cc123456","cc@126.com", "cc", formattedDate)); - Assert.assertEquals(3, userRepository.findAll()); - Assert.assertEquals("bb", userRepository.findByUserNameOrEmail("bb", "bb@126.com").getNickName()); +// Assert.assertEquals(3, userRepository.findAll().size()); +// Assert.assertEquals("bb", userRepository.findByUserNameOrEmail("bb", "bb@126.com").getNickName()); // userRepository.delete(userRepository.findByUserName("aa")); } @@ -44,19 +42,19 @@ public void testBaseQuery() { DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG); String formattedDate = dateFormat.format(date); User user=new User("ff", "ff123456","ff@126.com", "ff", formattedDate); -// userRepository.findAll(); -// userRepository.findOne(3l); -// userRepository.save(user); -// user.setId(2l); -// userRepository.delete(user); -// userRepository.count(); - userRepository.exists(3l); + userRepository.findAll(); + userRepository.findById(3L); + userRepository.save(user); + user.setId(2L); + userRepository.delete(user); + userRepository.count(); + userRepository.existsById(3L); } @Test public void testCustomSql() { - userRepository.modifyById("neo",3l); -// userRepository.deleteById(3l); + userRepository.modifyById("neo",3L); + userRepository.deleteById(3L); userRepository.findByEmail("ff@126.com"); } @@ -65,7 +63,7 @@ public void testCustomSql() { public void testPageQuery() { int page=1,size=2; Sort sort = new Sort(Sort.Direction.DESC, "id"); - Pageable pageable = new PageRequest(page, size, sort); + Pageable pageable = PageRequest.of(page, size, sort); userRepository.findALL(pageable); userRepository.findByNickName("aa", pageable); } diff --git "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/pom.xml" "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/pom.xml" similarity index 89% rename from "\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/pom.xml" rename to "\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/pom.xml" index 10c41f8..b42ead5 100644 --- "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/pom.xml" +++ "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/pom.xml" @@ -4,17 +4,17 @@ 4.0.0 com.neo - spring-boot-multi-Jpa - 0.0.1-SNAPSHOT + spring-boot-Jpa + 1.0.0 jar - spring-boot-multi-Jpa + spring-boot-Jpa Demo project for Spring Boot org.springframework.boot spring-boot-starter-parent - 1.5.8.RELEASE + 2.1.0.RELEASE @@ -33,7 +33,6 @@ mysql mysql-connector-java - org.springframework.boot spring-boot-starter-test @@ -50,5 +49,4 @@ - diff --git "a/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/JpaApplication.java" "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/JpaApplication.java" new file mode 100644 index 0000000..a1b5532 --- /dev/null +++ "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/JpaApplication.java" @@ -0,0 +1,13 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.domain.EntityScan; + +@SpringBootApplication +public class JpaApplication { + + public static void main(String[] args) { + SpringApplication.run(JpaApplication.class, args); + } +} diff --git "a/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/model/Address.java" "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/model/Address.java" new file mode 100644 index 0000000..883ea20 --- /dev/null +++ "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/model/Address.java" @@ -0,0 +1,59 @@ +package com.neo.model; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; + +@Entity +public class Address { + + @Id + @GeneratedValue + private Long id; + @Column(nullable = false) + private Long userId; + private String province; + private String city; + private String street; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getProvince() { + return province; + } + + public void setProvince(String province) { + this.province = province; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getStreet() { + return street; + } + + public void setStreet(String street) { + this.street = street; + } +} diff --git "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-Jpa/src/main/java/com/neo/domain/User.java" "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/model/User.java" similarity index 93% rename from "\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-Jpa/src/main/java/com/neo/domain/User.java" rename to "\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/model/User.java" index 76234d4..7ec1e8b 100644 --- "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-Jpa/src/main/java/com/neo/domain/User.java" +++ "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/model/User.java" @@ -1,4 +1,4 @@ -package com.neo.domain; +package com.neo.model; @@ -10,9 +10,8 @@ import java.io.Serializable; @Entity -public class User implements Serializable { +public class User { - private static final long serialVersionUID = 1L; @Id @GeneratedValue private Long id; diff --git "a/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/model/UserDetail.java" "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/model/UserDetail.java" new file mode 100644 index 0000000..4f3c67d --- /dev/null +++ "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/model/UserDetail.java" @@ -0,0 +1,102 @@ +package com.neo.model; + + +import org.hibernate.annotations.Fetch; +import org.hibernate.annotations.FetchMode; + +import javax.persistence.*; +import java.io.Serializable; + +@Entity +public class UserDetail { + + @Id + @GeneratedValue + private Long id; + @Column(nullable = false, unique = true) + private Long userId; + private Integer age; + private String realName; + private String status; + private String hobby; + private String introduction; + private String lastLoginIp; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Integer getAge() { + return age; + } + + public void setAge(Integer age) { + this.age = age; + } + + public String getRealName() { + return realName; + } + + public void setRealName(String realName) { + this.realName = realName; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getHobby() { + return hobby; + } + + public void setHobby(String hobby) { + this.hobby = hobby; + } + + public String getIntroduction() { + return introduction; + } + + public void setIntroduction(String introduction) { + this.introduction = introduction; + } + + public String getLastLoginIp() { + return lastLoginIp; + } + + public void setLastLoginIp(String lastLoginIp) { + this.lastLoginIp = lastLoginIp; + } + + @Override + public String toString() { + return "UserDetail{" + + "id=" + id + + ", userId=" + userId + + ", age=" + age + + ", realName='" + realName + '\'' + + ", status='" + status + '\'' + + ", hobby='" + hobby + '\'' + + ", introduction='" + introduction + '\'' + + ", lastLoginIp='" + lastLoginIp + '\'' + + '}'; + } +} diff --git "a/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/model/UserInfo.java" "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/model/UserInfo.java" new file mode 100644 index 0000000..5a5ae5e --- /dev/null +++ "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/model/UserInfo.java" @@ -0,0 +1,8 @@ +package com.neo.model; + +public interface UserInfo { + String getUserName(); + String getEmail(); + String getHobby(); + String getIntroduction(); +} \ No newline at end of file diff --git "a/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/param/UserDetailParam.java" "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/param/UserDetailParam.java" new file mode 100644 index 0000000..0f7a497 --- /dev/null +++ "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/param/UserDetailParam.java" @@ -0,0 +1,65 @@ +package com.neo.param; + + +import com.neo.model.Address; +import org.hibernate.annotations.Fetch; +import org.hibernate.annotations.FetchMode; + +import javax.persistence.*; + +public class UserDetailParam { + private String userId; + private Integer minAge; + private Integer maxAge; + private String realName; + private String introduction; + private String city; + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public Integer getMinAge() { + return minAge; + } + + public void setMinAge(Integer minAge) { + this.minAge = minAge; + } + + public Integer getMaxAge() { + return maxAge; + } + + public void setMaxAge(Integer maxAge) { + this.maxAge = maxAge; + } + + public String getRealName() { + return realName; + } + + public void setRealName(String realName) { + this.realName = realName; + } + + public String getIntroduction() { + return introduction; + } + + public void setIntroduction(String introduction) { + this.introduction = introduction; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } +} diff --git "a/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/repository/AddressRepository.java" "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/repository/AddressRepository.java" new file mode 100644 index 0000000..3bba027 --- /dev/null +++ "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/repository/AddressRepository.java" @@ -0,0 +1,7 @@ +package com.neo.repository; + +import com.neo.model.Address; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface AddressRepository extends JpaRepository { +} \ No newline at end of file diff --git "a/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/repository/UserDetailRepository.java" "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/repository/UserDetailRepository.java" new file mode 100644 index 0000000..e133b05 --- /dev/null +++ "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/repository/UserDetailRepository.java" @@ -0,0 +1,20 @@ +package com.neo.repository; + +import com.neo.model.User; +import com.neo.model.UserDetail; +import com.neo.model.UserInfo; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; + +import java.util.List; + + +public interface UserDetailRepository extends JpaSpecificationExecutor,JpaRepository { + + UserDetail findByHobby(String hobby); + + @Query("select u.userName as userName, u.email as email, d.introduction as introduction , d.hobby as hobby from User u , UserDetail d " + + "where u.id=d.userId and d.hobby = ?1 ") + List findUserInfo(String hobby); +} \ No newline at end of file diff --git "a/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/repository/UserRepository.java" "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/repository/UserRepository.java" new file mode 100644 index 0000000..8318068 --- /dev/null +++ "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/repository/UserRepository.java" @@ -0,0 +1,40 @@ +package com.neo.repository; + +import com.neo.model.User; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Slice; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.transaction.annotation.Transactional; + + +public interface UserRepository extends JpaRepository { + + User findByUserName(String userName); + + User findByUserNameOrEmail(String username, String email); + + @Transactional(timeout = 10) + @Modifying + @Query("update User set userName = ?1 where id = ?2") + int modifyById(String userName, Long id); + + @Transactional + @Modifying + @Query("delete from User where id = ?1") + void deleteById(Long id); + + @Query("select u from User u where u.email = ?1") + User findByEmail(String email); + + @Query("select u from User u") + Page findALL(Pageable pageable); + + Page findByNickName(String nickName, Pageable pageable); + + Slice findByNickNameAndEmail(String nickName, String email,Pageable pageable); + + +} \ No newline at end of file diff --git "a/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/service/UserDetailService.java" "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/service/UserDetailService.java" new file mode 100644 index 0000000..a5d14ea --- /dev/null +++ "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/service/UserDetailService.java" @@ -0,0 +1,10 @@ +package com.neo.service; + +import com.neo.model.UserDetail; +import com.neo.param.UserDetailParam; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; + +public interface UserDetailService { + public Page findByCondition(UserDetailParam detailParam, Pageable pageable); +} diff --git "a/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/service/UserDetailServiceImpl.java" "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/service/UserDetailServiceImpl.java" new file mode 100644 index 0000000..18eaba9 --- /dev/null +++ "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/java/com/neo/service/UserDetailServiceImpl.java" @@ -0,0 +1,48 @@ +package com.neo.service; + +import com.mysql.cj.util.StringUtils; +import com.neo.model.UserDetail; +import com.neo.param.UserDetailParam; +import com.neo.repository.UserDetailRepository; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.persistence.criteria.Predicate; +import java.util.ArrayList; +import java.util.List; + +@Service +public class UserDetailServiceImpl implements UserDetailService{ + + @Resource + private UserDetailRepository userDetailRepository; + + @Override + public Page findByCondition(UserDetailParam detailParam, Pageable pageable){ + + return userDetailRepository.findAll((root, query, cb) -> { + List predicates = new ArrayList(); + //equal 示例 + if (!StringUtils.isNullOrEmpty(detailParam.getIntroduction())){ + predicates.add(cb.equal(root.get("introduction"),detailParam.getIntroduction())); + } + //like 示例 + if (!StringUtils.isNullOrEmpty(detailParam.getRealName())){ + predicates.add(cb.like(root.get("realName"),"%"+detailParam.getRealName()+"%")); + } + //between 示例 + if (detailParam.getMinAge()!=null && detailParam.getMaxAge()!=null) { + Predicate agePredicate = cb.between(root.get("age"), detailParam.getMinAge(), detailParam.getMaxAge()); + predicates.add(agePredicate); + } + //greaterThan 大于等于示例 + if (detailParam.getMinAge()!=null){ + predicates.add(cb.greaterThan(root.get("age"),detailParam.getMinAge())); + } + return query.where(predicates.toArray(new Predicate[predicates.size()])).getRestriction(); + }, pageable); + + } +} diff --git "a/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/resources/application.properties" "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/resources/application.properties" new file mode 100644 index 0000000..b0b5ebe --- /dev/null +++ "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/main/resources/application.properties" @@ -0,0 +1,11 @@ +spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.username=root +spring.datasource.password=root +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.properties.hibernate.hbm2ddl.auto=create +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect +#sql\u8F93\u51FA +spring.jpa.show-sql=true +#format\u4E00\u4E0Bsql\u8FDB\u884C\u8F93\u51FA +spring.jpa.properties.hibernate.format_sql=true \ No newline at end of file diff --git "a/\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-package-war/src/test/java/com/neo/ApplicationTests.java" "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/test/java/com/neo/JpaApplicationTests.java" similarity index 89% rename from "\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-package-war/src/test/java/com/neo/ApplicationTests.java" rename to "\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/test/java/com/neo/JpaApplicationTests.java" index 31d482a..4fe4fdb 100644 --- "a/\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-package-war/src/test/java/com/neo/ApplicationTests.java" +++ "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/test/java/com/neo/JpaApplicationTests.java" @@ -7,7 +7,7 @@ @RunWith(SpringRunner.class) @SpringBootTest -public class ApplicationTests { +public class JpaApplicationTests { @Test public void contextLoads() { diff --git "a/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/test/java/com/neo/repository/JpaSpecificationTests.java" "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/test/java/com/neo/repository/JpaSpecificationTests.java" new file mode 100644 index 0000000..751b7d3 --- /dev/null +++ "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/test/java/com/neo/repository/JpaSpecificationTests.java" @@ -0,0 +1,40 @@ +package com.neo.repository; + +import com.neo.model.UserDetail; +import com.neo.param.UserDetailParam; +import com.neo.service.UserDetailService; +import com.neo.service.UserDetailServiceImpl; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.test.context.junit4.SpringRunner; + +import javax.annotation.Resource; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class JpaSpecificationTests { + + @Resource + private UserDetailService userDetailService; + + @Test + public void testFindByCondition() { + int page=0,size=10; + Sort sort = new Sort(Sort.Direction.DESC, "id"); + Pageable pageable = PageRequest.of(page, size, sort); + UserDetailParam param=new UserDetailParam(); + param.setIntroduction("程序员"); + param.setMinAge(10); + param.setMaxAge(30); + Page page1=userDetailService.findByCondition(param,pageable); + for (UserDetail userDetail:page1){ + System.out.println("userDetail: "+userDetail.toString()); + } + } + +} \ No newline at end of file diff --git "a/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/test/java/com/neo/repository/UserDetailRepositoryTests.java" "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/test/java/com/neo/repository/UserDetailRepositoryTests.java" new file mode 100644 index 0000000..679efb1 --- /dev/null +++ "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/test/java/com/neo/repository/UserDetailRepositoryTests.java" @@ -0,0 +1,59 @@ +package com.neo.repository; + +import com.neo.model.Address; +import com.neo.model.User; +import com.neo.model.UserDetail; +import com.neo.model.UserInfo; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.test.context.junit4.SpringRunner; + +import javax.annotation.Resource; +import java.text.DateFormat; +import java.util.Date; +import java.util.List; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class UserDetailRepositoryTests { + + @Resource + private AddressRepository addressRepository; + @Resource + private UserDetailRepository userDetailRepository; + + @Test + public void testSaveAddress() { + Address address=new Address(); + address.setUserId(1L); + address.setCity("北京"); + address.setProvince("北京"); + address.setStreet("分钟寺"); + addressRepository.save(address); + } + + @Test + public void testSaveUserDetail() { + Date date = new Date(); + DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG); + String formattedDate = dateFormat.format(date); + UserDetail userDetail=new UserDetail(); + userDetail.setUserId(3L); + userDetail.setHobby("吃鸡游戏"); + userDetail.setAge(28); + userDetail.setIntroduction("一个爱玩的人"); + userDetailRepository.save(userDetail); + } + + @Test + public void testUserInfo() { + List userInfos=userDetailRepository.findUserInfo("钓鱼"); + for (UserInfo userInfo:userInfos){ + System.out.println("userInfo: "+userInfo.getUserName()+"-"+userInfo.getEmail()+"-"+userInfo.getHobby()+"-"+userInfo.getIntroduction()); + } + } +} \ No newline at end of file diff --git "a/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/test/java/com/neo/repository/UserRepositoryTests.java" "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/test/java/com/neo/repository/UserRepositoryTests.java" new file mode 100644 index 0000000..c689ce5 --- /dev/null +++ "b/\347\254\254 3-5 \350\257\276\357\274\232 Spring Data JPA \347\232\204\351\253\230\347\272\247\347\224\250\346\263\225/spring-boot-jpa/src/test/java/com/neo/repository/UserRepositoryTests.java" @@ -0,0 +1,71 @@ +package com.neo.repository; + +import com.neo.model.User; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.test.context.junit4.SpringRunner; + +import javax.annotation.Resource; +import java.text.DateFormat; +import java.util.Date; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class UserRepositoryTests { + + @Resource + private UserRepository userRepository; + + @Test + public void testSave() { + Date date = new Date(); + DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG); + String formattedDate = dateFormat.format(date); + + userRepository.save(new User("aa", "aa123456","aa@126.com", "aa", formattedDate)); + userRepository.save(new User("bb", "bb123456","bb@126.com", "bb", formattedDate)); + userRepository.save(new User("cc", "cc123456","cc@126.com", "cc", formattedDate)); + +// Assert.assertEquals(3, userRepository.findAll().size()); +// Assert.assertEquals("bb", userRepository.findByUserNameOrEmail("bb", "bb@126.com").getNickName()); +// userRepository.delete(userRepository.findByUserName("aa")); + } + + + @Test + public void testBaseQuery() { + Date date = new Date(); + DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG); + String formattedDate = dateFormat.format(date); + User user=new User("ff", "ff123456","ff@126.com", "ff", formattedDate); + userRepository.findAll(); + userRepository.findById(3L); + userRepository.save(user); + user.setId(2L); + userRepository.delete(user); + userRepository.count(); + userRepository.existsById(3L); + } + + @Test + public void testCustomSql() { + userRepository.modifyById("neo",3L); + userRepository.deleteById(3L); + userRepository.findByEmail("ff@126.com"); + } + + + @Test + public void testPageQuery() { + int page=1,size=2; + Sort sort = new Sort(Sort.Direction.DESC, "id"); + Pageable pageable = PageRequest.of(page, size, sort); + userRepository.findALL(pageable); + userRepository.findByNickName("aa", pageable); + } + +} \ No newline at end of file diff --git "a/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/pom.xml" "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/pom.xml" new file mode 100644 index 0000000..78e5e2e --- /dev/null +++ "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/pom.xml" @@ -0,0 +1,52 @@ + + + 4.0.0 + + com.neo + spring-boot-multi-Jpa + 1.0 + jar + + spring-boot-multi-Jpa + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + mysql + mysql-connector-java + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/MultiJpaApplication.java" "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/MultiJpaApplication.java" similarity index 100% rename from "\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/MultiJpaApplication.java" rename to "\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/MultiJpaApplication.java" diff --git "a/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/config/DataSourceConfig.java" "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/config/DataSourceConfig.java" new file mode 100644 index 0000000..09f2b75 --- /dev/null +++ "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/config/DataSourceConfig.java" @@ -0,0 +1,41 @@ +package com.neo.config; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties; +import org.springframework.boot.autoconfigure.orm.jpa.HibernateSettings; +import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.jdbc.DataSourceBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; + +import javax.sql.DataSource; +import java.util.Map; + +@Configuration +public class DataSourceConfig { + + @Autowired + private JpaProperties jpaProperties; + @Autowired + private HibernateProperties hibernateProperties; + + @Bean(name = "primaryDataSource") + @Primary + @ConfigurationProperties("spring.datasource.primary") + public DataSource firstDataSource() { + return DataSourceBuilder.create().build(); + } + + @Bean(name = "secondaryDataSource") + @ConfigurationProperties("spring.datasource.secondary") + public DataSource secondDataSource() { + return DataSourceBuilder.create().build(); + } + + @Bean(name = "vendorProperties") + public Map getVendorProperties() { + return hibernateProperties.determineHibernateProperties(jpaProperties.getProperties(), new HibernateSettings()); + } +} diff --git "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/config/PrimaryConfig.java" "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/config/PrimaryConfig.java" similarity index 83% rename from "\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/config/PrimaryConfig.java" rename to "\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/config/PrimaryConfig.java" index cdf8005..588cf91 100644 --- "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/config/PrimaryConfig.java" +++ "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/config/PrimaryConfig.java" @@ -7,7 +7,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties; import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -25,33 +24,30 @@ transactionManagerRef="transactionManagerPrimary", basePackages= { "com.neo.repository.test1" })//设置dao(repo)所在位置 public class PrimaryConfig { - - @Autowired - private JpaProperties jpaProperties; @Autowired @Qualifier("primaryDataSource") private DataSource primaryDataSource; - @Bean(name = "entityManagerPrimary") - @Primary - public EntityManager entityManager(EntityManagerFactoryBuilder builder) { - return entityManagerFactoryPrimary(builder).getObject().createEntityManager(); - } + @Autowired + @Qualifier("vendorProperties") + private Map vendorProperties; @Bean(name = "entityManagerFactoryPrimary") @Primary public LocalContainerEntityManagerFactoryBean entityManagerFactoryPrimary (EntityManagerFactoryBuilder builder) { return builder .dataSource(primaryDataSource) - .properties(getVendorProperties(primaryDataSource)) - .packages("com.neo.domain") //设置实体类所在位置 + .properties(vendorProperties) + .packages("com.neo.model") //设置实体类所在位置 .persistenceUnit("primaryPersistenceUnit") .build(); } - private Map getVendorProperties(DataSource dataSource) { - return jpaProperties.getHibernateProperties(dataSource); + @Bean(name = "entityManagerPrimary") + @Primary + public EntityManager entityManager(EntityManagerFactoryBuilder builder) { + return entityManagerFactoryPrimary(builder).getObject().createEntityManager(); } @Bean(name = "transactionManagerPrimary") diff --git "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/config/SecondaryConfig.java" "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/config/SecondaryConfig.java" similarity index 82% rename from "\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/config/SecondaryConfig.java" rename to "\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/config/SecondaryConfig.java" index 861f461..241f476 100644 --- "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/config/SecondaryConfig.java" +++ "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/config/SecondaryConfig.java" @@ -2,11 +2,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties; import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Primary; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.orm.jpa.JpaTransactionManager; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; @@ -24,30 +22,28 @@ transactionManagerRef="transactionManagerSecondary", basePackages= { "com.neo.repository.test2" }) public class SecondaryConfig { - @Autowired - private JpaProperties jpaProperties; @Autowired @Qualifier("secondaryDataSource") private DataSource secondaryDataSource; - @Bean(name = "entityManagerSecondary") - public EntityManager entityManager(EntityManagerFactoryBuilder builder) { - return entityManagerFactorySecondary(builder).getObject().createEntityManager(); - } + @Autowired + @Qualifier("vendorProperties") + private Map vendorProperties; @Bean(name = "entityManagerFactorySecondary") public LocalContainerEntityManagerFactoryBean entityManagerFactorySecondary (EntityManagerFactoryBuilder builder) { return builder .dataSource(secondaryDataSource) - .properties(getVendorProperties(secondaryDataSource)) - .packages("com.neo.domain") + .properties(vendorProperties) + .packages("com.neo.model") .persistenceUnit("secondaryPersistenceUnit") .build(); } - private Map getVendorProperties(DataSource dataSource) { - return jpaProperties.getHibernateProperties(dataSource); + @Bean(name = "entityManagerSecondary") + public EntityManager entityManager(EntityManagerFactoryBuilder builder) { + return entityManagerFactorySecondary(builder).getObject().createEntityManager(); } @Bean(name = "transactionManagerSecondary") diff --git "a/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/model/User.java" "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/model/User.java" new file mode 100644 index 0000000..f4cb974 --- /dev/null +++ "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/model/User.java" @@ -0,0 +1,86 @@ +package com.neo.model; + + + +import javax.persistence.*; + +import java.io.Serializable; + +@Entity +public class User implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private long id; + @Column(nullable = false, unique = true) + private String userName; + @Column(nullable = false) + private String passWord; + @Column(nullable = false, unique = true) + private String email; + @Column(nullable = true, unique = true) + private String nickName; + @Column(nullable = false) + private String regTime; + + public User() { + } + + public User(String userName, String passWord, String email, String nickName, String regTime) { + this.userName = userName; + this.passWord = passWord; + this.email = email; + this.nickName = nickName; + this.regTime = regTime; + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getPassWord() { + return passWord; + } + + public void setPassWord(String passWord) { + this.passWord = passWord; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + public String getRegTime() { + return regTime; + } + + public void setRegTime(String regTime) { + this.regTime = regTime; + } +} diff --git "a/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/repository/test1/UserTest1Repository.java" "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/repository/test1/UserTest1Repository.java" new file mode 100644 index 0000000..feeccea --- /dev/null +++ "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/repository/test1/UserTest1Repository.java" @@ -0,0 +1,10 @@ +package com.neo.repository.test1; + +import com.neo.model.User; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface UserTest1Repository extends JpaRepository { + User findById(long id); + User findByUserName(String userName); + User findByUserNameOrEmail(String username, String email); +} \ No newline at end of file diff --git "a/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/repository/test2/UserTest2Repository.java" "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/repository/test2/UserTest2Repository.java" new file mode 100644 index 0000000..45f8c24 --- /dev/null +++ "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/java/com/neo/repository/test2/UserTest2Repository.java" @@ -0,0 +1,11 @@ +package com.neo.repository.test2; + +import com.neo.model.User; +import org.springframework.data.jpa.repository.JpaRepository; + + +public interface UserTest2Repository extends JpaRepository { + User findById(long id); + User findByUserName(String userName); + User findByUserNameOrEmail(String username, String email); +} \ No newline at end of file diff --git "a/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/resources/application.properties" "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/resources/application.properties" new file mode 100644 index 0000000..cab7dd7 --- /dev/null +++ "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/main/resources/application.properties" @@ -0,0 +1,16 @@ +spring.datasource.primary.jdbc-url=jdbc:mysql://localhost:3306/test1?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.primary.username=root +spring.datasource.primary.password=root +spring.datasource.primary.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.datasource.secondary.jdbc-url=jdbc:mysql://localhost:3306/test2?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.secondary.username=root +spring.datasource.secondary.password=root +spring.datasource.secondary.driver-class-name=com.mysql.cj.jdbc.Driver + +#sql\u8F93\u51FA +spring.jpa.show-sql=true +spring.jpa.properties.hibernate.hbm2ddl.auto=create +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect +#format\u4E00\u4E0Bsql\u8FDB\u884C\u8F93\u51FA +spring.jpa.properties.hibernate.format_sql=true diff --git "a/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/test/java/com/neo/MultiJpaApplicationTests.java" "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/test/java/com/neo/MultiJpaApplicationTests.java" new file mode 100644 index 0000000..c87999c --- /dev/null +++ "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/test/java/com/neo/MultiJpaApplicationTests.java" @@ -0,0 +1,18 @@ +package com.neo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class MultiJpaApplicationTests { + + @Test + public void contextLoads() { + System.out.println("Hello MultiJpa!"); + } + +} diff --git "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/test/java/com/neo/repository/UserRepositoryTests.java" "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/test/java/com/neo/repository/UserRepositoryTests.java" similarity index 81% rename from "\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/test/java/com/neo/repository/UserRepositoryTests.java" rename to "\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/test/java/com/neo/repository/UserRepositoryTests.java" index 9554828..693986f 100644 --- "a/\347\254\25403\350\257\276\357\274\232Spring Data Jpa \347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/test/java/com/neo/repository/UserRepositoryTests.java" +++ "b/\347\254\254 3-6 \350\257\276\357\274\232 Spring Data JPA \345\244\232\346\225\260\346\215\256\346\272\220\347\232\204\344\275\277\347\224\250/spring-boot-multi-Jpa/src/test/java/com/neo/repository/UserRepositoryTests.java" @@ -1,16 +1,13 @@ package com.neo.repository; -import com.neo.domain.User; +import com.neo.model.User; import com.neo.repository.test1.UserTest1Repository; import com.neo.repository.test2.UserTest2Repository; -import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Sort; import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.text.DateFormat; @@ -20,7 +17,7 @@ @SpringBootTest public class UserRepositoryTests { @Resource - private UserTest1Repository userTest1Repository; + private UserTest1Repository userTest1Repository; @Resource private UserTest2Repository userTest2Repository; @@ -33,10 +30,15 @@ public void testSave() throws Exception { userTest1Repository.save(new User("aa", "aa123456","aa@126.com", "aa", formattedDate)); userTest1Repository.save(new User("bb", "bb123456","bb@126.com", "bb", formattedDate)); userTest2Repository.save(new User("cc", "cc123456","cc@126.com", "cc", formattedDate)); - } + @Test + public void testDelete() throws Exception { + userTest1Repository.deleteAll(); + userTest2Repository.deleteAll(); + } + @Test public void testBaseQuery() { Date date = new Date(); @@ -44,12 +46,12 @@ public void testBaseQuery() { String formattedDate = dateFormat.format(date); User user=new User("ff", "ff123456","ff@126.com", "ff", formattedDate); userTest1Repository.findAll(); - userTest2Repository.findOne(3l); + userTest2Repository.findById(3l); userTest2Repository.save(user); user.setId(2l); userTest1Repository.delete(user); userTest1Repository.count(); - userTest2Repository.exists(3l); + userTest2Repository.findById(3l); } diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/pom.xml" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/pom.xml" new file mode 100644 index 0000000..d8d7de4 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/pom.xml" @@ -0,0 +1,62 @@ + + + 4.0.0 + + com.neo + spring-boot-jpa-druid + 1.0.0 + jar + + spring-boot-jpa-druid + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-web + + + com.alibaba + druid-spring-boot-starter + 1.1.10 + + + mysql + mysql-connector-java + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/JpaDruidApplication.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/JpaDruidApplication.java" new file mode 100644 index 0000000..f084ca0 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/JpaDruidApplication.java" @@ -0,0 +1,12 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class JpaDruidApplication { + + public static void main(String[] args) { + SpringApplication.run(JpaDruidApplication.class, args); + } +} diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/model/Address.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/model/Address.java" new file mode 100644 index 0000000..883ea20 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/model/Address.java" @@ -0,0 +1,59 @@ +package com.neo.model; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; + +@Entity +public class Address { + + @Id + @GeneratedValue + private Long id; + @Column(nullable = false) + private Long userId; + private String province; + private String city; + private String street; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getProvince() { + return province; + } + + public void setProvince(String province) { + this.province = province; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getStreet() { + return street; + } + + public void setStreet(String street) { + this.street = street; + } +} diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/model/User.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/model/User.java" new file mode 100644 index 0000000..7ec1e8b --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/model/User.java" @@ -0,0 +1,87 @@ +package com.neo.model; + + + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; + +import java.io.Serializable; + +@Entity +public class User { + + @Id + @GeneratedValue + private Long id; + @Column(nullable = false, unique = true) + private String userName; + @Column(nullable = false) + private String passWord; + @Column(nullable = false, unique = true) + private String email; + @Column(nullable = true, unique = true) + private String nickName; + @Column(nullable = false) + private String regTime; + + public User() { + } + + public User(String userName, String passWord, String email, String nickName, String regTime) { + this.userName = userName; + this.passWord = passWord; + this.email = email; + this.nickName = nickName; + this.regTime = regTime; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getPassWord() { + return passWord; + } + + public void setPassWord(String passWord) { + this.passWord = passWord; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + public String getRegTime() { + return regTime; + } + + public void setRegTime(String regTime) { + this.regTime = regTime; + } +} diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/model/UserDetail.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/model/UserDetail.java" new file mode 100644 index 0000000..4f3c67d --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/model/UserDetail.java" @@ -0,0 +1,102 @@ +package com.neo.model; + + +import org.hibernate.annotations.Fetch; +import org.hibernate.annotations.FetchMode; + +import javax.persistence.*; +import java.io.Serializable; + +@Entity +public class UserDetail { + + @Id + @GeneratedValue + private Long id; + @Column(nullable = false, unique = true) + private Long userId; + private Integer age; + private String realName; + private String status; + private String hobby; + private String introduction; + private String lastLoginIp; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Integer getAge() { + return age; + } + + public void setAge(Integer age) { + this.age = age; + } + + public String getRealName() { + return realName; + } + + public void setRealName(String realName) { + this.realName = realName; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getHobby() { + return hobby; + } + + public void setHobby(String hobby) { + this.hobby = hobby; + } + + public String getIntroduction() { + return introduction; + } + + public void setIntroduction(String introduction) { + this.introduction = introduction; + } + + public String getLastLoginIp() { + return lastLoginIp; + } + + public void setLastLoginIp(String lastLoginIp) { + this.lastLoginIp = lastLoginIp; + } + + @Override + public String toString() { + return "UserDetail{" + + "id=" + id + + ", userId=" + userId + + ", age=" + age + + ", realName='" + realName + '\'' + + ", status='" + status + '\'' + + ", hobby='" + hobby + '\'' + + ", introduction='" + introduction + '\'' + + ", lastLoginIp='" + lastLoginIp + '\'' + + '}'; + } +} diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/model/UserInfo.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/model/UserInfo.java" new file mode 100644 index 0000000..5a5ae5e --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/model/UserInfo.java" @@ -0,0 +1,8 @@ +package com.neo.model; + +public interface UserInfo { + String getUserName(); + String getEmail(); + String getHobby(); + String getIntroduction(); +} \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/param/UserDetailParam.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/param/UserDetailParam.java" new file mode 100644 index 0000000..0f7a497 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/param/UserDetailParam.java" @@ -0,0 +1,65 @@ +package com.neo.param; + + +import com.neo.model.Address; +import org.hibernate.annotations.Fetch; +import org.hibernate.annotations.FetchMode; + +import javax.persistence.*; + +public class UserDetailParam { + private String userId; + private Integer minAge; + private Integer maxAge; + private String realName; + private String introduction; + private String city; + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public Integer getMinAge() { + return minAge; + } + + public void setMinAge(Integer minAge) { + this.minAge = minAge; + } + + public Integer getMaxAge() { + return maxAge; + } + + public void setMaxAge(Integer maxAge) { + this.maxAge = maxAge; + } + + public String getRealName() { + return realName; + } + + public void setRealName(String realName) { + this.realName = realName; + } + + public String getIntroduction() { + return introduction; + } + + public void setIntroduction(String introduction) { + this.introduction = introduction; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } +} diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/repository/AddressRepository.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/repository/AddressRepository.java" new file mode 100644 index 0000000..3bba027 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/repository/AddressRepository.java" @@ -0,0 +1,7 @@ +package com.neo.repository; + +import com.neo.model.Address; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface AddressRepository extends JpaRepository { +} \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/repository/UserDetailRepository.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/repository/UserDetailRepository.java" new file mode 100644 index 0000000..e133b05 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/repository/UserDetailRepository.java" @@ -0,0 +1,20 @@ +package com.neo.repository; + +import com.neo.model.User; +import com.neo.model.UserDetail; +import com.neo.model.UserInfo; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; + +import java.util.List; + + +public interface UserDetailRepository extends JpaSpecificationExecutor,JpaRepository { + + UserDetail findByHobby(String hobby); + + @Query("select u.userName as userName, u.email as email, d.introduction as introduction , d.hobby as hobby from User u , UserDetail d " + + "where u.id=d.userId and d.hobby = ?1 ") + List findUserInfo(String hobby); +} \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/repository/UserRepository.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/repository/UserRepository.java" new file mode 100644 index 0000000..8318068 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/repository/UserRepository.java" @@ -0,0 +1,40 @@ +package com.neo.repository; + +import com.neo.model.User; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Slice; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.transaction.annotation.Transactional; + + +public interface UserRepository extends JpaRepository { + + User findByUserName(String userName); + + User findByUserNameOrEmail(String username, String email); + + @Transactional(timeout = 10) + @Modifying + @Query("update User set userName = ?1 where id = ?2") + int modifyById(String userName, Long id); + + @Transactional + @Modifying + @Query("delete from User where id = ?1") + void deleteById(Long id); + + @Query("select u from User u where u.email = ?1") + User findByEmail(String email); + + @Query("select u from User u") + Page findALL(Pageable pageable); + + Page findByNickName(String nickName, Pageable pageable); + + Slice findByNickNameAndEmail(String nickName, String email,Pageable pageable); + + +} \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/service/UserDetailService.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/service/UserDetailService.java" new file mode 100644 index 0000000..a5d14ea --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/service/UserDetailService.java" @@ -0,0 +1,10 @@ +package com.neo.service; + +import com.neo.model.UserDetail; +import com.neo.param.UserDetailParam; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; + +public interface UserDetailService { + public Page findByCondition(UserDetailParam detailParam, Pageable pageable); +} diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/service/UserDetailServiceImpl.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/service/UserDetailServiceImpl.java" new file mode 100644 index 0000000..18eaba9 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/service/UserDetailServiceImpl.java" @@ -0,0 +1,48 @@ +package com.neo.service; + +import com.mysql.cj.util.StringUtils; +import com.neo.model.UserDetail; +import com.neo.param.UserDetailParam; +import com.neo.repository.UserDetailRepository; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.persistence.criteria.Predicate; +import java.util.ArrayList; +import java.util.List; + +@Service +public class UserDetailServiceImpl implements UserDetailService{ + + @Resource + private UserDetailRepository userDetailRepository; + + @Override + public Page findByCondition(UserDetailParam detailParam, Pageable pageable){ + + return userDetailRepository.findAll((root, query, cb) -> { + List predicates = new ArrayList(); + //equal 示例 + if (!StringUtils.isNullOrEmpty(detailParam.getIntroduction())){ + predicates.add(cb.equal(root.get("introduction"),detailParam.getIntroduction())); + } + //like 示例 + if (!StringUtils.isNullOrEmpty(detailParam.getRealName())){ + predicates.add(cb.like(root.get("realName"),"%"+detailParam.getRealName()+"%")); + } + //between 示例 + if (detailParam.getMinAge()!=null && detailParam.getMaxAge()!=null) { + Predicate agePredicate = cb.between(root.get("age"), detailParam.getMinAge(), detailParam.getMaxAge()); + predicates.add(agePredicate); + } + //greaterThan 大于等于示例 + if (detailParam.getMinAge()!=null){ + predicates.add(cb.greaterThan(root.get("age"),detailParam.getMinAge())); + } + return query.where(predicates.toArray(new Predicate[predicates.size()])).getRestriction(); + }, pageable); + + } +} diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/web/UserController.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/web/UserController.java" new file mode 100644 index 0000000..254dcb0 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/java/com/neo/web/UserController.java" @@ -0,0 +1,27 @@ +package com.neo.web; + + +import com.neo.model.User; +import com.neo.repository.UserRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +public class UserController { + + @Autowired + private UserRepository userRepository; + + @RequestMapping("/getUsers") + public List getUsers() { + List users=userRepository.findAll(); + return users; + } + + + +} \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/resources/application.properties" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/resources/application.properties" new file mode 100644 index 0000000..f8a8a90 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/main/resources/application.properties" @@ -0,0 +1,28 @@ +spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.username=root +spring.datasource.password=root +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.properties.hibernate.hbm2ddl.auto=create +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect +#sql\u8F93\u51FA +spring.jpa.show-sql=true +#format\u4E00\u4E0Bsql\u8FDB\u884C\u8F93\u51FA +spring.jpa.properties.hibernate.format_sql=true + + +# \u521D\u59CB\u5316\u5927\u5C0F\uFF0C\u6700\u5C0F\uFF0C\u6700\u5927\u94FE\u63A5\u6570 +spring.datasource.druid.initial-size=3 +spring.datasource.druid.min-idle=3 +spring.datasource.druid.max-active=10 + +# \u914D\u7F6E\u83B7\u53D6\u8FDE\u63A5\u7B49\u5F85\u8D85\u65F6\u7684\u65F6\u95F4 +spring.datasource.druid.max-wait=60000 + +# StatViewServlet \u914D\u7F6E +spring.datasource.druid.stat-view-servlet.login-username=admin +spring.datasource.druid.stat-view-servlet.login-password=admin + +# \u914D\u7F6EStatFilter +spring.datasource.druid.filter.stat.log-slow-sql=true +spring.datasource.druid.filter.stat.slow-sql-millis=2000 \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/test/java/com/neo/JpaDruidApplicationTests.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/test/java/com/neo/JpaDruidApplicationTests.java" new file mode 100644 index 0000000..871a021 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/test/java/com/neo/JpaDruidApplicationTests.java" @@ -0,0 +1,16 @@ +package com.neo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class JpaDruidApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/test/java/com/neo/repository/JpaSpecificationTests.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/test/java/com/neo/repository/JpaSpecificationTests.java" new file mode 100644 index 0000000..751b7d3 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/test/java/com/neo/repository/JpaSpecificationTests.java" @@ -0,0 +1,40 @@ +package com.neo.repository; + +import com.neo.model.UserDetail; +import com.neo.param.UserDetailParam; +import com.neo.service.UserDetailService; +import com.neo.service.UserDetailServiceImpl; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.test.context.junit4.SpringRunner; + +import javax.annotation.Resource; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class JpaSpecificationTests { + + @Resource + private UserDetailService userDetailService; + + @Test + public void testFindByCondition() { + int page=0,size=10; + Sort sort = new Sort(Sort.Direction.DESC, "id"); + Pageable pageable = PageRequest.of(page, size, sort); + UserDetailParam param=new UserDetailParam(); + param.setIntroduction("程序员"); + param.setMinAge(10); + param.setMaxAge(30); + Page page1=userDetailService.findByCondition(param,pageable); + for (UserDetail userDetail:page1){ + System.out.println("userDetail: "+userDetail.toString()); + } + } + +} \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/test/java/com/neo/repository/UserDetailRepositoryTests.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/test/java/com/neo/repository/UserDetailRepositoryTests.java" new file mode 100644 index 0000000..679efb1 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/test/java/com/neo/repository/UserDetailRepositoryTests.java" @@ -0,0 +1,59 @@ +package com.neo.repository; + +import com.neo.model.Address; +import com.neo.model.User; +import com.neo.model.UserDetail; +import com.neo.model.UserInfo; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.test.context.junit4.SpringRunner; + +import javax.annotation.Resource; +import java.text.DateFormat; +import java.util.Date; +import java.util.List; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class UserDetailRepositoryTests { + + @Resource + private AddressRepository addressRepository; + @Resource + private UserDetailRepository userDetailRepository; + + @Test + public void testSaveAddress() { + Address address=new Address(); + address.setUserId(1L); + address.setCity("北京"); + address.setProvince("北京"); + address.setStreet("分钟寺"); + addressRepository.save(address); + } + + @Test + public void testSaveUserDetail() { + Date date = new Date(); + DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG); + String formattedDate = dateFormat.format(date); + UserDetail userDetail=new UserDetail(); + userDetail.setUserId(3L); + userDetail.setHobby("吃鸡游戏"); + userDetail.setAge(28); + userDetail.setIntroduction("一个爱玩的人"); + userDetailRepository.save(userDetail); + } + + @Test + public void testUserInfo() { + List userInfos=userDetailRepository.findUserInfo("钓鱼"); + for (UserInfo userInfo:userInfos){ + System.out.println("userInfo: "+userInfo.getUserName()+"-"+userInfo.getEmail()+"-"+userInfo.getHobby()+"-"+userInfo.getIntroduction()); + } + } +} \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/test/java/com/neo/repository/UserRepositoryTests.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/test/java/com/neo/repository/UserRepositoryTests.java" new file mode 100644 index 0000000..c689ce5 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-jpa-druid/src/test/java/com/neo/repository/UserRepositoryTests.java" @@ -0,0 +1,71 @@ +package com.neo.repository; + +import com.neo.model.User; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.test.context.junit4.SpringRunner; + +import javax.annotation.Resource; +import java.text.DateFormat; +import java.util.Date; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class UserRepositoryTests { + + @Resource + private UserRepository userRepository; + + @Test + public void testSave() { + Date date = new Date(); + DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG); + String formattedDate = dateFormat.format(date); + + userRepository.save(new User("aa", "aa123456","aa@126.com", "aa", formattedDate)); + userRepository.save(new User("bb", "bb123456","bb@126.com", "bb", formattedDate)); + userRepository.save(new User("cc", "cc123456","cc@126.com", "cc", formattedDate)); + +// Assert.assertEquals(3, userRepository.findAll().size()); +// Assert.assertEquals("bb", userRepository.findByUserNameOrEmail("bb", "bb@126.com").getNickName()); +// userRepository.delete(userRepository.findByUserName("aa")); + } + + + @Test + public void testBaseQuery() { + Date date = new Date(); + DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG); + String formattedDate = dateFormat.format(date); + User user=new User("ff", "ff123456","ff@126.com", "ff", formattedDate); + userRepository.findAll(); + userRepository.findById(3L); + userRepository.save(user); + user.setId(2L); + userRepository.delete(user); + userRepository.count(); + userRepository.existsById(3L); + } + + @Test + public void testCustomSql() { + userRepository.modifyById("neo",3L); + userRepository.deleteById(3L); + userRepository.findByEmail("ff@126.com"); + } + + + @Test + public void testPageQuery() { + int page=1,size=2; + Sort sort = new Sort(Sort.Direction.DESC, "id"); + Pageable pageable = PageRequest.of(page, size, sort); + userRepository.findALL(pageable); + userRepository.findByNickName("aa", pageable); + } + +} \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/pom.xml" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/pom.xml" new file mode 100644 index 0000000..4d1bda0 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/pom.xml" @@ -0,0 +1,71 @@ + + + 4.0.0 + + com.neo + spring-boot-multi-Jpa-druid + 1.0 + jar + + spring-boot-multi-Jpa-druid + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + mysql + mysql-connector-java + + + org.springframework.boot + spring-boot-starter-web + + + com.alibaba + druid + 1.1.10 + + + log4j + log4j + 1.2.17 + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/MultiJpaApplication.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/MultiJpaApplication.java" new file mode 100644 index 0000000..2a9a26b --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/MultiJpaApplication.java" @@ -0,0 +1,12 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class MultiJpaApplication { + + public static void main(String[] args) { + SpringApplication.run(MultiJpaApplication.class, args); + } +} diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/PrimaryConfig.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/PrimaryConfig.java" new file mode 100644 index 0000000..c6e42b6 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/PrimaryConfig.java" @@ -0,0 +1,67 @@ +package com.neo.config; + +import java.util.Map; + +import javax.persistence.EntityManager; +import javax.sql.DataSource; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties; +import org.springframework.boot.autoconfigure.orm.jpa.HibernateSettings; +import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties; +import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import org.springframework.orm.jpa.JpaTransactionManager; +import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; +import org.springframework.transaction.PlatformTransactionManager; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +@Configuration +@EnableTransactionManagement +@EnableJpaRepositories( + entityManagerFactoryRef="entityManagerFactoryPrimary", + transactionManagerRef="transactionManagerPrimary", + basePackages= { "com.neo.repository.test1" })//设置dao(repo)所在位置 +public class PrimaryConfig { + + @Autowired + private JpaProperties jpaProperties; + @Autowired + private HibernateProperties hibernateProperties; + + @Autowired + @Qualifier("primaryDataSource") + private DataSource primaryDataSource; + + public Map getVendorProperties() { + return hibernateProperties.determineHibernateProperties(jpaProperties.getProperties(), new HibernateSettings()); + } + + @Bean(name = "entityManagerFactoryPrimary") + @Primary + public LocalContainerEntityManagerFactoryBean entityManagerFactoryPrimary (EntityManagerFactoryBuilder builder) { + return builder + .dataSource(primaryDataSource) + .properties(getVendorProperties()) + .packages("com.neo.model") //设置实体类所在位置 + .persistenceUnit("primaryPersistenceUnit") + .build(); + } + + @Bean(name = "entityManagerPrimary") + @Primary + public EntityManager entityManager(EntityManagerFactoryBuilder builder) { + return entityManagerFactoryPrimary(builder).getObject().createEntityManager(); + } + + @Bean(name = "transactionManagerPrimary") + @Primary + PlatformTransactionManager transactionManagerPrimary(EntityManagerFactoryBuilder builder) { + return new JpaTransactionManager(entityManagerFactoryPrimary(builder).getObject()); + } + +} \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/SecondaryConfig.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/SecondaryConfig.java" new file mode 100644 index 0000000..34dd926 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/SecondaryConfig.java" @@ -0,0 +1,62 @@ +package com.neo.config; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties; +import org.springframework.boot.autoconfigure.orm.jpa.HibernateSettings; +import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties; +import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; +import org.springframework.orm.jpa.JpaTransactionManager; +import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; +import org.springframework.transaction.PlatformTransactionManager; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +import javax.persistence.EntityManager; +import javax.sql.DataSource; +import java.util.Map; + +@Configuration +@EnableTransactionManagement +@EnableJpaRepositories( + entityManagerFactoryRef="entityManagerFactorySecondary", + transactionManagerRef="transactionManagerSecondary", + basePackages= { "com.neo.repository.test2" }) +public class SecondaryConfig { + @Autowired + private JpaProperties jpaProperties; + @Autowired + private HibernateProperties hibernateProperties; + + @Autowired + @Qualifier("secondaryDataSource") + private DataSource secondaryDataSource; + + public Map getVendorProperties() { + return hibernateProperties.determineHibernateProperties(jpaProperties.getProperties(), new HibernateSettings()); + } + + @Bean(name = "entityManagerFactorySecondary") + public LocalContainerEntityManagerFactoryBean entityManagerFactorySecondary (EntityManagerFactoryBuilder builder) { + return builder + .dataSource(secondaryDataSource) + .properties(getVendorProperties()) + .packages("com.neo.model") + .persistenceUnit("secondaryPersistenceUnit") + .build(); + } + + @Bean(name = "entityManagerSecondary") + public EntityManager entityManager(EntityManagerFactoryBuilder builder) { + return entityManagerFactorySecondary(builder).getObject().createEntityManager(); + } + + @Bean(name = "transactionManagerSecondary") + PlatformTransactionManager transactionManagerSecondary(EntityManagerFactoryBuilder builder) { + return new JpaTransactionManager(entityManagerFactorySecondary(builder).getObject()); + } + +} \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/druid/DruidConfig.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/druid/DruidConfig.java" new file mode 100644 index 0000000..a03b46e --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/druid/DruidConfig.java" @@ -0,0 +1,180 @@ +package com.neo.config.druid; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +@Component +@ConfigurationProperties(prefix="spring.datasource.druid") +public class DruidConfig { + protected String url; + protected String username; + protected String password; + protected String driverClassName; + protected int initialSize; + protected int minIdle; + protected int maxActive; + protected int maxWait; + protected int timeBetweenEvictionRunsMillis; + protected long minEvictableIdleTimeMillis; + protected long maxEvictableIdleTimeMillis; + protected String validationQuery; + protected boolean testWhileIdle; + protected boolean testOnBorrow; + protected boolean testOnReturn; + protected boolean poolPreparedStatements; + protected int maxPoolPreparedStatementPerConnectionSize; + protected String filters; + protected String connectionProperties; + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public int getMaxPoolPreparedStatementPerConnectionSize() { + return maxPoolPreparedStatementPerConnectionSize; + } + + public void setMaxPoolPreparedStatementPerConnectionSize(int maxPoolPreparedStatementPerConnectionSize) { + this.maxPoolPreparedStatementPerConnectionSize = maxPoolPreparedStatementPerConnectionSize; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getDriverClassName() { + return driverClassName; + } + + public void setDriverClassName(String driverClassName) { + this.driverClassName = driverClassName; + } + + public int getInitialSize() { + return initialSize; + } + + public void setInitialSize(int initialSize) { + this.initialSize = initialSize; + } + + public int getMinIdle() { + return minIdle; + } + + public void setMinIdle(int minIdle) { + this.minIdle = minIdle; + } + + public int getMaxActive() { + return maxActive; + } + + public void setMaxActive(int maxActive) { + this.maxActive = maxActive; + } + + public int getMaxWait() { + return maxWait; + } + + public void setMaxWait(int maxWait) { + this.maxWait = maxWait; + } + + public int getTimeBetweenEvictionRunsMillis() { + return timeBetweenEvictionRunsMillis; + } + + public void setTimeBetweenEvictionRunsMillis(int timeBetweenEvictionRunsMillis) { + this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis; + } + + public long getMinEvictableIdleTimeMillis() { + return minEvictableIdleTimeMillis; + } + + public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) { + this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis; + } + + public long getMaxEvictableIdleTimeMillis() { + return maxEvictableIdleTimeMillis; + } + + public void setMaxEvictableIdleTimeMillis(long maxEvictableIdleTimeMillis) { + this.maxEvictableIdleTimeMillis = maxEvictableIdleTimeMillis; + } + + public String getValidationQuery() { + return validationQuery; + } + + public void setValidationQuery(String validationQuery) { + this.validationQuery = validationQuery; + } + + public boolean isTestWhileIdle() { + return testWhileIdle; + } + + public void setTestWhileIdle(boolean testWhileIdle) { + this.testWhileIdle = testWhileIdle; + } + + public boolean isTestOnBorrow() { + return testOnBorrow; + } + + public void setTestOnBorrow(boolean testOnBorrow) { + this.testOnBorrow = testOnBorrow; + } + + public boolean isTestOnReturn() { + return testOnReturn; + } + + public void setTestOnReturn(boolean testOnReturn) { + this.testOnReturn = testOnReturn; + } + + public boolean isPoolPreparedStatements() { + return poolPreparedStatements; + } + + public void setPoolPreparedStatements(boolean poolPreparedStatements) { + this.poolPreparedStatements = poolPreparedStatements; + } + + public String getFilters() { + return filters; + } + + public void setFilters(String filters) { + this.filters = filters; + } + + public String getConnectionProperties() { + return connectionProperties; + } + + public void setConnectionProperties(String connectionProperties) { + this.connectionProperties = connectionProperties; + } +} diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/druid/DruidConfiguration.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/druid/DruidConfiguration.java" new file mode 100644 index 0000000..518836b --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/druid/DruidConfiguration.java" @@ -0,0 +1,29 @@ +package com.neo.config.druid; + +import com.alibaba.druid.support.http.StatViewServlet; +import com.alibaba.druid.support.http.WebStatFilter; +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.boot.web.servlet.ServletRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class DruidConfiguration { + @Bean + public ServletRegistrationBean druidStatViewServlet() { + ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean<>(new StatViewServlet(), "/druid/*"); + servletRegistrationBean.addInitParameter("loginUsername", "admin"); + servletRegistrationBean.addInitParameter("loginPassword", "admin"); + servletRegistrationBean.addInitParameter("resetEnable", "false"); + return servletRegistrationBean; + } + + @Bean + public FilterRegistrationBean druidStatFilter() { + FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean<>(new WebStatFilter()); + filterRegistrationBean.setName("DruidWebStatFilter"); + filterRegistrationBean.addUrlPatterns("/*"); + filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"); + return filterRegistrationBean; + } +} \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/druid/DruidDBConfig.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/druid/DruidDBConfig.java" new file mode 100644 index 0000000..35bf948 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/druid/DruidDBConfig.java" @@ -0,0 +1,69 @@ +package com.neo.config.druid; + +import com.alibaba.druid.pool.DruidDataSource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; + +import java.sql.SQLException; +import javax.sql.DataSource; + +@Configuration +public class DruidDBConfig { + private Logger logger = LoggerFactory.getLogger(DruidDBConfig.class); + + @Autowired + private DruidConfig druidOneConfig; + @Autowired + private DruidConfig druidTwoConfig; + @Autowired + private DruidConfig druidConfig; + + + @Bean(name = "primaryDataSource") + public DataSource dataSource() { + return initDruidDataSource(druidOneConfig); + } + + @Bean(name = "secondaryDataSource") + @Primary + public DataSource secondaryDataSource() { + return initDruidDataSource(druidTwoConfig); + } + + private DruidDataSource initDruidDataSource(DruidConfig config) { + DruidDataSource datasource = new DruidDataSource(); + + datasource.setUrl(config.getUrl()); + datasource.setUsername(config.getUsername()); + datasource.setPassword(config.getPassword()); + datasource.setDriverClassName(config.getDriverClassName()); + datasource.setInitialSize(config.getInitialSize()); + datasource.setMinIdle(config.getMinIdle()); + datasource.setMaxActive(config.getMaxActive()); + + // common config + datasource.setMaxWait(druidConfig.getMaxWait()); + datasource.setTimeBetweenEvictionRunsMillis(druidConfig.getTimeBetweenEvictionRunsMillis()); + datasource.setMinEvictableIdleTimeMillis(druidConfig.getMinEvictableIdleTimeMillis()); + datasource.setMaxEvictableIdleTimeMillis(druidConfig.getMaxEvictableIdleTimeMillis()); + datasource.setValidationQuery(druidConfig.getValidationQuery()); + datasource.setTestWhileIdle(druidConfig.isTestWhileIdle()); + datasource.setTestOnBorrow(druidConfig.isTestOnBorrow()); + datasource.setTestOnReturn(druidConfig.isTestOnReturn()); + datasource.setPoolPreparedStatements(druidConfig.isPoolPreparedStatements()); + datasource.setMaxPoolPreparedStatementPerConnectionSize(druidConfig.getMaxPoolPreparedStatementPerConnectionSize()); + try { + datasource.setFilters(druidConfig.getFilters()); + } catch (SQLException e) { + logger.error("druid configuration initialization filter : {0}", e); + } + datasource.setConnectionProperties(druidConfig.getConnectionProperties()); + + return datasource; + } +} \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/druid/DruidOneConfig.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/druid/DruidOneConfig.java" new file mode 100644 index 0000000..ad8f6dc --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/druid/DruidOneConfig.java" @@ -0,0 +1,75 @@ +package com.neo.config.druid; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.DependsOn; +import org.springframework.stereotype.Component; + +@Component +@ConfigurationProperties(prefix="spring.datasource.druid.one") +public class DruidOneConfig extends DruidConfig{ + private String url; + private String username; + private String password; + private String driverClassName; + private int initialSize; + private int minIdle; + private int maxActive; + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getDriverClassName() { + return driverClassName; + } + + public void setDriverClassName(String driverClassName) { + this.driverClassName = driverClassName; + } + + public int getInitialSize() { + return initialSize; + } + + public void setInitialSize(int initialSize) { + this.initialSize = initialSize; + } + + public int getMinIdle() { + return minIdle; + } + + public void setMinIdle(int minIdle) { + this.minIdle = minIdle; + } + + public int getMaxActive() { + return maxActive; + } + + public void setMaxActive(int maxActive) { + this.maxActive = maxActive; + } + + +} diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/druid/DruidTwoConfig.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/druid/DruidTwoConfig.java" new file mode 100644 index 0000000..ec48d1f --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/config/druid/DruidTwoConfig.java" @@ -0,0 +1,73 @@ +package com.neo.config.druid; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.DependsOn; +import org.springframework.stereotype.Component; + +@Component +@ConfigurationProperties(prefix="spring.datasource.druid.two") +public class DruidTwoConfig extends DruidConfig{ + private String url; + private String username; + private String password; + private String driverClassName; + private int initialSize; + private int minIdle; + private int maxActive; + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getDriverClassName() { + return driverClassName; + } + + public void setDriverClassName(String driverClassName) { + this.driverClassName = driverClassName; + } + + public int getInitialSize() { + return initialSize; + } + + public void setInitialSize(int initialSize) { + this.initialSize = initialSize; + } + + public int getMinIdle() { + return minIdle; + } + + public void setMinIdle(int minIdle) { + this.minIdle = minIdle; + } + + public int getMaxActive() { + return maxActive; + } + + public void setMaxActive(int maxActive) { + this.maxActive = maxActive; + } +} diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/model/User.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/model/User.java" new file mode 100644 index 0000000..f4cb974 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/model/User.java" @@ -0,0 +1,86 @@ +package com.neo.model; + + + +import javax.persistence.*; + +import java.io.Serializable; + +@Entity +public class User implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + private long id; + @Column(nullable = false, unique = true) + private String userName; + @Column(nullable = false) + private String passWord; + @Column(nullable = false, unique = true) + private String email; + @Column(nullable = true, unique = true) + private String nickName; + @Column(nullable = false) + private String regTime; + + public User() { + } + + public User(String userName, String passWord, String email, String nickName, String regTime) { + this.userName = userName; + this.passWord = passWord; + this.email = email; + this.nickName = nickName; + this.regTime = regTime; + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getPassWord() { + return passWord; + } + + public void setPassWord(String passWord) { + this.passWord = passWord; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + public String getRegTime() { + return regTime; + } + + public void setRegTime(String regTime) { + this.regTime = regTime; + } +} diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/repository/test1/UserTest1Repository.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/repository/test1/UserTest1Repository.java" new file mode 100644 index 0000000..feeccea --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/repository/test1/UserTest1Repository.java" @@ -0,0 +1,10 @@ +package com.neo.repository.test1; + +import com.neo.model.User; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface UserTest1Repository extends JpaRepository { + User findById(long id); + User findByUserName(String userName); + User findByUserNameOrEmail(String username, String email); +} \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/repository/test2/UserTest2Repository.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/repository/test2/UserTest2Repository.java" new file mode 100644 index 0000000..45f8c24 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/repository/test2/UserTest2Repository.java" @@ -0,0 +1,11 @@ +package com.neo.repository.test2; + +import com.neo.model.User; +import org.springframework.data.jpa.repository.JpaRepository; + + +public interface UserTest2Repository extends JpaRepository { + User findById(long id); + User findByUserName(String userName); + User findByUserNameOrEmail(String username, String email); +} \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/web/UserController.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/web/UserController.java" new file mode 100644 index 0000000..3af164d --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/java/com/neo/web/UserController.java" @@ -0,0 +1,31 @@ +package com.neo.web; + + +import com.neo.model.User; +import com.neo.repository.test1.UserTest1Repository; +import com.neo.repository.test2.UserTest2Repository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +public class UserController { + + @Autowired + private UserTest1Repository userTest1Repository; + @Autowired + private UserTest2Repository userTest2Repository; + + @RequestMapping("/getUsers") + public List getUsers() { + List users1=userTest1Repository.findAll(); + List users2=userTest2Repository.findAll(); + users1.addAll(users2); + return users1; + } + + + +} \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/resources/application.properties" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/resources/application.properties" new file mode 100644 index 0000000..25e5cdf --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/main/resources/application.properties" @@ -0,0 +1,47 @@ +#primary +spring.datasource.druid.one.url=jdbc:mysql://localhost:3306/test1?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.druid.one.username=root +spring.datasource.druid.one.password=root +spring.datasource.druid.one.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.druid.one.initialSize=3 +spring.datasource.druid.one.minIdle=3 +spring.datasource.druid.one.maxActive=10 + +#secondary +spring.datasource.druid.two.url=jdbc:mysql://localhost:3306/test2?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.druid.two.username=root +spring.datasource.druid.two.password=root +spring.datasource.druid.two.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.druid.two.initialSize=6 +spring.datasource.druid.two.minIdle=20 +spring.datasource.druid.two.maxActive=30 + +#\u914D\u7F6E\u83B7\u53D6\u8FDE\u63A5\u7B49\u5F85\u8D85\u65F6\u7684\u65F6\u95F4 +spring.datasource.druid.maxWait=60000 +#\u914D\u7F6E\u95F4\u9694\u591A\u4E45\u624D\u8FDB\u884C\u4E00\u6B21\u68C0\u6D4B\uFF0C\u68C0\u6D4B\u9700\u8981\u5173\u95ED\u7684\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2 +spring.datasource.druid.timeBetweenEvictionRunsMillis=60000 +#\u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5C0F\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2 +spring.datasource.druid.minEvictableIdleTimeMillis=600000 +spring.datasource.druid.maxEvictableIdleTimeMillis=900000 +spring.datasource.druid.validationQuery=SELECT 1 FROM DUAL +#y\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548 +spring.datasource.druid.testWhileIdle=true +#\u662F\u5426\u5728\u4ECE\u6C60\u4E2D\u53D6\u51FA\u8FDE\u63A5\u524D\u8FDB\u884C\u68C0\u9A8C\u8FDE\u63A5\u6C60\u7684\u53EF\u7528\u6027 +spring.datasource.druid.testOnBorrow=false +#\u662F\u5426\u5728\u5F52\u8FD8\u5230\u6C60\u4E2D\u524D\u8FDB\u884C\u68C0\u9A8C\u8FDE\u63A5\u6C60\u7684\u53EF\u7528\u6027 +spring.datasource.druid.testOnReturn=false +# \u662F\u5426\u6253\u5F00PSCache\uFF0C +spring.datasource.druid.poolPreparedStatements=true +#\u5E76\u4E14\u6307\u5B9A\u6BCF\u4E2A\u8FDE\u63A5\u4E0APSCache\u7684\u5927\u5C0F +spring.datasource.druid.maxPoolPreparedStatementPerConnectionSize=20 +#\u914D\u7F6E\u76D1\u63A7\u7EDF\u8BA1\u62E6\u622A\u7684filters +spring.datasource.druid.filters=stat,wall,log4j +#\u901A\u8FC7connectProperties\u5C5E\u6027\u6765\u6253\u5F00mergeSql\u529F\u80FD\uFF1B\u6162SQL\u8BB0\u5F55 +spring.datasource.druid.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=600 + +spring.jpa.properties.hibernate.hbm2ddl.auto=create +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect +#sql\u8F93\u51FA +spring.jpa.show-sql=true +#format\u4E00\u4E0Bsql\u8FDB\u884C\u8F93\u51FA +spring.jpa.properties.hibernate.format_sql=true diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/test/java/com/neo/MultiJpaApplicationTests.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/test/java/com/neo/MultiJpaApplicationTests.java" new file mode 100644 index 0000000..c87999c --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/test/java/com/neo/MultiJpaApplicationTests.java" @@ -0,0 +1,18 @@ +package com.neo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class MultiJpaApplicationTests { + + @Test + public void contextLoads() { + System.out.println("Hello MultiJpa!"); + } + +} diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/test/java/com/neo/repository/UserRepositoryTests.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/test/java/com/neo/repository/UserRepositoryTests.java" new file mode 100644 index 0000000..a32df22 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-Jpa-druid/src/test/java/com/neo/repository/UserRepositoryTests.java" @@ -0,0 +1,60 @@ +package com.neo.repository; + +import com.neo.model.User; +import com.neo.repository.test1.UserTest1Repository; +import com.neo.repository.test2.UserTest2Repository; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.text.DateFormat; +import java.util.Date; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class UserRepositoryTests { + @Resource + private UserTest1Repository userTest1Repository; + @Resource + private UserTest2Repository userTest2Repository; + + + + @Test + public void testSave() throws Exception { + Date date = new Date(); + DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG); + String formattedDate = dateFormat.format(date); + + userTest1Repository.save(new User("aa", "aa123456","aa@126.com", "aa", formattedDate)); + userTest1Repository.save(new User("bb", "bb123456","bb@126.com", "bb", formattedDate)); + userTest2Repository.save(new User("cc", "cc123456","cc@126.com", "cc", formattedDate)); + } + + + @Test + public void testDelete() throws Exception { + userTest1Repository.deleteAll(); + userTest2Repository.deleteAll(); + } + + @Test + public void testBaseQuery() { + Date date = new Date(); + DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG); + String formattedDate = dateFormat.format(date); + User user=new User("ff", "ff123456","ff@126.com", "ff", formattedDate); + userTest1Repository.findAll(); + userTest2Repository.findById(3l); + userTest2Repository.save(user); + user.setId(2l); + userTest1Repository.delete(user); + userTest1Repository.count(); + userTest2Repository.findById(3l); + } + + +} \ No newline at end of file diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/pom.xml" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/pom.xml" similarity index 80% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/pom.xml" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/pom.xml" index 9104852..ea72831 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/pom.xml" +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/pom.xml" @@ -4,17 +4,17 @@ 4.0.0 com.neo - spring-boot-mybatis-druid + spring-boot-multi-mybatis-annotation-druid 1.0.0 jar - spring-boot-mybatis-druid + spring-boot-multi-mybatis-annotation-druid Demo project for Spring Boot and mybatis org.springframework.boot spring-boot-starter-parent - 1.5.8.RELEASE + 2.1.0.RELEASE @@ -24,15 +24,6 @@ - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-test - test - org.springframework.boot spring-boot-starter-web @@ -40,7 +31,7 @@ org.mybatis.spring.boot mybatis-spring-boot-starter - 1.3.1 + 1.3.2 mysql @@ -49,12 +40,12 @@ com.alibaba druid-spring-boot-starter - 1.1.5 + 1.1.10 - org.apache.commons - commons-lang3 - 3.6 + org.springframework.boot + spring-boot-starter-test + test org.springframework.boot diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/MMADApplication.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/MMADApplication.java" new file mode 100644 index 0000000..404293a --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/MMADApplication.java" @@ -0,0 +1,12 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class MMADApplication { + + public static void main(String[] args) { + SpringApplication.run(MMADApplication.class, args); + } +} diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/config/MultiDataSourceConfig.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/config/MultiDataSourceConfig.java" similarity index 100% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/config/MultiDataSourceConfig.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/config/MultiDataSourceConfig.java" diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/config/OneDataSourceConfig.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/config/OneDataSourceConfig.java" similarity index 100% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/config/OneDataSourceConfig.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/config/OneDataSourceConfig.java" diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/config/TwoSourceConfig.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/config/TwoSourceConfig.java" similarity index 86% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/config/TwoSourceConfig.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/config/TwoSourceConfig.java" index 6312b6e..9a4dd96 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/config/TwoSourceConfig.java" +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/config/TwoSourceConfig.java" @@ -1,13 +1,10 @@ package com.neo.config; -import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder; import org.apache.ibatis.session.SqlSessionFactory; import org.mybatis.spring.SqlSessionFactoryBean; import org.mybatis.spring.SqlSessionTemplate; import org.mybatis.spring.annotation.MapperScan; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder; -import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.jdbc.datasource.DataSourceTransactionManager; diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/enums/UserSexEnum.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/enums/UserSexEnum.java" new file mode 100644 index 0000000..0b8be44 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/enums/UserSexEnum.java" @@ -0,0 +1,5 @@ +package com.neo.enums; + +public enum UserSexEnum { + MAN, WOMAN +} diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/mapper/UserSql.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/mapper/UserSql.java" similarity index 81% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/mapper/UserSql.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/mapper/UserSql.java" index b73e44a..da3dcec 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/mapper/UserSql.java" +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/mapper/UserSql.java" @@ -1,7 +1,7 @@ package com.neo.mapper; +import com.mysql.cj.util.StringUtils; import com.neo.param.UserParam; -import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.jdbc.SQL; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -16,10 +16,10 @@ public String getList(UserParam userParam) { StringBuffer sql = new StringBuffer("select id, userName, passWord, user_sex as userSex, nick_name as nickName"); sql.append(" from users where 1=1 "); if (userParam != null) { - if (!StringUtils.isBlank(userParam.getUserName())) { + if (!StringUtils.isNullOrEmpty(userParam.getUserName())) { sql.append(" and userName = #{userName}"); } - if (!StringUtils.isBlank(userParam.getUserSex())) { + if (!StringUtils.isNullOrEmpty(userParam.getUserSex())) { sql.append(" and user_sex = #{userSex}"); } } @@ -33,10 +33,10 @@ public String getCount(UserParam userParam) { String sql= new SQL(){{ SELECT("count(1)"); FROM("users"); - if (StringUtils.isNotBlank(userParam.getUserName())) { + if (!StringUtils.isNullOrEmpty(userParam.getUserName())) { WHERE("userName = #{userName}"); } - if (StringUtils.isNotBlank(userParam.getUserSex())) { + if (!StringUtils.isNullOrEmpty(userParam.getUserSex())) { WHERE("user_sex = #{userSex}"); } //从这个toString可以看出,其内部使用高效的StringBuilder实现SQL拼接 diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/mapper/one/UserOneMapper.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/mapper/one/UserOneMapper.java" similarity index 83% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/mapper/one/UserOneMapper.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/mapper/one/UserOneMapper.java" index 5556623..e6fde65 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/mapper/one/UserOneMapper.java" +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/mapper/one/UserOneMapper.java" @@ -1,6 +1,6 @@ package com.neo.mapper.one; -import com.neo.entity.UserEntity; +import com.neo.model.User; import com.neo.enums.UserSexEnum; import com.neo.mapper.UserSql; import com.neo.param.UserParam; @@ -15,10 +15,10 @@ public interface UserOneMapper { @Result(property = "userSex", column = "user_sex", javaType = UserSexEnum.class), @Result(property = "nickName", column = "nick_name") }) - List getAll(); + List getAll(); @SelectProvider(type = UserSql.class, method = "getList") - List getList(UserParam userParam); + List getList(UserParam userParam); @SelectProvider(type = UserSql.class, method = "getCount") int getCount(UserParam userParam); @@ -28,13 +28,13 @@ public interface UserOneMapper { @Result(property = "userSex", column = "user_sex", javaType = UserSexEnum.class), @Result(property = "nickName", column = "nick_name") }) - UserEntity getOne(Long id); + User getOne(Long id); @Insert("INSERT INTO users(userName,passWord,user_sex) VALUES(#{userName}, #{passWord}, #{userSex})") - void insert(UserEntity user); + void insert(User user); @Update("UPDATE users SET userName=#{userName},nick_name=#{nickName} WHERE id =#{id}") - void update(UserEntity user); + void update(User user); @Delete("DELETE FROM users WHERE id =#{id}") void delete(Long id); diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/mapper/two/UserTwoMapper.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/mapper/two/UserTwoMapper.java" similarity index 83% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/mapper/two/UserTwoMapper.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/mapper/two/UserTwoMapper.java" index f745131..a5b32d4 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/mapper/two/UserTwoMapper.java" +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/mapper/two/UserTwoMapper.java" @@ -1,6 +1,6 @@ package com.neo.mapper.two; -import com.neo.entity.UserEntity; +import com.neo.model.User; import com.neo.enums.UserSexEnum; import com.neo.mapper.UserSql; import com.neo.param.UserParam; @@ -15,10 +15,10 @@ public interface UserTwoMapper { @Result(property = "userSex", column = "user_sex", javaType = UserSexEnum.class), @Result(property = "nickName", column = "nick_name") }) - List getAll(); + List getAll(); @SelectProvider(type = UserSql.class, method = "getList") - List getList(UserParam userParam); + List getList(UserParam userParam); @SelectProvider(type = UserSql.class, method = "getCount") int getCount(UserParam userParam); @@ -28,13 +28,13 @@ public interface UserTwoMapper { @Result(property = "userSex", column = "user_sex", javaType = UserSexEnum.class), @Result(property = "nickName", column = "nick_name") }) - UserEntity getOne(Long id); + User getOne(Long id); @Insert("INSERT INTO users(userName,passWord,user_sex) VALUES(#{userName}, #{passWord}, #{userSex})") - void insert(UserEntity user); + void insert(User user); @Update("UPDATE users SET userName=#{userName},nick_name=#{nickName} WHERE id =#{id}") - void update(UserEntity user); + void update(User user); @Delete("DELETE FROM users WHERE id =#{id}") void delete(Long id); diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/model/User.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/model/User.java" new file mode 100644 index 0000000..a459a82 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/model/User.java" @@ -0,0 +1,77 @@ +package com.neo.model; + +import java.io.Serializable; + +import com.neo.enums.UserSexEnum; + +public class User implements Serializable { + + private static final long serialVersionUID = 1L; + private Long id; + private String userName; + private String passWord; + private UserSexEnum userSex; + private String nickName; + + public User() { + super(); + } + + public User(String userName, String passWord, UserSexEnum userSex) { + super(); + this.passWord = passWord; + this.userName = userName; + this.userSex = userSex; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getPassWord() { + return passWord; + } + + public void setPassWord(String passWord) { + this.passWord = passWord; + } + + public UserSexEnum getUserSex() { + return userSex; + } + + public void setUserSex(UserSexEnum userSex) { + this.userSex = userSex; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + @Override + public String toString() { + return "User{" + + "id=" + id + + ", userName='" + userName + '\'' + + ", passWord='" + passWord + '\'' + + ", userSex=" + userSex + + ", nickName='" + nickName + '\'' + + '}'; + } +} \ No newline at end of file diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/param/PageParam.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/param/PageParam.java" similarity index 77% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/param/PageParam.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/param/PageParam.java" index ae979ab..1fbad44 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/param/PageParam.java" +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/param/PageParam.java" @@ -1,7 +1,5 @@ package com.neo.param; -import org.apache.commons.lang3.builder.ToStringBuilder; - public class PageParam { private int beginLine; //起始行 private Integer pageSize = 3; @@ -27,9 +25,12 @@ public void setCurrentPage(Integer currentPage) { this.currentPage = currentPage; } - @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + return "PageParam{" + + "beginLine=" + beginLine + + ", pageSize=" + pageSize + + ", currentPage=" + currentPage + + '}'; } } diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/param/UserParam.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/param/UserParam.java" similarity index 100% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/param/UserParam.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/param/UserParam.java" diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/result/Page.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/result/Page.java" similarity index 91% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/result/Page.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/result/Page.java" index d6b6aa4..63bca7e 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/result/Page.java" +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/result/Page.java" @@ -2,7 +2,6 @@ import com.neo.param.PageParam; -import org.apache.commons.lang3.builder.ToStringBuilder; import java.io.Serializable; import java.util.ArrayList; @@ -90,6 +89,11 @@ public void setList(List list) { @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + return "Page{" + + "currentPage=" + currentPage + + ", totalPage=" + totalPage + + ", totalNumber=" + totalNumber + + ", list=" + list + + '}'; } } diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/web/UserController.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/web/UserController.java" similarity index 71% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/web/UserController.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/web/UserController.java" index 6bda33c..84baff3 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/web/UserController.java" +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/java/com/neo/web/UserController.java" @@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import com.neo.entity.UserEntity; +import com.neo.model.User; @RestController public class UserController { @@ -23,34 +23,34 @@ public class UserController { private UserTwoMapper userTwoMapper; @RequestMapping("/getUsers") - public List getUsers() { - List usersOne=userOneMapper.getAll(); - List usersTwo=userTwoMapper.getAll(); + public List getUsers() { + List usersOne=userOneMapper.getAll(); + List usersTwo=userTwoMapper.getAll(); usersOne.addAll(usersTwo); return usersOne; } @RequestMapping("/getList") - public Page getList(UserParam userParam) { - List users=userOneMapper.getList(userParam); + public Page getList(UserParam userParam) { + List users=userOneMapper.getList(userParam); long count=userOneMapper.getCount(userParam); Page page = new Page(userParam,count,users); return page; } @RequestMapping("/getUser") - public UserEntity getUser(Long id) { - UserEntity user=userTwoMapper.getOne(id); + public User getUser(Long id) { + User user=userTwoMapper.getOne(id); return user; } @RequestMapping("/add") - public void save(UserEntity user) { + public void save(User user) { userOneMapper.insert(user); } @RequestMapping(value="update") - public void update(UserEntity user) { + public void update(User user) { userOneMapper.update(user); } diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/resources/application.properties" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/resources/application.properties" new file mode 100644 index 0000000..58332ee --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/main/resources/application.properties" @@ -0,0 +1,28 @@ +mybatis.type-aliases-package=com.neo.model + +spring.datasource.druid.one.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.druid.one.url = jdbc:mysql://localhost:3306/test1?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.druid.one.username = root +spring.datasource.druid.one.password = root +spring.datasource.druid.one.initial-size=3 +spring.datasource.druid.one.min-idle=3 +spring.datasource.druid.one.max-active=10 +spring.datasource.druid.one.max-wait=60000 + + +spring.datasource.druid.two.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.druid.two.url = jdbc:mysql://localhost:3306/test2?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.druid.two.username = root +spring.datasource.druid.two.password = root +spring.datasource.druid.two.initial-size=6 +spring.datasource.druid.two.min-idle=6 +spring.datasource.druid.two.max-active=20 +spring.datasource.druid.two.max-wait=120000 + +# StatViewServlet \u914D\u7F6E +spring.datasource.druid.stat-view-servlet.login-username=admin +spring.datasource.druid.stat-view-servlet.login-password=admin + +# \u914D\u7F6EStatFilter +spring.datasource.druid.filter.stat.log-slow-sql=true +spring.datasource.druid.filter.stat.slow-sql-millis=2000 diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/test/java/com/neo/MMADApplicationTests.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/test/java/com/neo/MMADApplicationTests.java" new file mode 100644 index 0000000..970befd --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/test/java/com/neo/MMADApplicationTests.java" @@ -0,0 +1,17 @@ +package com.neo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class MMADApplicationTests { + + @Test + public void contextLoads() { + System.out.println("hello world"); + } + +} diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/test/java/com/neo/mapper/UserMapperTest.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/test/java/com/neo/mapper/UserMapperTest.java" similarity index 74% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/test/java/com/neo/mapper/UserMapperTest.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/test/java/com/neo/mapper/UserMapperTest.java" index a5d5025..16ca8f8 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/test/java/com/neo/mapper/UserMapperTest.java" +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/src/test/java/com/neo/mapper/UserMapperTest.java" @@ -13,7 +13,7 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; -import com.neo.entity.UserEntity; +import com.neo.model.User; import com.neo.enums.UserSexEnum; @RunWith(SpringRunner.class) @@ -28,24 +28,24 @@ public class UserMapperTest { @Test public void testInsert() throws Exception { - userOneMapper.insert(new UserEntity("aaa", "a123456", UserSexEnum.MAN)); - userOneMapper.insert(new UserEntity("bbb", "b123456", UserSexEnum.WOMAN)); - userTwoMapper.insert(new UserEntity("ccc", "b123456", UserSexEnum.WOMAN)); - - Assert.assertEquals(2, userOneMapper.getAll().size()); + userOneMapper.insert(new User("aaa", "a123456", UserSexEnum.MAN)); + userOneMapper.insert(new User("bbb", "b123456", UserSexEnum.WOMAN)); + userTwoMapper.insert(new User("ccc", "b123456", UserSexEnum.WOMAN)); +/* Assert.assertEquals(2, userOneMapper.getAll().size()); + Assert.assertEquals(2, userOneMapper.getAll().size());*/ } @Test public void testQuery() throws Exception { - List users = userTwoMapper.getAll(); + List users = userTwoMapper.getAll(); System.out.println(users.toString()); } @Test public void testUpdate() throws Exception { - UserEntity user = userOneMapper.getOne(3l); + User user = userOneMapper.getOne(3l); System.out.println(user.toString()); user.setNickName("neo"); userOneMapper.update(user); @@ -58,7 +58,7 @@ public void testPage() { UserParam userParam=new UserParam(); userParam.setUserSex("WOMAN"); userParam.setCurrentPage(1); - List users=userOneMapper.getList(userParam); + List users=userOneMapper.getList(userParam); long count=userOneMapper.getCount(userParam); Page page = new Page(userParam,count,users); System.out.println(page); diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/users.sql" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/users.sql" similarity index 100% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/users.sql" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-annotation-druid/users.sql" diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/pom.xml" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/pom.xml" similarity index 80% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/pom.xml" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/pom.xml" index 5cf69f9..7da5e96 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/pom.xml" +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/pom.xml" @@ -4,17 +4,17 @@ 4.0.0 com.neo - spring-boot-multi-mybatis-druid + spring-boot-multi-mybatis-xml-druid-druid 1.0.0 jar - spring-boot-multi-mybatis-druid + spring-boot-multi-mybatis-xml-druid Demo project for Spring Boot and mybatis org.springframework.boot spring-boot-starter-parent - 1.5.8.RELEASE + 2.1.0.RELEASE @@ -24,15 +24,6 @@ - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-test - test - org.springframework.boot spring-boot-starter-web @@ -40,21 +31,21 @@ org.mybatis.spring.boot mybatis-spring-boot-starter - 1.3.1 + 1.3.2 - - mysql - mysql-connector-java - com.alibaba druid-spring-boot-starter - 1.1.5 + 1.1.10 + + mysql + mysql-connector-java + - org.apache.commons - commons-lang3 - 3.6 + org.springframework.boot + spring-boot-starter-test + test org.springframework.boot diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/MMXDApplication.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/MMXDApplication.java" new file mode 100644 index 0000000..cd982fb --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/MMXDApplication.java" @@ -0,0 +1,12 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class MMXDApplication { + + public static void main(String[] args) { + SpringApplication.run(MMXDApplication.class, args); + } +} diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/datasource/DataSource1Config.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/datasource/DataSource1Config.java" new file mode 100644 index 0000000..12578cb --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/datasource/DataSource1Config.java" @@ -0,0 +1,45 @@ +package com.neo.datasource; + +import org.apache.ibatis.session.SqlSessionFactory; +import org.mybatis.spring.SqlSessionFactoryBean; +import org.mybatis.spring.SqlSessionTemplate; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.jdbc.DataSourceBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.jdbc.datasource.DataSourceTransactionManager; + +import javax.sql.DataSource; + + +@Configuration +@MapperScan(basePackages = "com.neo.mapper.test1", sqlSessionTemplateRef = "test1SqlSessionTemplate") +public class DataSource1Config { + + + @Bean(name = "test1SqlSessionFactory") + @Primary + public SqlSessionFactory testSqlSessionFactory(@Qualifier("oneDataSource") DataSource dataSource) throws Exception { + SqlSessionFactoryBean bean = new SqlSessionFactoryBean(); + bean.setDataSource(dataSource); + bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mybatis/mapper/test1/*.xml")); + return bean.getObject(); + } + + @Bean(name = "test1TransactionManager") + @Primary + public DataSourceTransactionManager testTransactionManager(@Qualifier("oneDataSource") DataSource dataSource) { + return new DataSourceTransactionManager(dataSource); + } + + @Bean(name = "test1SqlSessionTemplate") + @Primary + public SqlSessionTemplate testSqlSessionTemplate(@Qualifier("test1SqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception { + return new SqlSessionTemplate(sqlSessionFactory); + } + +} diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/datasource/DataSource2Config.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/datasource/DataSource2Config.java" new file mode 100644 index 0000000..e1477b3 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/datasource/DataSource2Config.java" @@ -0,0 +1,40 @@ +package com.neo.datasource; + +import org.apache.ibatis.session.SqlSessionFactory; +import org.mybatis.spring.SqlSessionFactoryBean; +import org.mybatis.spring.SqlSessionTemplate; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.jdbc.DataSourceBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.jdbc.datasource.DataSourceTransactionManager; + +import javax.sql.DataSource; + + +@Configuration +@MapperScan(basePackages = "com.neo.mapper.test2", sqlSessionTemplateRef = "test2SqlSessionTemplate") +public class DataSource2Config { + + @Bean(name = "test2SqlSessionFactory") + public SqlSessionFactory testSqlSessionFactory(@Qualifier("twoDataSource") DataSource dataSource) throws Exception { + SqlSessionFactoryBean bean = new SqlSessionFactoryBean(); + bean.setDataSource(dataSource); + bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mybatis/mapper/test2/*.xml")); + return bean.getObject(); + } + + @Bean(name = "test2TransactionManager") + public DataSourceTransactionManager testTransactionManager(@Qualifier("twoDataSource") DataSource dataSource) { + return new DataSourceTransactionManager(dataSource); + } + + @Bean(name = "test2SqlSessionTemplate") + public SqlSessionTemplate testSqlSessionTemplate(@Qualifier("test2SqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception { + return new SqlSessionTemplate(sqlSessionFactory); + } + +} diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/datasource/MultiDataSourceConfig.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/datasource/MultiDataSourceConfig.java" new file mode 100644 index 0000000..c89975d --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/datasource/MultiDataSourceConfig.java" @@ -0,0 +1,25 @@ +package com.neo.datasource; + +import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; + +import javax.sql.DataSource; + + +@Configuration +public class MultiDataSourceConfig { + @Primary + @Bean(name = "oneDataSource") + @ConfigurationProperties("spring.datasource.druid.one") + public DataSource dataSourceOne(){ + return DruidDataSourceBuilder.create().build(); + } + @Bean(name = "twoDataSource") + @ConfigurationProperties("spring.datasource.druid.two") + public DataSource dataSourceTwo(){ + return DruidDataSourceBuilder.create().build(); + } +} diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/enums/UserSexEnum.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/enums/UserSexEnum.java" new file mode 100644 index 0000000..0b8be44 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/enums/UserSexEnum.java" @@ -0,0 +1,5 @@ +package com.neo.enums; + +public enum UserSexEnum { + MAN, WOMAN +} diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/mapper/test1/User1Mapper.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/mapper/test1/User1Mapper.java" new file mode 100644 index 0000000..d950282 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/mapper/test1/User1Mapper.java" @@ -0,0 +1,19 @@ +package com.neo.mapper.test1; + +import com.neo.model.User; + +import java.util.List; + +public interface User1Mapper { + + List getAll(); + + User getOne(Long id); + + void insert(User user); + + void update(User user); + + void delete(Long id); + +} \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/mapper/test2/User2Mapper.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/mapper/test2/User2Mapper.java" new file mode 100644 index 0000000..d5c91eb --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/mapper/test2/User2Mapper.java" @@ -0,0 +1,19 @@ +package com.neo.mapper.test2; + +import java.util.List; + +import com.neo.model.User; + +public interface User2Mapper { + + List getAll(); + + User getOne(Long id); + + void insert(User user); + + void update(User user); + + void delete(Long id); + +} \ No newline at end of file diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/java/com/neo/entity/UserEntity.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/model/User.java" similarity index 78% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/java/com/neo/entity/UserEntity.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/model/User.java" index 0a88b17..de50165 100644 --- "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/java/com/neo/entity/UserEntity.java" +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/model/User.java" @@ -1,11 +1,10 @@ -package com.neo.entity; +package com.neo.model; import java.io.Serializable; import com.neo.enums.UserSexEnum; -import org.apache.commons.lang3.builder.ToStringBuilder; -public class UserEntity implements Serializable { +public class User implements Serializable { private static final long serialVersionUID = 1L; private Long id; @@ -14,11 +13,11 @@ public class UserEntity implements Serializable { private UserSexEnum userSex; private String nickName; - public UserEntity() { + public User() { super(); } - public UserEntity(String userName, String passWord, UserSexEnum userSex) { + public User(String userName, String passWord, UserSexEnum userSex) { super(); this.passWord = passWord; this.userName = userName; @@ -67,7 +66,8 @@ public void setNickName(String nickName) { @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + // TODO Auto-generated method stub + return "userName " + this.userName + ", pasword " + this.passWord + "sex " + userSex.name(); } } \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/web/UserController.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/web/UserController.java" new file mode 100644 index 0000000..2a162fd --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/java/com/neo/web/UserController.java" @@ -0,0 +1,52 @@ +package com.neo.web; + +import java.util.List; + +import com.neo.mapper.test1.User1Mapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.neo.model.User; +import com.neo.mapper.test2.User2Mapper; + +@RestController +public class UserController { + + @Autowired + private User1Mapper user1Mapper; + + @Autowired + private User2Mapper user2Mapper; + + @RequestMapping("/getUsers") + public List getUsers() { + List users=user1Mapper.getAll(); + users.addAll(user2Mapper.getAll()); + return users; + } + + @RequestMapping("/getUser") + public User getUser(Long id) { + User user=user2Mapper.getOne(id); + return user; + } + + @RequestMapping("/add") + public void save(User user) { + user2Mapper.insert(user); + } + + @RequestMapping(value="update") + public void update(User user) { + user2Mapper.update(user); + } + + @RequestMapping(value="/delete/{id}") + public void delete(@PathVariable("id") Long id) { + user1Mapper.delete(id); + } + + +} \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/resources/application.properties" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/resources/application.properties" new file mode 100644 index 0000000..1ce8b6a --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/resources/application.properties" @@ -0,0 +1,32 @@ +mybatis.config-location=classpath:mybatis/mybatis-config.xml +mybatis.type-aliases-package=com.neo.model + +spring.datasource.druid.one.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.druid.one.url = jdbc:mysql://localhost:3306/test1?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.druid.one.username = root +spring.datasource.druid.one.password = root + +spring.datasource.druid.two.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.druid.two.url = jdbc:mysql://localhost:3306/test2?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.druid.two.username = root +spring.datasource.druid.two.password = root + +# StatViewServlet \u914D\u7F6E +spring.datasource.druid.stat-view-servlet.login-username=admin +spring.datasource.druid.stat-view-servlet.login-password=admin + +# \u914D\u7F6E StatFilter +spring.datasource.druid.filter.stat.log-slow-sql=true +spring.datasource.druid.filter.stat.slow-sql-millis=2000 + +# Druid \u6570\u636E\u6E90 1 \u914D\u7F6E +spring.datasource.druid.one.initial-size=3 +spring.datasource.druid.one.min-idle=3 +spring.datasource.druid.one.max-active=10 +spring.datasource.druid.one.max-wait=60000 + +# Druid \u6570\u636E\u6E90 2 \u914D\u7F6E +spring.datasource.druid.two.initial-size=6 +spring.datasource.druid.two.min-idle=6 +spring.datasource.druid.two.max-active=20 +spring.datasource.druid.two.max-wait=120000 \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/resources/mybatis/mapper/test1/UserMapper.xml" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/resources/mybatis/mapper/test1/UserMapper.xml" new file mode 100644 index 0000000..0a2ced2 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/resources/mybatis/mapper/test1/UserMapper.xml" @@ -0,0 +1,55 @@ + + + + + + + + + + + + + id, userName, passWord, user_sex, nick_name + + + + + + + + INSERT INTO + users + (userName,passWord,user_sex) + VALUES + (#{userName}, #{passWord}, #{userSex}) + + + + UPDATE + users + SET + userName = #{userName}, + passWord = #{passWord}, + nick_name = #{nickName} + WHERE + id = #{id} + + + + DELETE FROM + users + WHERE + id =#{id} + + + \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/resources/mybatis/mapper/test2/UserMapper.xml" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/resources/mybatis/mapper/test2/UserMapper.xml" new file mode 100644 index 0000000..da3dc2e --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/resources/mybatis/mapper/test2/UserMapper.xml" @@ -0,0 +1,55 @@ + + + + + + + + + + + + + id, userName, passWord, user_sex, nick_name + + + + + + + + INSERT INTO + users + (userName,passWord,user_sex) + VALUES + (#{userName}, #{passWord}, #{userSex}) + + + + UPDATE + users + SET + userName = #{userName}, + passWord = #{passWord}, + nick_name = #{nickName} + WHERE + id = #{id} + + + + DELETE FROM + users + WHERE + id =#{id} + + + \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/resources/mybatis/mybatis-config.xml" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/resources/mybatis/mybatis-config.xml" new file mode 100644 index 0000000..56097ff --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/main/resources/mybatis/mybatis-config.xml" @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/test/java/com/neo/MMXDApplicationTests.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/test/java/com/neo/MMXDApplicationTests.java" new file mode 100644 index 0000000..d40f298 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/test/java/com/neo/MMXDApplicationTests.java" @@ -0,0 +1,17 @@ +package com.neo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class MMXDApplicationTests { + + @Test + public void contextLoads() { + System.out.println("hello world"); + } + +} diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/test/java/com/neo/mapper/User1MapperTest.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/test/java/com/neo/mapper/User1MapperTest.java" new file mode 100644 index 0000000..0cb0f64 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/test/java/com/neo/mapper/User1MapperTest.java" @@ -0,0 +1,52 @@ +package com.neo.mapper; + +import java.util.List; + +import com.neo.mapper.test1.User1Mapper; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import com.neo.model.User; +import com.neo.enums.UserSexEnum; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class User1MapperTest { + + @Autowired + private User1Mapper userMapper; + + @Test + public void testInsert() throws Exception { + userMapper.insert(new User("aammxd", "a123456", UserSexEnum.MAN)); + userMapper.insert(new User("bbmmxd", "b123456", UserSexEnum.WOMAN)); + userMapper.insert(new User("ccmmxd", "b123456", UserSexEnum.WOMAN)); + +// Assert.assertEquals(3, userMapper.getAll().size()); + } + + @Test + public void testQuery() throws Exception { + List users = userMapper.getAll(); + if(users==null || users.size()==0){ + System.out.println("is null"); + }else{ + System.out.println(users.size()); + } + } + + + @Test + public void testUpdate() throws Exception { + User user = userMapper.getOne(6l); + System.out.println(user.toString()); + user.setNickName("neo"); + userMapper.update(user); + Assert.assertTrue(("neo".equals(userMapper.getOne(6l).getNickName()))); + } + +} \ No newline at end of file diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/test/java/com/neo/mapper/User2MapperTest.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/test/java/com/neo/mapper/User2MapperTest.java" new file mode 100644 index 0000000..b55fa3d --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/src/test/java/com/neo/mapper/User2MapperTest.java" @@ -0,0 +1,51 @@ +package com.neo.mapper; + +import com.neo.model.User; +import com.neo.enums.UserSexEnum; +import com.neo.mapper.test2.User2Mapper; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.List; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class User2MapperTest { + + @Autowired + private User2Mapper userMapper; + + @Test + public void testInsert() throws Exception { + userMapper.insert(new User("aammxd2", "a123456", UserSexEnum.MAN)); + userMapper.insert(new User("bbmmxd2", "b123456", UserSexEnum.WOMAN)); + userMapper.insert(new User("ccmmxd2", "b123456", UserSexEnum.WOMAN)); + +// Assert.assertEquals(3, userMapper.getAll().size()); + } + + @Test + public void testQuery() throws Exception { + List users = userMapper.getAll(); + if(users==null || users.size()==0){ + System.out.println("is null"); + }else{ + System.out.println(users.toString()); + } + } + + + @Test + public void testUpdate() throws Exception { + User user = userMapper.getOne(6l); + System.out.println(user.toString()); + user.setNickName("neo"); + userMapper.update(user); + Assert.assertTrue(("neo".equals(userMapper.getOne(6l).getNickName()))); + } + +} \ No newline at end of file diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/users.sql" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/users.sql" similarity index 100% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/users.sql" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-xml-druid/users.sql" diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/pom.xml" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/pom.xml" new file mode 100644 index 0000000..a15fb87 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/pom.xml" @@ -0,0 +1,70 @@ + + + 4.0.0 + + com.neo + spring-boot-mybatis-annotation-druid + 1.0.0 + jar + + spring-boot-mybatis-annotation-druid + Demo project for Spring Boot and mybatis + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + 1.3.2 + + + mysql + mysql-connector-java + + + com.alibaba + druid-spring-boot-starter + 1.1.10 + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-devtools + true + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + + + + + diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/Application.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/MADApplication.java" similarity index 77% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/Application.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/MADApplication.java" index 8f280fe..577d755 100644 --- "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/Application.java" +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/MADApplication.java" @@ -6,9 +6,9 @@ @SpringBootApplication @MapperScan("com.neo.mapper") -public class Application { +public class MADApplication { public static void main(String[] args) { - SpringApplication.run(Application.class, args); + SpringApplication.run(MADApplication.class, args); } } diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/enums/UserSexEnum.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/enums/UserSexEnum.java" new file mode 100644 index 0000000..0b8be44 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/enums/UserSexEnum.java" @@ -0,0 +1,5 @@ +package com.neo.enums; + +public enum UserSexEnum { + MAN, WOMAN +} diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/mapper/UserMapper.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/mapper/UserMapper.java" similarity index 83% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/mapper/UserMapper.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/mapper/UserMapper.java" index 15274cb..b6425db 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/mapper/UserMapper.java" +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/mapper/UserMapper.java" @@ -5,7 +5,7 @@ import com.neo.param.UserParam; import org.apache.ibatis.annotations.*; -import com.neo.entity.UserEntity; +import com.neo.model.User; import com.neo.enums.UserSexEnum; public interface UserMapper { @@ -15,10 +15,10 @@ public interface UserMapper { @Result(property = "userSex", column = "user_sex", javaType = UserSexEnum.class), @Result(property = "nickName", column = "nick_name") }) - List getAll(); + List getAll(); @SelectProvider(type = UserSql.class, method = "getList") - List getList(UserParam userParam); + List getList(UserParam userParam); @SelectProvider(type = UserSql.class, method = "getCount") int getCount(UserParam userParam); @@ -28,13 +28,13 @@ public interface UserMapper { @Result(property = "userSex", column = "user_sex", javaType = UserSexEnum.class), @Result(property = "nickName", column = "nick_name") }) - UserEntity getOne(Long id); + User getOne(Long id); @Insert("INSERT INTO users(userName,passWord,user_sex) VALUES(#{userName}, #{passWord}, #{userSex})") - void insert(UserEntity user); + void insert(User user); @Update("UPDATE users SET userName=#{userName},nick_name=#{nickName} WHERE id =#{id}") - void update(UserEntity user); + void update(User user); @Delete("DELETE FROM users WHERE id =#{id}") void delete(Long id); diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/mapper/UserSql.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/mapper/UserSql.java" similarity index 76% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/mapper/UserSql.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/mapper/UserSql.java" index b73e44a..834d387 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-multi-mybatis-druid/src/main/java/com/neo/mapper/UserSql.java" +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/mapper/UserSql.java" @@ -1,7 +1,7 @@ package com.neo.mapper; +import com.mysql.cj.util.StringUtils; import com.neo.param.UserParam; -import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.jdbc.SQL; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -11,15 +11,13 @@ public class UserSql { private static final Logger log = LoggerFactory.getLogger(UserSql.class); public String getList(UserParam userParam) { - int currentPage = 1; - int pageSize = 15; StringBuffer sql = new StringBuffer("select id, userName, passWord, user_sex as userSex, nick_name as nickName"); sql.append(" from users where 1=1 "); if (userParam != null) { - if (!StringUtils.isBlank(userParam.getUserName())) { + if (!StringUtils.isNullOrEmpty(userParam.getUserName())) { sql.append(" and userName = #{userName}"); } - if (!StringUtils.isBlank(userParam.getUserSex())) { + if (!StringUtils.isNullOrEmpty(userParam.getUserSex())) { sql.append(" and user_sex = #{userSex}"); } } @@ -30,13 +28,13 @@ public String getList(UserParam userParam) { } public String getCount(UserParam userParam) { - String sql= new SQL(){{ + String sql= new SQL(){{ SELECT("count(1)"); FROM("users"); - if (StringUtils.isNotBlank(userParam.getUserName())) { + if (!StringUtils.isNullOrEmpty(userParam.getUserName())) { WHERE("userName = #{userName}"); } - if (StringUtils.isNotBlank(userParam.getUserSex())) { + if (!StringUtils.isNullOrEmpty(userParam.getUserSex())) { WHERE("user_sex = #{userSex}"); } //从这个toString可以看出,其内部使用高效的StringBuilder实现SQL拼接 diff --git "a/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/model/User.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/model/User.java" new file mode 100644 index 0000000..a459a82 --- /dev/null +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/model/User.java" @@ -0,0 +1,77 @@ +package com.neo.model; + +import java.io.Serializable; + +import com.neo.enums.UserSexEnum; + +public class User implements Serializable { + + private static final long serialVersionUID = 1L; + private Long id; + private String userName; + private String passWord; + private UserSexEnum userSex; + private String nickName; + + public User() { + super(); + } + + public User(String userName, String passWord, UserSexEnum userSex) { + super(); + this.passWord = passWord; + this.userName = userName; + this.userSex = userSex; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getPassWord() { + return passWord; + } + + public void setPassWord(String passWord) { + this.passWord = passWord; + } + + public UserSexEnum getUserSex() { + return userSex; + } + + public void setUserSex(UserSexEnum userSex) { + this.userSex = userSex; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + @Override + public String toString() { + return "User{" + + "id=" + id + + ", userName='" + userName + '\'' + + ", passWord='" + passWord + '\'' + + ", userSex=" + userSex + + ", nickName='" + nickName + '\'' + + '}'; + } +} \ No newline at end of file diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/java/com/neo/param/PageParam.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/param/PageParam.java" similarity index 77% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/java/com/neo/param/PageParam.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/param/PageParam.java" index 5199932..af9f546 100644 --- "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/java/com/neo/param/PageParam.java" +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/param/PageParam.java" @@ -1,7 +1,5 @@ package com.neo.param; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.jboss.logging.Field; public class PageParam { private int beginLine; //起始行 @@ -28,9 +26,12 @@ public void setCurrentPage(Integer currentPage) { this.currentPage = currentPage; } - @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + return "PageParam{" + + "beginLine=" + beginLine + + ", pageSize=" + pageSize + + ", currentPage=" + currentPage + + '}'; } } diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/java/com/neo/param/UserParam.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/param/UserParam.java" similarity index 92% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/java/com/neo/param/UserParam.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/param/UserParam.java" index ce90d1d..d3a8fdf 100644 --- "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/main/java/com/neo/param/UserParam.java" +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/param/UserParam.java" @@ -1,7 +1,5 @@ package com.neo.param; -import com.neo.enums.UserSexEnum; - public class UserParam extends PageParam{ private String userName; diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/result/Page.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/result/Page.java" similarity index 91% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/result/Page.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/result/Page.java" index d6b6aa4..8a37424 100644 --- "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/main/java/com/neo/result/Page.java" +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/result/Page.java" @@ -2,7 +2,6 @@ import com.neo.param.PageParam; -import org.apache.commons.lang3.builder.ToStringBuilder; import java.io.Serializable; import java.util.ArrayList; @@ -16,7 +15,7 @@ public class Page implements Serializable { private static final long serialVersionUID = -2020350783443768083L; - private int currentPage = 1; //当前页数 + private int currentPage = 0; //当前页数 private long totalPage; //总页数 private long totalNumber; //总记录数 private List list; //数据集 @@ -88,8 +87,11 @@ public void setList(List list) { this.list = list; } - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this); + public static Page getNULL() { + return NULL; + } + + public static void setNULL(Page NULL) { + Page.NULL = NULL; } } diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/web/UserController.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/web/UserController.java" similarity index 72% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/web/UserController.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/web/UserController.java" index 31b355e..802002d 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/java/com/neo/web/UserController.java" +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/java/com/neo/web/UserController.java" @@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import com.neo.entity.UserEntity; +import com.neo.model.User; import com.neo.mapper.UserMapper; @RestController @@ -19,32 +19,32 @@ public class UserController { private UserMapper userMapper; @RequestMapping("/getUsers") - public List getUsers() { - List users=userMapper.getAll(); + public List getUsers() { + List users=userMapper.getAll(); return users; } @RequestMapping("/getList") - public Page getList(UserParam userParam) { - List users=userMapper.getList(userParam); + public Page getList(UserParam userParam) { + List users=userMapper.getList(userParam); long count=userMapper.getCount(userParam); Page page = new Page(userParam,count,users); return page; } @RequestMapping("/getUser") - public UserEntity getUser(Long id) { - UserEntity user=userMapper.getOne(id); + public User getUser(Long id) { + User user=userMapper.getOne(id); return user; } @RequestMapping("/add") - public void save(UserEntity user) { + public void save(User user) { userMapper.insert(user); } @RequestMapping(value="update") - public void update(UserEntity user) { + public void update(User user) { userMapper.update(user); } diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/resources/application.properties" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/resources/application.properties" similarity index 54% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/resources/application.properties" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/resources/application.properties" index 5a6d583..0d53070 100644 --- "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/src/main/resources/application.properties" +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/main/resources/application.properties" @@ -1,9 +1,10 @@ -mybatis.type-aliases-package=com.neo.entity +mybatis.type-aliases-package=com.neo.model -spring.datasource.driverClassName = com.mysql.jdbc.Driver -spring.datasource.url = jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8 -spring.datasource.username = root -spring.datasource.password = root +spring.datasource.type: com.alibaba.druid.pool.DruidDataSource +spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.username=root +spring.datasource.password=root +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver # \u521D\u59CB\u5316\u5927\u5C0F\uFF0C\u6700\u5C0F\uFF0C\u6700\u5927\u94FE\u63A5\u6570 spring.datasource.druid.initial-size=3 @@ -13,10 +14,10 @@ spring.datasource.druid.max-active=10 # \u914D\u7F6E\u83B7\u53D6\u8FDE\u63A5\u7B49\u5F85\u8D85\u65F6\u7684\u65F6\u95F4 spring.datasource.druid.max-wait=60000 -# \u76D1\u63A7\u540E\u53F0\u7684\u8D26\u6237\u548C\u5BC6\u7801 +# StatViewServlet \u914D\u7F6E spring.datasource.druid.stat-view-servlet.login-username=admin spring.datasource.druid.stat-view-servlet.login-password=admin # \u914D\u7F6EStatFilter spring.datasource.druid.filter.stat.log-slow-sql=true -spring.datasource.druid.filter.stat.slow-sql-millis=2000 \ No newline at end of file +spring.datasource.druid.filter.stat.slow-sql-millis=2000 diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/test/java/com/neo/ApplicationTests.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/test/java/com/neo/ApplicationTests.java" similarity index 100% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-xml/src/test/java/com/neo/ApplicationTests.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/test/java/com/neo/ApplicationTests.java" diff --git "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/test/java/com/neo/mapper/UserMapperTest.java" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/test/java/com/neo/mapper/UserMapperTest.java" similarity index 63% rename from "\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/test/java/com/neo/mapper/UserMapperTest.java" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/test/java/com/neo/mapper/UserMapperTest.java" index 9078a35..0a26f59 100644 --- "a/\347\254\25407\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 MyBatis/spring-boot-mybatis-annotation/src/test/java/com/neo/mapper/UserMapperTest.java" +++ "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/src/test/java/com/neo/mapper/UserMapperTest.java" @@ -11,7 +11,7 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; -import com.neo.entity.UserEntity; +import com.neo.model.User; import com.neo.enums.UserSexEnum; @RunWith(SpringRunner.class) @@ -23,27 +23,27 @@ public class UserMapperTest { @Test public void testInsert() throws Exception { - userMapper.insert(new UserEntity("aa", "a123456", UserSexEnum.MAN)); - userMapper.insert(new UserEntity("bb", "b123456", UserSexEnum.WOMAN)); - userMapper.insert(new UserEntity("cc", "b123456", UserSexEnum.WOMAN)); + userMapper.insert(new User("aa", "a123456", UserSexEnum.MAN)); + userMapper.insert(new User("bb", "b123456", UserSexEnum.WOMAN)); + userMapper.insert(new User("cc", "b123456", UserSexEnum.WOMAN)); Assert.assertEquals(3, userMapper.getAll().size()); } @Test public void testQuery() throws Exception { - List users = userMapper.getAll(); - System.out.println(users.toString()); + List users = userMapper.getAll(); + System.out.println("testQuery:"+users.toString()); } @Test public void testUpdate() throws Exception { - UserEntity user = userMapper.getOne(3l); - System.out.println(user.toString()); + User user = userMapper.getOne(31L); + System.out.println("user :"+user.toString()); user.setNickName("neo"); userMapper.update(user); - Assert.assertTrue(("neo".equals(userMapper.getOne(3l).getNickName()))); + Assert.assertTrue(("neo".equals(user.getNickName()))); } @@ -51,11 +51,11 @@ public void testUpdate() throws Exception { public void testPage() { UserParam userParam=new UserParam(); userParam.setUserSex("WOMAN"); - userParam.setUserName("neo"); +// userParam.setUserName("neo"); userParam.setCurrentPage(0); - List users=userMapper.getList(userParam); + List users=userMapper.getList(userParam); long count=userMapper.getCount(userParam); Page page = new Page(userParam,count,users); - System.out.println(page); + System.out.println("page === "+page); } } \ No newline at end of file diff --git "a/\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/users.sql" "b/\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/users.sql" similarity index 100% rename from "\347\254\25408\350\257\276\357\274\232Mybatis Druid \345\244\232\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-druid/users.sql" rename to "\347\254\254 3-7 \350\257\276\357\274\232 Spring Boot \351\233\206\346\210\220 Druid \347\233\221\346\216\247\346\225\260\346\215\256\346\272\220/spring-boot-mybatis-annotation-druid/users.sql" diff --git "a/\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/pom.xml" "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/pom.xml" similarity index 90% rename from "\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/pom.xml" rename to "\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/pom.xml" index 580307d..d791473 100644 --- "a/\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/pom.xml" +++ "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/pom.xml" @@ -7,7 +7,7 @@ org.springframework.boot spring-boot-starter-parent - 1.5.8.RELEASE + 2.1.0.RELEASE @@ -33,11 +33,6 @@ mysql mysql-connector-java - - org.apache.commons - commons-lang3 - 3.6 - org.springframework.boot spring-boot-devtools diff --git "a/\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/java/com/neo/JpaThymeleafApplication.java" "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/java/com/neo/JpaThymeleafApplication.java" similarity index 88% rename from "\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/java/com/neo/JpaThymeleafApplication.java" rename to "\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/java/com/neo/JpaThymeleafApplication.java" index 92f4c0a..20dc3f1 100644 --- "a/\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/java/com/neo/JpaThymeleafApplication.java" +++ "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/java/com/neo/JpaThymeleafApplication.java" @@ -3,7 +3,7 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.support.SpringBootServletInitializer; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; @SpringBootApplication diff --git "a/\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/java/com/neo/entity/User.java" "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/java/com/neo/model/User.java" similarity index 81% rename from "\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/java/com/neo/entity/User.java" rename to "\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/java/com/neo/model/User.java" index 271d073..c6e5ecc 100644 --- "a/\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/java/com/neo/entity/User.java" +++ "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/java/com/neo/model/User.java" @@ -1,6 +1,4 @@ -package com.neo.entity; - -import org.apache.commons.lang3.builder.ToStringBuilder; +package com.neo.model; import javax.persistence.Column; import javax.persistence.Entity; @@ -64,6 +62,12 @@ public void setRegTime(Date regTime) { @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + return "User{" + + "id=" + id + + ", userName='" + userName + '\'' + + ", passWord='" + passWord + '\'' + + ", age=" + age + + ", regTime=" + regTime + + '}'; } } diff --git "a/\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/java/com/neo/param/UserParam.java" "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/java/com/neo/param/UserParam.java" similarity index 86% rename from "\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/java/com/neo/param/UserParam.java" rename to "\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/java/com/neo/param/UserParam.java" index 6aa21e9..4f04001 100644 --- "a/\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/java/com/neo/param/UserParam.java" +++ "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/java/com/neo/param/UserParam.java" @@ -1,6 +1,5 @@ package com.neo.param; -import org.apache.commons.lang3.builder.ToStringBuilder; import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.NotEmpty; @@ -55,6 +54,11 @@ public void setAge(int age) { @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + return "UserParam{" + + "id=" + id + + ", userName='" + userName + '\'' + + ", passWord='" + passWord + '\'' + + ", age=" + age + + '}'; } } diff --git "a/\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/java/com/neo/repository/UserRepository.java" "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/java/com/neo/repository/UserRepository.java" similarity index 88% rename from "\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/java/com/neo/repository/UserRepository.java" rename to "\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/java/com/neo/repository/UserRepository.java" index 1b2f56c..e99a2e1 100644 --- "a/\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/java/com/neo/repository/UserRepository.java" +++ "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/java/com/neo/repository/UserRepository.java" @@ -1,6 +1,6 @@ package com.neo.repository; -import com.neo.entity.User; +import com.neo.model.User; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; @@ -10,10 +10,7 @@ public interface UserRepository extends JpaRepository { @Query("select u from User u") Page findList(Pageable pageable); - User findById(long id); - User findByUserName(String userName); - - Long deleteById(Long id); + void deleteById(Long id); } \ No newline at end of file diff --git "a/\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/java/com/neo/web/UserController.java" "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/java/com/neo/web/UserController.java" similarity index 91% rename from "\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/java/com/neo/web/UserController.java" rename to "\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/java/com/neo/web/UserController.java" index eb9478b..d05dbdc 100644 --- "a/\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/java/com/neo/web/UserController.java" +++ "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/java/com/neo/web/UserController.java" @@ -1,9 +1,8 @@ package com.neo.web; -import com.neo.entity.User; +import com.neo.model.User; import com.neo.param.UserParam; import com.neo.repository.UserRepository; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; @@ -18,7 +17,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import javax.annotation.Resource; import javax.validation.Valid; import java.util.Date; import java.util.List; @@ -37,7 +35,7 @@ public String index() { public String list(Model model,@RequestParam(value = "page", defaultValue = "0") Integer page, @RequestParam(value = "size", defaultValue = "6") Integer size) { Sort sort = new Sort(Sort.Direction.DESC, "id"); - Pageable pageable = new PageRequest(page, size, sort); + Pageable pageable = PageRequest.of(page, size, sort); Page users=userRepository.findList(pageable); model.addAttribute("users", users); return "user/list"; @@ -49,7 +47,7 @@ public String toAdd() { } @RequestMapping("/add") - public String add(@Valid UserParam userParam,BindingResult result, ModelMap model) { + public String add(@Valid UserParam userParam,BindingResult result, Model model) { String errorMsg=""; if(result.hasErrors()) { List list = result.getAllErrors(); @@ -73,13 +71,13 @@ public String add(@Valid UserParam userParam,BindingResult result, ModelMap mode @RequestMapping("/toEdit") public String toEdit(Model model,Long id) { - User user=userRepository.findById(id); + User user=userRepository.findById((long)id); model.addAttribute("user", user); return "user/userEdit"; } @RequestMapping("/edit") - public String edit(@Valid UserParam userParam, BindingResult result,ModelMap model) { + public String edit(@Valid UserParam userParam, BindingResult result,Model model) { String errorMsg=""; if(result.hasErrors()) { List list = result.getAllErrors(); @@ -100,7 +98,7 @@ public String edit(@Valid UserParam userParam, BindingResult result,ModelMap mod @RequestMapping("/delete") public String delete(Long id) { - userRepository.delete(id); + userRepository.deleteById(id); return "redirect:/list"; } } diff --git "a/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/resources/application.properties" "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/resources/application.properties" new file mode 100644 index 0000000..3852949 --- /dev/null +++ "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/resources/application.properties" @@ -0,0 +1,10 @@ +spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.username=root +spring.datasource.password=root +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.properties.hibernate.hbm2ddl.auto=create +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect +spring.jpa.show-sql= true + +spring.thymeleaf.cache=false \ No newline at end of file diff --git "a/\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/resources/static/css/bootstrap.css" "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/resources/static/css/bootstrap.css" similarity index 100% rename from "\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/resources/static/css/bootstrap.css" rename to "\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/resources/static/css/bootstrap.css" diff --git "a/\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/resources/static/js/jquery.js" "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/resources/static/js/jquery.js" similarity index 100% rename from "\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/resources/static/js/jquery.js" rename to "\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/resources/static/js/jquery.js" diff --git "a/\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/resources/templates/page.html" "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/resources/templates/page.html" similarity index 100% rename from "\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/resources/templates/page.html" rename to "\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/resources/templates/page.html" diff --git "a/\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/resources/templates/user/list.html" "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/resources/templates/user/list.html" similarity index 93% rename from "\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/resources/templates/user/list.html" rename to "\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/resources/templates/user/list.html" index 1be11fe..b3e1acf 100644 --- "a/\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/resources/templates/user/list.html" +++ "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/resources/templates/user/list.html" @@ -28,7 +28,7 @@

用户列表

neo Otto 6 - + edit delete diff --git "a/\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/resources/templates/user/userAdd.html" "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/resources/templates/user/userAdd.html" similarity index 100% rename from "\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/resources/templates/user/userAdd.html" rename to "\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/resources/templates/user/userAdd.html" diff --git "a/\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/resources/templates/user/userEdit.html" "b/\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/resources/templates/user/userEdit.html" similarity index 100% rename from "\347\254\25405\350\257\276\357\274\232Jpa \345\222\214 Thymeleaf \345\256\236\350\267\265/spring-boot-jpa-thymeleaf/src/main/resources/templates/user/userEdit.html" rename to "\347\254\254 3-8 \350\257\276\357\274\232Spring Data Jpa \345\222\214 Thymeleaf \347\273\274\345\220\210\345\256\236\350\267\265/spring-boot-Jpa-thymeleaf/src/main/resources/templates/user/userEdit.html" diff --git "a/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/pom.xml" "b/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/pom.xml" new file mode 100644 index 0000000..c44d5d8 --- /dev/null +++ "b/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/pom.xml" @@ -0,0 +1,54 @@ + + + 4.0.0 + + com.neo + spring-boot-memcache + 1.0.0 + jar + + spring-boot-memcache + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter + + + com.googlecode.xmemcached + xmemcached + 2.4.5 + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git "a/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/src/main/java/com/neo/XMemcacheApplication.java" "b/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/src/main/java/com/neo/XMemcacheApplication.java" new file mode 100644 index 0000000..05e04ae --- /dev/null +++ "b/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/src/main/java/com/neo/XMemcacheApplication.java" @@ -0,0 +1,12 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class XMemcacheApplication { + + public static void main(String[] args) { + SpringApplication.run(XMemcacheApplication.class, args); + } +} diff --git "a/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/src/main/java/com/neo/config/MemcachedBuilder.java" "b/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/src/main/java/com/neo/config/MemcachedBuilder.java" new file mode 100644 index 0000000..23befa0 --- /dev/null +++ "b/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/src/main/java/com/neo/config/MemcachedBuilder.java" @@ -0,0 +1,52 @@ +package com.neo.config; + +import net.rubyeye.xmemcached.MemcachedClient; +import net.rubyeye.xmemcached.MemcachedClientBuilder; +import net.rubyeye.xmemcached.XMemcachedClientBuilder; +import net.rubyeye.xmemcached.command.BinaryCommandFactory; +import net.rubyeye.xmemcached.impl.KetamaMemcachedSessionLocator; +import net.rubyeye.xmemcached.transcoders.SerializingTranscoder; +import net.rubyeye.xmemcached.utils.AddrUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.annotation.Resource; +import java.io.IOException; + +@Configuration +public class MemcachedBuilder { + protected static Logger logger = LoggerFactory.getLogger(MemcachedBuilder.class); + @Resource + private XMemcachedProperties xMemcachedProperties; + + @Bean + public MemcachedClient getMemcachedClient() { + MemcachedClient memcachedClient = null; + try { + MemcachedClientBuilder builder = new XMemcachedClientBuilder(AddrUtil.getAddresses(xMemcachedProperties.getServers())); + // 设置集群权重 + // MemcachedClientBuilder builder = new XMemcachedClientBuilder(AddrUtil.getAddresses(memcacheConfig.getServers()),new int[]{3,2,1}); + // 开启/关闭failure模式 + builder.setFailureMode(false); + // 多 Memcached 时启用 一致性哈希 算法 + builder.setSessionLocator(new KetamaMemcachedSessionLocator()); + // 多 Memcached 时启用 选举散列 算法 + // builder.setSessionLocator(new ElectionMemcachedSessionLocator()); + builder.setConnectionPoolSize(xMemcachedProperties.getPoolSize()); + //操作超时时间 + builder.setOpTimeout(xMemcachedProperties.getOpTimeout()); + // 进行数据压缩,大于1KB时进行压缩 + builder.getTranscoder().setCompressionThreshold(1024); + // 使用序列化传输编码 + builder.setTranscoder(new SerializingTranscoder()); + // use binary protocol + builder.setCommandFactory(new BinaryCommandFactory()); + memcachedClient = builder.build(); + } catch (IOException e) { + logger.error("inint MemcachedClient failed ",e); + } + return memcachedClient; + } +} \ No newline at end of file diff --git "a/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/src/main/java/com/neo/config/XMemcachedProperties.java" "b/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/src/main/java/com/neo/config/XMemcachedProperties.java" new file mode 100644 index 0000000..9c1e768 --- /dev/null +++ "b/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/src/main/java/com/neo/config/XMemcachedProperties.java" @@ -0,0 +1,36 @@ +package com.neo.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +@Component +@ConfigurationProperties(prefix = "memcached") +public class XMemcachedProperties { + private String servers; + private int poolSize; + private long opTimeout; + + public String getServers() { + return servers; + } + + public void setServers(String servers) { + this.servers = servers; + } + + public int getPoolSize() { + return poolSize; + } + + public void setPoolSize(int poolSize) { + this.poolSize = poolSize; + } + + public long getOpTimeout() { + return opTimeout; + } + + public void setOpTimeout(long opTimeout) { + this.opTimeout = opTimeout; + } +} diff --git "a/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/src/main/resources/application.properties" "b/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/src/main/resources/application.properties" new file mode 100644 index 0000000..f826edf --- /dev/null +++ "b/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/src/main/resources/application.properties" @@ -0,0 +1,8 @@ +# \u5355\u4E2A Memcached \u914D\u7F6E +memcached.servers=192.168.0.161:11211 +# \u591A\u4E2A Memcached \u914D\u7F6E +# memcached.servers=192.168.0.161:11211 192.168.0.162:11211 192.168.0.163:11211 +# \u8FDE\u63A5\u6C60 +memcached.poolSize=10 +#\u64CD\u4F5C\u8D85\u65F6\u65F6\u95F4 +memcached.opTimeout=6000 \ No newline at end of file diff --git "a/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/src/test/java/com/neo/MemcachedTests.java" "b/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/src/test/java/com/neo/MemcachedTests.java" new file mode 100644 index 0000000..38efe44 --- /dev/null +++ "b/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/src/test/java/com/neo/MemcachedTests.java" @@ -0,0 +1,127 @@ +package com.neo; + +import com.neo.config.MemcachedBuilder; +import net.rubyeye.xmemcached.*; +import net.rubyeye.xmemcached.command.BinaryCommandFactory; +import net.rubyeye.xmemcached.exception.MemcachedException; +import net.rubyeye.xmemcached.impl.KetamaMemcachedSessionLocator; +import net.rubyeye.xmemcached.transcoders.SerializingTranscoder; +import net.rubyeye.xmemcached.transcoders.StringTranscoder; +import net.rubyeye.xmemcached.utils.AddrUtil; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import javax.annotation.Resource; +import java.io.IOException; +import java.net.InetSocketAddress; +import java.util.Map; +import java.util.concurrent.TimeoutException; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class MemcachedTests { + + @Autowired + private MemcachedClient memcachedClient; + + @Test + public void testGetSet() throws Exception { + memcachedClient.set("hello", 0, "Hello,xmemcached"); + String value = memcachedClient.get("hello"); + System.out.println("hello=" + value); + memcachedClient.delete("hello"); + value = memcachedClient.get("hello"); + System.out.println("hello=" + value); + } + + @Test + public void testMore() throws Exception { + if (!memcachedClient.set("hello", 0, "world")) { + System.err.println("set error"); + } + if (!memcachedClient.add("hello", 0, "dennis")) { + System.err.println("Add error,key is existed"); + } + if (!memcachedClient.replace("hello", 0, "dennis")) { + System.err.println("replace error"); + } + memcachedClient.append("hello", " good"); + memcachedClient.prepend("hello", "hello "); + String name = memcachedClient.get("hello", new StringTranscoder()); + System.out.println(name); + memcachedClient.deleteWithNoReply("hello"); + } + + @Test + public void testIncrDecr() throws Exception { + memcachedClient.delete("Incr"); + memcachedClient.delete("Decr"); + System.out.println(memcachedClient.incr("Incr", 6, 12)); + System.out.println(memcachedClient.incr("Incr", 3)); + System.out.println(memcachedClient.incr("Incr", 2)); + System.out.println(memcachedClient.decr("Decr", 1, 6)); + System.out.println(memcachedClient.decr("Decr", 2)); + } + + @Test + public void testCounter() throws Exception { + Counter counter=memcachedClient.getCounter("counter1",10); + System.out.println("counter="+counter.get()); + long c1 =counter.incrementAndGet(); + System.out.println("counter="+c1); + long c2 =counter.decrementAndGet(); + System.out.println("counter="+c2); + long c3 =counter.addAndGet(-6); + System.out.println("counter="+c3); + } + + + @Test + public void testTouch() throws Exception { + memcachedClient.set("Touch", 2, "Touch Value"); + Thread.sleep(1000); + //memcached 不支持 + // memcachedClient.touch("Touch",6); + Thread.sleep(2000); + String value =memcachedClient.get("Touch",3000); + System.out.println("Touch=" + value); + } + + @Test + public void testCas() throws Exception { + memcachedClient.set("cas", 0, 100); + GetsResponse result = memcachedClient.gets("cas"); + System.out.println("result value "+result.getValue()); + + long cas = result.getCas(); + //尝试将a的值更新为2 + if (!memcachedClient.cas("cas", 0, 200, cas)) { + System.err.println("cas error"); + } + System.out.println("cas value "+memcachedClient.get("cas")); + + memcachedClient.cas("cas", 0, new CASOperation() { + public int getMaxTries() { + return 1; + } + + public Integer getNewValue(long currentCAS, Integer currentValue) { + return 300; + } + }); + System.out.println("cas value "+memcachedClient.get("cas")); + + } + + @Test + public void testStat() throws Exception { + Map> result=memcachedClient.getStats(); + System.out.println("Stats=" + result.toString()); + Map> items=memcachedClient.getStatsByItem("items"); + System.out.println("items=" + items.toString()); + } + +} \ No newline at end of file diff --git "a/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/src/test/java/com/neo/XMemcacheApplicationTests.java" "b/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/src/test/java/com/neo/XMemcacheApplicationTests.java" new file mode 100644 index 0000000..3d49d17 --- /dev/null +++ "b/\347\254\254 4-1 \350\257\276\357\274\232Spring Boot \346\223\215\344\275\234 Memcache/spring-boot-memcache/src/test/java/com/neo/XMemcacheApplicationTests.java" @@ -0,0 +1,16 @@ +package com.neo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class XMemcacheApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git "a/\347\254\25413\350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\217\221\351\200\201\351\202\256\344\273\266/spring-boot-mail/pom.xml" "b/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/pom.xml" similarity index 86% rename from "\347\254\25413\350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\217\221\351\200\201\351\202\256\344\273\266/spring-boot-mail/pom.xml" rename to "\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/pom.xml" index 70ce44c..5a3d40d 100644 --- "a/\347\254\25413\350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\217\221\351\200\201\351\202\256\344\273\266/spring-boot-mail/pom.xml" +++ "b/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/pom.xml" @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 1.5.8.RELEASE + 2.1.0.RELEASE @@ -28,6 +28,10 @@ org.springframework.boot spring-boot-starter
+ + org.springframework.boot + spring-boot-starter-web + org.springframework.boot spring-boot-starter-mail @@ -41,10 +45,10 @@ spring-boot-starter-test test - - org.springframework.boot - spring-boot-devtools - true + + org.springframework.boot + spring-boot-devtools + true
diff --git "a/\347\254\25413\350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\217\221\351\200\201\351\202\256\344\273\266/spring-boot-mail/src/main/java/com/neo/MailApplication.java" "b/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/main/java/com/neo/MailApplication.java" similarity index 100% rename from "\347\254\25413\350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\217\221\351\200\201\351\202\256\344\273\266/spring-boot-mail/src/main/java/com/neo/MailApplication.java" rename to "\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/main/java/com/neo/MailApplication.java" diff --git "a/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/main/java/com/neo/result/MailResult.java" "b/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/main/java/com/neo/result/MailResult.java" new file mode 100644 index 0000000..2af0d6b --- /dev/null +++ "b/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/main/java/com/neo/result/MailResult.java" @@ -0,0 +1,27 @@ +package com.neo.result; + +public class MailResult { + private String rspCode; + private String rspMsg; + + public MailResult() { + this.rspCode = "00"; + this.rspMsg = "发送成功"; + } + + public String getRspCode() { + return rspCode; + } + + public void setRspCode(String rspCode) { + this.rspCode = rspCode; + } + + public String getRspMsg() { + return rspMsg; + } + + public void setRspMsg(String rspMsg) { + this.rspMsg = rspMsg; + } +} diff --git "a/\347\254\25413\350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\217\221\351\200\201\351\202\256\344\273\266/spring-boot-mail/src/main/java/com/neo/service/MailService.java" "b/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/main/java/com/neo/service/MailService.java" similarity index 99% rename from "\347\254\25413\350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\217\221\351\200\201\351\202\256\344\273\266/spring-boot-mail/src/main/java/com/neo/service/MailService.java" rename to "\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/main/java/com/neo/service/MailService.java" index 06d7312..42ef089 100644 --- "a/\347\254\25413\350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\217\221\351\200\201\351\202\256\344\273\266/spring-boot-mail/src/main/java/com/neo/service/MailService.java" +++ "b/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/main/java/com/neo/service/MailService.java" @@ -1,6 +1,5 @@ package com.neo.service; - public interface MailService { public void sendSimpleMail(String to, String subject, String content); diff --git "a/\347\254\25413\350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\217\221\351\200\201\351\202\256\344\273\266/spring-boot-mail/src/main/java/com/neo/service/impl/MailServiceImpl.java" "b/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/main/java/com/neo/service/impl/MailServiceImpl.java" similarity index 96% rename from "\347\254\25413\350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\217\221\351\200\201\351\202\256\344\273\266/spring-boot-mail/src/main/java/com/neo/service/impl/MailServiceImpl.java" rename to "\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/main/java/com/neo/service/impl/MailServiceImpl.java" index 1639a7a..f45fa9c 100644 --- "a/\347\254\25413\350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\217\221\351\200\201\351\202\256\344\273\266/spring-boot-mail/src/main/java/com/neo/service/impl/MailServiceImpl.java" +++ "b/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/main/java/com/neo/service/impl/MailServiceImpl.java" @@ -15,7 +15,6 @@ import javax.mail.internet.MimeMessage; import java.io.File; - @Component public class MailServiceImpl implements MailService{ @@ -24,7 +23,7 @@ public class MailServiceImpl implements MailService{ @Autowired private JavaMailSender mailSender; - @Value("${spring.mail.username}") + @Value("${mail.fromMail.addr}") private String from; /** @@ -46,6 +45,7 @@ public void sendSimpleMail(String to, String subject, String content) { logger.info("简单邮件已经发送。"); } catch (Exception e) { logger.error("发送简单邮件时发生异常!", e); + throw e; } } @@ -94,7 +94,7 @@ public void sendAttachmentsMail(String to, String subject, String content, Strin helper.setText(content, true); FileSystemResource file = new FileSystemResource(new File(filePath)); - String fileName = file.getFilename(); + String fileName = filePath.substring(filePath.lastIndexOf(File.separator)+1); helper.addAttachment(fileName, file); //helper.addAttachment("test"+fileName, file); diff --git "a/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/main/java/com/neo/web/MailController.java" "b/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/main/java/com/neo/web/MailController.java" new file mode 100644 index 0000000..f3a7d72 --- /dev/null +++ "b/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/main/java/com/neo/web/MailController.java" @@ -0,0 +1,44 @@ +package com.neo.web; + + +import com.neo.result.MailResult; +import com.neo.service.MailService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +@RestController +public class MailController { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Resource + private MailService mailService; + + @RequestMapping("/sendSimpleMail") + public MailResult sendSimpleMail(String to, String subject, String content) { + MailResult result=new MailResult(); + if(StringUtils.isEmpty(to) || !to.contains("@")){ + result.setRspCode("01"); + result.setRspCode("手机人邮件格式不正确"); + } + if(StringUtils.isEmpty(content) ){ + result.setRspCode("03"); + result.setRspCode("邮件正文不能为空"); + } + try { + mailService.sendSimpleMail(to,subject,content); + logger.info("简单邮件已经发送。"); + } catch (Exception e) { + result.setRspCode("04"); + result.setRspCode("邮件发送出现异常"); + logger.error("sendSimpleMail Exception ", e); + } + return result; + } + + +} diff --git "a/\347\254\25413\350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\217\221\351\200\201\351\202\256\344\273\266/spring-boot-mail/src/main/resources/application.properties" "b/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/main/resources/application.properties" similarity index 54% rename from "\347\254\25413\350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\217\221\351\200\201\351\202\256\344\273\266/spring-boot-mail/src/main/resources/application.properties" rename to "\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/main/resources/application.properties" index cb94332..56a744e 100644 --- "a/\347\254\25413\350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\217\221\351\200\201\351\202\256\344\273\266/spring-boot-mail/src/main/resources/application.properties" +++ "b/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/main/resources/application.properties" @@ -1,7 +1,9 @@ spring.application.name=spirng-boot-mail spring.mail.host=smtp.126.com -spring.mail.username=yourEmail@126.com -spring.mail.password=yourPassword +spring.mail.username=xxx@126.com +spring.mail.password=xxx spring.mail.default-encoding=UTF-8 +mail.fromMail.addr=xxx@126.com + diff --git "a/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/main/resources/templates/emailTemplate.html" "b/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/main/resources/templates/emailTemplate.html" new file mode 100644 index 0000000..387a4fb --- /dev/null +++ "b/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/main/resources/templates/emailTemplate.html" @@ -0,0 +1,11 @@ + + + + + Title + + + 您好,这是验证邮件,请点击下面的链接完成验证,
+ 激活账号 + + \ No newline at end of file diff --git "a/\347\254\25413\350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\217\221\351\200\201\351\202\256\344\273\266/spring-boot-mail/src/test/java/com/neo/MailApplicationTests.java" "b/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/test/java/com/neo/MailApplicationTests.java" similarity index 100% rename from "\347\254\25413\350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\217\221\351\200\201\351\202\256\344\273\266/spring-boot-mail/src/test/java/com/neo/MailApplicationTests.java" rename to "\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/test/java/com/neo/MailApplicationTests.java" diff --git "a/\347\254\25413\350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\217\221\351\200\201\351\202\256\344\273\266/spring-boot-mail/src/test/java/com/neo/service/MailServiceTest.java" "b/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/test/java/com/neo/service/MailServiceTest.java" similarity index 79% rename from "\347\254\25413\350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\217\221\351\200\201\351\202\256\344\273\266/spring-boot-mail/src/test/java/com/neo/service/MailServiceTest.java" rename to "\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/test/java/com/neo/service/MailServiceTest.java" index e249d69..f102138 100644 --- "a/\347\254\25413\350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\217\221\351\200\201\351\202\256\344\273\266/spring-boot-mail/src/test/java/com/neo/service/MailServiceTest.java" +++ "b/\347\254\254 4-10 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \345\274\200\345\217\221\351\202\256\344\273\266\347\263\273\347\273\237/spring-boot-mail/src/test/java/com/neo/service/MailServiceTest.java" @@ -8,7 +8,6 @@ import org.thymeleaf.TemplateEngine; import org.thymeleaf.context.Context; - @RunWith(SpringRunner.class) @SpringBootTest public class MailServiceTest { @@ -21,7 +20,7 @@ public class MailServiceTest { @Test public void testSimpleMail() throws Exception { - mailService.sendSimpleMail("ityouknow@126.com","这是一封简单邮件","大家好,这是我的第一封邮件!"); + mailService.sendSimpleMail("ityouknow@126.com","simple mail"," hello this is simple mail"); } @Test @@ -31,12 +30,12 @@ public void testHtmlMail() throws Exception { "

hello world ! 这是一封html邮件!

\n" + "\n" + ""; - mailService.sendHtmlMail("ityouknow@126.com","这是一封HTML邮件",content); + mailService.sendHtmlMail("ityouknow@126.com","test simple mail",content); } @Test public void sendAttachmentsMail() { - String filePath="e:\\temp\\fastdfs-client-java-5.0.0.jar"; + String filePath="e:\\temp\\temp.txt"; mailService.sendAttachmentsMail("ityouknow@126.com", "主题:带附件的邮件", "有附件,请查收!", filePath); } @@ -45,7 +44,7 @@ public void sendAttachmentsMail() { public void sendInlineResourceMail() { String rscId = "neo006"; String content="这是有图片的邮件:"; - String imgPath = "e:\\temp\\weixin.jpg"; + String imgPath = "e:\\temp\\\\SpringBoot.jpg"; mailService.sendInlineResourceMail("ityouknow@126.com", "主题:这是有图片的邮件", content, imgPath, rscId); } @@ -58,6 +57,6 @@ public void sendTemplateMail() { context.setVariable("id", "006"); String emailContent = templateEngine.process("emailTemplate", context); - mailService.sendHtmlMail("wherebt@126.com","主题:这是模板邮件",emailContent); + mailService.sendHtmlMail("ityouknow@126.com","主题:这是模板邮件",emailContent); } } diff --git "a/\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/pom.xml" "b/\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/pom.xml" similarity index 72% rename from "\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/pom.xml" rename to "\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/pom.xml" index a098845..edbcbfe 100644 --- "a/\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/pom.xml" +++ "b/\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/pom.xml" @@ -5,7 +5,7 @@ com.neo spring-boot-redis - 0.0.1-SNAPSHOT + 1.0.0-SNAPSHOT jar spring-boot-redis @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 1.5.8.RELEASE + 2.1.0.RELEASE @@ -24,30 +24,19 @@ - - org.springframework.boot - spring-boot-starter - org.springframework.boot spring-boot-starter-data-redis org.apache.commons - commons-lang3 - 3.6 + commons-pool2 org.springframework.boot spring-boot-starter-test test - - org.springframework.boot - spring-boot-devtools - true - - @@ -55,9 +44,6 @@ org.springframework.boot spring-boot-maven-plugin - - true - diff --git "a/\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/src/main/java/com/neo/RedisApplication.java" "b/\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/main/java/com/neo/RedisApplication.java" similarity index 100% rename from "\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/src/main/java/com/neo/RedisApplication.java" rename to "\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/main/java/com/neo/RedisApplication.java" diff --git "a/\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/src/main/java/com/neo/config/RedisConfig.java" "b/\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/main/java/com/neo/config/RedisConfig.java" similarity index 81% rename from "\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/src/main/java/com/neo/config/RedisConfig.java" rename to "\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/main/java/com/neo/config/RedisConfig.java" index 79dd013..f267489 100644 --- "a/\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/src/main/java/com/neo/config/RedisConfig.java" +++ "b/\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/main/java/com/neo/config/RedisConfig.java" @@ -31,12 +31,4 @@ public Object generate(Object target, Method method, Object... params) { } }; } - - @Bean - public CacheManager cacheManager(RedisTemplate redisTemplate) { - RedisCacheManager rcm = new RedisCacheManager(redisTemplate); - //设置缓存过期时间 - //rcm.setDefaultExpiration(60);//秒 - return rcm; - } } \ No newline at end of file diff --git "a/\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/src/main/java/com/neo/domain/User.java" "b/\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/main/java/com/neo/model/User.java" similarity index 83% rename from "\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/src/main/java/com/neo/domain/User.java" rename to "\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/main/java/com/neo/model/User.java" index 9bd60a0..0457488 100644 --- "a/\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/src/main/java/com/neo/domain/User.java" +++ "b/\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/main/java/com/neo/model/User.java" @@ -1,6 +1,4 @@ -package com.neo.domain; - -import org.apache.commons.lang3.builder.ToStringBuilder; +package com.neo.model; import java.io.Serializable; @@ -78,7 +76,13 @@ public void setRegTime(String regTime) { @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + return "User{" + + "id=" + id + + ", userName='" + userName + '\'' + + ", password='" + password + '\'' + + ", email='" + email + '\'' + + ", nickname='" + nickname + '\'' + + ", regTime='" + regTime + '\'' + + '}'; } - } \ No newline at end of file diff --git "a/\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/src/main/java/com/neo/service/RedisService.java" "b/\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/main/java/com/neo/service/RedisService.java" similarity index 100% rename from "\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/src/main/java/com/neo/service/RedisService.java" rename to "\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/main/java/com/neo/service/RedisService.java" diff --git "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/main/resources/application.properties" "b/\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/main/resources/application.properties" similarity index 50% rename from "\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/main/resources/application.properties" rename to "\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/main/resources/application.properties" index 073d2b1..67eeff6 100644 --- "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/main/resources/application.properties" +++ "b/\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/main/resources/application.properties" @@ -1,13 +1,3 @@ -spring.datasource.url=jdbc:mysql://localhost:3306/test -spring.datasource.username=root -spring.datasource.password=root -spring.datasource.driver-class-name=com.mysql.jdbc.Driver - -spring.jpa.properties.hibernate.hbm2ddl.auto=update -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect -spring.jpa.show-sql= true - - # REDIS # Redis\u6570\u636E\u5E93\u7D22\u5F15\uFF08\u9ED8\u8BA4\u4E3A0\uFF09 spring.redis.database=0 @@ -17,15 +7,12 @@ spring.redis.host=localhost spring.redis.port=6379 # Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09 spring.redis.password= -# \u8FDE\u63A5\u6C60\u6700\u5927\u8FDE\u63A5\u6570\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09 -spring.redis.pool.max-active=8 -# \u8FDE\u63A5\u6C60\u6700\u5927\u963B\u585E\u7B49\u5F85\u65F6\u95F4\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09 -spring.redis.pool.max-wait=-1 -# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5927\u7A7A\u95F2\u8FDE\u63A5 -spring.redis.pool.max-idle=8 -# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5C0F\u7A7A\u95F2\u8FDE\u63A5 -spring.redis.pool.min-idle=0 -# \u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09 -spring.redis.timeout=10000 +# \u8FDE\u63A5\u6C60\u6700\u5927\u8FDE\u63A5\u6570\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09 \u9ED8\u8BA4 8 +spring.redis.lettuce.pool.max-active=8 +# \u8FDE\u63A5\u6C60\u6700\u5927\u963B\u585E\u7B49\u5F85\u65F6\u95F4\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09 \u9ED8\u8BA4 -1 +spring.redis.lettuce.pool.max-wait=-1 +# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5927\u7A7A\u95F2\u8FDE\u63A5 \u9ED8\u8BA4 8 +spring.redis.lettuce.pool.max-idle=8 +# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5C0F\u7A7A\u95F2\u8FDE\u63A5 \u9ED8\u8BA4 0 +spring.redis.lettuce.pool.min-idle=0 -server.port=8080 \ No newline at end of file diff --git "a/\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/src/test/java/com/neo/RedisApplicationTests.java" "b/\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/test/java/com/neo/RedisApplicationTests.java" similarity index 100% rename from "\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/src/test/java/com/neo/RedisApplicationTests.java" rename to "\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/test/java/com/neo/RedisApplicationTests.java" diff --git "a/\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/src/test/java/com/neo/redis/TestRedisService.java" "b/\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/test/java/com/neo/redis/TestRedisService.java" similarity index 79% rename from "\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/src/test/java/com/neo/redis/TestRedisService.java" rename to "\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/test/java/com/neo/redis/TestRedisService.java" index cfb0654..62bfa63 100644 --- "a/\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/src/test/java/com/neo/redis/TestRedisService.java" +++ "b/\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/test/java/com/neo/redis/TestRedisService.java" @@ -1,18 +1,14 @@ package com.neo.redis; -import com.neo.domain.User; +import com.neo.model.User; import com.neo.service.RedisService; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.core.ValueOperations; import org.springframework.test.context.junit4.SpringRunner; -import java.util.concurrent.TimeUnit; - @RunWith(SpringRunner.class) @SpringBootTest public class TestRedisService { @@ -30,7 +26,7 @@ public void testObj() throws Exception { User user=new User("ityouknow@126.com", "smile", "youknow", "know","2020"); redisService.set("user",user); User userR=(User) redisService.get("user"); - System.out.println(userR.toString()); + System.out.println("userR== "+userR.toString()); } diff --git "a/\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/src/test/java/com/neo/redis/TestRedisTemplate.java" "b/\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/test/java/com/neo/redis/TestRedisTemplate.java" similarity index 98% rename from "\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/src/test/java/com/neo/redis/TestRedisTemplate.java" rename to "\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/test/java/com/neo/redis/TestRedisTemplate.java" index 217ab08..7afb161 100644 --- "a/\347\254\25409\350\257\276\357\274\232\345\246\202\344\275\225\347\216\251\350\275\254 Redis/spring-boot-redis/src/test/java/com/neo/redis/TestRedisTemplate.java" +++ "b/\347\254\254 4-2 \350\257\276\357\274\232Spring Boot \345\222\214 Redis \345\270\270\347\224\250\346\223\215\344\275\234/spring-boot-redis/src/test/java/com/neo/redis/TestRedisTemplate.java" @@ -1,11 +1,9 @@ package com.neo.redis; -import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.concurrent.TimeUnit; -import com.neo.service.RedisService; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @@ -13,7 +11,7 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.data.redis.core.*; -import com.neo.domain.User; +import com.neo.model.User; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) diff --git "a/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/pom.xml" "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/pom.xml" new file mode 100644 index 0000000..4d9dc54 --- /dev/null +++ "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/pom.xml" @@ -0,0 +1,68 @@ + + + 4.0.0 + + com.neo + spring-boot-redis-session-1 + 0.0.1-SNAPSHOT + jar + + spring-boot-redis-session-1 + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-data-redis + + + org.springframework.session + spring-session-data-redis + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-data-jpa + + + mysql + mysql-connector-java + + + org.apache.commons + commons-pool2 + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git "a/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/main/java/com/neo/RedisSession1Application.java" "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/main/java/com/neo/RedisSession1Application.java" new file mode 100644 index 0000000..047d89c --- /dev/null +++ "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/main/java/com/neo/RedisSession1Application.java" @@ -0,0 +1,12 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class RedisSession1Application { + + public static void main(String[] args) { + SpringApplication.run(RedisSession1Application.class, args); + } +} diff --git "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/config/SessionConfig.java" "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/main/java/com/neo/config/SessionConfig.java" similarity index 100% rename from "\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/config/SessionConfig.java" rename to "\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/main/java/com/neo/config/SessionConfig.java" diff --git "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-data-cache/src/main/java/com/neo/domain/User.java" "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/main/java/com/neo/model/User.java" similarity index 86% rename from "\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-data-cache/src/main/java/com/neo/domain/User.java" rename to "\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/main/java/com/neo/model/User.java" index e429fd2..73e241e 100644 --- "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-data-cache/src/main/java/com/neo/domain/User.java" +++ "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/main/java/com/neo/model/User.java" @@ -1,6 +1,5 @@ -package com.neo.domain; +package com.neo.model; -import org.apache.commons.lang3.builder.ToStringBuilder; import javax.persistence.Column; import javax.persistence.Entity; @@ -82,6 +81,13 @@ public void setRegTime(String regTime) { @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + return "User{" + + "id=" + id + + ", userName='" + userName + '\'' + + ", password='" + password + '\'' + + ", email='" + email + '\'' + + ", nickname='" + nickname + '\'' + + ", regTime='" + regTime + '\'' + + '}'; } } \ No newline at end of file diff --git "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/repository/UserRepository.java" "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/main/java/com/neo/repository/UserRepository.java" similarity index 79% rename from "\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/repository/UserRepository.java" rename to "\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/main/java/com/neo/repository/UserRepository.java" index 332e413..74e6848 100644 --- "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/repository/UserRepository.java" +++ "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/main/java/com/neo/repository/UserRepository.java" @@ -1,10 +1,8 @@ package com.neo.repository; -import com.neo.domain.User; +import com.neo.model.User; import org.springframework.data.jpa.repository.JpaRepository; -import java.util.List; - public interface UserRepository extends JpaRepository { User findByUserName(String userName); } \ No newline at end of file diff --git "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/web/UserController.java" "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/main/java/com/neo/web/UserController.java" similarity index 86% rename from "\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/web/UserController.java" rename to "\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/main/java/com/neo/web/UserController.java" index 3bdf3c6..76590df 100644 --- "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/web/UserController.java" +++ "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/main/java/com/neo/web/UserController.java" @@ -1,18 +1,13 @@ package com.neo.web; import java.util.HashMap; -import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.cache.annotation.CachePut; -import org.springframework.cache.annotation.Cacheable; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; -import com.neo.domain.User; +import com.neo.model.User; import com.neo.repository.UserRepository; import javax.servlet.http.HttpServletRequest; @@ -61,4 +56,10 @@ public String login (HttpServletRequest request,String userName,String password) return msg; } + @RequestMapping(value = "/loginout") + public String loginout (HttpServletRequest request){ + request.getSession().removeAttribute("user"); + return "loginout successful!"; + } + } \ No newline at end of file diff --git "a/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/main/resources/application.properties" "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/main/resources/application.properties" new file mode 100644 index 0000000..8f0f0c9 --- /dev/null +++ "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/main/resources/application.properties" @@ -0,0 +1,27 @@ +spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.username=root +spring.datasource.password=root +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.properties.hibernate.hbm2ddl.auto=create +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect +spring.jpa.show-sql= true + +server.port=9090 + +# REDIS +# Redis\u6570\u636E\u5E93\u7D22\u5F15\uFF08\u9ED8\u8BA4\u4E3A0\uFF09 +spring.redis.database=0 +# Redis\u670D\u52A1\u5668\u5730\u5740 +spring.redis.host=localhost +# Redis\u670D\u52A1\u5668\u8FDE\u63A5\u7AEF\u53E3 +spring.redis.port=6379 +# Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09 +spring.redis.password= +# \u8FDE\u63A5\u6C60\u6700\u5927\u8FDE\u63A5\u6570\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09 +spring.redis.lettuce.pool.max-active=8 +spring.redis.lettuce.pool.max-wait=-1 +spring.redis.lettuce.shutdown-timeout=100 +spring.redis.lettuce.pool.max-idle=8 +spring.redis.lettuce.pool.min-idle=0 + diff --git "a/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/main/resources/import.sql" "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/main/resources/import.sql" new file mode 100644 index 0000000..4e9f7a6 --- /dev/null +++ "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/main/resources/import.sql" @@ -0,0 +1 @@ +INSERT INTO `user` VALUES ('1', 'ityouknow@126.com', 'smile', '123456', '2018', 'neo'); \ No newline at end of file diff --git "a/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/test/java/com/neo/RedisSession1ApplicationTests.java" "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/test/java/com/neo/RedisSession1ApplicationTests.java" new file mode 100644 index 0000000..0c6f13f --- /dev/null +++ "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/test/java/com/neo/RedisSession1ApplicationTests.java" @@ -0,0 +1,18 @@ +package com.neo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class RedisSession1ApplicationTests { + + @Test + public void contextLoads() { + System.out.println("hello web"); + } + +} diff --git "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/test/java/com/neo/domain/UserRepositoryTests.java" "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/test/java/com/neo/model/UserRepositoryTests.java" similarity index 95% rename from "\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/test/java/com/neo/domain/UserRepositoryTests.java" rename to "\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/test/java/com/neo/model/UserRepositoryTests.java" index d0a8493..7f5bb41 100644 --- "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/test/java/com/neo/domain/UserRepositoryTests.java" +++ "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session-1/src/test/java/com/neo/model/UserRepositoryTests.java" @@ -1,10 +1,9 @@ -package com.neo.domain; +package com.neo.model; import java.text.DateFormat; import java.util.Date; import com.neo.repository.UserRepository; -import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; diff --git "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/pom.xml" "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/pom.xml" similarity index 84% rename from "\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/pom.xml" rename to "\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/pom.xml" index 568d118..788be5a 100644 --- "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/pom.xml" +++ "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/pom.xml" @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 1.5.8.RELEASE + 2.1.0.RELEASE @@ -24,10 +24,6 @@ - - org.springframework.boot - spring-boot-starter - org.springframework.boot spring-boot-starter-data-redis @@ -36,10 +32,6 @@ org.springframework.session spring-session-data-redis - - org.springframework.boot - spring-boot-starter-cache - org.springframework.boot spring-boot-starter-web @@ -54,8 +46,7 @@ org.apache.commons - commons-lang3 - 3.6 + commons-pool2 org.springframework.boot diff --git "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/RedisSessionApplication.java" "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/RedisSessionApplication.java" similarity index 100% rename from "\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/RedisSessionApplication.java" rename to "\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/RedisSessionApplication.java" diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/config/SessionConfig.java" "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/config/SessionConfig.java" similarity index 51% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/config/SessionConfig.java" rename to "\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/config/SessionConfig.java" index 014f9be..400f03f 100644 --- "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/config/SessionConfig.java" +++ "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/config/SessionConfig.java" @@ -1,12 +1,9 @@ package com.neo.config; + import org.springframework.context.annotation.Configuration; import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession; - -/** - * maxInactiveIntervalInSeconds: 设置Session失效时间,使用Redis Session之后,原Boot的server.session.timeout属性不再生效 - */ @Configuration -@EnableRedisHttpSession(maxInactiveIntervalInSeconds = 3000) +@EnableRedisHttpSession(maxInactiveIntervalInSeconds = 86400*30) public class SessionConfig { -} +} \ No newline at end of file diff --git "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/domain/User.java" "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/model/User.java" similarity index 86% rename from "\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/domain/User.java" rename to "\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/model/User.java" index e429fd2..73e241e 100644 --- "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/domain/User.java" +++ "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/model/User.java" @@ -1,6 +1,5 @@ -package com.neo.domain; +package com.neo.model; -import org.apache.commons.lang3.builder.ToStringBuilder; import javax.persistence.Column; import javax.persistence.Entity; @@ -82,6 +81,13 @@ public void setRegTime(String regTime) { @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + return "User{" + + "id=" + id + + ", userName='" + userName + '\'' + + ", password='" + password + '\'' + + ", email='" + email + '\'' + + ", nickname='" + nickname + '\'' + + ", regTime='" + regTime + '\'' + + '}'; } } \ No newline at end of file diff --git "a/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/repository/UserRepository.java" "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/repository/UserRepository.java" new file mode 100644 index 0000000..74e6848 --- /dev/null +++ "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/repository/UserRepository.java" @@ -0,0 +1,8 @@ +package com.neo.repository; + +import com.neo.model.User; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface UserRepository extends JpaRepository { + User findByUserName(String userName); +} \ No newline at end of file diff --git "a/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/web/UserController.java" "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/web/UserController.java" new file mode 100644 index 0000000..76590df --- /dev/null +++ "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/main/java/com/neo/web/UserController.java" @@ -0,0 +1,65 @@ +package com.neo.web; + +import java.util.HashMap; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.neo.model.User; +import com.neo.repository.UserRepository; + +import javax.servlet.http.HttpServletRequest; + +@RestController +public class UserController { + + @Autowired + private UserRepository userRepository; + + @RequestMapping(value = "/setSession") + public Map setSession (HttpServletRequest request){ + Map map = new HashMap<>(); + request.getSession().setAttribute("message", request.getRequestURL()); + map.put("request Url", request.getRequestURL()); + return map; + } + + @RequestMapping(value = "/getSession") + public Object getSession (HttpServletRequest request){ + Map map = new HashMap<>(); + map.put("sessionId", request.getSession().getId()); + map.put("message", request.getSession().getAttribute("message")); + return map; + } + + + @RequestMapping(value = "/index") + public String index (HttpServletRequest request){ + String msg="index content"; + Object user= request.getSession().getAttribute("user"); + if (user==null){ + msg="please login first!"; + } + return msg; + } + + @RequestMapping(value = "/login") + public String login (HttpServletRequest request,String userName,String password){ + String msg="logon failure!"; + User user= userRepository.findByUserName(userName); + if (user!=null && user.getPassword().equals(password)){ + request.getSession().setAttribute("user",user); + msg="login successful!"; + } + return msg; + } + + @RequestMapping(value = "/loginout") + public String loginout (HttpServletRequest request){ + request.getSession().removeAttribute("user"); + return "loginout successful!"; + } + +} \ No newline at end of file diff --git "a/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/main/resources/application.properties" "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/main/resources/application.properties" new file mode 100644 index 0000000..318fda8 --- /dev/null +++ "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/main/resources/application.properties" @@ -0,0 +1,26 @@ +spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.username=root +spring.datasource.password=root +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.properties.hibernate.hbm2ddl.auto=create +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect +spring.jpa.show-sql= true + + +# REDIS +# Redis\u6570\u636E\u5E93\u7D22\u5F15\uFF08\u9ED8\u8BA4\u4E3A0\uFF09 +spring.redis.database=0 +# Redis\u670D\u52A1\u5668\u5730\u5740 +spring.redis.host=localhost +# Redis\u670D\u52A1\u5668\u8FDE\u63A5\u7AEF\u53E3 +spring.redis.port=6379 +# Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09 +spring.redis.password= +# \u8FDE\u63A5\u6C60\u6700\u5927\u8FDE\u63A5\u6570\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09 +spring.redis.lettuce.pool.max-active=8 +spring.redis.lettuce.pool.max-wait=-1 +spring.redis.lettuce.shutdown-timeout=100 +spring.redis.lettuce.pool.max-idle=8 +spring.redis.lettuce.pool.min-idle=0 + diff --git "a/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/main/resources/import.sql" "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/main/resources/import.sql" new file mode 100644 index 0000000..4e9f7a6 --- /dev/null +++ "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/main/resources/import.sql" @@ -0,0 +1 @@ +INSERT INTO `user` VALUES ('1', 'ityouknow@126.com', 'smile', '123456', '2018', 'neo'); \ No newline at end of file diff --git "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/test/java/com/neo/RedisSessionApplicationTests.java" "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/test/java/com/neo/RedisSessionApplicationTests.java" similarity index 100% rename from "\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-session/src/test/java/com/neo/RedisSessionApplicationTests.java" rename to "\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/test/java/com/neo/RedisSessionApplicationTests.java" diff --git "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-data-cache/src/test/java/com/neo/domain/UserRepositoryTests.java" "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/test/java/com/neo/model/UserRepositoryTests.java" similarity index 67% rename from "\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-data-cache/src/test/java/com/neo/domain/UserRepositoryTests.java" rename to "\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/test/java/com/neo/model/UserRepositoryTests.java" index f34e2c2..7f5bb41 100644 --- "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-data-cache/src/test/java/com/neo/domain/UserRepositoryTests.java" +++ "b/\347\254\254 4-3 \350\257\276\357\274\232\344\275\277\347\224\250 Redis \345\256\236\347\216\260 Session \345\205\261\344\272\253/spring-boot-redis-session/src/test/java/com/neo/model/UserRepositoryTests.java" @@ -1,10 +1,9 @@ -package com.neo.domain; +package com.neo.model; import java.text.DateFormat; import java.util.Date; import com.neo.repository.UserRepository; -import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -21,18 +20,15 @@ public class UserRepositoryTests { private UserRepository userRepository; @Test - public void test() throws Exception { + public void testRepository() throws Exception { Date date = new Date(); DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG); String formattedDate = dateFormat.format(date); - userRepository.save(new User("aa@126.com","neo", "aa123456","小明", formattedDate)); + userRepository.save(new User("aa@126.com","neo", "123456","neo", formattedDate)); userRepository.save(new User("bb@126.com","pure", "bb123456","小张", formattedDate)); userRepository.save(new User("cc@126.com","smile", "cc123456","小王" ,formattedDate)); - Assert.assertEquals(3, userRepository.findAll().size()); - Assert.assertEquals("bb", userRepository.findByUserNameOrEmail("bb", "cc@126.com").getNickname()); - userRepository.delete(userRepository.findByUserName("aa1")); } } \ No newline at end of file diff --git "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-data-cache/pom.xml" "b/\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/pom.xml" similarity index 90% rename from "\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-data-cache/pom.xml" rename to "\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/pom.xml" index 252c597..c223465 100644 --- "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-data-cache/pom.xml" +++ "b/\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/pom.xml" @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 1.5.8.RELEASE + 2.1.0.RELEASE @@ -24,10 +24,6 @@ - - org.springframework.boot - spring-boot-starter - org.springframework.boot spring-boot-starter-data-redis @@ -50,8 +46,7 @@ org.apache.commons - commons-lang3 - 3.6 + commons-pool2 org.springframework.boot @@ -63,7 +58,6 @@ spring-boot-devtools true - diff --git "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-data-cache/src/main/java/com/neo/RedisDataApplication.java" "b/\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/main/java/com/neo/RedisDataApplication.java" similarity index 100% rename from "\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-data-cache/src/main/java/com/neo/RedisDataApplication.java" rename to "\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/main/java/com/neo/RedisDataApplication.java" diff --git "a/\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/main/java/com/neo/model/User.java" "b/\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/main/java/com/neo/model/User.java" new file mode 100644 index 0000000..73e241e --- /dev/null +++ "b/\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/main/java/com/neo/model/User.java" @@ -0,0 +1,93 @@ +package com.neo.model; + + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import java.io.Serializable; + +@Entity +public class User implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @GeneratedValue + private Long id; + @Column(nullable = false, unique = true) + private String userName; + @Column(nullable = false) + private String password; + @Column(nullable = false, unique = true) + private String email; + @Column(nullable = false) + private String nickname; + @Column(nullable = false) + private String regTime; + + public User() { + super(); + } + public User(String email, String nickname, String password, String userName, String regTime) { + super(); + this.email = email; + this.nickname = nickname; + this.password = password; + this.userName = userName; + this.regTime = regTime; + } + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + public String getUserName() { + return userName; + } + public void setUserName(String userName) { + this.userName = userName; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + public String getNickname() { + return nickname; + } + + public void setNickname(String nickname) { + this.nickname = nickname; + } + + public String getRegTime() { + return regTime; + } + public void setRegTime(String regTime) { + this.regTime = regTime; + } + + @Override + public String toString() { + return "User{" + + "id=" + id + + ", userName='" + userName + '\'' + + ", password='" + password + '\'' + + ", email='" + email + '\'' + + ", nickname='" + nickname + '\'' + + ", regTime='" + regTime + '\'' + + '}'; + } +} \ No newline at end of file diff --git "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-data-cache/src/main/java/com/neo/repository/UserRepository.java" "b/\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/main/java/com/neo/repository/UserRepository.java" similarity index 92% rename from "\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-data-cache/src/main/java/com/neo/repository/UserRepository.java" rename to "\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/main/java/com/neo/repository/UserRepository.java" index 0cb457a..338c442 100644 --- "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-data-cache/src/main/java/com/neo/repository/UserRepository.java" +++ "b/\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/main/java/com/neo/repository/UserRepository.java" @@ -1,6 +1,6 @@ package com.neo.repository; -import com.neo.domain.User; +import com.neo.model.User; import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; diff --git "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-data-cache/src/main/java/com/neo/web/UserController.java" "b/\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/main/java/com/neo/web/UserController.java" similarity index 98% rename from "\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-data-cache/src/main/java/com/neo/web/UserController.java" rename to "\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/main/java/com/neo/web/UserController.java" index 832f449..24034cb 100644 --- "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-data-cache/src/main/java/com/neo/web/UserController.java" +++ "b/\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/main/java/com/neo/web/UserController.java" @@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import com.neo.domain.User; +import com.neo.model.User; import com.neo.repository.UserRepository; @RestController diff --git "a/\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/main/resources/application.properties" "b/\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/main/resources/application.properties" new file mode 100644 index 0000000..3ccc8c9 --- /dev/null +++ "b/\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/main/resources/application.properties" @@ -0,0 +1,25 @@ +spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&useSSL=true +spring.datasource.username=root +spring.datasource.password=root +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +spring.jpa.properties.hibernate.hbm2ddl.auto=create +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect +spring.jpa.show-sql= true + +# REDIS +# Redis\u6570\u636E\u5E93\u7D22\u5F15\uFF08\u9ED8\u8BA4\u4E3A0\uFF09 +spring.redis.database=0 +# Redis\u670D\u52A1\u5668\u5730\u5740 +spring.redis.host=localhost +# Redis\u670D\u52A1\u5668\u8FDE\u63A5\u7AEF\u53E3 +spring.redis.port=6379 +# Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09 +spring.redis.password= +spring.redis.lettuce.pool.max-active=8 +spring.redis.lettuce.pool.max-wait=-1 +spring.redis.lettuce.shutdown-timeout=100 +spring.redis.lettuce.pool.max-idle=8 +spring.redis.lettuce.pool.min-idle=0 + + diff --git "a/\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/main/resources/import.sql" "b/\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/main/resources/import.sql" new file mode 100644 index 0000000..e6ab8ae --- /dev/null +++ "b/\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/main/resources/import.sql" @@ -0,0 +1 @@ +INSERT INTO `user` VALUES ('1', 'ityouknow@126.com', 'ityouknow', '123456', '2018', 'keepSmile'); \ No newline at end of file diff --git "a/\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-data-cache/src/test/java/com/neo/RedisDataApplicationTests.java" "b/\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/test/java/com/neo/RedisDataApplicationTests.java" similarity index 100% rename from "\347\254\25410\350\257\276\357\274\232Redis\345\256\236\347\216\260\346\225\260\346\215\256\347\274\223\345\255\230\345\222\214Session\345\205\261\344\272\253/spring-boot-redis-data-cache/src/test/java/com/neo/RedisDataApplicationTests.java" rename to "\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/test/java/com/neo/RedisDataApplicationTests.java" diff --git "a/\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/test/java/com/neo/model/UserRepositoryTests.java" "b/\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/test/java/com/neo/model/UserRepositoryTests.java" new file mode 100644 index 0000000..8502bf6 --- /dev/null +++ "b/\347\254\254 4-4 \350\257\276\357\274\232Spring Boot \344\270\255\344\275\277\347\224\250 Cache \347\274\223\345\255\230\347\232\204\344\275\277\347\224\250/spring-boot-redis-data-cache/src/test/java/com/neo/model/UserRepositoryTests.java" @@ -0,0 +1,38 @@ +package com.neo.model; + +import java.text.DateFormat; +import java.util.Date; + +import com.neo.repository.UserRepository; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; + +import org.springframework.test.context.junit4.SpringRunner; + + +@RunWith(SpringRunner.class) +@SpringBootTest +public class UserRepositoryTests { + + @Autowired + private UserRepository userRepository; + + @Test + public void test() throws Exception { + Date date = new Date(); + DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG); + String formattedDate = dateFormat.format(date); + + userRepository.save(new User("aa@126.com","neo", "aa12345d6","小明", formattedDate)); + userRepository.save(new User("bb@126.com","pure", "bb12345d6","小张", formattedDate)); + userRepository.save(new User("cc@126.com","smile", "cc12345d6","小王" ,formattedDate)); + + Assert.assertEquals(3, userRepository.findAll().size()); + Assert.assertEquals("smile", userRepository.findByUserNameOrEmail("smile", "cc@126.com").getNickname()); + userRepository.delete(userRepository.findByUserName("小张")); + } + +} \ No newline at end of file diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/pom.xml" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/pom.xml" new file mode 100644 index 0000000..a83b2ec --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/pom.xml" @@ -0,0 +1,49 @@ + + + 4.0.0 + + com.neo + spring-boot-activemq-queue + 1.0.0 + jar + + spring-boot-activemq-queue + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-activemq + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/main/java/com/neo/ActiveMQQueueApplication.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/main/java/com/neo/ActiveMQQueueApplication.java" new file mode 100644 index 0000000..6504efc --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/main/java/com/neo/ActiveMQQueueApplication.java" @@ -0,0 +1,12 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class ActiveMQQueueApplication { + + public static void main(String[] args) { + SpringApplication.run(ActiveMQQueueApplication.class, args); + } +} diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/main/java/com/neo/config/MqConfig.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/main/java/com/neo/config/MqConfig.java" new file mode 100644 index 0000000..f522104 --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/main/java/com/neo/config/MqConfig.java" @@ -0,0 +1,16 @@ +package com.neo.config; + +import org.apache.activemq.command.ActiveMQQueue; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.jms.Queue; + + +@Configuration +public class MqConfig { + @Bean + public Queue queue() { + return new ActiveMQQueue("neo.queue"); + } +} \ No newline at end of file diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/main/java/com/neo/consumer/Consumer.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/main/java/com/neo/consumer/Consumer.java" new file mode 100644 index 0000000..f55b46d --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/main/java/com/neo/consumer/Consumer.java" @@ -0,0 +1,13 @@ +package com.neo.consumer; + +import org.springframework.jms.annotation.JmsListener; +import org.springframework.stereotype.Component; + +@Component +public class Consumer { + + @JmsListener(destination = "neo.queue") + public void receiveQueue(String text) { + System.out.println("Consumer queue msg : "+text); + } +} \ No newline at end of file diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/main/java/com/neo/consumer/Consumer2.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/main/java/com/neo/consumer/Consumer2.java" new file mode 100644 index 0000000..69d61e4 --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/main/java/com/neo/consumer/Consumer2.java" @@ -0,0 +1,13 @@ +package com.neo.consumer; + +import org.springframework.jms.annotation.JmsListener; +import org.springframework.stereotype.Component; + +@Component +public class Consumer2 { + + @JmsListener(destination = "neo.queue") + public void receiveQueue(String text) { + System.out.println("Consumer2 queue msg : "+text); + } +} \ No newline at end of file diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/main/java/com/neo/producer/Producer.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/main/java/com/neo/producer/Producer.java" new file mode 100644 index 0000000..4aedc59 --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/main/java/com/neo/producer/Producer.java" @@ -0,0 +1,22 @@ +package com.neo.producer; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jms.core.JmsMessagingTemplate; +import org.springframework.stereotype.Component; + +import javax.jms.Queue; + +@Component +public class Producer{ + + @Autowired + private JmsMessagingTemplate jmsMessagingTemplate; + + @Autowired + private Queue queue; + + public void sendQueue(String msg) { +// System.out.println("send queue msg :"+msg); + this.jmsMessagingTemplate.convertAndSend(this.queue, msg); + } +} diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/main/resources/application.properties" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/main/resources/application.properties" new file mode 100644 index 0000000..9b10a71 --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/main/resources/application.properties" @@ -0,0 +1,2 @@ +spring.activemq.in-memory=true +spring.activemq.pool.enabled=false diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/test/java/com/neo/ActiveMQQueueApplicationTests.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/test/java/com/neo/ActiveMQQueueApplicationTests.java" new file mode 100644 index 0000000..e9f7ee5 --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/test/java/com/neo/ActiveMQQueueApplicationTests.java" @@ -0,0 +1,16 @@ +package com.neo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class ActiveMQQueueApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/test/java/com/neo/send/SampleActiveMqTests.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/test/java/com/neo/send/SampleActiveMqTests.java" new file mode 100644 index 0000000..ff3218a --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-queue/src/test/java/com/neo/send/SampleActiveMqTests.java" @@ -0,0 +1,39 @@ +package com.neo.send; + +import com.neo.producer.Producer; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.rule.OutputCapture; +import org.springframework.test.context.junit4.SpringRunner; + +import static org.assertj.core.api.Assertions.assertThat; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class SampleActiveMqTests { + + @Rule + public OutputCapture outputCapture = new OutputCapture(); + + @Autowired + private Producer producer; + + @Test + public void sendSimpleQueueMessage() throws InterruptedException { + this.producer.sendQueue("Test queue message"); + Thread.sleep(1000L); + assertThat(this.outputCapture.toString().contains("Test queue")).isTrue(); + } + + @Test + public void send100QueueMessage() throws InterruptedException { + for (int i=0;i<100;i++){ + this.producer.sendQueue("Test queue message"+i); + } + Thread.sleep(1000L); + } + +} \ No newline at end of file diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/pom.xml" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/pom.xml" new file mode 100644 index 0000000..22a2195 --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/pom.xml" @@ -0,0 +1,53 @@ + + + 4.0.0 + + com.neo + spring-boot-activemq-topic + 1.0.0 + jar + + spring-boot-activemq-topic + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-activemq + + + mysql + mysql-connector-java + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/main/java/com/neo/ActiveMQTopicApplication.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/main/java/com/neo/ActiveMQTopicApplication.java" new file mode 100644 index 0000000..9b2d441 --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/main/java/com/neo/ActiveMQTopicApplication.java" @@ -0,0 +1,12 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class ActiveMQTopicApplication { + + public static void main(String[] args) { + SpringApplication.run(ActiveMQTopicApplication.class, args); + } +} diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/main/java/com/neo/config/MqConfig.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/main/java/com/neo/config/MqConfig.java" new file mode 100644 index 0000000..66a4ded --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/main/java/com/neo/config/MqConfig.java" @@ -0,0 +1,18 @@ +package com.neo.config; + +import org.apache.activemq.command.ActiveMQQueue; +import org.apache.activemq.command.ActiveMQTopic; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.jms.Queue; +import javax.jms.Topic; + + +@Configuration +public class MqConfig { + @Bean + public Topic topic() { + return new ActiveMQTopic("neo.topic"); + } +} \ No newline at end of file diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/main/java/com/neo/consumer/Consumer.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/main/java/com/neo/consumer/Consumer.java" new file mode 100644 index 0000000..324246c --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/main/java/com/neo/consumer/Consumer.java" @@ -0,0 +1,14 @@ +package com.neo.consumer; + +import org.springframework.jms.annotation.JmsListener; +import org.springframework.stereotype.Component; + +@Component +public class Consumer { + + @JmsListener(destination = "neo.topic") + public void receiveTopic(String text) { + System.out.println("Consumer topic msg : "+text); + } + +} \ No newline at end of file diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/main/java/com/neo/consumer/Consumer2.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/main/java/com/neo/consumer/Consumer2.java" new file mode 100644 index 0000000..9cc28fe --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/main/java/com/neo/consumer/Consumer2.java" @@ -0,0 +1,13 @@ +package com.neo.consumer; + +import org.springframework.jms.annotation.JmsListener; +import org.springframework.stereotype.Component; + +@Component +public class Consumer2 { + + @JmsListener(destination = "neo.topic") + public void receiveTopic(String text) { + System.out.println("Consumer2 topic msg : "+text); + } +} \ No newline at end of file diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/main/java/com/neo/producer/Producer.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/main/java/com/neo/producer/Producer.java" new file mode 100644 index 0000000..680b35b --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/main/java/com/neo/producer/Producer.java" @@ -0,0 +1,22 @@ +package com.neo.producer; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jms.core.JmsMessagingTemplate; +import org.springframework.stereotype.Component; + +import javax.jms.Queue; +import javax.jms.Topic; + +@Component +public class Producer{ + + @Autowired + private JmsMessagingTemplate jmsMessagingTemplate; + @Autowired + private Topic topic; + + public void sendTopic(String msg) { + System.out.println("send topic msg :"+msg); + this.jmsMessagingTemplate.convertAndSend(this.topic, msg); + } +} diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/main/resources/application.properties" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/main/resources/application.properties" new file mode 100644 index 0000000..47c817f --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/main/resources/application.properties" @@ -0,0 +1,3 @@ +spring.activemq.in-memory=true +spring.activemq.pool.enabled=false +spring.jms.pub-sub-domain=true \ No newline at end of file diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/test/java/com/neo/ActiveMQTopicApplicationTests.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/test/java/com/neo/ActiveMQTopicApplicationTests.java" new file mode 100644 index 0000000..156d1d6 --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/test/java/com/neo/ActiveMQTopicApplicationTests.java" @@ -0,0 +1,16 @@ +package com.neo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class ActiveMQTopicApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/test/java/com/neo/send/SampleActiveMqTests.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/test/java/com/neo/send/SampleActiveMqTests.java" new file mode 100644 index 0000000..c1ee062 --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq-topic/src/test/java/com/neo/send/SampleActiveMqTests.java" @@ -0,0 +1,26 @@ +package com.neo.send; + +import com.neo.producer.Producer; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.rule.OutputCapture; +import org.springframework.test.context.junit4.SpringRunner; + +import static org.assertj.core.api.Assertions.assertThat; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class SampleActiveMqTests { + + @Autowired + private Producer producer; + + @Test + public void sendSimpleTopicMessage() throws InterruptedException { + this.producer.sendTopic("Test Topic message"); + Thread.sleep(1000L); + } +} \ No newline at end of file diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/pom.xml" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/pom.xml" new file mode 100644 index 0000000..6517e43 --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/pom.xml" @@ -0,0 +1,49 @@ + + + 4.0.0 + + com.neo + spring-boot-activemq + 1.0.0 + jar + + spring-boot-activemq + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-activemq + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/java/com/neo/ActiveMQApplication.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/java/com/neo/ActiveMQApplication.java" new file mode 100644 index 0000000..453701a --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/java/com/neo/ActiveMQApplication.java" @@ -0,0 +1,18 @@ +package com.neo; + +import javax.jms.Queue; +import javax.jms.Topic; + +import org.apache.activemq.command.ActiveMQQueue; +import org.apache.activemq.command.ActiveMQTopic; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; + +@SpringBootApplication +public class ActiveMQApplication { + + public static void main(String[] args) { + SpringApplication.run(ActiveMQApplication.class, args); + } +} diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/java/com/neo/config/ActiveMQConfig.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/java/com/neo/config/ActiveMQConfig.java" new file mode 100644 index 0000000..c937d07 --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/java/com/neo/config/ActiveMQConfig.java" @@ -0,0 +1,30 @@ +package com.neo.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.jms.annotation.EnableJms; +import org.springframework.jms.config.DefaultJmsListenerContainerFactory; +import org.springframework.jms.config.JmsListenerContainerFactory; + +import javax.jms.ConnectionFactory; + +@Configuration +@EnableJms +public class ActiveMQConfig { + + @Bean("queueListenerFactory") + public JmsListenerContainerFactory queueListenerFactory(ConnectionFactory connectionFactory) { + DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory(); + factory.setConnectionFactory(connectionFactory); + factory.setPubSubDomain(false); + return factory; + } + + @Bean("topicListenerFactory") + public JmsListenerContainerFactory topicListenerFactory(ConnectionFactory connectionFactory) { + DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory(); + factory.setConnectionFactory(connectionFactory); + factory.setPubSubDomain(true); + return factory; + } +} diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/java/com/neo/config/MqConfig.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/java/com/neo/config/MqConfig.java" new file mode 100644 index 0000000..07f7c23 --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/java/com/neo/config/MqConfig.java" @@ -0,0 +1,25 @@ +package com.neo.config; + +import org.apache.activemq.command.ActiveMQQueue; +import org.apache.activemq.command.ActiveMQTopic; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.jms.Queue; +import javax.jms.Topic; + +@Configuration +public class MqConfig { + @Bean + public Queue queue() { + return new ActiveMQQueue("neo.queue"); + } + + @Bean + public Topic topic() { + return new ActiveMQTopic("neo.topic"); + } + + + +} \ No newline at end of file diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/java/com/neo/consumer/Consumer.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/java/com/neo/consumer/Consumer.java" new file mode 100644 index 0000000..dc46bbe --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/java/com/neo/consumer/Consumer.java" @@ -0,0 +1,19 @@ +package com.neo.consumer; + +import org.springframework.jms.annotation.JmsListener; +import org.springframework.stereotype.Component; + +@Component +public class Consumer { + + @JmsListener(destination = "neo.queue", containerFactory = "queueListenerFactory") + public void receiveQueue(String text) { + System.out.println("Consumer queue msg : "+text); + } + + @JmsListener(destination = "neo.topic", containerFactory = "topicListenerFactory") + public void receiveTopic(String text) { + System.out.println("Consumer topic msg : "+text); + } + +} \ No newline at end of file diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/java/com/neo/consumer/Consumer2.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/java/com/neo/consumer/Consumer2.java" new file mode 100644 index 0000000..e4eb2f4 --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/java/com/neo/consumer/Consumer2.java" @@ -0,0 +1,18 @@ +package com.neo.consumer; + +import org.springframework.jms.annotation.JmsListener; +import org.springframework.stereotype.Component; + +@Component +public class Consumer2 { + + @JmsListener(destination = "neo.queue", containerFactory = "queueListenerFactory") + public void receiveQueue(String text) { + System.out.println("Consumer2 msg : "+text); + } + + @JmsListener(destination = "neo.topic", containerFactory = "topicListenerFactory") + public void receiveTopic(String text) { + System.out.println("Consumer2 topic msg : "+text); + } +} \ No newline at end of file diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/java/com/neo/producer/Producer.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/java/com/neo/producer/Producer.java" new file mode 100644 index 0000000..0c7f59e --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/java/com/neo/producer/Producer.java" @@ -0,0 +1,31 @@ +package com.neo.producer; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jms.core.JmsMessagingTemplate; +import org.springframework.stereotype.Component; + +import javax.jms.Queue; +import javax.jms.Topic; + +@Component +public class Producer{ + + @Autowired + private JmsMessagingTemplate jmsMessagingTemplate; + + @Autowired + private Queue queue; + + @Autowired + private Topic topic; + + public void sendQueue(String msg) { + System.out.println("send queue msg :"+msg); + this.jmsMessagingTemplate.convertAndSend(this.queue, msg); + } + + public void sendTopic(String msg) { + System.out.println("send topic msg :"+msg); + this.jmsMessagingTemplate.convertAndSend(this.topic, msg); + } +} diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/resources/application.properties" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/resources/application.properties" new file mode 100644 index 0000000..54671f3 --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/main/resources/application.properties" @@ -0,0 +1,47 @@ +# \u57FA\u4E8E\u5185\u5B58\u7684 ActiveMQ +spring.activemq.in-memory=true +spring.activemq.pool.enabled=false + +# \u72EC\u7ACB\u5B89\u88C5\u7684 ActiveMQ +#spring.activemq.broker-url=tcp://192.168.0.1:61616 +#spring.activemq.user=admin +#spring.activemq.password=admin + +# \u5728\u8003\u8651\u7ED3\u675F\u4E4B\u524D\u7B49\u5F85\u7684\u65F6\u95F4 +#spring.activemq.close-timeout=15s +# \u662F\u5426\u5728\u56DE\u6EDA\u56DE\u6EDA\u6D88\u606F\u4E4B\u524D\u505C\u6B62\u6D88\u606F\u4F20\u9012\u3002\u8FD9\u610F\u5473\u7740\u5F53\u542F\u7528\u6B64\u547D\u4EE4\u65F6\uFF0C\u6D88\u606F\u987A\u5E8F\u4E0D\u4F1A\u88AB\u4FDD\u7559\u3002 +spring.activemq.non-blocking-redelivery=false +# \u7B49\u5F85\u6D88\u606F\u53D1\u9001\u54CD\u5E94\u7684\u65F6\u95F4\u3002\u8BBE\u7F6E\u4E3A0\u7B49\u5F85\u6C38\u8FDC\u3002 +spring.activemq.send-timeout=0 +#\u9ED8\u8BA4\u60C5\u51B5\u4E0Bactivemq\u63D0\u4F9B\u7684\u662Fqueue\u6A21\u5F0F\uFF0C\u82E5\u8981\u4F7F\u7528topic\u6A21\u5F0F\u9700\u8981\u914D\u7F6E\u4E0B\u9762\u914D\u7F6E +#spring.jms.pub-sub-domain=true +#\u8D26\u53F7 +# spring.activemq.user=admin +# \u5BC6\u7801 +# spring.activemq.password=admin +# \u662F\u5426\u4FE1\u4EFB\u6240\u6709\u5305 +#spring.activemq.packages.trust-all= +# \u8981\u4FE1\u4EFB\u7684\u7279\u5B9A\u5305\u7684\u9017\u53F7\u5206\u9694\u5217\u8868\uFF08\u5F53\u4E0D\u4FE1\u4EFB\u6240\u6709\u5305\u65F6\uFF09 +#spring.activemq.packages.trusted= +# \u5F53\u8FDE\u63A5\u8BF7\u6C42\u548C\u6C60\u6EE1\u65F6\u662F\u5426\u963B\u585E\u3002\u8BBE\u7F6Efalse\u4F1A\u629B\u201CJMSException\u5F02\u5E38\u201D\u3002 +#spring.activemq.pool.block-if-full=true +# \u5982\u679C\u6C60\u4ECD\u7136\u6EE1\uFF0C\u5219\u5728\u629B\u51FA\u5F02\u5E38\u524D\u963B\u585E\u65F6\u95F4\u3002 +#spring.activemq.pool.block-if-full-timeout=-1ms +# \u662F\u5426\u5728\u542F\u52A8\u65F6\u521B\u5EFA\u8FDE\u63A5\u3002\u53EF\u4EE5\u5728\u542F\u52A8\u65F6\u7528\u4E8E\u52A0\u70ED\u6C60\u3002 +#spring.activemq.pool.create-connection-on-startup=true +# \u662F\u5426\u7528Pooledconnectionfactory\u4EE3\u66FF\u666E\u901A\u7684ConnectionFactory\u3002 +#spring.activemq.pool.enabled=false +# \u8FDE\u63A5\u8FC7\u671F\u8D85\u65F6\u3002 +#spring.activemq.pool.expiry-timeout=0ms +# \u8FDE\u63A5\u7A7A\u95F2\u8D85\u65F6 +#spring.activemq.pool.idle-timeout=30s +# \u8FDE\u63A5\u6C60\u6700\u5927\u8FDE\u63A5\u6570 +#spring.activemq.pool.max-connections=1 +# \u6BCF\u4E2A\u8FDE\u63A5\u7684\u6709\u6548\u4F1A\u8BDD\u7684\u6700\u5927\u6570\u76EE\u3002 +#spring.activemq.pool.maximum-active-session-per-connection=500 +# \u5F53\u6709"JMSException"\u65F6\u5C1D\u8BD5\u91CD\u65B0\u8FDE\u63A5 +#spring.activemq.pool.reconnect-on-exception=true +# \u5728\u7A7A\u95F2\u8FDE\u63A5\u6E05\u9664\u7EBF\u7A0B\u4E4B\u95F4\u8FD0\u884C\u7684\u65F6\u95F4\u3002\u5F53\u4E3A\u8D1F\u6570\u65F6\uFF0C\u6CA1\u6709\u7A7A\u95F2\u8FDE\u63A5\u9A71\u9010\u7EBF\u7A0B\u8FD0\u884C\u3002 +#spring.activemq.pool.time-between-expiration-check=-1ms +# \u662F\u5426\u53EA\u4F7F\u7528\u4E00\u4E2AMessageProducer +#spring.activemq.pool.use-anonymous-producers=true diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/test/java/com/neo/ActiveMQApplicationTests.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/test/java/com/neo/ActiveMQApplicationTests.java" new file mode 100644 index 0000000..236a8d4 --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/test/java/com/neo/ActiveMQApplicationTests.java" @@ -0,0 +1,16 @@ +package com.neo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class ActiveMQApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git "a/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/test/java/com/neo/send/SampleActiveMqTests.java" "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/test/java/com/neo/send/SampleActiveMqTests.java" new file mode 100644 index 0000000..e962aba --- /dev/null +++ "b/\347\254\254 4-5 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot \346\223\215\344\275\234 ActiveMQ/spring-boot-activemq/src/test/java/com/neo/send/SampleActiveMqTests.java" @@ -0,0 +1,40 @@ +package com.neo.send; + +import com.neo.producer.Producer; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.rule.OutputCapture; +import org.springframework.test.context.junit4.SpringRunner; + +import static org.assertj.core.api.Assertions.assertThat; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class SampleActiveMqTests { + + @Rule + public OutputCapture outputCapture = new OutputCapture(); + + @Autowired + private Producer producer; + + @Test + public void sendSimpleQueueMessage() throws InterruptedException { + for (int i=0;i<100;i++){ + this.producer.sendQueue("Test queue message"+i); + } + Thread.sleep(1000L); +// assertThat(this.outputCapture.toString().contains("Test message")).isTrue(); + } + + @Test + public void sendSimpleTopicMessage() throws InterruptedException { + for (int i=0;i<100;i++){ + this.producer.sendTopic("Test Topic message"+i); + } + Thread.sleep(1000L); + } +} \ No newline at end of file diff --git "a/\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-scheduler/pom.xml" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/pom.xml" similarity index 71% rename from "\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-scheduler/pom.xml" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/pom.xml" index 1256dc0..a23b858 100644 --- "a/\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-scheduler/pom.xml" +++ "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/pom.xml" @@ -4,17 +4,17 @@ 4.0.0 com.neo - spring-boot-scheduler + spring-boot-rabbitmq 1.0.0 jar - spring-boot-scheduler - Demo project for Spring Boot and scheduler + spring-boot-rabbitmq + Demo project for Spring Boot and rabbitmq org.springframework.boot spring-boot-starter-parent - 1.5.8.RELEASE + 2.1.0.RELEASE @@ -26,7 +26,12 @@ org.springframework.boot - spring-boot-starter + spring-boot-starter-amqp + + + org.springframework.boot + spring-boot-starter-test + test diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/RabbitMQApplication.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/RabbitMQApplication.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/RabbitMQApplication.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/RabbitMQApplication.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/model/User.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/model/User.java" similarity index 78% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/model/User.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/model/User.java" index b173767..75e8d07 100644 --- "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/model/User.java" +++ "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/model/User.java" @@ -1,7 +1,5 @@ package com.neo.model; -import org.apache.commons.lang3.builder.ToStringBuilder; - import java.io.Serializable; @@ -29,6 +27,9 @@ public void setPass(String pass) { @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + return "User{" + + "name='" + name + '\'' + + ", pass='" + pass + '\'' + + '}'; } } diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/FanoutRabbitConfig.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/FanoutRabbitConfig.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/FanoutRabbitConfig.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/FanoutRabbitConfig.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/RabbitConfig.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/RabbitConfig.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/RabbitConfig.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/RabbitConfig.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/TopicRabbitConfig.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/TopicRabbitConfig.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/TopicRabbitConfig.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/TopicRabbitConfig.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/fanout/FanoutReceiverA.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/fanout/FanoutReceiverA.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/fanout/FanoutReceiverA.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/fanout/FanoutReceiverA.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/fanout/FanoutReceiverB.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/fanout/FanoutReceiverB.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/fanout/FanoutReceiverB.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/fanout/FanoutReceiverB.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/fanout/FanoutReceiverC.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/fanout/FanoutReceiverC.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/fanout/FanoutReceiverC.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/fanout/FanoutReceiverC.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/fanout/FanoutSender.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/fanout/FanoutSender.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/fanout/FanoutSender.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/fanout/FanoutSender.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/hello/HelloReceiver.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/hello/HelloReceiver.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/hello/HelloReceiver.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/hello/HelloReceiver.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/hello/HelloSender.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/hello/HelloSender.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/hello/HelloSender.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/hello/HelloSender.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/many/NeoReceiver1.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/many/NeoReceiver1.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/many/NeoReceiver1.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/many/NeoReceiver1.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/many/NeoReceiver2.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/many/NeoReceiver2.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/many/NeoReceiver2.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/many/NeoReceiver2.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/many/NeoSender.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/many/NeoSender.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/many/NeoSender.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/many/NeoSender.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/many/NeoSender2.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/many/NeoSender2.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/many/NeoSender2.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/many/NeoSender2.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/object/ObjectReceiver.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/object/ObjectReceiver.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/object/ObjectReceiver.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/object/ObjectReceiver.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/object/ObjectSender.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/object/ObjectSender.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/object/ObjectSender.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/object/ObjectSender.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/topic/TopicReceiver.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/topic/TopicReceiver.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/topic/TopicReceiver.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/topic/TopicReceiver.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/topic/TopicReceiver2.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/topic/TopicReceiver2.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/topic/TopicReceiver2.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/topic/TopicReceiver2.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/topic/TopicSender.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/topic/TopicSender.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/topic/TopicSender.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/java/com/neo/rabbit/topic/TopicSender.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/resources/application.properties" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/resources/application.properties" similarity index 62% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/resources/application.properties" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/resources/application.properties" index 412278c..04e441a 100644 --- "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/resources/application.properties" +++ "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/main/resources/application.properties" @@ -2,5 +2,5 @@ spring.application.name=spirng-boot-rabbitmq spring.rabbitmq.host=192.168.0.56 spring.rabbitmq.port=5672 -spring.rabbitmq.username=admin -spring.rabbitmq.password=123456 +spring.rabbitmq.username=zzq +spring.rabbitmq.password=zzq diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/RabbitMQApplicationTests.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/RabbitMQApplicationTests.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/RabbitMQApplicationTests.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/RabbitMQApplicationTests.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/rabbitmq/FanoutTest.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/rabbitmq/FanoutTest.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/rabbitmq/FanoutTest.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/rabbitmq/FanoutTest.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/rabbitmq/HelloTest.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/rabbitmq/HelloTest.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/rabbitmq/HelloTest.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/rabbitmq/HelloTest.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/rabbitmq/ManyTest.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/rabbitmq/ManyTest.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/rabbitmq/ManyTest.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/rabbitmq/ManyTest.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/rabbitmq/ObjectTest.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/rabbitmq/ObjectTest.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/rabbitmq/ObjectTest.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/rabbitmq/ObjectTest.java" diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/rabbitmq/TopicTest.java" "b/\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/rabbitmq/TopicTest.java" similarity index 100% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/rabbitmq/TopicTest.java" rename to "\347\254\254 4-6 \350\257\276\357\274\232Spring Boot RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/src/test/java/com/neo/rabbitmq/TopicTest.java" diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-repository/pom.xml" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-repository/pom.xml" similarity index 67% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-repository/pom.xml" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-repository/pom.xml" index 2dd5693..8684fd7 100644 --- "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-repository/pom.xml" +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-repository/pom.xml" @@ -14,8 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 1.5.8.RELEASE - + 2.1.0.RELEASE @@ -24,28 +23,13 @@ - - org.springframework.boot - spring-boot-starter - org.springframework.boot spring-boot-starter-data-mongodb - - org.apache.commons - commons-lang3 - 3.6 - org.springframework.boot spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-devtools - true @@ -54,9 +38,6 @@ org.springframework.boot spring-boot-maven-plugin - - true - diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-repository/src/main/java/com/neo/RepositoryApplication.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-repository/src/main/java/com/neo/RepositoryApplication.java" similarity index 100% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-repository/src/main/java/com/neo/RepositoryApplication.java" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-repository/src/main/java/com/neo/RepositoryApplication.java" diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-repository/src/main/java/com/neo/entity/UserEntity.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-repository/src/main/java/com/neo/model/User.java" similarity index 68% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-repository/src/main/java/com/neo/entity/UserEntity.java" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-repository/src/main/java/com/neo/model/User.java" index f5eca92..ad93b4d 100644 --- "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-repository/src/main/java/com/neo/entity/UserEntity.java" +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-repository/src/main/java/com/neo/model/User.java" @@ -1,12 +1,6 @@ -package com.neo.entity; +package com.neo.model; -import org.apache.commons.lang3.builder.ToStringBuilder; - -import java.io.Serializable; - - -public class UserEntity implements Serializable { - private static final long serialVersionUID = -3258839839160856613L; +public class User { private Long id; private String userName; private String passWord; @@ -35,9 +29,12 @@ public void setPassWord(String passWord) { this.passWord = passWord; } - @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + return "User{" + + "id=" + id + + ", userName='" + userName + '\'' + + ", passWord='" + passWord + '\'' + + '}'; } } diff --git "a/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-repository/src/main/java/com/neo/repository/UserRepository.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-repository/src/main/java/com/neo/repository/UserRepository.java" new file mode 100644 index 0000000..c98c2b5 --- /dev/null +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-repository/src/main/java/com/neo/repository/UserRepository.java" @@ -0,0 +1,11 @@ +package com.neo.repository; + +import com.neo.model.User; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.mongodb.repository.MongoRepository; + +public interface UserRepository extends MongoRepository { + User findByUserName(String userName); + Page findAll(Pageable var1); +} \ No newline at end of file diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-repository/src/main/resources/application.properties" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-repository/src/main/resources/application.properties" similarity index 50% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-repository/src/main/resources/application.properties" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-repository/src/main/resources/application.properties" index a0d7e0f..56f653d 100644 --- "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-repository/src/main/resources/application.properties" +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-repository/src/main/resources/application.properties" @@ -1,5 +1,5 @@ spring.application.name=spring-boot-mongodb-repository -spring.data.mongodb.uri=mongodb://192.168.0.74:27017/test +spring.data.mongodb.uri=mongodb://localhost:27017/test diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-repository/src/test/java/com/neo/RepositoryApplicationTests.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-repository/src/test/java/com/neo/RepositoryApplicationTests.java" similarity index 100% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-repository/src/test/java/com/neo/RepositoryApplicationTests.java" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-repository/src/test/java/com/neo/RepositoryApplicationTests.java" diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-repository/src/test/java/com/neo/repository/UserDaoTest.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-repository/src/test/java/com/neo/repository/RepositoryTest.java" similarity index 81% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-repository/src/test/java/com/neo/repository/UserDaoTest.java" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-repository/src/test/java/com/neo/repository/RepositoryTest.java" index 1b392b7..723a94f 100644 --- "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-repository/src/test/java/com/neo/repository/UserDaoTest.java" +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-repository/src/test/java/com/neo/repository/RepositoryTest.java" @@ -1,6 +1,6 @@ package com.neo.repository; -import com.neo.entity.UserEntity; +import com.neo.model.User; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -14,7 +14,7 @@ @RunWith(SpringRunner.class) @SpringBootTest -public class UserDaoTest { +public class RepositoryTest { @Autowired private UserRepository userRepository; @@ -22,7 +22,7 @@ public class UserDaoTest { @Test public void testSaveUser() throws Exception { for (long i=0;i<100;i++) { - UserEntity user=new UserEntity(); + User user=new User(); user.setId(i); user.setUserName("小明"+i); user.setPassWord("fffooo123"); @@ -32,13 +32,13 @@ public void testSaveUser() throws Exception { @Test public void findUserByUserName(){ - UserEntity user= userRepository.findByUserName("小明"); + User user= userRepository.findByUserName("小明1"); System.out.println("user is "+user); } @Test public void updateUser(){ - UserEntity user=new UserEntity(); + User user=new User(); user.setId(2l); user.setUserName("天空"); user.setPassWord("fffxxxx"); @@ -47,13 +47,13 @@ public void updateUser(){ @Test public void deleteUserById(){ - userRepository.delete(2l); + userRepository.deleteById(2l); } @Test public void testPage(){ Sort sort = new Sort(Sort.Direction.DESC, "id"); - Pageable pageable = new PageRequest(2, 10, sort); + Pageable pageable = PageRequest.of(2, 10, sort); Page page=userRepository.findAll(pageable); System.out.println("users: "+page.getContent().toString()); } diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-template/pom.xml" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/pom.xml" similarity index 67% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-template/pom.xml" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/pom.xml" index 579da7b..9d21ab4 100644 --- "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-template/pom.xml" +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/pom.xml" @@ -14,8 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 1.5.8.RELEASE - + 2.1.0.RELEASE @@ -24,28 +23,13 @@ - - org.springframework.boot - spring-boot-starter - org.springframework.boot spring-boot-starter-data-mongodb - - org.apache.commons - commons-lang3 - 3.6 - org.springframework.boot spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-devtools - true @@ -54,9 +38,6 @@ org.springframework.boot spring-boot-maven-plugin - - true - diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-template/src/main/java/com/neo/TemplateApplication.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/main/java/com/neo/TemplateApplication.java" similarity index 100% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-template/src/main/java/com/neo/TemplateApplication.java" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/main/java/com/neo/TemplateApplication.java" diff --git "a/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/main/java/com/neo/config/MongoConfig.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/main/java/com/neo/config/MongoConfig.java" new file mode 100644 index 0000000..60706f7 --- /dev/null +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/main/java/com/neo/config/MongoConfig.java" @@ -0,0 +1,41 @@ +package com.neo.config; + +import com.mongodb.MongoClient; +import com.mongodb.MongoClientURI; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.data.mongodb.MongoDbFactory; +import org.springframework.data.mongodb.core.MongoTemplate; +import org.springframework.data.mongodb.core.SimpleMongoDbFactory; +import org.springframework.data.mongodb.core.convert.DefaultDbRefResolver; +import org.springframework.data.mongodb.core.convert.DefaultMongoTypeMapper; +import org.springframework.data.mongodb.core.convert.MappingMongoConverter; +import org.springframework.data.mongodb.core.mapping.MongoMappingContext; + +@Configuration +public class MongoConfig { + + @Value("${mongodb.uri}") + private String mongodbUri; + + @Primary + @Bean(name = "mongoTemplate") + public MongoTemplate mongoTemplate() throws Exception { + MappingMongoConverter converter = + new MappingMongoConverter(new DefaultDbRefResolver(mongoFactory()), new MongoMappingContext()); + converter.setTypeMapper(new DefaultMongoTypeMapper(null)); + return new MongoTemplate(mongoFactory(), converter); + } + + @Bean + @Primary + public MongoDbFactory mongoFactory() throws Exception { + MongoClient client = new MongoClient(new MongoClientURI(mongodbUri)); + return new SimpleMongoDbFactory(client, "test"); + } + +} + diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-template/src/main/java/com/neo/entity/UserEntity.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/main/java/com/neo/model/User.java" similarity index 68% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-template/src/main/java/com/neo/entity/UserEntity.java" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/main/java/com/neo/model/User.java" index f5eca92..1f91595 100644 --- "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-template/src/main/java/com/neo/entity/UserEntity.java" +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/main/java/com/neo/model/User.java" @@ -1,12 +1,6 @@ -package com.neo.entity; +package com.neo.model; -import org.apache.commons.lang3.builder.ToStringBuilder; - -import java.io.Serializable; - - -public class UserEntity implements Serializable { - private static final long serialVersionUID = -3258839839160856613L; +public class User { private Long id; private String userName; private String passWord; @@ -35,9 +29,12 @@ public void setPassWord(String passWord) { this.passWord = passWord; } - @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + return "User{" + + "id=" + id + + ", userName='" + userName + '\'' + + ", passWord='" + passWord + '\'' + + '}'; } } diff --git "a/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/main/java/com/neo/repository/UserRepository.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/main/java/com/neo/repository/UserRepository.java" new file mode 100644 index 0000000..0405e4e --- /dev/null +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/main/java/com/neo/repository/UserRepository.java" @@ -0,0 +1,15 @@ +package com.neo.repository; + +import com.neo.model.User; + +public interface UserRepository { + + public void saveUser(User user); + + public User findUserByUserName(String userName); + + public long updateUser(User user); + + public void deleteUserById(Long id); + +} diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-template/src/main/java/com/neo/repository/impl/UserDaoImpl.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/main/java/com/neo/repository/impl/UserRepositoryImpl.java" similarity index 72% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-template/src/main/java/com/neo/repository/impl/UserDaoImpl.java" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/main/java/com/neo/repository/impl/UserRepositoryImpl.java" index 5011c81..16d5eae 100644 --- "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-template/src/main/java/com/neo/repository/impl/UserDaoImpl.java" +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/main/java/com/neo/repository/impl/UserRepositoryImpl.java" @@ -1,8 +1,8 @@ package com.neo.repository.impl; -import com.mongodb.WriteResult; -import com.neo.repository.UserDao; -import com.neo.entity.UserEntity; +import com.mongodb.client.result.UpdateResult; +import com.neo.model.User; +import com.neo.repository.UserRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.query.Criteria; @@ -11,7 +11,7 @@ import org.springframework.stereotype.Component; @Component -public class UserDaoImpl implements UserDao { +public class UserRepositoryImpl implements UserRepository { @Autowired private MongoTemplate mongoTemplate; @@ -21,7 +21,7 @@ public class UserDaoImpl implements UserDao { * @param user */ @Override - public void saveUser(UserEntity user) { + public void saveUser(User user) { mongoTemplate.save(user); } @@ -31,9 +31,9 @@ public void saveUser(UserEntity user) { * @return */ @Override - public UserEntity findUserByUserName(String userName) { + public User findUserByUserName(String userName) { Query query=new Query(Criteria.where("userName").is(userName)); - UserEntity user = mongoTemplate.findOne(query , UserEntity.class); + User user = mongoTemplate.findOne(query , User.class); return user; } @@ -42,15 +42,15 @@ public UserEntity findUserByUserName(String userName) { * @param user */ @Override - public int updateUser(UserEntity user) { + public long updateUser(User user) { Query query=new Query(Criteria.where("id").is(user.getId())); Update update= new Update().set("userName", user.getUserName()).set("passWord", user.getPassWord()); //更新查询返回结果集的第一条 - WriteResult result =mongoTemplate.updateFirst(query,update,UserEntity.class); + UpdateResult result =mongoTemplate.updateFirst(query,update,User.class); //更新查询返回结果集的所有 // mongoTemplate.updateMulti(query,update,UserEntity.class); if(result!=null) - return result.getN(); + return result.getMatchedCount(); else return 0; } @@ -62,6 +62,6 @@ public int updateUser(UserEntity user) { @Override public void deleteUserById(Long id) { Query query=new Query(Criteria.where("id").is(id)); - mongoTemplate.remove(query,UserEntity.class); + mongoTemplate.remove(query,User.class); } } diff --git "a/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/main/resources/application.properties" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/main/resources/application.properties" new file mode 100644 index 0000000..8dc844b --- /dev/null +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/main/resources/application.properties" @@ -0,0 +1,5 @@ +spring.application.name=spring-boot-mongodb-template + +#spring.data.mongodb.uri=mongodb://localhost:27017/test + +mongodb.uri=mongodb://localhost:27017 diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-template/src/test/java/com/neo/TemplateApplicationTests.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/test/java/com/neo/TemplateApplicationTests.java" similarity index 100% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-template/src/test/java/com/neo/TemplateApplicationTests.java" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/test/java/com/neo/TemplateApplicationTests.java" diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-template/src/test/java/com/neo/repository/UserDaoTest.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/test/java/com/neo/repository/UserTemplateTest.java" similarity index 69% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-template/src/test/java/com/neo/repository/UserDaoTest.java" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/test/java/com/neo/repository/UserTemplateTest.java" index b3228d8..c8eab70 100644 --- "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-mongodb-template/src/test/java/com/neo/repository/UserDaoTest.java" +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-mongodb-template/src/test/java/com/neo/repository/UserTemplateTest.java" @@ -1,6 +1,6 @@ package com.neo.repository; -import com.neo.entity.UserEntity; +import com.neo.model.User; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -10,38 +10,38 @@ @RunWith(SpringRunner.class) @SpringBootTest -public class UserDaoTest { +public class UserTemplateTest { @Autowired - private UserDao userDao; + private UserRepository userRepository; @Test public void testSaveUser() throws Exception { - UserEntity user=new UserEntity(); + User user=new User(); user.setId(2l); user.setUserName("小明"); user.setPassWord("fffooo123"); - userDao.saveUser(user); + userRepository.saveUser(user); } @Test public void findUserByUserName(){ - UserEntity user= userDao.findUserByUserName("小明"); + User user= userRepository.findUserByUserName("小明"); System.out.println("user is "+user); } @Test public void updateUser(){ - UserEntity user=new UserEntity(); + User user=new User(); user.setId(2l); user.setUserName("天空"); user.setPassWord("fffxxxx"); - userDao.updateUser(user); + userRepository.updateUser(user); } @Test public void deleteUserById(){ - userDao.deleteUserById(1l); + userRepository.deleteUserById(1L); } } diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/pom.xml" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/pom.xml" similarity index 79% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/pom.xml" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/pom.xml" index a9520bd..e38f5ba 100644 --- "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/pom.xml" +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/pom.xml" @@ -14,8 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 1.5.8.RELEASE - + 2.1.0.RELEASE @@ -28,15 +27,9 @@ org.springframework.boot spring-boot-starter-data-mongodb - - org.apache.commons - commons-lang3 - 3.6 - org.springframework.boot spring-boot-starter-test - test @@ -45,9 +38,6 @@ org.springframework.boot spring-boot-maven-plugin - - true - diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/main/java/com/neo/MultiMongodbApplication.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/MultiMongodbApplication.java" similarity index 79% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/main/java/com/neo/MultiMongodbApplication.java" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/MultiMongodbApplication.java" index 608674b..e101cf8 100644 --- "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/main/java/com/neo/MultiMongodbApplication.java" +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/MultiMongodbApplication.java" @@ -6,8 +6,7 @@ import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; -@EnableConfigurationProperties(MultipleMongoProperties.class) -@SpringBootApplication(exclude = MongoAutoConfiguration.class) +@SpringBootApplication public class MultiMongodbApplication { public static void main(String[] args) { diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/main/java/com/neo/config/MultipleMongoConfig.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/config/MultipleMongoConfig.java" similarity index 94% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/main/java/com/neo/config/MultipleMongoConfig.java" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/config/MultipleMongoConfig.java" index 5715cc9..5d4a2f5 100644 --- "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/main/java/com/neo/config/MultipleMongoConfig.java" +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/config/MultipleMongoConfig.java" @@ -20,13 +20,13 @@ public class MultipleMongoConfig { private MultipleMongoProperties mongoProperties; @Primary - @Bean(name = PrimaryMongoConfig.MONGO_TEMPLATE) + @Bean(name = "primaryMongoTemplate") public MongoTemplate primaryMongoTemplate() throws Exception { return new MongoTemplate(primaryFactory(this.mongoProperties.getPrimary())); } @Bean - @Qualifier(SecondaryMongoConfig.MONGO_TEMPLATE) + @Qualifier("secondaryMongoTemplate") public MongoTemplate secondaryMongoTemplate() throws Exception { return new MongoTemplate(secondaryFactory(this.mongoProperties.getSecondary())); } diff --git "a/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/config/PrimaryMongoConfig.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/config/PrimaryMongoConfig.java" new file mode 100644 index 0000000..7920d18 --- /dev/null +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/config/PrimaryMongoConfig.java" @@ -0,0 +1,23 @@ +package com.neo.config; + +import com.mongodb.MongoClient; +import com.mongodb.MongoClientURI; +import com.neo.config.props.MultipleMongoProperties; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.mongo.MongoProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.data.mongodb.MongoDbFactory; +import org.springframework.data.mongodb.core.MongoTemplate; +import org.springframework.data.mongodb.core.SimpleMongoDbFactory; +import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; + + +@Configuration +@EnableConfigurationProperties(MultipleMongoProperties.class) +@EnableMongoRepositories(basePackages = "com.neo.repository.primary", + mongoTemplateRef = "primaryMongoTemplate") +public class PrimaryMongoConfig { +} diff --git "a/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/config/SecondaryMongoConfig.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/config/SecondaryMongoConfig.java" new file mode 100644 index 0000000..c50e228 --- /dev/null +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/config/SecondaryMongoConfig.java" @@ -0,0 +1,24 @@ +package com.neo.config; + +import com.mongodb.MongoClient; +import com.mongodb.MongoClientURI; +import com.neo.config.props.MultipleMongoProperties; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.mongo.MongoProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.mongodb.MongoDbFactory; +import org.springframework.data.mongodb.core.MongoTemplate; +import org.springframework.data.mongodb.core.SimpleMongoDbFactory; +import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; + + +@Configuration +@EnableConfigurationProperties(MultipleMongoProperties.class) +@EnableMongoRepositories(basePackages = "com.neo.repository.secondary", + mongoTemplateRef = "secondaryMongoTemplate") +public class SecondaryMongoConfig { + +} diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/main/java/com/neo/config/props/MultipleMongoProperties.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/config/props/MultipleMongoProperties.java" similarity index 96% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/main/java/com/neo/config/props/MultipleMongoProperties.java" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/config/props/MultipleMongoProperties.java" index 822004e..5bf4ff6 100644 --- "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/main/java/com/neo/config/props/MultipleMongoProperties.java" +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/config/props/MultipleMongoProperties.java" @@ -3,9 +3,6 @@ import org.springframework.boot.autoconfigure.mongo.MongoProperties; import org.springframework.boot.context.properties.ConfigurationProperties; -/** - * @author neo - */ @ConfigurationProperties(prefix = "mongodb") public class MultipleMongoProperties { diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/main/java/com/neo/entity/UserEntity.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/model/User.java" similarity index 71% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/main/java/com/neo/entity/UserEntity.java" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/model/User.java" index 009fcc1..b5cd0a8 100644 --- "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/main/java/com/neo/entity/UserEntity.java" +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/model/User.java" @@ -1,17 +1,15 @@ -package com.neo.entity; - -import org.apache.commons.lang3.builder.ToStringBuilder; +package com.neo.model; import java.io.Serializable; -public class UserEntity implements Serializable { +public class User implements Serializable { private static final long serialVersionUID = -3258839839160856613L; private String id; private String userName; private String passWord; - public UserEntity(String userName, String passWord) { + public User(String userName, String passWord) { this.userName = userName; this.passWord = passWord; } @@ -40,9 +38,12 @@ public void setPassWord(String passWord) { this.passWord = passWord; } - @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + return "User{" + + "id='" + id + '\'' + + ", userName='" + userName + '\'' + + ", passWord='" + passWord + '\'' + + '}'; } } diff --git "a/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/repository/primary/PrimaryRepository.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/repository/primary/PrimaryRepository.java" new file mode 100644 index 0000000..50877eb --- /dev/null +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/repository/primary/PrimaryRepository.java" @@ -0,0 +1,10 @@ +package com.neo.repository.primary; + +import com.neo.model.User; +import org.springframework.data.mongodb.repository.MongoRepository; + +/** + * @author neo + */ +public interface PrimaryRepository extends MongoRepository { +} diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/main/java/com/neo/model/repository/secondary/SecondaryRepository.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/repository/secondary/SecondaryRepository.java" similarity index 62% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/main/java/com/neo/model/repository/secondary/SecondaryRepository.java" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/repository/secondary/SecondaryRepository.java" index 2a6307b..11df915 100644 --- "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/main/java/com/neo/model/repository/secondary/SecondaryRepository.java" +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/java/com/neo/repository/secondary/SecondaryRepository.java" @@ -1,10 +1,10 @@ -package com.neo.model.repository.secondary; +package com.neo.repository.secondary; -import com.neo.entity.UserEntity; +import com.neo.model.User; import org.springframework.data.mongodb.repository.MongoRepository; /** * @author neo */ -public interface SecondaryRepository extends MongoRepository { +public interface SecondaryRepository extends MongoRepository { } diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/main/resources/application.properties" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/resources/application.properties" similarity index 55% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/main/resources/application.properties" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/resources/application.properties" index 0a6055d..02504a1 100644 --- "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/main/resources/application.properties" +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/main/resources/application.properties" @@ -1,8 +1,8 @@ spring.application.name=spring-boot-multi-mongodb -mongodb.primary.uri=mongodb://192.168.0.74:27017 +mongodb.primary.uri=mongodb://localhost:27017 mongodb.primary.database=primary -mongodb.secondary.uri=mongodb://192.168.0.74:27017 +mongodb.secondary.uri=mongodb://localhost:27017 mongodb.secondary.database=secondary diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/test/java/com/neo/MultiMongodbApplicationTests.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/test/java/com/neo/MultiMongodbApplicationTests.java" similarity index 100% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/test/java/com/neo/MultiMongodbApplicationTests.java" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/test/java/com/neo/MultiMongodbApplicationTests.java" diff --git "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/test/java/com/neo/model/repository/MuliDatabaseTest.java" "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/test/java/com/neo/repository/MuliDatabaseTest.java" similarity index 65% rename from "\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/test/java/com/neo/model/repository/MuliDatabaseTest.java" rename to "\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/test/java/com/neo/repository/MuliDatabaseTest.java" index a7a8e65..42bf1b4 100644 --- "a/\347\254\25412\350\257\276\357\274\232MongoDB \345\256\236\346\210\230/spring-boot-multi-mongodb/src/test/java/com/neo/model/repository/MuliDatabaseTest.java" +++ "b/\347\254\254 4-7 \350\257\276\357\274\232Spring Boot \347\256\200\345\215\225\351\233\206\346\210\220 MongoDB/spring-boot-multi-mongodb/src/test/java/com/neo/repository/MuliDatabaseTest.java" @@ -1,8 +1,8 @@ -package com.neo.model.repository; +package com.neo.repository; -import com.neo.entity.UserEntity; -import com.neo.model.repository.primary.PrimaryRepository; -import com.neo.model.repository.secondary.SecondaryRepository; +import com.neo.model.User; +import com.neo.repository.primary.PrimaryRepository; +import com.neo.repository.secondary.SecondaryRepository; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -24,26 +24,19 @@ public class MuliDatabaseTest { @Test public void TestSave() { - System.out.println("************************************************************"); System.out.println("测试开始"); System.out.println("************************************************************"); - - this.primaryRepository.save(new UserEntity("小张", "123456")); - - this.secondaryRepository.save(new UserEntity("小王", "654321")); - - List primaries = this.primaryRepository.findAll(); - for (UserEntity primary : primaries) { + this.primaryRepository.save(new User("小张", "123456")); + this.secondaryRepository.save(new User("小王", "654321")); + List primaries = this.primaryRepository.findAll(); + for (User primary : primaries) { System.out.println(primary.toString()); } - - List secondaries = this.secondaryRepository.findAll(); - - for (UserEntity secondary : secondaries) { + List secondaries = this.secondaryRepository.findAll(); + for (User secondary : secondaries) { System.out.println(secondary.toString()); } - System.out.println("************************************************************"); System.out.println("测试完成"); System.out.println("************************************************************"); diff --git "a/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/pom.xml" "b/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/pom.xml" new file mode 100644 index 0000000..939098a --- /dev/null +++ "b/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/pom.xml" @@ -0,0 +1,47 @@ + + + 4.0.0 + + com.neo + spring-boot-elasticsearch + 1.0 + jar + + spring-boot-elasticsearch + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-data-elasticsearch + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git "a/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/main/java/com/neo/ElasticsearchApplication.java" "b/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/main/java/com/neo/ElasticsearchApplication.java" new file mode 100644 index 0000000..e16db52 --- /dev/null +++ "b/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/main/java/com/neo/ElasticsearchApplication.java" @@ -0,0 +1,12 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class ElasticsearchApplication { + + public static void main(String[] args) { + SpringApplication.run(ElasticsearchApplication.class, args); + } +} diff --git "a/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/main/java/com/neo/model/Customer.java" "b/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/main/java/com/neo/model/Customer.java" new file mode 100644 index 0000000..e71076d --- /dev/null +++ "b/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/main/java/com/neo/model/Customer.java" @@ -0,0 +1,71 @@ + +package com.neo.model; + +import org.springframework.data.annotation.Id; +import org.springframework.data.elasticsearch.annotations.Document; +import org.springframework.data.elasticsearch.annotations.Field; + +@Document(indexName = "customer", type = "customer", shards = 1, replicas = 0, refreshInterval = "-1") +public class Customer { + + //Id注解加上后,在Elasticsearch里相应于该列就是主键了,在查询时就可以直接用主键查询 + @Id + private String id; + + private String userName; + + private String address; + + private int age; + + public Customer() { + } + + public Customer(String userName, String address, int age) { + this.userName = userName; + this.address = address; + this.age = age; + } + + public String getId() { + return this.id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getAddress() { + return address; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + public void setAddress(String address) { + this.address = address; + } + + @Override + public String toString() { + return "Customer{" + + "id='" + id + '\'' + + ", userName='" + userName + '\'' + + ", address='" + address + '\'' + + ", age=" + age + + '}'; + } +} diff --git "a/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/main/java/com/neo/repository/CustomerRepository.java" "b/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/main/java/com/neo/repository/CustomerRepository.java" new file mode 100644 index 0000000..fec24b4 --- /dev/null +++ "b/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/main/java/com/neo/repository/CustomerRepository.java" @@ -0,0 +1,19 @@ + +package com.neo.repository; + +import com.neo.model.Customer; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; + +import java.util.List; + + +public interface CustomerRepository extends ElasticsearchRepository { + public List findByAddress(String address); + public Customer findByUserName(String userName); + public int deleteByUserName(String userName); + public Page findByAddress(String address, Pageable pageable); + + +} diff --git "a/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/main/java/com/neo/service/CustomersInterface.java" "b/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/main/java/com/neo/service/CustomersInterface.java" new file mode 100644 index 0000000..ad36175 --- /dev/null +++ "b/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/main/java/com/neo/service/CustomersInterface.java" @@ -0,0 +1,12 @@ +package com.neo.service; + +import com.neo.model.Customer; + +import java.util.List; + +public interface CustomersInterface { + + public List searchCity(Integer pageNumber, Integer pageSize, String searchContent); + + +} diff --git "a/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/main/java/com/neo/service/impl/CustomersInterfaceImpl.java" "b/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/main/java/com/neo/service/impl/CustomersInterfaceImpl.java" new file mode 100644 index 0000000..742a52b --- /dev/null +++ "b/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/main/java/com/neo/service/impl/CustomersInterfaceImpl.java" @@ -0,0 +1,50 @@ +package com.neo.service.impl; + +import com.neo.model.Customer; +import com.neo.repository.CustomerRepository; +import com.neo.service.CustomersInterface; +import org.elasticsearch.index.query.QueryBuilders; +import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder; +import org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; +import org.springframework.data.elasticsearch.core.query.SearchQuery; + +import java.util.List; + +public class CustomersInterfaceImpl implements CustomersInterface { + + Logger logger= LoggerFactory.getLogger(this.getClass()); + @Autowired + private CustomerRepository customerRepository; + + @Override + public List searchCity(Integer pageNumber, Integer pageSize, String searchContent) { +/* // 分页参数 + Pageable pageable = new PageRequest(pageNumber, pageSize); + + // Function Score Query + FunctionScoreQueryBuilder functionScoreQueryBuilder = QueryBuilders.functionScoreQuery() + .add(QueryBuilders.boolQuery().should(QueryBuilders.matchQuery("cityname", searchContent)), + ScoreFunctionBuilders.weightFactorFunction(1000)) + .add(QueryBuilders.boolQuery().should(QueryBuilders.matchQuery("description", searchContent)), + ScoreFunctionBuilders.weightFactorFunction(100)); + + // 创建搜索 DSL 查询 + SearchQuery searchQuery = new NativeSearchQueryBuilder() + .withPageable(pageable) + .withQuery(functionScoreQueryBuilder).build(); + + logger.info("\n searchCity(): searchContent [" + searchContent + "] \n DSL = \n " + searchQuery.getQuery().toString()); + + Page searchPageResults = customerRepository.search(searchQuery); + return searchPageResults.getContent(); + */ + return null; + } +} diff --git "a/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/main/resources/application.properties" "b/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/main/resources/application.properties" new file mode 100644 index 0000000..6b48fb3 --- /dev/null +++ "b/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/main/resources/application.properties" @@ -0,0 +1,2 @@ +spring.data.elasticsearch.cluster-name=es-mongodb +spring.data.elasticsearch.cluster-nodes=192.168.0.53:9300 \ No newline at end of file diff --git "a/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/test/java/com/neo/ElasticsearchApplicationTests.java" "b/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/test/java/com/neo/ElasticsearchApplicationTests.java" new file mode 100644 index 0000000..4a07e8e --- /dev/null +++ "b/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/test/java/com/neo/ElasticsearchApplicationTests.java" @@ -0,0 +1,18 @@ +package com.neo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class ElasticsearchApplicationTests { + + @Test + public void contextLoads() { + System.out.println("Spring Boot Test"); + } + +} diff --git "a/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/test/java/com/neo/repository/CustomerRepositoryTest.java" "b/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/test/java/com/neo/repository/CustomerRepositoryTest.java" new file mode 100644 index 0000000..a9e3c42 --- /dev/null +++ "b/\347\254\254 4-8 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 ElasticSearch/spring-boot-elasticsearch/src/test/java/com/neo/repository/CustomerRepositoryTest.java" @@ -0,0 +1,135 @@ +package com.neo.repository; + +import com.neo.model.Customer; +import org.elasticsearch.action.search.SearchResponse; +import org.elasticsearch.index.query.QueryBuilder; +import org.elasticsearch.index.query.QueryBuilders; +import org.elasticsearch.search.aggregations.Aggregation; +import org.elasticsearch.search.aggregations.AggregationBuilders; +import org.elasticsearch.search.aggregations.Aggregations; +import org.elasticsearch.search.aggregations.metrics.sum.InternalSum; +import org.elasticsearch.search.aggregations.metrics.sum.SumAggregationBuilder; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; +import org.springframework.data.elasticsearch.core.ResultsExtractor; +import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder; +import org.springframework.data.elasticsearch.core.query.SearchQuery; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.List; +import java.util.Map; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class CustomerRepositoryTest { + @Autowired + private CustomerRepository repository; + @Autowired + private ElasticsearchTemplate elasticsearchTemplate; + + @Test + public void saveCustomers() { + repository.save(new Customer("Alice", "北京",13)); + repository.save(new Customer("Bob", "北京",23)); + repository.save(new Customer("neo", "西安",30)); + repository.save(new Customer("summer", "烟台",22)); + } + + @Test + public void fetchAllCustomers() { + System.out.println("Customers found with findAll():"); + System.out.println("-------------------------------"); + Iterable iterable=repository.findAll(); + for (Customer customer :iterable) { + System.out.println(customer); + } + } + + @Test + public void deleteCustomers() { + repository.deleteAll(); +// repository.deleteByUserName("neo"); + } + + @Test + public void updateCustomers() { + Customer customer= repository.findByUserName("summer"); + System.out.println(customer); + customer.setAddress("北京市海淀区西直门"); + repository.save(customer); + Customer xcustomer=repository.findByUserName("summer"); + System.out.println(xcustomer); + } + + @Test + public void fetchIndividualCustomers() { + System.out.println("Customer found with findByUserName('summer'):"); + System.out.println("--------------------------------"); + System.out.println(repository.findByUserName("summer")); + System.out.println("--------------------------------"); + System.out.println("Customers found with findByAddress(\"北京\"):"); + String q="北京"; + for (Customer customer : repository.findByAddress(q)) { + System.out.println(customer); + } + } + + @Test + public void fetchPageCustomers() { + System.out.println("Customers found with fetchPageCustomers:"); + System.out.println("-------------------------------"); + Sort sort = new Sort(Sort.Direction.DESC, "address.keyword"); + Pageable pageable = PageRequest.of(0, 10, sort); + Page customers=repository.findByAddress("北京", pageable); + System.out.println("Page customers "+customers.getContent().toString()); + } + + @Test + public void fetchPage2Customers() { + System.out.println("Customers found with fetchPageCustomers:"); + System.out.println("-------------------------------"); + QueryBuilder customerQuery = QueryBuilders.boolQuery() + .must(QueryBuilders.matchQuery("address", "北京")); + Page page = repository.search(customerQuery, PageRequest.of(0, 10)); + System.out.println("Page customers "+page.getContent().toString()); + page = repository.search(customerQuery, PageRequest.of(1, 10)); + System.out.println("Page customers "+page.getContent().toString()); + } + + @Test + public void fetchAggregation() { + System.out.println("Customers found with fetchAggregation:"); + System.out.println("-------------------------------"); + + QueryBuilder customerQuery = QueryBuilders.boolQuery() + .must(QueryBuilders.matchQuery("address", "北京")); + + SumAggregationBuilder sumBuilder = AggregationBuilders.sum("sumAge").field("age"); + + SearchQuery searchQuery = new NativeSearchQueryBuilder() + .withQuery(customerQuery) + .addAggregation(sumBuilder) + .build(); + + Aggregations aggregations = elasticsearchTemplate.query(searchQuery, new ResultsExtractor() { + @Override + public Aggregations extract(SearchResponse response) { + return response.getAggregations(); + } + }); + + //转换成map集合 + Map aggregationMap = aggregations.asMap(); + //获得对应的聚合函数的聚合子类,该聚合子类也是个map集合,里面的value就是桶Bucket,我们要获得Bucket + InternalSum sumAge = (InternalSum) aggregationMap.get("sumAge"); + System.out.println("sum age is "+sumAge.getValue()); + } + +} diff --git "a/\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/pom.xml" "b/\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/pom.xml" similarity index 96% rename from "\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/pom.xml" rename to "\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/pom.xml" index 5008658..88f8316 100644 --- "a/\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/pom.xml" +++ "b/\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/pom.xml" @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.0.M6 + 2.1.0.RELEASE diff --git "a/\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/MyStartupRunner.java" "b/\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/MyStartupRunner.java" similarity index 100% rename from "\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/MyStartupRunner.java" rename to "\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/MyStartupRunner.java" diff --git "a/\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/QuartzApplication.java" "b/\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/QuartzApplication.java" similarity index 100% rename from "\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/QuartzApplication.java" rename to "\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/QuartzApplication.java" diff --git "a/\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/SchedulerListener.java" "b/\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/SchedulerListener.java" similarity index 100% rename from "\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/SchedulerListener.java" rename to "\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/SchedulerListener.java" diff --git "a/\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/job/SampleJob.java" "b/\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/job/SampleJob.java" similarity index 100% rename from "\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/job/SampleJob.java" rename to "\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/job/SampleJob.java" diff --git "a/\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/job/ScheduledJob.java" "b/\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/job/ScheduledJob.java" similarity index 100% rename from "\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/job/ScheduledJob.java" rename to "\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/job/ScheduledJob.java" diff --git "a/\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/job/ScheduledJob2.java" "b/\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/job/ScheduledJob2.java" similarity index 100% rename from "\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/job/ScheduledJob2.java" rename to "\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/job/ScheduledJob2.java" diff --git "a/\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/scheduler/CronSchedulerJob.java" "b/\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/scheduler/CronSchedulerJob.java" similarity index 100% rename from "\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/scheduler/CronSchedulerJob.java" rename to "\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/scheduler/CronSchedulerJob.java" diff --git "a/\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/scheduler/SampleScheduler.java" "b/\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/scheduler/SampleScheduler.java" similarity index 100% rename from "\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/scheduler/SampleScheduler.java" rename to "\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/java/com/neo/scheduler/SampleScheduler.java" diff --git "a/\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/resources/application.properties" "b/\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/resources/application.properties" similarity index 100% rename from "\347\254\25414\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/resources/application.properties" rename to "\347\254\254 4-9 \350\257\276\357\274\232Spring Boot \351\233\206\346\210\220 Quartz/spring-boot-quartz/src/main/resources/application.properties" diff --git "a/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/pom.xml" "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/pom.xml" new file mode 100644 index 0000000..385c4a8 --- /dev/null +++ "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/pom.xml" @@ -0,0 +1,59 @@ + + + 4.0.0 + + spring-boot-security + jar + Spring Boot Web Spring Security + Spring Boot Web Spring Security Example + https://www.mkyong.com + 1.0 + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + 1.8 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-security + + + org.thymeleaf.extras + thymeleaf-extras-springsecurity5 + + + org.springframework.boot + spring-boot-devtools + true + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + + + diff --git "a/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/java/com/neo/SecurityApplication.java" "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/java/com/neo/SecurityApplication.java" new file mode 100644 index 0000000..2c202ca --- /dev/null +++ "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/java/com/neo/SecurityApplication.java" @@ -0,0 +1,13 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SecurityApplication { + + public static void main(String[] args) throws Exception { + SpringApplication.run(SecurityApplication.class, args); + } + +} \ No newline at end of file diff --git "a/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/java/com/neo/config/SecurityConfig.java" "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/java/com/neo/config/SecurityConfig.java" new file mode 100644 index 0000000..808a460 --- /dev/null +++ "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/java/com/neo/config/SecurityConfig.java" @@ -0,0 +1,50 @@ +package com.neo.config; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; + +@Configuration +@EnableWebSecurity +@EnableGlobalMethodSecurity(prePostEnabled = true) +public class SecurityConfig extends WebSecurityConfigurerAdapter { + + @Override + protected void configure(HttpSecurity http) throws Exception { + http.authorizeRequests() + .antMatchers("/resources/**", "/").permitAll() + .antMatchers("/admin/**").hasRole("ADMIN") + .antMatchers("/content").access("hasRole('USER') or hasRole('ADMIN')") + .anyRequest().authenticated() + .and() + .formLogin() +// .loginPage("/login") + .permitAll() + .and() + .logout() + .permitAll() + .and() + .csrf() + .ignoringAntMatchers("/logout"); + } + + @Autowired + public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { + auth.inMemoryAuthentication() + .passwordEncoder(new BCryptPasswordEncoder()) + .withUser("user") + .password(new BCryptPasswordEncoder() + .encode("123456")).roles("USER") + .and() + .withUser("admin") + .password(new BCryptPasswordEncoder() + .encode("admin")).roles("ADMIN", "USER"); + } + + +} diff --git "a/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/java/com/neo/controller/SecurityController.java" "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/java/com/neo/controller/SecurityController.java" new file mode 100644 index 0000000..32f35ac --- /dev/null +++ "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/java/com/neo/controller/SecurityController.java" @@ -0,0 +1,32 @@ +package com.neo.controller; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +@Controller +public class SecurityController { + + @RequestMapping("/") + public String index() { + return "index"; + } + + @RequestMapping(value = "/login", method = RequestMethod.GET) + public String login() { + return "login"; + } + + @RequestMapping("/content") + @PreAuthorize("hasAuthority('ADMIN')") + public String content() { + return "content"; + } + + @PreAuthorize("hasAuthority('ADMIN')") + @RequestMapping("/admin") + public String admin() { + return "admin"; + } +} \ No newline at end of file diff --git "a/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/application.properties" "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/application.properties" new file mode 100644 index 0000000..9484f82 --- /dev/null +++ "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/application.properties" @@ -0,0 +1,6 @@ +spring.thymeleaf.cache=false + +spring.security.user.name=admin +spring.security.user.password=admin +#\u89D2\u8272 +#spring.security.user.roles=USER \ No newline at end of file diff --git "a/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/static/css/bootstrap.min.css" "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/static/css/bootstrap.min.css" new file mode 100644 index 0000000..6561b6f --- /dev/null +++ "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/static/css/bootstrap.min.css" @@ -0,0 +1,7 @@ +/*! + * Bootstrap v4.0.0 (https://getbootstrap.com) + * Copyright 2011-2018 The Bootstrap Authors + * Copyright 2011-2018 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-family:inherit;font-weight:500;line-height:1.2;color:inherit}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem;font-weight:300;line-height:1.2}.display-2{font-size:5.5rem;font-weight:300;line-height:1.2}.display-3{font-size:4.5rem;font-weight:300;line-height:1.2}.display-4{font-size:3.5rem;font-weight:300;line-height:1.2}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote-footer{display:block;font-size:80%;color:#6c757d}.blockquote-footer::before{content:"\2014 \00A0"}.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #dee2e6;border-radius:.25rem;max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:90%;color:#6c757d}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}code{font-size:87.5%;color:#e83e8c;word-break:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:87.5%;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;font-size:87.5%;color:#212529}pre code{font-size:inherit;color:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1140px}}.container-fluid{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-auto,.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{position:relative;width:100%;min-height:1px;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-1{-webkit-box-flex:0;-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-2{-webkit-box-flex:0;-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-webkit-box-flex:0;-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-5{-webkit-box-flex:0;-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-7{-webkit-box-flex:0;-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-8{-webkit-box-flex:0;-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-webkit-box-flex:0;-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-11{-webkit-box-flex:0;-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-1{margin-left:8.333333%}.offset-2{margin-left:16.666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.333333%}.offset-5{margin-left:41.666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.333333%}.offset-8{margin-left:66.666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.333333%}.offset-11{margin-left:91.666667%}@media (min-width:576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-sm-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-sm-1{-webkit-box-flex:0;-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-sm-2{-webkit-box-flex:0;-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-webkit-box-flex:0;-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-sm-5{-webkit-box-flex:0;-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-sm-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-webkit-box-flex:0;-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-sm-8{-webkit-box-flex:0;-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-sm-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-webkit-box-flex:0;-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-sm-11{-webkit-box-flex:0;-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-sm-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-sm-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-sm-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-sm-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-sm-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-sm-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-sm-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-sm-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-sm-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-sm-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-sm-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-sm-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-sm-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-sm-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-sm-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.333333%}.offset-sm-2{margin-left:16.666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.333333%}.offset-sm-5{margin-left:41.666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.333333%}.offset-sm-8{margin-left:66.666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.333333%}.offset-sm-11{margin-left:91.666667%}}@media (min-width:768px){.col-md{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-md-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-md-1{-webkit-box-flex:0;-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-md-2{-webkit-box-flex:0;-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-md-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-md-4{-webkit-box-flex:0;-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-md-5{-webkit-box-flex:0;-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-md-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-md-7{-webkit-box-flex:0;-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-md-8{-webkit-box-flex:0;-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-md-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-md-10{-webkit-box-flex:0;-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-md-11{-webkit-box-flex:0;-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-md-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-md-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-md-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-md-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-md-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-md-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-md-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-md-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-md-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-md-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-md-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-md-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-md-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-md-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-md-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-md-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.333333%}.offset-md-2{margin-left:16.666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.333333%}.offset-md-5{margin-left:41.666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.333333%}.offset-md-8{margin-left:66.666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.333333%}.offset-md-11{margin-left:91.666667%}}@media (min-width:992px){.col-lg{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-lg-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-lg-1{-webkit-box-flex:0;-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-lg-2{-webkit-box-flex:0;-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-lg-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-lg-4{-webkit-box-flex:0;-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-lg-5{-webkit-box-flex:0;-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-lg-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-lg-7{-webkit-box-flex:0;-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-lg-8{-webkit-box-flex:0;-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-lg-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-lg-10{-webkit-box-flex:0;-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-lg-11{-webkit-box-flex:0;-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-lg-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-lg-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-lg-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-lg-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-lg-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-lg-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-lg-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-lg-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-lg-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-lg-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-lg-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-lg-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-lg-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-lg-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-lg-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-lg-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.333333%}.offset-lg-2{margin-left:16.666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.333333%}.offset-lg-5{margin-left:41.666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.333333%}.offset-lg-8{margin-left:66.666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.333333%}.offset-lg-11{margin-left:91.666667%}}@media (min-width:1200px){.col-xl{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-xl-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-xl-1{-webkit-box-flex:0;-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-xl-2{-webkit-box-flex:0;-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-xl-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-xl-4{-webkit-box-flex:0;-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-xl-5{-webkit-box-flex:0;-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-xl-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-xl-7{-webkit-box-flex:0;-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-xl-8{-webkit-box-flex:0;-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-xl-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-xl-10{-webkit-box-flex:0;-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-xl-11{-webkit-box-flex:0;-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-xl-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-xl-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-xl-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-xl-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-xl-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-xl-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-xl-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-xl-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-xl-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-xl-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-xl-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-xl-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-xl-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-xl-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-xl-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-xl-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.333333%}.offset-xl-2{margin-left:16.666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.333333%}.offset-xl-5{margin-left:41.666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.333333%}.offset-xl-8{margin-left:66.666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.333333%}.offset-xl-11{margin-left:91.666667%}}.table{width:100%;max-width:100%;margin-bottom:1rem;background-color:transparent}.table td,.table th{padding:.75rem;vertical-align:top;border-top:1px solid #dee2e6}.table thead th{vertical-align:bottom;border-bottom:2px solid #dee2e6}.table tbody+tbody{border-top:2px solid #dee2e6}.table .table{background-color:#fff}.table-sm td,.table-sm th{padding:.3rem}.table-bordered{border:1px solid #dee2e6}.table-bordered td,.table-bordered th{border:1px solid #dee2e6}.table-bordered thead td,.table-bordered thead th{border-bottom-width:2px}.table-striped tbody tr:nth-of-type(odd){background-color:rgba(0,0,0,.05)}.table-hover tbody tr:hover{background-color:rgba(0,0,0,.075)}.table-primary,.table-primary>td,.table-primary>th{background-color:#b8daff}.table-hover .table-primary:hover{background-color:#9fcdff}.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#9fcdff}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#d6d8db}.table-hover .table-secondary:hover{background-color:#c8cbcf}.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#c8cbcf}.table-success,.table-success>td,.table-success>th{background-color:#c3e6cb}.table-hover .table-success:hover{background-color:#b1dfbb}.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#b1dfbb}.table-info,.table-info>td,.table-info>th{background-color:#bee5eb}.table-hover .table-info:hover{background-color:#abdde5}.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#abdde5}.table-warning,.table-warning>td,.table-warning>th{background-color:#ffeeba}.table-hover .table-warning:hover{background-color:#ffe8a1}.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#ffe8a1}.table-danger,.table-danger>td,.table-danger>th{background-color:#f5c6cb}.table-hover .table-danger:hover{background-color:#f1b0b7}.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#f1b0b7}.table-light,.table-light>td,.table-light>th{background-color:#fdfdfe}.table-hover .table-light:hover{background-color:#ececf6}.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#ececf6}.table-dark,.table-dark>td,.table-dark>th{background-color:#c6c8ca}.table-hover .table-dark:hover{background-color:#b9bbbe}.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#b9bbbe}.table-active,.table-active>td,.table-active>th{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table .thead-dark th{color:#fff;background-color:#212529;border-color:#32383e}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#dee2e6}.table-dark{color:#fff;background-color:#212529}.table-dark td,.table-dark th,.table-dark thead th{border-color:#32383e}.table-dark.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:rgba(255,255,255,.05)}.table-dark.table-hover tbody tr:hover{background-color:rgba(255,255,255,.075)}@media (max-width:575.98px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-sm>.table-bordered{border:0}}@media (max-width:767.98px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-md>.table-bordered{border:0}}@media (max-width:991.98px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-lg>.table-bordered{border:0}}@media (max-width:1199.98px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-xl>.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive>.table-bordered{border:0}.form-control{display:block;width:100%;padding:.375rem .75rem;font-size:1rem;line-height:1.5;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.form-control::-ms-expand{background-color:transparent;border:0}.form-control:focus{color:#495057;background-color:#fff;border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.form-control::-webkit-input-placeholder{color:#6c757d;opacity:1}.form-control::-moz-placeholder{color:#6c757d;opacity:1}.form-control:-ms-input-placeholder{color:#6c757d;opacity:1}.form-control::-ms-input-placeholder{color:#6c757d;opacity:1}.form-control::placeholder{color:#6c757d;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#e9ecef;opacity:1}select.form-control:not([size]):not([multiple]){height:calc(2.25rem + 2px)}select.form-control:focus::-ms-value{color:#495057;background-color:#fff}.form-control-file,.form-control-range{display:block;width:100%}.col-form-label{padding-top:calc(.375rem + 1px);padding-bottom:calc(.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(.5rem + 1px);padding-bottom:calc(.5rem + 1px);font-size:1.25rem;line-height:1.5}.col-form-label-sm{padding-top:calc(.25rem + 1px);padding-bottom:calc(.25rem + 1px);font-size:.875rem;line-height:1.5}.form-control-plaintext{display:block;width:100%;padding-top:.375rem;padding-bottom:.375rem;margin-bottom:0;line-height:1.5;background-color:transparent;border:solid transparent;border-width:1px 0}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm,.input-group-lg>.form-control-plaintext.form-control,.input-group-lg>.input-group-append>.form-control-plaintext.btn,.input-group-lg>.input-group-append>.form-control-plaintext.input-group-text,.input-group-lg>.input-group-prepend>.form-control-plaintext.btn,.input-group-lg>.input-group-prepend>.form-control-plaintext.input-group-text,.input-group-sm>.form-control-plaintext.form-control,.input-group-sm>.input-group-append>.form-control-plaintext.btn,.input-group-sm>.input-group-append>.form-control-plaintext.input-group-text,.input-group-sm>.input-group-prepend>.form-control-plaintext.btn,.input-group-sm>.input-group-prepend>.form-control-plaintext.input-group-text{padding-right:0;padding-left:0}.form-control-sm,.input-group-sm>.form-control,.input-group-sm>.input-group-append>.btn,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-prepend>.input-group-text{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.input-group-sm>.input-group-append>select.btn:not([size]):not([multiple]),.input-group-sm>.input-group-append>select.input-group-text:not([size]):not([multiple]),.input-group-sm>.input-group-prepend>select.btn:not([size]):not([multiple]),.input-group-sm>.input-group-prepend>select.input-group-text:not([size]):not([multiple]),.input-group-sm>select.form-control:not([size]):not([multiple]),select.form-control-sm:not([size]):not([multiple]){height:calc(1.8125rem + 2px)}.form-control-lg,.input-group-lg>.form-control,.input-group-lg>.input-group-append>.btn,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-prepend>.input-group-text{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.input-group-lg>.input-group-append>select.btn:not([size]):not([multiple]),.input-group-lg>.input-group-append>select.input-group-text:not([size]):not([multiple]),.input-group-lg>.input-group-prepend>select.btn:not([size]):not([multiple]),.input-group-lg>.input-group-prepend>select.input-group-text:not([size]):not([multiple]),.input-group-lg>select.form-control:not([size]):not([multiple]),select.form-control-lg:not([size]):not([multiple]){height:calc(2.875rem + 2px)}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:.25rem}.form-row{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*=col-]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;padding-left:1.25rem}.form-check-input{position:absolute;margin-top:.3rem;margin-left:-1.25rem}.form-check-input:disabled~.form-check-label{color:#6c757d}.form-check-label{margin-bottom:0}.form-check-inline{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-left:0;margin-right:.75rem}.form-check-inline .form-check-input{position:static;margin-top:0;margin-right:.3125rem;margin-left:0}.valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#28a745}.valid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.5rem;margin-top:.1rem;font-size:.875rem;line-height:1;color:#fff;background-color:rgba(40,167,69,.8);border-radius:.2rem}.custom-select.is-valid,.form-control.is-valid,.was-validated .custom-select:valid,.was-validated .form-control:valid{border-color:#28a745}.custom-select.is-valid:focus,.form-control.is-valid:focus,.was-validated .custom-select:valid:focus,.was-validated .form-control:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.custom-select.is-valid~.valid-feedback,.custom-select.is-valid~.valid-tooltip,.form-control.is-valid~.valid-feedback,.form-control.is-valid~.valid-tooltip,.was-validated .custom-select:valid~.valid-feedback,.was-validated .custom-select:valid~.valid-tooltip,.was-validated .form-control:valid~.valid-feedback,.was-validated .form-control:valid~.valid-tooltip{display:block}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:#28a745}.form-check-input.is-valid~.valid-feedback,.form-check-input.is-valid~.valid-tooltip,.was-validated .form-check-input:valid~.valid-feedback,.was-validated .form-check-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid~.custom-control-label,.was-validated .custom-control-input:valid~.custom-control-label{color:#28a745}.custom-control-input.is-valid~.custom-control-label::before,.was-validated .custom-control-input:valid~.custom-control-label::before{background-color:#71dd8a}.custom-control-input.is-valid~.valid-feedback,.custom-control-input.is-valid~.valid-tooltip,.was-validated .custom-control-input:valid~.valid-feedback,.was-validated .custom-control-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid:checked~.custom-control-label::before,.was-validated .custom-control-input:valid:checked~.custom-control-label::before{background-color:#34ce57}.custom-control-input.is-valid:focus~.custom-control-label::before,.was-validated .custom-control-input:valid:focus~.custom-control-label::before{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(40,167,69,.25)}.custom-file-input.is-valid~.custom-file-label,.was-validated .custom-file-input:valid~.custom-file-label{border-color:#28a745}.custom-file-input.is-valid~.custom-file-label::before,.was-validated .custom-file-input:valid~.custom-file-label::before{border-color:inherit}.custom-file-input.is-valid~.valid-feedback,.custom-file-input.is-valid~.valid-tooltip,.was-validated .custom-file-input:valid~.valid-feedback,.was-validated .custom-file-input:valid~.valid-tooltip{display:block}.custom-file-input.is-valid:focus~.custom-file-label,.was-validated .custom-file-input:valid:focus~.custom-file-label{box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.5rem;margin-top:.1rem;font-size:.875rem;line-height:1;color:#fff;background-color:rgba(220,53,69,.8);border-radius:.2rem}.custom-select.is-invalid,.form-control.is-invalid,.was-validated .custom-select:invalid,.was-validated .form-control:invalid{border-color:#dc3545}.custom-select.is-invalid:focus,.form-control.is-invalid:focus,.was-validated .custom-select:invalid:focus,.was-validated .form-control:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.custom-select.is-invalid~.invalid-feedback,.custom-select.is-invalid~.invalid-tooltip,.form-control.is-invalid~.invalid-feedback,.form-control.is-invalid~.invalid-tooltip,.was-validated .custom-select:invalid~.invalid-feedback,.was-validated .custom-select:invalid~.invalid-tooltip,.was-validated .form-control:invalid~.invalid-feedback,.was-validated .form-control:invalid~.invalid-tooltip{display:block}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#dc3545}.form-check-input.is-invalid~.invalid-feedback,.form-check-input.is-invalid~.invalid-tooltip,.was-validated .form-check-input:invalid~.invalid-feedback,.was-validated .form-check-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid~.custom-control-label,.was-validated .custom-control-input:invalid~.custom-control-label{color:#dc3545}.custom-control-input.is-invalid~.custom-control-label::before,.was-validated .custom-control-input:invalid~.custom-control-label::before{background-color:#efa2a9}.custom-control-input.is-invalid~.invalid-feedback,.custom-control-input.is-invalid~.invalid-tooltip,.was-validated .custom-control-input:invalid~.invalid-feedback,.was-validated .custom-control-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid:checked~.custom-control-label::before,.was-validated .custom-control-input:invalid:checked~.custom-control-label::before{background-color:#e4606d}.custom-control-input.is-invalid:focus~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus~.custom-control-label::before{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(220,53,69,.25)}.custom-file-input.is-invalid~.custom-file-label,.was-validated .custom-file-input:invalid~.custom-file-label{border-color:#dc3545}.custom-file-input.is-invalid~.custom-file-label::before,.was-validated .custom-file-input:invalid~.custom-file-label::before{border-color:inherit}.custom-file-input.is-invalid~.invalid-feedback,.custom-file-input.is-invalid~.invalid-tooltip,.was-validated .custom-file-input:invalid~.invalid-feedback,.was-validated .custom-file-input:invalid~.invalid-tooltip{display:block}.custom-file-input.is-invalid:focus~.custom-file-label,.was-validated .custom-file-input:invalid:focus~.custom-file-label{box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-inline{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.form-inline .form-check{width:100%}@media (min-width:576px){.form-inline label{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-bottom:0}.form-inline .form-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:0}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .input-group{width:auto}.form-inline .form-check{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:auto;padding-left:0}.form-inline .form-check-input{position:relative;margin-top:0;margin-right:.25rem;margin-left:0}.form-inline .custom-control{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.form-inline .custom-control-label{margin-bottom:0}}.btn{display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}.btn:focus,.btn:hover{text-decoration:none}.btn.focus,.btn:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.btn.disabled,.btn:disabled{opacity:.65}.btn:not(:disabled):not(.disabled){cursor:pointer}.btn:not(:disabled):not(.disabled).active,.btn:not(:disabled):not(.disabled):active{background-image:none}a.btn.disabled,fieldset:disabled a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:hover{color:#fff;background-color:#0069d9;border-color:#0062cc}.btn-primary.focus,.btn-primary:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#0062cc;border-color:#005cbf}.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-secondary{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:hover{color:#fff;background-color:#5a6268;border-color:#545b62}.btn-secondary.focus,.btn-secondary:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-secondary.disabled,.btn-secondary:disabled{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:not(:disabled):not(.disabled).active,.btn-secondary:not(:disabled):not(.disabled):active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#545b62;border-color:#4e555b}.btn-secondary:not(:disabled):not(.disabled).active:focus,.btn-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-success{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:hover{color:#fff;background-color:#218838;border-color:#1e7e34}.btn-success.focus,.btn-success:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-success.disabled,.btn-success:disabled{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:not(:disabled):not(.disabled).active,.btn-success:not(:disabled):not(.disabled):active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#1e7e34;border-color:#1c7430}.btn-success:not(:disabled):not(.disabled).active:focus,.btn-success:not(:disabled):not(.disabled):active:focus,.show>.btn-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-info{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:hover{color:#fff;background-color:#138496;border-color:#117a8b}.btn-info.focus,.btn-info:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-info.disabled,.btn-info:disabled{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:not(:disabled):not(.disabled).active,.btn-info:not(:disabled):not(.disabled):active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#117a8b;border-color:#10707f}.btn-info:not(:disabled):not(.disabled).active:focus,.btn-info:not(:disabled):not(.disabled):active:focus,.show>.btn-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-warning{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:hover{color:#212529;background-color:#e0a800;border-color:#d39e00}.btn-warning.focus,.btn-warning:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-warning.disabled,.btn-warning:disabled{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:not(:disabled):not(.disabled).active,.btn-warning:not(:disabled):not(.disabled):active,.show>.btn-warning.dropdown-toggle{color:#212529;background-color:#d39e00;border-color:#c69500}.btn-warning:not(:disabled):not(.disabled).active:focus,.btn-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-danger{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:hover{color:#fff;background-color:#c82333;border-color:#bd2130}.btn-danger.focus,.btn-danger:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-danger.disabled,.btn-danger:disabled{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:not(:disabled):not(.disabled).active,.btn-danger:not(:disabled):not(.disabled):active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#bd2130;border-color:#b21f2d}.btn-danger:not(:disabled):not(.disabled).active:focus,.btn-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-light{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5}.btn-light.focus,.btn-light:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-light.disabled,.btn-light:disabled{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:not(:disabled):not(.disabled).active,.btn-light:not(:disabled):not(.disabled):active,.show>.btn-light.dropdown-toggle{color:#212529;background-color:#dae0e5;border-color:#d3d9df}.btn-light:not(:disabled):not(.disabled).active:focus,.btn-light:not(:disabled):not(.disabled):active:focus,.show>.btn-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-dark{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:hover{color:#fff;background-color:#23272b;border-color:#1d2124}.btn-dark.focus,.btn-dark:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-dark.disabled,.btn-dark:disabled{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:not(:disabled):not(.disabled).active,.btn-dark:not(:disabled):not(.disabled):active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#1d2124;border-color:#171a1d}.btn-dark:not(:disabled):not(.disabled).active:focus,.btn-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-outline-primary{color:#007bff;background-color:transparent;background-image:none;border-color:#007bff}.btn-outline-primary:hover{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary.focus,.btn-outline-primary:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#007bff;background-color:transparent}.btn-outline-primary:not(:disabled):not(.disabled).active,.btn-outline-primary:not(:disabled):not(.disabled):active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-secondary{color:#6c757d;background-color:transparent;background-image:none;border-color:#6c757d}.btn-outline-secondary:hover{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary.focus,.btn-outline-secondary:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#6c757d;background-color:transparent}.btn-outline-secondary:not(:disabled):not(.disabled).active,.btn-outline-secondary:not(:disabled):not(.disabled):active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-success{color:#28a745;background-color:transparent;background-image:none;border-color:#28a745}.btn-outline-success:hover{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success.focus,.btn-outline-success:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#28a745;background-color:transparent}.btn-outline-success:not(:disabled):not(.disabled).active,.btn-outline-success:not(:disabled):not(.disabled):active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success:not(:disabled):not(.disabled).active:focus,.btn-outline-success:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-info{color:#17a2b8;background-color:transparent;background-image:none;border-color:#17a2b8}.btn-outline-info:hover{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info.focus,.btn-outline-info:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#17a2b8;background-color:transparent}.btn-outline-info:not(:disabled):not(.disabled).active,.btn-outline-info:not(:disabled):not(.disabled):active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info:not(:disabled):not(.disabled).active:focus,.btn-outline-info:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-warning{color:#ffc107;background-color:transparent;background-image:none;border-color:#ffc107}.btn-outline-warning:hover{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning.focus,.btn-outline-warning:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffc107;background-color:transparent}.btn-outline-warning:not(:disabled):not(.disabled).active,.btn-outline-warning:not(:disabled):not(.disabled):active,.show>.btn-outline-warning.dropdown-toggle{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-danger{color:#dc3545;background-color:transparent;background-image:none;border-color:#dc3545}.btn-outline-danger:hover{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger.focus,.btn-outline-danger:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#dc3545;background-color:transparent}.btn-outline-danger:not(:disabled):not(.disabled).active,.btn-outline-danger:not(:disabled):not(.disabled):active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-light{color:#f8f9fa;background-color:transparent;background-image:none;border-color:#f8f9fa}.btn-outline-light:hover{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light.focus,.btn-outline-light:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#f8f9fa;background-color:transparent}.btn-outline-light:not(:disabled):not(.disabled).active,.btn-outline-light:not(:disabled):not(.disabled):active,.show>.btn-outline-light.dropdown-toggle{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:not(:disabled):not(.disabled).active:focus,.btn-outline-light:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-dark{color:#343a40;background-color:transparent;background-image:none;border-color:#343a40}.btn-outline-dark:hover{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark.focus,.btn-outline-dark:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#343a40;background-color:transparent}.btn-outline-dark:not(:disabled):not(.disabled).active,.btn-outline-dark:not(:disabled):not(.disabled):active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-link{font-weight:400;color:#007bff;background-color:transparent}.btn-link:hover{color:#0056b3;text-decoration:underline;background-color:transparent;border-color:transparent}.btn-link.focus,.btn-link:focus{text-decoration:underline;border-color:transparent;box-shadow:none}.btn-link.disabled,.btn-link:disabled{color:#6c757d}.btn-group-lg>.btn,.btn-lg{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.btn-group-sm>.btn,.btn-sm{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:.5rem}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;transition:opacity .15s linear}.fade.show{opacity:1}.collapse{display:none}.collapse.show{display:block}tr.collapse.show{display:table-row}tbody.collapse.show{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;transition:height .35s ease}.dropdown,.dropup{position:relative}.dropdown-toggle::after{display:inline-block;width:0;height:0;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle:empty::after{margin-left:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:1rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropup .dropdown-menu{margin-top:0;margin-bottom:.125rem}.dropup .dropdown-toggle::after{display:inline-block;width:0;height:0;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropup .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-menu{margin-top:0;margin-left:.125rem}.dropright .dropdown-toggle::after{display:inline-block;width:0;height:0;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-bottom:.3em solid transparent;border-left:.3em solid}.dropright .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-toggle::after{vertical-align:0}.dropleft .dropdown-menu{margin-top:0;margin-right:.125rem}.dropleft .dropdown-toggle::after{display:inline-block;width:0;height:0;margin-left:.255em;vertical-align:.255em;content:""}.dropleft .dropdown-toggle::after{display:none}.dropleft .dropdown-toggle::before{display:inline-block;width:0;height:0;margin-right:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:.3em solid;border-bottom:.3em solid transparent}.dropleft .dropdown-toggle:empty::after{margin-left:0}.dropleft .dropdown-toggle::before{vertical-align:0}.dropdown-divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item{display:block;width:100%;padding:.25rem 1.5rem;clear:both;font-weight:400;color:#212529;text-align:inherit;white-space:nowrap;background-color:transparent;border:0}.dropdown-item:focus,.dropdown-item:hover{color:#16181b;text-decoration:none;background-color:#f8f9fa}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#007bff}.dropdown-item.disabled,.dropdown-item:disabled{color:#6c757d;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:.5rem 1.5rem;margin-bottom:0;font-size:.875rem;color:#6c757d;white-space:nowrap}.btn-group,.btn-group-vertical{position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto}.btn-group-vertical>.btn:hover,.btn-group>.btn:hover{z-index:1}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus{z-index:1}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group,.btn-group-vertical .btn+.btn,.btn-group-vertical .btn+.btn-group,.btn-group-vertical .btn-group+.btn,.btn-group-vertical .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.dropdown-toggle-split::after{margin-left:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.btn-group-vertical .btn,.btn-group-vertical .btn-group{width:100%}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.btn-group-toggle>.btn,.btn-group-toggle>.btn-group>.btn{margin-bottom:0}.btn-group-toggle>.btn input[type=checkbox],.btn-group-toggle>.btn input[type=radio],.btn-group-toggle>.btn-group>.btn input[type=checkbox],.btn-group-toggle>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;width:100%}.input-group>.custom-file,.input-group>.custom-select,.input-group>.form-control{position:relative;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;width:1%;margin-bottom:0}.input-group>.custom-file:focus,.input-group>.custom-select:focus,.input-group>.form-control:focus{z-index:3}.input-group>.custom-file+.custom-file,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.form-control,.input-group>.custom-select+.custom-file,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.form-control,.input-group>.form-control+.custom-file,.input-group>.form-control+.custom-select,.input-group>.form-control+.form-control{margin-left:-1px}.input-group>.custom-select:not(:last-child),.input-group>.form-control:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-select:not(:first-child),.input-group>.form-control:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.custom-file{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.input-group>.custom-file:not(:last-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label::before{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-file:not(:first-child) .custom-file-label,.input-group>.custom-file:not(:first-child) .custom-file-label::before{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-append,.input-group-prepend{display:-webkit-box;display:-ms-flexbox;display:flex}.input-group-append .btn,.input-group-prepend .btn{position:relative;z-index:2}.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.btn,.input-group-append .input-group-text+.input-group-text,.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-prepend .input-group-text+.input-group-text{margin-left:-1px}.input-group-prepend{margin-right:-1px}.input-group-append{margin-left:-1px}.input-group-text{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:.375rem .75rem;margin-bottom:0;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;text-align:center;white-space:nowrap;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem}.input-group-text input[type=checkbox],.input-group-text input[type=radio]{margin-top:0}.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child),.input-group>.input-group-append:not(:last-child)>.btn,.input-group>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child),.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text{border-top-left-radius:0;border-bottom-left-radius:0}.custom-control{position:relative;display:block;min-height:1.5rem;padding-left:1.5rem}.custom-control-inline{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;margin-right:1rem}.custom-control-input{position:absolute;z-index:-1;opacity:0}.custom-control-input:checked~.custom-control-label::before{color:#fff;background-color:#007bff}.custom-control-input:focus~.custom-control-label::before{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-control-input:active~.custom-control-label::before{color:#fff;background-color:#b3d7ff}.custom-control-input:disabled~.custom-control-label{color:#6c757d}.custom-control-input:disabled~.custom-control-label::before{background-color:#e9ecef}.custom-control-label{margin-bottom:0}.custom-control-label::before{position:absolute;top:.25rem;left:0;display:block;width:1rem;height:1rem;pointer-events:none;content:"";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#dee2e6}.custom-control-label::after{position:absolute;top:.25rem;left:0;display:block;width:1rem;height:1rem;content:"";background-repeat:no-repeat;background-position:center center;background-size:50% 50%}.custom-checkbox .custom-control-label::before{border-radius:.25rem}.custom-checkbox .custom-control-input:checked~.custom-control-label::before{background-color:#007bff}.custom-checkbox .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E")}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::before{background-color:#007bff}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='%23fff' d='M0 2h4'/%3E%3C/svg%3E")}.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-checkbox .custom-control-input:disabled:indeterminate~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-radio .custom-control-label::before{border-radius:50%}.custom-radio .custom-control-input:checked~.custom-control-label::before{background-color:#007bff}.custom-radio .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E")}.custom-radio .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-select{display:inline-block;width:100%;height:calc(2.25rem + 2px);padding:.375rem 1.75rem .375rem .75rem;line-height:1.5;color:#495057;vertical-align:middle;background:#fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right .75rem center;background-size:8px 10px;border:1px solid #ced4da;border-radius:.25rem;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:inset 0 1px 2px rgba(0,0,0,.075),0 0 5px rgba(128,189,255,.5)}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-select[multiple],.custom-select[size]:not([size="1"]){height:auto;padding-right:.75rem;background-image:none}.custom-select:disabled{color:#6c757d;background-color:#e9ecef}.custom-select::-ms-expand{opacity:0}.custom-select-sm{height:calc(1.8125rem + 2px);padding-top:.375rem;padding-bottom:.375rem;font-size:75%}.custom-select-lg{height:calc(2.875rem + 2px);padding-top:.375rem;padding-bottom:.375rem;font-size:125%}.custom-file{position:relative;display:inline-block;width:100%;height:calc(2.25rem + 2px);margin-bottom:0}.custom-file-input{position:relative;z-index:2;width:100%;height:calc(2.25rem + 2px);margin:0;opacity:0}.custom-file-input:focus~.custom-file-control{border-color:#80bdff;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-file-input:focus~.custom-file-control::before{border-color:#80bdff}.custom-file-input:lang(en)~.custom-file-label::after{content:"Browse"}.custom-file-label{position:absolute;top:0;right:0;left:0;z-index:1;height:calc(2.25rem + 2px);padding:.375rem .75rem;line-height:1.5;color:#495057;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem}.custom-file-label::after{position:absolute;top:0;right:0;bottom:0;z-index:3;display:block;height:calc(calc(2.25rem + 2px) - 1px * 2);padding:.375rem .75rem;line-height:1.5;color:#495057;content:"Browse";background-color:#e9ecef;border-left:1px solid #ced4da;border-radius:0 .25rem .25rem 0}.nav{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem}.nav-link:focus,.nav-link:hover{text-decoration:none}.nav-link.disabled{color:#6c757d}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #dee2e6}.nav-tabs .nav-link.disabled{color:#6c757d;background-color:transparent;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#007bff}.nav-fill .nav-item{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;text-align:center}.nav-justified .nav-item{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:.5rem 1rem}.navbar>.container,.navbar>.container-fluid{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.3125rem;padding-bottom:.3125rem;margin-right:1rem;font-size:1.25rem;line-height:inherit;white-space:nowrap}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-nav{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:.5rem;padding-bottom:.5rem}.navbar-collapse{-ms-flex-preferred-size:100%;flex-basis:100%;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.navbar-toggler{padding:.25rem .75rem;font-size:1.25rem;line-height:1;background-color:transparent;border:1px solid transparent;border-radius:.25rem}.navbar-toggler:focus,.navbar-toggler:hover{text-decoration:none}.navbar-toggler:not(:disabled):not(.disabled){cursor:pointer}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:no-repeat center center;background-size:100% 100%}@media (max-width:575.98px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:576px){.navbar-expand-sm{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-sm .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-sm .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-sm .navbar-collapse{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}.navbar-expand-sm .dropup .dropdown-menu{top:auto;bottom:100%}}@media (max-width:767.98px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:768px){.navbar-expand-md{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-md .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-md .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-md .navbar-collapse{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}.navbar-expand-md .dropup .dropdown-menu{top:auto;bottom:100%}}@media (max-width:991.98px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:992px){.navbar-expand-lg{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-lg .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-lg .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-lg .navbar-collapse{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}.navbar-expand-lg .dropup .dropdown-menu{top:auto;bottom:100%}}@media (max-width:1199.98px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:1200px){.navbar-expand-xl{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-xl .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-xl .navbar-collapse{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}.navbar-expand-xl .dropup .dropdown-menu{top:auto;bottom:100%}}.navbar-expand{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand .navbar-collapse{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-expand .dropup .dropdown-menu{top:auto;bottom:100%}.navbar-light .navbar-brand{color:rgba(0,0,0,.9)}.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.5);border-color:rgba(0,0,0,.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-light .navbar-text{color:rgba(0,0,0,.5)}.navbar-light .navbar-text a{color:rgba(0,0,0,.9)}.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand{color:#fff}.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:rgba(255,255,255,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:rgba(255,255,255,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:rgba(255,255,255,.25)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:rgba(255,255,255,.5);border-color:rgba(255,255,255,.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-dark .navbar-text{color:rgba(255,255,255,.5)}.navbar-dark .navbar-text a{color:#fff}.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}.card>hr{margin-right:0;margin-left:0}.card>.list-group:first-child .list-group-item:first-child{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.card>.list-group:last-child .list-group-item:last-child{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.card-body{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;padding:1.25rem}.card-title{margin-bottom:.75rem}.card-subtitle{margin-top:-.375rem;margin-bottom:0}.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card-header{padding:.75rem 1.25rem;margin-bottom:0;background-color:rgba(0,0,0,.03);border-bottom:1px solid rgba(0,0,0,.125)}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-header+.list-group .list-group-item:first-child{border-top:0}.card-footer{padding:.75rem 1.25rem;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.125)}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-right:-.625rem;margin-bottom:-.75rem;margin-left:-.625rem;border-bottom:0}.card-header-pills{margin-right:-.625rem;margin-left:-.625rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem}.card-img{width:100%;border-radius:calc(.25rem - 1px)}.card-img-top{width:100%;border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img-bottom{width:100%;border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-deck{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.card-deck .card{margin-bottom:15px}@media (min-width:576px){.card-deck{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck .card{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1 0 0%;flex:1 0 0%;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin-right:15px;margin-bottom:0;margin-left:15px}}.card-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.card-group>.card{margin-bottom:15px}@media (min-width:576px){.card-group{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap}.card-group>.card{-webkit-box-flex:1;-ms-flex:1 0 0%;flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:first-child .card-header,.card-group>.card:first-child .card-img-top{border-top-right-radius:0}.card-group>.card:first-child .card-footer,.card-group>.card:first-child .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:last-child .card-header,.card-group>.card:last-child .card-img-top{border-top-left-radius:0}.card-group>.card:last-child .card-footer,.card-group>.card:last-child .card-img-bottom{border-bottom-left-radius:0}.card-group>.card:only-child{border-radius:.25rem}.card-group>.card:only-child .card-header,.card-group>.card:only-child .card-img-top{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.card-group>.card:only-child .card-footer,.card-group>.card:only-child .card-img-bottom{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.card-group>.card:not(:first-child):not(:last-child):not(:only-child){border-radius:0}.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-footer,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-header,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-img-bottom,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-img-top{border-radius:0}}.card-columns .card{margin-bottom:.75rem}@media (min-width:576px){.card-columns{-webkit-column-count:3;-moz-column-count:3;column-count:3;-webkit-column-gap:1.25rem;-moz-column-gap:1.25rem;column-gap:1.25rem}.card-columns .card{display:inline-block;width:100%}}.breadcrumb{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#e9ecef;border-radius:.25rem}.breadcrumb-item+.breadcrumb-item::before{display:inline-block;padding-right:.5rem;padding-left:.5rem;color:#6c757d;content:"/"}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:underline}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:none}.breadcrumb-item.active{color:#6c757d}.pagination{display:-webkit-box;display:-ms-flexbox;display:flex;padding-left:0;list-style:none;border-radius:.25rem}.page-link{position:relative;display:block;padding:.5rem .75rem;margin-left:-1px;line-height:1.25;color:#007bff;background-color:#fff;border:1px solid #dee2e6}.page-link:hover{color:#0056b3;text-decoration:none;background-color:#e9ecef;border-color:#dee2e6}.page-link:focus{z-index:2;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.page-link:not(:disabled):not(.disabled){cursor:pointer}.page-item:first-child .page-link{margin-left:0;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.page-item:last-child .page-link{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.page-item.active .page-link{z-index:1;color:#fff;background-color:#007bff;border-color:#007bff}.page-item.disabled .page-link{color:#6c757d;pointer-events:none;cursor:auto;background-color:#fff;border-color:#dee2e6}.pagination-lg .page-link{padding:.75rem 1.5rem;font-size:1.25rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem}.pagination-sm .page-link{padding:.25rem .5rem;font-size:.875rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:.2rem;border-bottom-right-radius:.2rem}.badge{display:inline-block;padding:.25em .4em;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:.6em;padding-left:.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#007bff}.badge-primary[href]:focus,.badge-primary[href]:hover{color:#fff;text-decoration:none;background-color:#0062cc}.badge-secondary{color:#fff;background-color:#6c757d}.badge-secondary[href]:focus,.badge-secondary[href]:hover{color:#fff;text-decoration:none;background-color:#545b62}.badge-success{color:#fff;background-color:#28a745}.badge-success[href]:focus,.badge-success[href]:hover{color:#fff;text-decoration:none;background-color:#1e7e34}.badge-info{color:#fff;background-color:#17a2b8}.badge-info[href]:focus,.badge-info[href]:hover{color:#fff;text-decoration:none;background-color:#117a8b}.badge-warning{color:#212529;background-color:#ffc107}.badge-warning[href]:focus,.badge-warning[href]:hover{color:#212529;text-decoration:none;background-color:#d39e00}.badge-danger{color:#fff;background-color:#dc3545}.badge-danger[href]:focus,.badge-danger[href]:hover{color:#fff;text-decoration:none;background-color:#bd2130}.badge-light{color:#212529;background-color:#f8f9fa}.badge-light[href]:focus,.badge-light[href]:hover{color:#212529;text-decoration:none;background-color:#dae0e5}.badge-dark{color:#fff;background-color:#343a40}.badge-dark[href]:focus,.badge-dark[href]:hover{color:#fff;text-decoration:none;background-color:#1d2124}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#e9ecef;border-radius:.3rem}@media (min-width:576px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{position:relative;padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:4rem}.alert-dismissible .close{position:absolute;top:0;right:0;padding:.75rem 1.25rem;color:inherit}.alert-primary{color:#004085;background-color:#cce5ff;border-color:#b8daff}.alert-primary hr{border-top-color:#9fcdff}.alert-primary .alert-link{color:#002752}.alert-secondary{color:#383d41;background-color:#e2e3e5;border-color:#d6d8db}.alert-secondary hr{border-top-color:#c8cbcf}.alert-secondary .alert-link{color:#202326}.alert-success{color:#155724;background-color:#d4edda;border-color:#c3e6cb}.alert-success hr{border-top-color:#b1dfbb}.alert-success .alert-link{color:#0b2e13}.alert-info{color:#0c5460;background-color:#d1ecf1;border-color:#bee5eb}.alert-info hr{border-top-color:#abdde5}.alert-info .alert-link{color:#062c33}.alert-warning{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.alert-warning hr{border-top-color:#ffe8a1}.alert-warning .alert-link{color:#533f03}.alert-danger{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.alert-danger hr{border-top-color:#f1b0b7}.alert-danger .alert-link{color:#491217}.alert-light{color:#818182;background-color:#fefefe;border-color:#fdfdfe}.alert-light hr{border-top-color:#ececf6}.alert-light .alert-link{color:#686868}.alert-dark{color:#1b1e21;background-color:#d6d8d9;border-color:#c6c8ca}.alert-dark hr{border-top-color:#b9bbbe}.alert-dark .alert-link{color:#040505}@-webkit-keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}.progress{display:-webkit-box;display:-ms-flexbox;display:flex;height:1rem;overflow:hidden;font-size:.75rem;background-color:#e9ecef;border-radius:.25rem}.progress-bar{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;color:#fff;text-align:center;background-color:#007bff;transition:width .6s ease}.progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem}.progress-bar-animated{-webkit-animation:progress-bar-stripes 1s linear infinite;animation:progress-bar-stripes 1s linear infinite}.media{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.media-body{-webkit-box-flex:1;-ms-flex:1;flex:1}.list-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0}.list-group-item-action{width:100%;color:#495057;text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{color:#495057;text-decoration:none;background-color:#f8f9fa}.list-group-item-action:active{color:#212529;background-color:#e9ecef}.list-group-item{position:relative;display:block;padding:.75rem 1.25rem;margin-bottom:-1px;background-color:#fff;border:1px solid rgba(0,0,0,.125)}.list-group-item:first-child{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.list-group-item:focus,.list-group-item:hover{z-index:1;text-decoration:none}.list-group-item.disabled,.list-group-item:disabled{color:#6c757d;background-color:#fff}.list-group-item.active{z-index:2;color:#fff;background-color:#007bff;border-color:#007bff}.list-group-flush .list-group-item{border-right:0;border-left:0;border-radius:0}.list-group-flush:first-child .list-group-item:first-child{border-top:0}.list-group-flush:last-child .list-group-item:last-child{border-bottom:0}.list-group-item-primary{color:#004085;background-color:#b8daff}.list-group-item-primary.list-group-item-action:focus,.list-group-item-primary.list-group-item-action:hover{color:#004085;background-color:#9fcdff}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#004085;border-color:#004085}.list-group-item-secondary{color:#383d41;background-color:#d6d8db}.list-group-item-secondary.list-group-item-action:focus,.list-group-item-secondary.list-group-item-action:hover{color:#383d41;background-color:#c8cbcf}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#383d41;border-color:#383d41}.list-group-item-success{color:#155724;background-color:#c3e6cb}.list-group-item-success.list-group-item-action:focus,.list-group-item-success.list-group-item-action:hover{color:#155724;background-color:#b1dfbb}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#155724;border-color:#155724}.list-group-item-info{color:#0c5460;background-color:#bee5eb}.list-group-item-info.list-group-item-action:focus,.list-group-item-info.list-group-item-action:hover{color:#0c5460;background-color:#abdde5}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#0c5460;border-color:#0c5460}.list-group-item-warning{color:#856404;background-color:#ffeeba}.list-group-item-warning.list-group-item-action:focus,.list-group-item-warning.list-group-item-action:hover{color:#856404;background-color:#ffe8a1}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#856404;border-color:#856404}.list-group-item-danger{color:#721c24;background-color:#f5c6cb}.list-group-item-danger.list-group-item-action:focus,.list-group-item-danger.list-group-item-action:hover{color:#721c24;background-color:#f1b0b7}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#721c24;border-color:#721c24}.list-group-item-light{color:#818182;background-color:#fdfdfe}.list-group-item-light.list-group-item-action:focus,.list-group-item-light.list-group-item-action:hover{color:#818182;background-color:#ececf6}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#818182;border-color:#818182}.list-group-item-dark{color:#1b1e21;background-color:#c6c8ca}.list-group-item-dark.list-group-item-action:focus,.list-group-item-dark.list-group-item-action:hover{color:#1b1e21;background-color:#b9bbbe}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#1b1e21;border-color:#1b1e21}.close{float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.close:focus,.close:hover{color:#000;text-decoration:none;opacity:.75}.close:not(:disabled):not(.disabled){cursor:pointer}button.close{padding:0;background-color:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;outline:0}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:.5rem;pointer-events:none}.modal.fade .modal-dialog{transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out;-webkit-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.show .modal-dialog{-webkit-transform:translate(0,0);transform:translate(0,0)}.modal-dialog-centered{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-height:calc(100% - (.5rem * 2))}.modal-content{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;width:100%;pointer-events:auto;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:.5}.modal-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:1rem;border-bottom:1px solid #e9ecef;border-top-left-radius:.3rem;border-top-right-radius:.3rem}.modal-header .close{padding:1rem;margin:-1rem -1rem -1rem auto}.modal-title{margin-bottom:0;line-height:1.5}.modal-body{position:relative;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.modal-footer{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;padding:1rem;border-top:1px solid #e9ecef}.modal-footer>:not(:first-child){margin-left:.25rem}.modal-footer>:not(:last-child){margin-right:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:576px){.modal-dialog{max-width:500px;margin:1.75rem auto}.modal-dialog-centered{min-height:calc(100% - (1.75rem * 2))}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg{max-width:800px}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;opacity:0}.tooltip.show{opacity:.9}.tooltip .arrow{position:absolute;display:block;width:.8rem;height:.4rem}.tooltip .arrow::before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-auto[x-placement^=top],.bs-tooltip-top{padding:.4rem 0}.bs-tooltip-auto[x-placement^=top] .arrow,.bs-tooltip-top .arrow{bottom:0}.bs-tooltip-auto[x-placement^=top] .arrow::before,.bs-tooltip-top .arrow::before{top:0;border-width:.4rem .4rem 0;border-top-color:#000}.bs-tooltip-auto[x-placement^=right],.bs-tooltip-right{padding:0 .4rem}.bs-tooltip-auto[x-placement^=right] .arrow,.bs-tooltip-right .arrow{left:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=right] .arrow::before,.bs-tooltip-right .arrow::before{right:0;border-width:.4rem .4rem .4rem 0;border-right-color:#000}.bs-tooltip-auto[x-placement^=bottom],.bs-tooltip-bottom{padding:.4rem 0}.bs-tooltip-auto[x-placement^=bottom] .arrow,.bs-tooltip-bottom .arrow{top:0}.bs-tooltip-auto[x-placement^=bottom] .arrow::before,.bs-tooltip-bottom .arrow::before{bottom:0;border-width:0 .4rem .4rem;border-bottom-color:#000}.bs-tooltip-auto[x-placement^=left],.bs-tooltip-left{padding:0 .4rem}.bs-tooltip-auto[x-placement^=left] .arrow,.bs-tooltip-left .arrow{right:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=left] .arrow::before,.bs-tooltip-left .arrow::before{left:0;border-width:.4rem 0 .4rem .4rem;border-left-color:#000}.tooltip-inner{max-width:200px;padding:.25rem .5rem;color:#fff;text-align:center;background-color:#000;border-radius:.25rem}.popover{position:absolute;top:0;left:0;z-index:1060;display:block;max-width:276px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.popover .arrow{position:absolute;display:block;width:1rem;height:.5rem;margin:0 .3rem}.popover .arrow::after,.popover .arrow::before{position:absolute;display:block;content:"";border-color:transparent;border-style:solid}.bs-popover-auto[x-placement^=top],.bs-popover-top{margin-bottom:.5rem}.bs-popover-auto[x-placement^=top] .arrow,.bs-popover-top .arrow{bottom:calc((.5rem + 1px) * -1)}.bs-popover-auto[x-placement^=top] .arrow::after,.bs-popover-auto[x-placement^=top] .arrow::before,.bs-popover-top .arrow::after,.bs-popover-top .arrow::before{border-width:.5rem .5rem 0}.bs-popover-auto[x-placement^=top] .arrow::before,.bs-popover-top .arrow::before{bottom:0;border-top-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=top] .arrow::after,.bs-popover-top .arrow::after{bottom:1px;border-top-color:#fff}.bs-popover-auto[x-placement^=right],.bs-popover-right{margin-left:.5rem}.bs-popover-auto[x-placement^=right] .arrow,.bs-popover-right .arrow{left:calc((.5rem + 1px) * -1);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=right] .arrow::after,.bs-popover-auto[x-placement^=right] .arrow::before,.bs-popover-right .arrow::after,.bs-popover-right .arrow::before{border-width:.5rem .5rem .5rem 0}.bs-popover-auto[x-placement^=right] .arrow::before,.bs-popover-right .arrow::before{left:0;border-right-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=right] .arrow::after,.bs-popover-right .arrow::after{left:1px;border-right-color:#fff}.bs-popover-auto[x-placement^=bottom],.bs-popover-bottom{margin-top:.5rem}.bs-popover-auto[x-placement^=bottom] .arrow,.bs-popover-bottom .arrow{top:calc((.5rem + 1px) * -1)}.bs-popover-auto[x-placement^=bottom] .arrow::after,.bs-popover-auto[x-placement^=bottom] .arrow::before,.bs-popover-bottom .arrow::after,.bs-popover-bottom .arrow::before{border-width:0 .5rem .5rem .5rem}.bs-popover-auto[x-placement^=bottom] .arrow::before,.bs-popover-bottom .arrow::before{top:0;border-bottom-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=bottom] .arrow::after,.bs-popover-bottom .arrow::after{top:1px;border-bottom-color:#fff}.bs-popover-auto[x-placement^=bottom] .popover-header::before,.bs-popover-bottom .popover-header::before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-.5rem;content:"";border-bottom:1px solid #f7f7f7}.bs-popover-auto[x-placement^=left],.bs-popover-left{margin-right:.5rem}.bs-popover-auto[x-placement^=left] .arrow,.bs-popover-left .arrow{right:calc((.5rem + 1px) * -1);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=left] .arrow::after,.bs-popover-auto[x-placement^=left] .arrow::before,.bs-popover-left .arrow::after,.bs-popover-left .arrow::before{border-width:.5rem 0 .5rem .5rem}.bs-popover-auto[x-placement^=left] .arrow::before,.bs-popover-left .arrow::before{right:0;border-left-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=left] .arrow::after,.bs-popover-left .arrow::after{right:1px;border-left-color:#fff}.popover-header{padding:.5rem .75rem;margin-bottom:0;font-size:1rem;color:inherit;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:.5rem .75rem;color:#212529}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-item{position:relative;display:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;transition:-webkit-transform .6s ease;transition:transform .6s ease;transition:transform .6s ease,-webkit-transform .6s ease;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.carousel-item-next,.carousel-item-prev{position:absolute;top:0}.carousel-item-next.carousel-item-left,.carousel-item-prev.carousel-item-right{-webkit-transform:translateX(0);transform:translateX(0)}@supports ((-webkit-transform-style:preserve-3d) or (transform-style:preserve-3d)){.carousel-item-next.carousel-item-left,.carousel-item-prev.carousel-item-right{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.active.carousel-item-right,.carousel-item-next{-webkit-transform:translateX(100%);transform:translateX(100%)}@supports ((-webkit-transform-style:preserve-3d) or (transform-style:preserve-3d)){.active.carousel-item-right,.carousel-item-next{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}.active.carousel-item-left,.carousel-item-prev{-webkit-transform:translateX(-100%);transform:translateX(-100%)}@supports ((-webkit-transform-style:preserve-3d) or (transform-style:preserve-3d)){.active.carousel-item-left,.carousel-item-prev{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:15%;color:#fff;text-align:center;opacity:.5}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:20px;height:20px;background:transparent no-repeat center center;background-size:100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E")}.carousel-control-next-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E")}.carousel-indicators{position:absolute;right:0;bottom:10px;left:0;z-index:15;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{position:relative;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;background-color:rgba(255,255,255,.5)}.carousel-indicators li::before{position:absolute;top:-10px;left:0;display:inline-block;width:100%;height:10px;content:""}.carousel-indicators li::after{position:absolute;bottom:-10px;left:0;display:inline-block;width:100%;height:10px;content:""}.carousel-indicators .active{background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.bg-primary{background-color:#007bff!important}a.bg-primary:focus,a.bg-primary:hover,button.bg-primary:focus,button.bg-primary:hover{background-color:#0062cc!important}.bg-secondary{background-color:#6c757d!important}a.bg-secondary:focus,a.bg-secondary:hover,button.bg-secondary:focus,button.bg-secondary:hover{background-color:#545b62!important}.bg-success{background-color:#28a745!important}a.bg-success:focus,a.bg-success:hover,button.bg-success:focus,button.bg-success:hover{background-color:#1e7e34!important}.bg-info{background-color:#17a2b8!important}a.bg-info:focus,a.bg-info:hover,button.bg-info:focus,button.bg-info:hover{background-color:#117a8b!important}.bg-warning{background-color:#ffc107!important}a.bg-warning:focus,a.bg-warning:hover,button.bg-warning:focus,button.bg-warning:hover{background-color:#d39e00!important}.bg-danger{background-color:#dc3545!important}a.bg-danger:focus,a.bg-danger:hover,button.bg-danger:focus,button.bg-danger:hover{background-color:#bd2130!important}.bg-light{background-color:#f8f9fa!important}a.bg-light:focus,a.bg-light:hover,button.bg-light:focus,button.bg-light:hover{background-color:#dae0e5!important}.bg-dark{background-color:#343a40!important}a.bg-dark:focus,a.bg-dark:hover,button.bg-dark:focus,button.bg-dark:hover{background-color:#1d2124!important}.bg-white{background-color:#fff!important}.bg-transparent{background-color:transparent!important}.border{border:1px solid #dee2e6!important}.border-top{border-top:1px solid #dee2e6!important}.border-right{border-right:1px solid #dee2e6!important}.border-bottom{border-bottom:1px solid #dee2e6!important}.border-left{border-left:1px solid #dee2e6!important}.border-0{border:0!important}.border-top-0{border-top:0!important}.border-right-0{border-right:0!important}.border-bottom-0{border-bottom:0!important}.border-left-0{border-left:0!important}.border-primary{border-color:#007bff!important}.border-secondary{border-color:#6c757d!important}.border-success{border-color:#28a745!important}.border-info{border-color:#17a2b8!important}.border-warning{border-color:#ffc107!important}.border-danger{border-color:#dc3545!important}.border-light{border-color:#f8f9fa!important}.border-dark{border-color:#343a40!important}.border-white{border-color:#fff!important}.rounded{border-radius:.25rem!important}.rounded-top{border-top-left-radius:.25rem!important;border-top-right-radius:.25rem!important}.rounded-right{border-top-right-radius:.25rem!important;border-bottom-right-radius:.25rem!important}.rounded-bottom{border-bottom-right-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-left{border-top-left-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-circle{border-radius:50%!important}.rounded-0{border-radius:0!important}.clearfix::after{display:block;clear:both;content:""}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-sm-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-md-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-lg-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-xl-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}@media print{.d-print-none{display:none!important}.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important}.d-print-inline-flex{display:-webkit-inline-box!important;display:-ms-inline-flexbox!important;display:inline-flex!important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive::before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9::before{padding-top:42.857143%}.embed-responsive-16by9::before{padding-top:56.25%}.embed-responsive-4by3::before{padding-top:75%}.embed-responsive-1by1::before{padding-top:100%}.flex-row{-webkit-box-orient:horizontal!important;-webkit-box-direction:normal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-column{-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}@media (min-width:576px){.flex-sm-row{-webkit-box-orient:horizontal!important;-webkit-box-direction:normal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-sm-column{-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-sm-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-sm-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-sm-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-sm-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-sm-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-sm-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-sm-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-sm-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-sm-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-sm-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-sm-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-sm-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-sm-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-sm-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-sm-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-sm-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-sm-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-sm-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-sm-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-sm-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-sm-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-sm-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-sm-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-sm-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-sm-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-sm-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-sm-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:768px){.flex-md-row{-webkit-box-orient:horizontal!important;-webkit-box-direction:normal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-md-column{-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-md-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-md-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-md-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-md-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-md-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-md-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-md-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-md-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-md-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-md-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-md-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-md-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-md-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-md-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-md-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-md-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-md-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-md-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-md-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-md-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-md-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-md-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-md-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-md-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-md-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-md-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-md-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:992px){.flex-lg-row{-webkit-box-orient:horizontal!important;-webkit-box-direction:normal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-lg-column{-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-lg-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-lg-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-lg-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-lg-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-lg-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-lg-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-lg-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-lg-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-lg-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-lg-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-lg-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-lg-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-lg-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-lg-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-lg-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-lg-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-lg-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-lg-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-lg-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-lg-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-lg-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-lg-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-lg-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-lg-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-lg-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-lg-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-lg-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{-webkit-box-orient:horizontal!important;-webkit-box-direction:normal!important;-ms-flex-direction:row!important;flex-direction:row!important}.flex-xl-column{-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-ms-flex-direction:column!important;flex-direction:column!important}.flex-xl-row-reverse{-webkit-box-orient:horizontal!important;-webkit-box-direction:reverse!important;-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-xl-column-reverse{-webkit-box-orient:vertical!important;-webkit-box-direction:reverse!important;-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-xl-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-xl-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-xl-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-xl-start{-webkit-box-pack:start!important;-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-xl-end{-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-xl-center{-webkit-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.justify-content-xl-between{-webkit-box-pack:justify!important;-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-xl-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-xl-start{-webkit-box-align:start!important;-ms-flex-align:start!important;align-items:flex-start!important}.align-items-xl-end{-webkit-box-align:end!important;-ms-flex-align:end!important;align-items:flex-end!important}.align-items-xl-center{-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important}.align-items-xl-baseline{-webkit-box-align:baseline!important;-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-xl-stretch{-webkit-box-align:stretch!important;-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-xl-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-xl-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-xl-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-xl-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-xl-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-xl-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-xl-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-xl-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-xl-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-xl-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-xl-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-xl-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}.float-left{float:left!important}.float-right{float:right!important}.float-none{float:none!important}@media (min-width:576px){.float-sm-left{float:left!important}.float-sm-right{float:right!important}.float-sm-none{float:none!important}}@media (min-width:768px){.float-md-left{float:left!important}.float-md-right{float:right!important}.float-md-none{float:none!important}}@media (min-width:992px){.float-lg-left{float:left!important}.float-lg-right{float:right!important}.float-lg-none{float:none!important}}@media (min-width:1200px){.float-xl-left{float:left!important}.float-xl-right{float:right!important}.float-xl-none{float:none!important}}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:-webkit-sticky!important;position:sticky!important}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}@supports ((position:-webkit-sticky) or (position:sticky)){.sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;-webkit-clip-path:inset(50%);clip-path:inset(50%);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal;-webkit-clip-path:none;clip-path:none}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.mw-100{max-width:100%!important}.mh-100{max-height:100%!important}.m-0{margin:0!important}.mt-0,.my-0{margin-top:0!important}.mr-0,.mx-0{margin-right:0!important}.mb-0,.my-0{margin-bottom:0!important}.ml-0,.mx-0{margin-left:0!important}.m-1{margin:.25rem!important}.mt-1,.my-1{margin-top:.25rem!important}.mr-1,.mx-1{margin-right:.25rem!important}.mb-1,.my-1{margin-bottom:.25rem!important}.ml-1,.mx-1{margin-left:.25rem!important}.m-2{margin:.5rem!important}.mt-2,.my-2{margin-top:.5rem!important}.mr-2,.mx-2{margin-right:.5rem!important}.mb-2,.my-2{margin-bottom:.5rem!important}.ml-2,.mx-2{margin-left:.5rem!important}.m-3{margin:1rem!important}.mt-3,.my-3{margin-top:1rem!important}.mr-3,.mx-3{margin-right:1rem!important}.mb-3,.my-3{margin-bottom:1rem!important}.ml-3,.mx-3{margin-left:1rem!important}.m-4{margin:1.5rem!important}.mt-4,.my-4{margin-top:1.5rem!important}.mr-4,.mx-4{margin-right:1.5rem!important}.mb-4,.my-4{margin-bottom:1.5rem!important}.ml-4,.mx-4{margin-left:1.5rem!important}.m-5{margin:3rem!important}.mt-5,.my-5{margin-top:3rem!important}.mr-5,.mx-5{margin-right:3rem!important}.mb-5,.my-5{margin-bottom:3rem!important}.ml-5,.mx-5{margin-left:3rem!important}.p-0{padding:0!important}.pt-0,.py-0{padding-top:0!important}.pr-0,.px-0{padding-right:0!important}.pb-0,.py-0{padding-bottom:0!important}.pl-0,.px-0{padding-left:0!important}.p-1{padding:.25rem!important}.pt-1,.py-1{padding-top:.25rem!important}.pr-1,.px-1{padding-right:.25rem!important}.pb-1,.py-1{padding-bottom:.25rem!important}.pl-1,.px-1{padding-left:.25rem!important}.p-2{padding:.5rem!important}.pt-2,.py-2{padding-top:.5rem!important}.pr-2,.px-2{padding-right:.5rem!important}.pb-2,.py-2{padding-bottom:.5rem!important}.pl-2,.px-2{padding-left:.5rem!important}.p-3{padding:1rem!important}.pt-3,.py-3{padding-top:1rem!important}.pr-3,.px-3{padding-right:1rem!important}.pb-3,.py-3{padding-bottom:1rem!important}.pl-3,.px-3{padding-left:1rem!important}.p-4{padding:1.5rem!important}.pt-4,.py-4{padding-top:1.5rem!important}.pr-4,.px-4{padding-right:1.5rem!important}.pb-4,.py-4{padding-bottom:1.5rem!important}.pl-4,.px-4{padding-left:1.5rem!important}.p-5{padding:3rem!important}.pt-5,.py-5{padding-top:3rem!important}.pr-5,.px-5{padding-right:3rem!important}.pb-5,.py-5{padding-bottom:3rem!important}.pl-5,.px-5{padding-left:3rem!important}.m-auto{margin:auto!important}.mt-auto,.my-auto{margin-top:auto!important}.mr-auto,.mx-auto{margin-right:auto!important}.mb-auto,.my-auto{margin-bottom:auto!important}.ml-auto,.mx-auto{margin-left:auto!important}@media (min-width:576px){.m-sm-0{margin:0!important}.mt-sm-0,.my-sm-0{margin-top:0!important}.mr-sm-0,.mx-sm-0{margin-right:0!important}.mb-sm-0,.my-sm-0{margin-bottom:0!important}.ml-sm-0,.mx-sm-0{margin-left:0!important}.m-sm-1{margin:.25rem!important}.mt-sm-1,.my-sm-1{margin-top:.25rem!important}.mr-sm-1,.mx-sm-1{margin-right:.25rem!important}.mb-sm-1,.my-sm-1{margin-bottom:.25rem!important}.ml-sm-1,.mx-sm-1{margin-left:.25rem!important}.m-sm-2{margin:.5rem!important}.mt-sm-2,.my-sm-2{margin-top:.5rem!important}.mr-sm-2,.mx-sm-2{margin-right:.5rem!important}.mb-sm-2,.my-sm-2{margin-bottom:.5rem!important}.ml-sm-2,.mx-sm-2{margin-left:.5rem!important}.m-sm-3{margin:1rem!important}.mt-sm-3,.my-sm-3{margin-top:1rem!important}.mr-sm-3,.mx-sm-3{margin-right:1rem!important}.mb-sm-3,.my-sm-3{margin-bottom:1rem!important}.ml-sm-3,.mx-sm-3{margin-left:1rem!important}.m-sm-4{margin:1.5rem!important}.mt-sm-4,.my-sm-4{margin-top:1.5rem!important}.mr-sm-4,.mx-sm-4{margin-right:1.5rem!important}.mb-sm-4,.my-sm-4{margin-bottom:1.5rem!important}.ml-sm-4,.mx-sm-4{margin-left:1.5rem!important}.m-sm-5{margin:3rem!important}.mt-sm-5,.my-sm-5{margin-top:3rem!important}.mr-sm-5,.mx-sm-5{margin-right:3rem!important}.mb-sm-5,.my-sm-5{margin-bottom:3rem!important}.ml-sm-5,.mx-sm-5{margin-left:3rem!important}.p-sm-0{padding:0!important}.pt-sm-0,.py-sm-0{padding-top:0!important}.pr-sm-0,.px-sm-0{padding-right:0!important}.pb-sm-0,.py-sm-0{padding-bottom:0!important}.pl-sm-0,.px-sm-0{padding-left:0!important}.p-sm-1{padding:.25rem!important}.pt-sm-1,.py-sm-1{padding-top:.25rem!important}.pr-sm-1,.px-sm-1{padding-right:.25rem!important}.pb-sm-1,.py-sm-1{padding-bottom:.25rem!important}.pl-sm-1,.px-sm-1{padding-left:.25rem!important}.p-sm-2{padding:.5rem!important}.pt-sm-2,.py-sm-2{padding-top:.5rem!important}.pr-sm-2,.px-sm-2{padding-right:.5rem!important}.pb-sm-2,.py-sm-2{padding-bottom:.5rem!important}.pl-sm-2,.px-sm-2{padding-left:.5rem!important}.p-sm-3{padding:1rem!important}.pt-sm-3,.py-sm-3{padding-top:1rem!important}.pr-sm-3,.px-sm-3{padding-right:1rem!important}.pb-sm-3,.py-sm-3{padding-bottom:1rem!important}.pl-sm-3,.px-sm-3{padding-left:1rem!important}.p-sm-4{padding:1.5rem!important}.pt-sm-4,.py-sm-4{padding-top:1.5rem!important}.pr-sm-4,.px-sm-4{padding-right:1.5rem!important}.pb-sm-4,.py-sm-4{padding-bottom:1.5rem!important}.pl-sm-4,.px-sm-4{padding-left:1.5rem!important}.p-sm-5{padding:3rem!important}.pt-sm-5,.py-sm-5{padding-top:3rem!important}.pr-sm-5,.px-sm-5{padding-right:3rem!important}.pb-sm-5,.py-sm-5{padding-bottom:3rem!important}.pl-sm-5,.px-sm-5{padding-left:3rem!important}.m-sm-auto{margin:auto!important}.mt-sm-auto,.my-sm-auto{margin-top:auto!important}.mr-sm-auto,.mx-sm-auto{margin-right:auto!important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto!important}.ml-sm-auto,.mx-sm-auto{margin-left:auto!important}}@media (min-width:768px){.m-md-0{margin:0!important}.mt-md-0,.my-md-0{margin-top:0!important}.mr-md-0,.mx-md-0{margin-right:0!important}.mb-md-0,.my-md-0{margin-bottom:0!important}.ml-md-0,.mx-md-0{margin-left:0!important}.m-md-1{margin:.25rem!important}.mt-md-1,.my-md-1{margin-top:.25rem!important}.mr-md-1,.mx-md-1{margin-right:.25rem!important}.mb-md-1,.my-md-1{margin-bottom:.25rem!important}.ml-md-1,.mx-md-1{margin-left:.25rem!important}.m-md-2{margin:.5rem!important}.mt-md-2,.my-md-2{margin-top:.5rem!important}.mr-md-2,.mx-md-2{margin-right:.5rem!important}.mb-md-2,.my-md-2{margin-bottom:.5rem!important}.ml-md-2,.mx-md-2{margin-left:.5rem!important}.m-md-3{margin:1rem!important}.mt-md-3,.my-md-3{margin-top:1rem!important}.mr-md-3,.mx-md-3{margin-right:1rem!important}.mb-md-3,.my-md-3{margin-bottom:1rem!important}.ml-md-3,.mx-md-3{margin-left:1rem!important}.m-md-4{margin:1.5rem!important}.mt-md-4,.my-md-4{margin-top:1.5rem!important}.mr-md-4,.mx-md-4{margin-right:1.5rem!important}.mb-md-4,.my-md-4{margin-bottom:1.5rem!important}.ml-md-4,.mx-md-4{margin-left:1.5rem!important}.m-md-5{margin:3rem!important}.mt-md-5,.my-md-5{margin-top:3rem!important}.mr-md-5,.mx-md-5{margin-right:3rem!important}.mb-md-5,.my-md-5{margin-bottom:3rem!important}.ml-md-5,.mx-md-5{margin-left:3rem!important}.p-md-0{padding:0!important}.pt-md-0,.py-md-0{padding-top:0!important}.pr-md-0,.px-md-0{padding-right:0!important}.pb-md-0,.py-md-0{padding-bottom:0!important}.pl-md-0,.px-md-0{padding-left:0!important}.p-md-1{padding:.25rem!important}.pt-md-1,.py-md-1{padding-top:.25rem!important}.pr-md-1,.px-md-1{padding-right:.25rem!important}.pb-md-1,.py-md-1{padding-bottom:.25rem!important}.pl-md-1,.px-md-1{padding-left:.25rem!important}.p-md-2{padding:.5rem!important}.pt-md-2,.py-md-2{padding-top:.5rem!important}.pr-md-2,.px-md-2{padding-right:.5rem!important}.pb-md-2,.py-md-2{padding-bottom:.5rem!important}.pl-md-2,.px-md-2{padding-left:.5rem!important}.p-md-3{padding:1rem!important}.pt-md-3,.py-md-3{padding-top:1rem!important}.pr-md-3,.px-md-3{padding-right:1rem!important}.pb-md-3,.py-md-3{padding-bottom:1rem!important}.pl-md-3,.px-md-3{padding-left:1rem!important}.p-md-4{padding:1.5rem!important}.pt-md-4,.py-md-4{padding-top:1.5rem!important}.pr-md-4,.px-md-4{padding-right:1.5rem!important}.pb-md-4,.py-md-4{padding-bottom:1.5rem!important}.pl-md-4,.px-md-4{padding-left:1.5rem!important}.p-md-5{padding:3rem!important}.pt-md-5,.py-md-5{padding-top:3rem!important}.pr-md-5,.px-md-5{padding-right:3rem!important}.pb-md-5,.py-md-5{padding-bottom:3rem!important}.pl-md-5,.px-md-5{padding-left:3rem!important}.m-md-auto{margin:auto!important}.mt-md-auto,.my-md-auto{margin-top:auto!important}.mr-md-auto,.mx-md-auto{margin-right:auto!important}.mb-md-auto,.my-md-auto{margin-bottom:auto!important}.ml-md-auto,.mx-md-auto{margin-left:auto!important}}@media (min-width:992px){.m-lg-0{margin:0!important}.mt-lg-0,.my-lg-0{margin-top:0!important}.mr-lg-0,.mx-lg-0{margin-right:0!important}.mb-lg-0,.my-lg-0{margin-bottom:0!important}.ml-lg-0,.mx-lg-0{margin-left:0!important}.m-lg-1{margin:.25rem!important}.mt-lg-1,.my-lg-1{margin-top:.25rem!important}.mr-lg-1,.mx-lg-1{margin-right:.25rem!important}.mb-lg-1,.my-lg-1{margin-bottom:.25rem!important}.ml-lg-1,.mx-lg-1{margin-left:.25rem!important}.m-lg-2{margin:.5rem!important}.mt-lg-2,.my-lg-2{margin-top:.5rem!important}.mr-lg-2,.mx-lg-2{margin-right:.5rem!important}.mb-lg-2,.my-lg-2{margin-bottom:.5rem!important}.ml-lg-2,.mx-lg-2{margin-left:.5rem!important}.m-lg-3{margin:1rem!important}.mt-lg-3,.my-lg-3{margin-top:1rem!important}.mr-lg-3,.mx-lg-3{margin-right:1rem!important}.mb-lg-3,.my-lg-3{margin-bottom:1rem!important}.ml-lg-3,.mx-lg-3{margin-left:1rem!important}.m-lg-4{margin:1.5rem!important}.mt-lg-4,.my-lg-4{margin-top:1.5rem!important}.mr-lg-4,.mx-lg-4{margin-right:1.5rem!important}.mb-lg-4,.my-lg-4{margin-bottom:1.5rem!important}.ml-lg-4,.mx-lg-4{margin-left:1.5rem!important}.m-lg-5{margin:3rem!important}.mt-lg-5,.my-lg-5{margin-top:3rem!important}.mr-lg-5,.mx-lg-5{margin-right:3rem!important}.mb-lg-5,.my-lg-5{margin-bottom:3rem!important}.ml-lg-5,.mx-lg-5{margin-left:3rem!important}.p-lg-0{padding:0!important}.pt-lg-0,.py-lg-0{padding-top:0!important}.pr-lg-0,.px-lg-0{padding-right:0!important}.pb-lg-0,.py-lg-0{padding-bottom:0!important}.pl-lg-0,.px-lg-0{padding-left:0!important}.p-lg-1{padding:.25rem!important}.pt-lg-1,.py-lg-1{padding-top:.25rem!important}.pr-lg-1,.px-lg-1{padding-right:.25rem!important}.pb-lg-1,.py-lg-1{padding-bottom:.25rem!important}.pl-lg-1,.px-lg-1{padding-left:.25rem!important}.p-lg-2{padding:.5rem!important}.pt-lg-2,.py-lg-2{padding-top:.5rem!important}.pr-lg-2,.px-lg-2{padding-right:.5rem!important}.pb-lg-2,.py-lg-2{padding-bottom:.5rem!important}.pl-lg-2,.px-lg-2{padding-left:.5rem!important}.p-lg-3{padding:1rem!important}.pt-lg-3,.py-lg-3{padding-top:1rem!important}.pr-lg-3,.px-lg-3{padding-right:1rem!important}.pb-lg-3,.py-lg-3{padding-bottom:1rem!important}.pl-lg-3,.px-lg-3{padding-left:1rem!important}.p-lg-4{padding:1.5rem!important}.pt-lg-4,.py-lg-4{padding-top:1.5rem!important}.pr-lg-4,.px-lg-4{padding-right:1.5rem!important}.pb-lg-4,.py-lg-4{padding-bottom:1.5rem!important}.pl-lg-4,.px-lg-4{padding-left:1.5rem!important}.p-lg-5{padding:3rem!important}.pt-lg-5,.py-lg-5{padding-top:3rem!important}.pr-lg-5,.px-lg-5{padding-right:3rem!important}.pb-lg-5,.py-lg-5{padding-bottom:3rem!important}.pl-lg-5,.px-lg-5{padding-left:3rem!important}.m-lg-auto{margin:auto!important}.mt-lg-auto,.my-lg-auto{margin-top:auto!important}.mr-lg-auto,.mx-lg-auto{margin-right:auto!important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto!important}.ml-lg-auto,.mx-lg-auto{margin-left:auto!important}}@media (min-width:1200px){.m-xl-0{margin:0!important}.mt-xl-0,.my-xl-0{margin-top:0!important}.mr-xl-0,.mx-xl-0{margin-right:0!important}.mb-xl-0,.my-xl-0{margin-bottom:0!important}.ml-xl-0,.mx-xl-0{margin-left:0!important}.m-xl-1{margin:.25rem!important}.mt-xl-1,.my-xl-1{margin-top:.25rem!important}.mr-xl-1,.mx-xl-1{margin-right:.25rem!important}.mb-xl-1,.my-xl-1{margin-bottom:.25rem!important}.ml-xl-1,.mx-xl-1{margin-left:.25rem!important}.m-xl-2{margin:.5rem!important}.mt-xl-2,.my-xl-2{margin-top:.5rem!important}.mr-xl-2,.mx-xl-2{margin-right:.5rem!important}.mb-xl-2,.my-xl-2{margin-bottom:.5rem!important}.ml-xl-2,.mx-xl-2{margin-left:.5rem!important}.m-xl-3{margin:1rem!important}.mt-xl-3,.my-xl-3{margin-top:1rem!important}.mr-xl-3,.mx-xl-3{margin-right:1rem!important}.mb-xl-3,.my-xl-3{margin-bottom:1rem!important}.ml-xl-3,.mx-xl-3{margin-left:1rem!important}.m-xl-4{margin:1.5rem!important}.mt-xl-4,.my-xl-4{margin-top:1.5rem!important}.mr-xl-4,.mx-xl-4{margin-right:1.5rem!important}.mb-xl-4,.my-xl-4{margin-bottom:1.5rem!important}.ml-xl-4,.mx-xl-4{margin-left:1.5rem!important}.m-xl-5{margin:3rem!important}.mt-xl-5,.my-xl-5{margin-top:3rem!important}.mr-xl-5,.mx-xl-5{margin-right:3rem!important}.mb-xl-5,.my-xl-5{margin-bottom:3rem!important}.ml-xl-5,.mx-xl-5{margin-left:3rem!important}.p-xl-0{padding:0!important}.pt-xl-0,.py-xl-0{padding-top:0!important}.pr-xl-0,.px-xl-0{padding-right:0!important}.pb-xl-0,.py-xl-0{padding-bottom:0!important}.pl-xl-0,.px-xl-0{padding-left:0!important}.p-xl-1{padding:.25rem!important}.pt-xl-1,.py-xl-1{padding-top:.25rem!important}.pr-xl-1,.px-xl-1{padding-right:.25rem!important}.pb-xl-1,.py-xl-1{padding-bottom:.25rem!important}.pl-xl-1,.px-xl-1{padding-left:.25rem!important}.p-xl-2{padding:.5rem!important}.pt-xl-2,.py-xl-2{padding-top:.5rem!important}.pr-xl-2,.px-xl-2{padding-right:.5rem!important}.pb-xl-2,.py-xl-2{padding-bottom:.5rem!important}.pl-xl-2,.px-xl-2{padding-left:.5rem!important}.p-xl-3{padding:1rem!important}.pt-xl-3,.py-xl-3{padding-top:1rem!important}.pr-xl-3,.px-xl-3{padding-right:1rem!important}.pb-xl-3,.py-xl-3{padding-bottom:1rem!important}.pl-xl-3,.px-xl-3{padding-left:1rem!important}.p-xl-4{padding:1.5rem!important}.pt-xl-4,.py-xl-4{padding-top:1.5rem!important}.pr-xl-4,.px-xl-4{padding-right:1.5rem!important}.pb-xl-4,.py-xl-4{padding-bottom:1.5rem!important}.pl-xl-4,.px-xl-4{padding-left:1.5rem!important}.p-xl-5{padding:3rem!important}.pt-xl-5,.py-xl-5{padding-top:3rem!important}.pr-xl-5,.px-xl-5{padding-right:3rem!important}.pb-xl-5,.py-xl-5{padding-bottom:3rem!important}.pl-xl-5,.px-xl-5{padding-left:3rem!important}.m-xl-auto{margin:auto!important}.mt-xl-auto,.my-xl-auto{margin-top:auto!important}.mr-xl-auto,.mx-xl-auto{margin-right:auto!important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto!important}.ml-xl-auto,.mx-xl-auto{margin-left:auto!important}}.text-justify{text-align:justify!important}.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left!important}.text-right{text-align:right!important}.text-center{text-align:center!important}@media (min-width:576px){.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.text-md-left{text-align:left!important}.text-md-right{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.text-lg-left{text-align:left!important}.text-lg-right{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.text-xl-left{text-align:left!important}.text-xl-right{text-align:right!important}.text-xl-center{text-align:center!important}}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.font-weight-light{font-weight:300!important}.font-weight-normal{font-weight:400!important}.font-weight-bold{font-weight:700!important}.font-italic{font-style:italic!important}.text-white{color:#fff!important}.text-primary{color:#007bff!important}a.text-primary:focus,a.text-primary:hover{color:#0062cc!important}.text-secondary{color:#6c757d!important}a.text-secondary:focus,a.text-secondary:hover{color:#545b62!important}.text-success{color:#28a745!important}a.text-success:focus,a.text-success:hover{color:#1e7e34!important}.text-info{color:#17a2b8!important}a.text-info:focus,a.text-info:hover{color:#117a8b!important}.text-warning{color:#ffc107!important}a.text-warning:focus,a.text-warning:hover{color:#d39e00!important}.text-danger{color:#dc3545!important}a.text-danger:focus,a.text-danger:hover{color:#bd2130!important}.text-light{color:#f8f9fa!important}a.text-light:focus,a.text-light:hover{color:#dae0e5!important}.text-dark{color:#343a40!important}a.text-dark:focus,a.text-dark:hover{color:#1d2124!important}.text-muted{color:#6c757d!important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.visible{visibility:visible!important}.invisible{visibility:hidden!important}@media print{*,::after,::before{text-shadow:none!important;box-shadow:none!important}a:not(.btn){text-decoration:underline}abbr[title]::after{content:" (" attr(title) ")"}pre{white-space:pre-wrap!important}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}@page{size:a3}body{min-width:992px!important}.container{min-width:992px!important}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}} +/*# sourceMappingURL=bootstrap.min.css.map */ \ No newline at end of file diff --git "a/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/static/css/main.css" "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/static/css/main.css" new file mode 100644 index 0000000..c8b1227 --- /dev/null +++ "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/static/css/main.css" @@ -0,0 +1,11 @@ +h1{ + color:#0000FF; +} + +h2{ + color:#FF0000; +} + +footer{ + margin-top:60px; +} \ No newline at end of file diff --git "a/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/templates/admin.html" "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/templates/admin.html" new file mode 100644 index 0000000..85e372f --- /dev/null +++ "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/templates/admin.html" @@ -0,0 +1,11 @@ + + + + admin + + +

admin

+

管理员页面

+

点击 这里 返回首页

+ + \ No newline at end of file diff --git "a/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/templates/content.html" "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/templates/content.html" new file mode 100644 index 0000000..0b0eb7b --- /dev/null +++ "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/templates/content.html" @@ -0,0 +1,16 @@ + + + + content + + + +

content

+

我是登录后才可以看的页面

+ +
+ +
+ + \ No newline at end of file diff --git "a/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/templates/index.html" "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/templates/index.html" new file mode 100644 index 0000000..32eebe4 --- /dev/null +++ "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/templates/index.html" @@ -0,0 +1,13 @@ + + + + index + + + +

Hello!

+

今天天气很好,来一个纯洁的微笑吧!

+

点击 这里 进入受限页面

+

点击 这里 进入 Admin 页面

+ + \ No newline at end of file diff --git "a/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/templates/login.html" "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/templates/login.html" new file mode 100644 index 0000000..b3cea75 --- /dev/null +++ "b/\347\254\254 5-1 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Security \350\277\233\350\241\214\345\256\211\345\205\250\346\216\247\345\210\266/spring-boot-security/src/main/resources/templates/login.html" @@ -0,0 +1,19 @@ + + + + login + + +
+ 用户名或密码错 +
+
+ 您已注销成功 +
+
+
+
+
+
+ + \ No newline at end of file diff --git "a/\347\254\254 5-2 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Actuator \347\233\221\346\216\247\345\272\224\347\224\250/spring-boot-actuator/pom.xml" "b/\347\254\254 5-2 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Actuator \347\233\221\346\216\247\345\272\224\347\224\250/spring-boot-actuator/pom.xml" new file mode 100644 index 0000000..7119dee --- /dev/null +++ "b/\347\254\254 5-2 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Actuator \347\233\221\346\216\247\345\272\224\347\224\250/spring-boot-actuator/pom.xml" @@ -0,0 +1,54 @@ + + + 4.0.0 + + com.neo + spring-boot-actuator + 1.0.0-SNAPSHOT + jar + + spring-boot-actuator + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-devtools + true + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + + + + diff --git "a/\347\254\254 5-2 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Actuator \347\233\221\346\216\247\345\272\224\347\224\250/spring-boot-actuator/src/main/java/com/neo/ActuatorApplication.java" "b/\347\254\254 5-2 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Actuator \347\233\221\346\216\247\345\272\224\347\224\250/spring-boot-actuator/src/main/java/com/neo/ActuatorApplication.java" new file mode 100644 index 0000000..66b2207 --- /dev/null +++ "b/\347\254\254 5-2 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Actuator \347\233\221\346\216\247\345\272\224\347\224\250/spring-boot-actuator/src/main/java/com/neo/ActuatorApplication.java" @@ -0,0 +1,12 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class ActuatorApplication { + + public static void main(String[] args) { + SpringApplication.run(ActuatorApplication.class, args); + } +} diff --git "a/\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-package-war/src/main/java/com/neo/controller/HelloWorldController.java" "b/\347\254\254 5-2 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Actuator \347\233\221\346\216\247\345\272\224\347\224\250/spring-boot-actuator/src/main/java/com/neo/controller/HelloController.java" similarity index 88% rename from "\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-package-war/src/main/java/com/neo/controller/HelloWorldController.java" rename to "\347\254\254 5-2 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Actuator \347\233\221\346\216\247\345\272\224\347\224\250/spring-boot-actuator/src/main/java/com/neo/controller/HelloController.java" index 7d0256b..5e93f0d 100644 --- "a/\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-package-war/src/main/java/com/neo/controller/HelloWorldController.java" +++ "b/\347\254\254 5-2 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Actuator \347\233\221\346\216\247\345\272\224\347\224\250/spring-boot-actuator/src/main/java/com/neo/controller/HelloController.java" @@ -4,7 +4,7 @@ import org.springframework.web.bind.annotation.RestController; @RestController -public class HelloWorldController { +public class HelloController { @RequestMapping("/hello") public String index() { diff --git "a/\347\254\254 5-2 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Actuator \347\233\221\346\216\247\345\272\224\347\224\250/spring-boot-actuator/src/main/resources/application.properties" "b/\347\254\254 5-2 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Actuator \347\233\221\346\216\247\345\272\224\347\224\250/spring-boot-actuator/src/main/resources/application.properties" new file mode 100644 index 0000000..4157eba --- /dev/null +++ "b/\347\254\254 5-2 \350\257\276\357\274\232\344\275\277\347\224\250 Spring Boot Actuator \347\233\221\346\216\247\345\272\224\347\224\250/spring-boot-actuator/src/main/resources/application.properties" @@ -0,0 +1,9 @@ +info.app.name=spring-boot-actuator +info.app.version= 1.0.0 +info.app.test=test + +management.endpoints.web.exposure.include=* +management.endpoint.health.show-details=always +#management.endpoints.web.base-path=/manage + +management.endpoint.shutdown.enabled=true diff --git "a/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/pom.xml" "b/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/pom.xml" new file mode 100644 index 0000000..b752440 --- /dev/null +++ "b/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/pom.xml" @@ -0,0 +1,53 @@ + + + 4.0.0 + com.neo + spring-boot-admin-simple + 1.0.0.BUILD-SNAPSHOT + + + spring-boot-admin-server + spring-boot-admin-client + + + pom + Spring boot admin + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + Edgware.SR1 + + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + + \ No newline at end of file diff --git "a/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-client/pom.xml" "b/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-client/pom.xml" new file mode 100644 index 0000000..3f456f4 --- /dev/null +++ "b/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-client/pom.xml" @@ -0,0 +1,34 @@ + + + 4.0.0 + + com.neo + spring-boot-admin-simple + 1.0.0.BUILD-SNAPSHOT + + spring-boot-admin-client + jar + + + + de.codecentric + spring-boot-admin-starter-client + 2.1.0 + + + org.springframework.boot + spring-boot-starter-web + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git "a/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-client/src/main/java/com/neo/AdminClientApplication.java" "b/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-client/src/main/java/com/neo/AdminClientApplication.java" new file mode 100644 index 0000000..9494e5e --- /dev/null +++ "b/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-client/src/main/java/com/neo/AdminClientApplication.java" @@ -0,0 +1,12 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class AdminClientApplication { + + public static void main(String[] args) { + SpringApplication.run(AdminClientApplication.class, args); + } +} diff --git "a/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-client/src/main/resources/application.properties" "b/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-client/src/main/resources/application.properties" new file mode 100644 index 0000000..9e406d0 --- /dev/null +++ "b/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-client/src/main/resources/application.properties" @@ -0,0 +1,8 @@ +server.port=8001 +spring.application.name=Admin Client + +management.endpoints.web.exposure.include=* + +spring.boot.admin.client.url=http://localhost:8000 +spring.boot.admin.client.username= admin +spring.boot.admin.client.password= admin \ No newline at end of file diff --git "a/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-client/src/test/java/com/neo/AdminClientApplicationTests.java" "b/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-client/src/test/java/com/neo/AdminClientApplicationTests.java" new file mode 100644 index 0000000..ad4141a --- /dev/null +++ "b/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-client/src/test/java/com/neo/AdminClientApplicationTests.java" @@ -0,0 +1,16 @@ +package com.neo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class AdminClientApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git "a/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-server/pom.xml" "b/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-server/pom.xml" new file mode 100644 index 0000000..4b0c51d --- /dev/null +++ "b/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-server/pom.xml" @@ -0,0 +1,42 @@ + + + 4.0.0 + + com.neo + spring-boot-admin-simple + 1.0.0.BUILD-SNAPSHOT + + spring-boot-admin-server + jar + + + + de.codecentric + spring-boot-admin-starter-server + 2.1.0 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-mail + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git "a/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-server/src/main/java/com/neo/AdminServerApplication.java" "b/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-server/src/main/java/com/neo/AdminServerApplication.java" new file mode 100644 index 0000000..3a34931 --- /dev/null +++ "b/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-server/src/main/java/com/neo/AdminServerApplication.java" @@ -0,0 +1,14 @@ +package com.neo; + +import de.codecentric.boot.admin.server.config.EnableAdminServer; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@EnableAdminServer +@SpringBootApplication +public class AdminServerApplication { + + public static void main(String[] args) { + SpringApplication.run(AdminServerApplication.class, args); + } +} diff --git "a/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-server/src/main/java/com/neo/config/SecuritySecureConfig.java" "b/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-server/src/main/java/com/neo/config/SecuritySecureConfig.java" new file mode 100644 index 0000000..9667a90 --- /dev/null +++ "b/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-server/src/main/java/com/neo/config/SecuritySecureConfig.java" @@ -0,0 +1,41 @@ +package com.neo.config; + +import de.codecentric.boot.admin.server.config.AdminServerProperties; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler; +import org.springframework.security.web.csrf.CookieCsrfTokenRepository; + +@Configuration +public class SecuritySecureConfig extends WebSecurityConfigurerAdapter { + private final String adminContextPath; + + public SecuritySecureConfig(AdminServerProperties adminServerProperties) { + this.adminContextPath = adminServerProperties.getContextPath(); + } + + @Override + protected void configure(HttpSecurity http) throws Exception { + // @formatter:off + SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler(); + successHandler.setTargetUrlParameter("redirectTo"); + successHandler.setDefaultTargetUrl(adminContextPath + "/"); + + http.authorizeRequests() + .antMatchers(adminContextPath + "/assets/**").permitAll() + .antMatchers(adminContextPath + "/login").permitAll() + .anyRequest().authenticated() + .and() + .formLogin().loginPage(adminContextPath + "/login").successHandler(successHandler).and() + .logout().logoutUrl(adminContextPath + "/logout").and() + .httpBasic().and() + .csrf() + .csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()) + .ignoringAntMatchers( + adminContextPath + "/instances", + adminContextPath + "/actuator/**" + ); + // @formatter:on + } +} \ No newline at end of file diff --git "a/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-server/src/main/resources/application.properties" "b/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-server/src/main/resources/application.properties" new file mode 100644 index 0000000..01d3dc4 --- /dev/null +++ "b/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-server/src/main/resources/application.properties" @@ -0,0 +1,13 @@ +server.port=8000 + +spring.mail.host=smtp.qq.com +spring.mail.username=xxx@qq.com +spring.mail.password= +spring.mail.properties.mail.smtp.auth=true +spring.mail.properties.mail.smtp.starttls.enable=true +spring.mail.properties.mail.smtp.starttls.required=true +spring.boot.admin.notify.mail.from=xx@qq.com +spring.boot.admin.notify.mail.to=xxx@qq.com + +spring.security.user.name= admin +spring.security.user.password= admin \ No newline at end of file diff --git "a/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-server/src/test/java/com/neo/AdminServerApplicationTests.java" "b/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-server/src/test/java/com/neo/AdminServerApplicationTests.java" new file mode 100644 index 0000000..6179c4d --- /dev/null +++ "b/\347\254\254 5-3 \350\257\276\357\274\232 Spring Boot Admin \347\232\204\344\275\277\347\224\250/spring-boot-admin/spring-boot-admin-server/src/test/java/com/neo/AdminServerApplicationTests.java" @@ -0,0 +1,16 @@ +package com.neo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class AdminServerApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git "a/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/pom.xml" "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/pom.xml" new file mode 100644 index 0000000..0d83d07 --- /dev/null +++ "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/pom.xml" @@ -0,0 +1,48 @@ + + + 4.0.0 + + com.neo + spring-boot-test + 0.0.1-SNAPSHOT + jar + + spring-boot-test + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git "a/\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-test/src/main/java/com/neo/TestApplication.java" "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/main/java/com/neo/TestApplication.java" similarity index 100% rename from "\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-test/src/main/java/com/neo/TestApplication.java" rename to "\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/main/java/com/neo/TestApplication.java" diff --git "a/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/main/java/com/neo/service/HelloService.java" "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/main/java/com/neo/service/HelloService.java" new file mode 100644 index 0000000..d85a4ff --- /dev/null +++ "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/main/java/com/neo/service/HelloService.java" @@ -0,0 +1,5 @@ +package com.neo.service; + +public interface HelloService { + public void sayHello(); +} diff --git "a/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/main/java/com/neo/service/impl/HelloServieImpl.java" "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/main/java/com/neo/service/impl/HelloServieImpl.java" new file mode 100644 index 0000000..d8687ce --- /dev/null +++ "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/main/java/com/neo/service/impl/HelloServieImpl.java" @@ -0,0 +1,12 @@ +package com.neo.service.impl; + +import com.neo.service.HelloService; +import org.springframework.stereotype.Service; + +@Service +public class HelloServieImpl implements HelloService { + @Override + public void sayHello() { + System.out.println("hello service"); + } +} diff --git "a/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/main/java/com/neo/util/Calculation.java" "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/main/java/com/neo/util/Calculation.java" new file mode 100644 index 0000000..5449629 --- /dev/null +++ "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/main/java/com/neo/util/Calculation.java" @@ -0,0 +1,45 @@ +package com.neo.util; + +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Component +public class Calculation { + + public int add(int a, int b) { + + return a + b; + } + + public int sub(int a, int b) { + + return a - b; + } + public double div(double a, double b) { + + return a / b; + } + + public String getName(String name) { + + return name; + } + + public List getList(String item) { + + List l = new ArrayList(); + l.add(item); + return l; + } + + public Map getMap(String key, String value) { + + Map m = new HashMap(); + m.put(key, value); + return m; + } +} \ No newline at end of file diff --git "a/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/main/java/com/neo/web/HelloController.java" "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/main/java/com/neo/web/HelloController.java" new file mode 100644 index 0000000..26003f6 --- /dev/null +++ "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/main/java/com/neo/web/HelloController.java" @@ -0,0 +1,12 @@ +package com.neo.web; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class HelloController { + @RequestMapping(name="/hello") + public String getHello() { + return "hello web"; + } +} diff --git "a/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/main/resources/application.properties" "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/main/resources/application.properties" new file mode 100644 index 0000000..e69de29 diff --git "a/\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-test/src/test/java/com/neo/TestApplicationTests.java" "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/test/java/com/neo/TestApplicationTests.java" similarity index 100% rename from "\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-test/src/test/java/com/neo/TestApplicationTests.java" rename to "\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/test/java/com/neo/TestApplicationTests.java" diff --git "a/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/test/java/com/neo/junit/CalculationTest.java" "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/test/java/com/neo/junit/CalculationTest.java" new file mode 100644 index 0000000..58df572 --- /dev/null +++ "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/test/java/com/neo/junit/CalculationTest.java" @@ -0,0 +1,69 @@ +package com.neo.junit; + +import com.neo.util.Calculation; +import org.junit.Test; +import static org.junit.Assert.*; +import static org.hamcrest.Matchers.*; +import java.util.List; +import java.util.Map; + +public class CalculationTest { + + @Test + public void test() { + + //一般匹配符 + int s = new Calculation().add(1, 1); + //allOf:所有条件必须都成立,测试才通过 + assertThat(s, allOf(greaterThan(1), lessThan(3))); + //anyOf:只要有一个条件成立,测试就通过 + assertThat(s, anyOf(greaterThan(1), lessThan(1))); + //anything:无论什么条件,测试都通过 + assertThat(s, anything()); + //is:变量的值等于指定值时,测试通过 + assertThat(s, is(2)); + //not:和is相反,变量的值不等于指定值时,测试通过 + assertThat(s, not(1)); + + //数值匹配符 + double d = new Calculation().div(10, 3); + //closeTo:浮点型变量的值在3.0±0.5范围内,测试通过 + assertThat(d, closeTo(3.0, 0.5)); + //greaterThan:变量的值大于指定值时,测试通过 + assertThat(d, greaterThan(3.0)); + //lessThan:变量的值小于指定值时,测试通过 + assertThat(d, lessThan(3.5)); + //greaterThanOrEuqalTo:变量的值大于等于指定值时,测试通过 + assertThat(d, greaterThanOrEqualTo(3.3)); + //lessThanOrEqualTo:变量的值小于等于指定值时,测试通过 + assertThat(d, lessThanOrEqualTo(3.4)); + + //字符串匹配符 + String n = new Calculation().getName("Magci"); + //containsString:字符串变量中包含指定字符串时,测试通过 + assertThat(n, containsString("ci")); + //startsWith:字符串变量以指定字符串开头时,测试通过 + assertThat(n, startsWith("Ma")); + //endsWith:字符串变量以指定字符串结尾时,测试通过 + assertThat(n, endsWith("i")); + //euqalTo:字符串变量等于指定字符串时,测试通过 + assertThat(n, equalTo("Magci")); + //equalToIgnoringCase:字符串变量在忽略大小写的情况下等于指定字符串时,测试通过 + assertThat(n, equalToIgnoringCase("magci")); + //equalToIgnoringWhiteSpace:字符串变量在忽略头尾任意空格的情况下等于指定字符串时,测试通过 + assertThat(n, equalToIgnoringWhiteSpace(" Magci ")); + + //集合匹配符 + List l = new Calculation().getList("Magci"); + //hasItem:Iterable变量中含有指定元素时,测试通过 + assertThat(l, hasItem("Magci")); + + Map m = new Calculation().getMap("mgc", "Magci"); + //hasEntry:Map变量中含有指定键值对时,测试通过 + assertThat(m, hasEntry("mgc", "Magci")); + //hasKey:Map变量中含有指定键时,测试通过 + assertThat(m, hasKey("mgc")); + //hasValue:Map变量中含有指定值时,测试通过 + assertThat(m, hasValue("Magci")); + } +} \ No newline at end of file diff --git "a/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/test/java/com/neo/junit/JUnit4Test.java" "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/test/java/com/neo/junit/JUnit4Test.java" new file mode 100644 index 0000000..882018f --- /dev/null +++ "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/test/java/com/neo/junit/JUnit4Test.java" @@ -0,0 +1,69 @@ +package com.neo.junit; + +import com.neo.util.Calculation; +import org.junit.*; + +import static org.junit.Assert.assertEquals; + + +public class JUnit4Test { + + Calculation calculation = new Calculation();//要测试的类的对象 + + int result;//测试结果 + + //在JUnit4中使用@Test标注为测试方法 + @Test + //测试方法必须是public void的 + public void testAdd() { + System.out.println("---testAdd开始测试---"); + + //每个里面只测一次,因为assertEquals一旦测试发现错误就抛出异常,不再运行后续代码 + result = calculation.add(1, 2); + assertEquals(3, result); + + System.out.println("---testAdd正常运行结束---"); + } + + //又一个测试方法 + //timeout表示测试允许的执行时间毫秒数,expected表示忽略哪些抛出的异常(不会因为该异常导致测试不通过) + @Test(timeout = 1, expected = NullPointerException.class) + public void testSub() { + System.out.println("---testSub开始测试---"); + + result = calculation.sub(3, 2); + assertEquals(1, result); + + throw new NullPointerException(); + + //System.out.println("---testSub正常运行结束---"); + } + + + //指示该[静态方法]将在该类的[所有]测试方法执行之[前]执行 + @BeforeClass + public static void beforeAll() { + System.out.println("||==BeforeClass==||"); + System.out.println("||==通常在这个方法中加载资源==||"); + } + + //指示该[静态方法]将在该类的[所有]测试方法执行之[后]执行 + @AfterClass + public static void afterAll() { + System.out.println("||==AfterClass==||"); + System.out.println("||==通常在这个方法中释放资源==||"); + } + + //该[成员方法]在[每个]测试方法执行之[前]执行 + @Before + public void beforeEvery() { + System.out.println("|==Before==|"); + } + + //该[成员方法]在[每个]测试方法执行之[后]执行 + @After + public void afterEvery() { + System.out.println("|==After==|"); + } + +} diff --git "a/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/test/java/com/neo/simple/HelloServiceTest.java" "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/test/java/com/neo/simple/HelloServiceTest.java" new file mode 100644 index 0000000..7e3098a --- /dev/null +++ "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/test/java/com/neo/simple/HelloServiceTest.java" @@ -0,0 +1,27 @@ +package com.neo.simple; + +import com.neo.service.HelloService; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import javax.annotation.Resource; +import static org.assertj.core.api.Assertions.assertThat; +import org.springframework.boot.test.rule.OutputCapture; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class HelloServiceTest { + @Rule + public OutputCapture outputCapture = new OutputCapture(); + @Resource + HelloService helloService; + + @Test + public void sayHelloTest(){ + helloService.sayHello(); + assertThat(this.outputCapture.toString().contains("hello service")).isTrue(); + } +} diff --git "a/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/test/java/com/neo/simple/HelloTest.java" "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/test/java/com/neo/simple/HelloTest.java" new file mode 100644 index 0000000..e945e03 --- /dev/null +++ "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/test/java/com/neo/simple/HelloTest.java" @@ -0,0 +1,12 @@ +package com.neo.simple; + +import org.junit.Test; + +public class HelloTest { + + @Test + public void hello() { + System.out.println("hello world"); + } + +} diff --git "a/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/test/java/com/neo/web/HelloWebTest.java" "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/test/java/com/neo/web/HelloWebTest.java" new file mode 100644 index 0000000..e26c433 --- /dev/null +++ "b/\347\254\254 5-4 \350\257\276\357\274\232 Spring Boot \345\257\271\346\265\213\350\257\225\347\232\204\346\224\257\346\214\201/spring-boot-test/src/test/java/com/neo/web/HelloWebTest.java" @@ -0,0 +1,55 @@ +package com.neo.web; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.MediaType; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; + +import static org.junit.Assert.*; +import static org.hamcrest.Matchers.*; +import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.*; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + + +@RunWith(SpringRunner.class) +@SpringBootTest +public class HelloWebTest { + private MockMvc mockMvc; + + @Before + public void setUp() throws Exception { + mockMvc = MockMvcBuilders.standaloneSetup(new HelloController()).build(); + } + + @Test + public void testHello() throws Exception { + mockMvc.perform( + MockMvcRequestBuilders.post("/hello") + .accept(MediaType.APPLICATION_JSON_UTF8)) +// .andDo(print()) +// .andExpect(content().string(equalTo("hello web"))); + .andExpect(content().string(containsString("hello"))); +// .andReturn().getResponse().getContentAsString(); + } + + @Test + public void testHelloMore() throws Exception { + final MultiValueMap params = new LinkedMultiValueMap<>(); + params.add("id", "6"); + params.add("hello", "world"); + mockMvc.perform( + MockMvcRequestBuilders.post("/hello") + .params(params) + .contentType(MediaType.APPLICATION_JSON_UTF8) + .accept(MediaType.APPLICATION_JSON_UTF8)) + .andExpect(status().isOk()) + .andExpect(content().string(containsString("hello")));; + } +} diff --git "a/\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-package-war/pom.xml" "b/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/pom.xml" similarity index 85% rename from "\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-package-war/pom.xml" rename to "\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/pom.xml" index ef85381..58d3791 100644 --- "a/\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-package-war/pom.xml" +++ "b/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/pom.xml" @@ -4,23 +4,23 @@ 4.0.0 com.neo - spring-boot-package-war + spring-boot-package 1.0.0 - war + jar - spring-boot-package-war + spring-boot-package Demo project for Spring Boot package war org.springframework.boot spring-boot-starter-parent - 1.5.8.RELEASE + 2.1.0.RELEASE UTF-8 - 1.7 + 1.8 @@ -28,11 +28,11 @@ org.springframework.boot spring-boot-starter-web
- + org.springframework.boot spring-boot-starter-test diff --git "a/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/main/java/com/neo/PackageApplication.java" "b/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/main/java/com/neo/PackageApplication.java" new file mode 100644 index 0000000..6611164 --- /dev/null +++ "b/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/main/java/com/neo/PackageApplication.java" @@ -0,0 +1,19 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; + +@SpringBootApplication +public class PackageApplication extends SpringBootServletInitializer { + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(PackageApplication.class); + } + + public static void main(String[] args) { + SpringApplication.run(PackageApplication.class, args); + } +} diff --git "a/\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-test/src/main/java/com/neo/web/HelloController.java" "b/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/main/java/com/neo/controller/HelloController.java" similarity index 58% rename from "\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-test/src/main/java/com/neo/web/HelloController.java" rename to "\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/main/java/com/neo/controller/HelloController.java" index a1964e0..5e93f0d 100644 --- "a/\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-test/src/main/java/com/neo/web/HelloController.java" +++ "b/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/main/java/com/neo/controller/HelloController.java" @@ -1,19 +1,13 @@ -package com.neo.web; +package com.neo.controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class HelloController { - + @RequestMapping("/hello") public String index() { - return "你好,世界!"; - } - - - @RequestMapping("/sayHi") - public String sayHi(String name) { - return name+ ", 你好!"; + return "Hello World"; } } \ No newline at end of file diff --git "a/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/main/resources/application-dev.properties" "b/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/main/resources/application-dev.properties" new file mode 100644 index 0000000..c83a6aa --- /dev/null +++ "b/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/main/resources/application-dev.properties" @@ -0,0 +1,2 @@ +info.app.name=spring-boot-test +info.app.version= 1.0.0 \ No newline at end of file diff --git "a/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/main/resources/application-pro.properties" "b/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/main/resources/application-pro.properties" new file mode 100644 index 0000000..5bc6c5c --- /dev/null +++ "b/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/main/resources/application-pro.properties" @@ -0,0 +1,2 @@ +info.app.name=spring-boot-pro +info.app.version= 1.0.0 \ No newline at end of file diff --git "a/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/main/resources/application-test.properties" "b/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/main/resources/application-test.properties" new file mode 100644 index 0000000..995c6d2 --- /dev/null +++ "b/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/main/resources/application-test.properties" @@ -0,0 +1,2 @@ +info.app.name=spring-boot-uat +info.app.version= 1.0.0 \ No newline at end of file diff --git "a/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/main/resources/application.properties" "b/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/main/resources/application.properties" new file mode 100644 index 0000000..bba9dfd --- /dev/null +++ "b/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/main/resources/application.properties" @@ -0,0 +1,26 @@ +# \u9879\u76EEcontextPath\uFF0C\u4E00\u822C\u4E0D\u914D\u7F6E +#server.servlet.context-path=/myspringboot +# \u9519\u8BEF\u9875\uFF0C\u6307\u5B9A\u53D1\u751F\u9519\u8BEF\u65F6\uFF0C\u8DF3\u8F6C\u7684URL\u3002 +server.error.path=/error +# \u670D\u52A1\u7AEF\u53E3 +server.port=8080 +# session\u6700\u5927\u8D85\u65F6\u65F6\u95F4(\u5206\u949F)\uFF0C\u9ED8\u8BA4\u4E3A30 +server.session-timeout=60 +# \u8BE5\u670D\u52A1\u7ED1\u5B9AIP\u5730\u5740\uFF0C\u542F\u52A8\u670D\u52A1\u5668\u65F6\u5982\u672C\u673A\u4E0D\u662F\u8BE5IP\u5730\u5740\u5219\u629B\u51FA\u5F02\u5E38\u542F\u52A8\u5931\u8D25\uFF0C\u53EA\u6709\u7279\u6B8A\u9700\u6C42\u7684\u60C5\u51B5\u4E0B\u624D\u914D\u7F6E +#server.address=192.168.0.6 + +# tomcat \u6700\u5927\u7EBF\u7A0B\u6570\uFF0C\u9ED8\u8BA4\u4E3A200 +server.tomcat.max-threads=600 +# tomcat\u7684URI\u7F16\u7801 +server.tomcat.uri-encoding=UTF-8 +# \u5B58\u653ETomcat\u7684\u65E5\u5FD7\u3001Dump\u7B49\u6587\u4EF6\u7684\u4E34\u65F6\u6587\u4EF6\u5939\uFF0C\u9ED8\u8BA4\u4E3A\u7CFB\u7EDF\u7684tmp\u6587\u4EF6\u5939 +server.tomcat.basedir=/tmp/log +# \u6253\u5F00Tomcat\u7684Access\u65E5\u5FD7\uFF0C\u5E76\u53EF\u4EE5\u8BBE\u7F6E\u65E5\u5FD7\u683C\u5F0F +#server.tomcat.access-log-enabled=true +#server.tomcat.access-log-pattern= +# accesslog\u76EE\u5F55\uFF0C\u9ED8\u8BA4\u5728basedir/logs +#server.tomcat.accesslog.directory= +# \u65E5\u5FD7\u6587\u4EF6\u76EE\u5F55 +logging.path=/tmp/log +# \u65E5\u5FD7\u6587\u4EF6\u540D\u79F0\uFF0C\u9ED8\u8BA4\u4E3Aspring.log +logging.file=myapp.log \ No newline at end of file diff --git "a/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/test/java/com/neo/PackageApplicationTests.java" "b/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/test/java/com/neo/PackageApplicationTests.java" new file mode 100644 index 0000000..ff737b9 --- /dev/null +++ "b/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/test/java/com/neo/PackageApplicationTests.java" @@ -0,0 +1,16 @@ +package com.neo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class PackageApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git "a/\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-package-war/src/test/java/com/neo/controller/HelloTests.java" "b/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/test/java/com/neo/controller/HelloTests.java" similarity index 93% rename from "\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-package-war/src/test/java/com/neo/controller/HelloTests.java" rename to "\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/test/java/com/neo/controller/HelloTests.java" index 6c2ce9d..1495439 100644 --- "a/\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-package-war/src/test/java/com/neo/controller/HelloTests.java" +++ "b/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/test/java/com/neo/controller/HelloTests.java" @@ -23,7 +23,7 @@ public class HelloTests { @Before public void setUp() throws Exception { - mvc = MockMvcBuilders.standaloneSetup(new HelloWorldController()).build(); + mvc = MockMvcBuilders.standaloneSetup(new HelloController()).build(); } @Test diff --git "a/\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-package-war/src/test/java/com/neo/controller/HelloWorldControlerTests.java" "b/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/test/java/com/neo/controller/HelloWorldControlerTests.java" similarity index 92% rename from "\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-package-war/src/test/java/com/neo/controller/HelloWorldControlerTests.java" rename to "\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/test/java/com/neo/controller/HelloWorldControlerTests.java" index f005ef6..d8b01a5 100644 --- "a/\347\254\25415\350\257\276\357\274\232Spring Boot \351\233\206\346\210\220\346\265\213\350\257\225\345\222\214\351\203\250\347\275\262\350\277\220\347\273\264/spring-boot-package-war/src/test/java/com/neo/controller/HelloWorldControlerTests.java" +++ "b/\347\254\254 5-5 \350\257\276\357\274\232 \345\246\202\344\275\225\346\211\223\345\214\205\351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-package/src/test/java/com/neo/controller/HelloWorldControlerTests.java" @@ -20,7 +20,7 @@ public class HelloWorldControlerTests { @Before public void setUp() throws Exception { - mvc = MockMvcBuilders.standaloneSetup(new HelloWorldController()).build(); + mvc = MockMvcBuilders.standaloneSetup(new HelloController()).build(); } @Test diff --git "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/pom.xml" "b/\347\254\254 5-6 \350\257\276\357\274\232 \344\275\277\347\224\250 Docker \351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-docker/pom.xml" similarity index 54% rename from "\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/pom.xml" rename to "\347\254\254 5-6 \350\257\276\357\274\232 \344\275\277\347\224\250 Docker \351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-docker/pom.xml" index d3ebaf5..1539028 100644 --- "a/\347\254\25411\350\257\276\357\274\232RabbitMQ \350\257\246\350\247\243/spring-boot-rabbitmq/pom.xml" +++ "b/\347\254\254 5-6 \350\257\276\357\274\232 \344\275\277\347\224\250 Docker \351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-docker/pom.xml" @@ -4,49 +4,35 @@ 4.0.0 com.neo - spring-boot-rabbitmq - 1.0.0 + spring-boot-docker + 1.0 jar - spring-boot-rabbitmq - Demo project for Spring Boot and rabbitmq + spring-boot-docker + Demo project for Spring Boot org.springframework.boot spring-boot-starter-parent - 1.5.8.RELEASE - + 2.1.0.RELEASE UTF-8 1.8 + springboot - - org.springframework.boot - spring-boot-starter - + + org.springframework.boot + spring-boot-starter-web + org.springframework.boot spring-boot-starter-test test - - org.springframework.boot - spring-boot-starter-amqp - - - org.apache.commons - commons-lang3 - 3.6 - - - org.springframework.boot - spring-boot-devtools - true - @@ -54,10 +40,25 @@ org.springframework.boot spring-boot-maven-plugin + + + + com.spotify + docker-maven-plugin + 1.0.0 - true - + ${docker.image.prefix}/${project.artifactId} + src/main/docker + + + / + ${project.build.directory} + ${project.build.finalName}.jar + + + + diff --git "a/\347\254\254 5-6 \350\257\276\357\274\232 \344\275\277\347\224\250 Docker \351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-docker/src/main/docker/Dockerfile" "b/\347\254\254 5-6 \350\257\276\357\274\232 \344\275\277\347\224\250 Docker \351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-docker/src/main/docker/Dockerfile" new file mode 100644 index 0000000..be52a48 --- /dev/null +++ "b/\347\254\254 5-6 \350\257\276\357\274\232 \344\275\277\347\224\250 Docker \351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-docker/src/main/docker/Dockerfile" @@ -0,0 +1,4 @@ +FROM openjdk:8-jdk-alpine +VOLUME /tmp +ADD spring-boot-docker-1.0.jar app.jar +ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] \ No newline at end of file diff --git "a/\347\254\254 5-6 \350\257\276\357\274\232 \344\275\277\347\224\250 Docker \351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-docker/src/main/java/com/neo/DockerApplication.java" "b/\347\254\254 5-6 \350\257\276\357\274\232 \344\275\277\347\224\250 Docker \351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-docker/src/main/java/com/neo/DockerApplication.java" new file mode 100644 index 0000000..d3a0276 --- /dev/null +++ "b/\347\254\254 5-6 \350\257\276\357\274\232 \344\275\277\347\224\250 Docker \351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-docker/src/main/java/com/neo/DockerApplication.java" @@ -0,0 +1,12 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class DockerApplication { + + public static void main(String[] args) { + SpringApplication.run(DockerApplication.class, args); + } +} diff --git "a/\347\254\254 5-6 \350\257\276\357\274\232 \344\275\277\347\224\250 Docker \351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-docker/src/main/java/com/neo/controller/DockerController.java" "b/\347\254\254 5-6 \350\257\276\357\274\232 \344\275\277\347\224\250 Docker \351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-docker/src/main/java/com/neo/controller/DockerController.java" new file mode 100644 index 0000000..8b6ba67 --- /dev/null +++ "b/\347\254\254 5-6 \350\257\276\357\274\232 \344\275\277\347\224\250 Docker \351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-docker/src/main/java/com/neo/controller/DockerController.java" @@ -0,0 +1,13 @@ +package com.neo.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class DockerController { + + @RequestMapping("/") + public String index() { + return "Hello Docker!"; + } +} \ No newline at end of file diff --git "a/\347\254\254 5-6 \350\257\276\357\274\232 \344\275\277\347\224\250 Docker \351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-docker/src/main/resources/application.properties" "b/\347\254\254 5-6 \350\257\276\357\274\232 \344\275\277\347\224\250 Docker \351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-docker/src/main/resources/application.properties" new file mode 100644 index 0000000..e69de29 diff --git "a/\347\254\254 5-6 \350\257\276\357\274\232 \344\275\277\347\224\250 Docker \351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-docker/src/test/java/com/neo/DockerApplicationTests.java" "b/\347\254\254 5-6 \350\257\276\357\274\232 \344\275\277\347\224\250 Docker \351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-docker/src/test/java/com/neo/DockerApplicationTests.java" new file mode 100644 index 0000000..b08b689 --- /dev/null +++ "b/\347\254\254 5-6 \350\257\276\357\274\232 \344\275\277\347\224\250 Docker \351\203\250\347\275\262 Spring Boot \351\241\271\347\233\256/spring-boot-docker/src/test/java/com/neo/DockerApplicationTests.java" @@ -0,0 +1,18 @@ +package com.neo; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class DockerApplicationTests { + + @Test + public void contextLoads() { + System.out.println("hello docker"); + } + +} diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/pom.xml" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/pom.xml" similarity index 89% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/pom.xml" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/pom.xml" index b620e15..e6d2da5 100644 --- "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/pom.xml" +++ "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/pom.xml" @@ -3,11 +3,12 @@ 4.0.0 user-manage user-manage + 1.0 user management system org.springframework.boot spring-boot-starter-parent - 1.5.8.RELEASE + 2.1.0.RELEASE @@ -17,10 +18,6 @@ - - org.springframework.boot - spring-boot-starter - org.springframework.boot spring-boot-starter-web @@ -29,13 +26,21 @@ org.springframework.boot spring-boot-starter-thymeleaf + + nz.net.ultraq.thymeleaf + thymeleaf-layout-dialect + org.springframework.boot spring-boot-starter-data-mongodb - org.springframework.session - spring-session-data-redis + org.springframework.boot + spring-boot-starter-data-redis + + + org.apache.commons + commons-pool2 org.springframework.boot @@ -45,11 +50,6 @@ org.springframework.boot spring-boot-starter-mail - - org.apache.commons - commons-lang3 - 3.6 - org.springframework.boot spring-boot-starter-test diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/UserManageApplication.java" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/UserManageApplication.java" similarity index 88% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/UserManageApplication.java" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/UserManageApplication.java" index ce07ef2..0a8094b 100644 --- "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/UserManageApplication.java" +++ "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/UserManageApplication.java" @@ -3,7 +3,7 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.support.SpringBootServletInitializer; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; @SpringBootApplication diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/config/SessionFilter.java" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/config/SessionFilter.java" similarity index 96% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/config/SessionFilter.java" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/config/SessionFilter.java" index 3bdfd3a..b753f25 100644 --- "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/config/SessionFilter.java" +++ "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/config/SessionFilter.java" @@ -1,9 +1,9 @@ package com.neo.config; -import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.util.StringUtils; import javax.servlet.*; import javax.servlet.annotation.WebFilter; @@ -42,7 +42,7 @@ public void doFilter(ServletRequest srequest, ServletResponse sresponse, return; } String id=(String)request.getSession().getAttribute(WebConfiguration.LOGIN_KEY); - if(StringUtils.isBlank(id)){ + if(StringUtils.isEmpty(id)){ String html = ""; sresponse.getWriter().write(html); }else { diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/config/WebConfiguration.java" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/config/WebConfiguration.java" similarity index 100% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/config/WebConfiguration.java" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/config/WebConfiguration.java" diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/entity/UserEntity.java" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/model/User.java" similarity index 85% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/entity/UserEntity.java" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/model/User.java" index 98c2d06..8e06f26 100644 --- "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/entity/UserEntity.java" +++ "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/model/User.java" @@ -1,12 +1,10 @@ -package com.neo.entity; - -import org.apache.commons.lang3.builder.ToStringBuilder; +package com.neo.model; import java.io.Serializable; import java.util.Date; -public class UserEntity implements Serializable{ +public class User implements Serializable{ private String id; private String userName; private String userType; @@ -80,8 +78,5 @@ public void setState(String state) { this.state = state; } - @Override - public String toString() { - return ToStringBuilder.reflectionToString(this); - } + } diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/param/LoginParam.java" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/param/LoginParam.java" similarity index 72% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/param/LoginParam.java" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/param/LoginParam.java" index e9ab361..3fdfc9f 100644 --- "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/param/LoginParam.java" +++ "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/param/LoginParam.java" @@ -1,9 +1,10 @@ package com.neo.param; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.hibernate.validator.constraints.Email; import org.hibernate.validator.constraints.Length; -import org.hibernate.validator.constraints.NotEmpty; + +import javax.validation.constraints.Max; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotEmpty; import javax.validation.constraints.Max; import javax.validation.constraints.Min; @@ -34,6 +35,9 @@ public void setPassword(String password) { @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + return "LoginParam{" + + "loginName='" + loginName + '\'' + + ", password='" + password + '\'' + + '}'; } } diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/param/RegisterParam.java" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/param/RegisterParam.java" similarity index 76% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/param/RegisterParam.java" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/param/RegisterParam.java" index e419a4a..e7e4eac 100644 --- "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/param/RegisterParam.java" +++ "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/param/RegisterParam.java" @@ -1,12 +1,14 @@ package com.neo.param; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.hibernate.validator.constraints.Email; + + + import org.hibernate.validator.constraints.Length; -import org.hibernate.validator.constraints.NotEmpty; +import javax.validation.constraints.Email; import javax.validation.constraints.Max; import javax.validation.constraints.Min; +import javax.validation.constraints.NotEmpty; public class RegisterParam { @@ -44,6 +46,10 @@ public void setEmail(String email) { @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + return "RegisterParam{" + + "userName='" + userName + '\'' + + ", password='" + password + '\'' + + ", email='" + email + '\'' + + '}'; } } diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/param/UserParam.java" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/param/UserParam.java" similarity index 78% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/param/UserParam.java" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/param/UserParam.java" index 44f1eab..b8b15f7 100644 --- "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/param/UserParam.java" +++ "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/param/UserParam.java" @@ -1,12 +1,12 @@ package com.neo.param; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.hibernate.validator.constraints.Email; + import org.hibernate.validator.constraints.Length; -import org.hibernate.validator.constraints.NotEmpty; +import javax.validation.constraints.Email; import javax.validation.constraints.Max; import javax.validation.constraints.Min; +import javax.validation.constraints.NotEmpty; public class UserParam { @@ -64,6 +64,12 @@ public void setAge(int age) { @Override public String toString() { - return ToStringBuilder.reflectionToString(this); + return "UserParam{" + + "id='" + id + '\'' + + ", userName='" + userName + '\'' + + ", password='" + password + '\'' + + ", email='" + email + '\'' + + ", age=" + age + + '}'; } } diff --git "a/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/repository/UserRepository.java" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/repository/UserRepository.java" new file mode 100644 index 0000000..f0528f6 --- /dev/null +++ "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/repository/UserRepository.java" @@ -0,0 +1,17 @@ +package com.neo.repository; + +import com.neo.model.User; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.mongodb.repository.MongoRepository; + +import java.util.Optional; + +public interface UserRepository extends MongoRepository { + Page findAll(Pageable pageable); + Optional findById(String id); + User findByUserNameOrEmail(String userName, String email); + User findByUserName(String userName); + User findByEmail(String email); + void deleteById(String id); +} \ No newline at end of file diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/web/IndexController.java" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/web/IndexController.java" similarity index 85% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/web/IndexController.java" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/web/IndexController.java" index b1bcbc8..63098d5 100644 --- "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/web/IndexController.java" +++ "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/web/IndexController.java" @@ -1,37 +1,27 @@ package com.neo.web; import com.neo.config.WebConfiguration; -import com.neo.entity.UserEntity; +import com.neo.model.User; import com.neo.param.LoginParam; import com.neo.param.RegisterParam; -import com.neo.param.UserParam; import com.neo.repository.UserRepository; -import org.apache.commons.lang3.StringUtils; -import org.hibernate.validator.constraints.Length; -import org.hibernate.validator.constraints.NotEmpty; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Sort; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; import org.springframework.ui.ModelMap; import org.springframework.validation.BindingResult; import org.springframework.validation.ObjectError; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; import org.thymeleaf.TemplateEngine; import org.thymeleaf.context.Context; +import org.thymeleaf.util.StringUtils; -import javax.mail.MessagingException; import javax.mail.internet.MimeMessage; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; @@ -54,7 +44,7 @@ public class IndexController { @RequestMapping("/") public String index(HttpServletRequest request) { String id = (String) request.getSession().getAttribute(WebConfiguration.LOGIN_KEY); - if (StringUtils.isBlank(id)) { + if (StringUtils.isEmpty(id)) { return "login"; } else { return "redirect:/list"; @@ -77,7 +67,7 @@ public String login(@Valid LoginParam loginParam, BindingResult result, ModelMap model.addAttribute("errorMsg", errorMsg); return "login"; } - UserEntity user = userRepository.findByUserName(loginParam.getLoginName()); + User user = userRepository.findByUserName(loginParam.getLoginName()); if (user == null) { user = userRepository.findByEmail(loginParam.getLoginName()); } @@ -118,12 +108,12 @@ public String register(@Valid RegisterParam registerParam, BindingResult result, model.addAttribute("errorMsg", errorMsg); return "register"; } - UserEntity u = userRepository.findByUserNameOrEmail(registerParam.getUserName(), registerParam.getEmail()); + User u = userRepository.findByUserNameOrEmail(registerParam.getUserName(), registerParam.getEmail()); if (u != null) { model.addAttribute("errorMsg", "用户已存在!"); return "register"; } - UserEntity user = new UserEntity(); + User user = new User(); BeanUtils.copyProperties(registerParam, user); user.setRegTime(new Date()); user.setUserType("manage"); @@ -134,7 +124,7 @@ public String register(@Valid RegisterParam registerParam, BindingResult result, return "login"; } - public void sendRegisterMail(UserEntity user) { + public void sendRegisterMail(User user) { Context context = new Context(); context.setVariable("id", user.getId()); String emailContent = templateEngine.process("emailTemplate", context); @@ -154,7 +144,7 @@ public void sendRegisterMail(UserEntity user) { @RequestMapping("/verified/{id}") public String verified(@PathVariable("id") String id,ModelMap model) { - UserEntity user=userRepository.findById(id); + User user=userRepository.findById(id).get(); if (user!=null && "unverified".equals(user.getState())){ user.setState("verified"); userRepository.save(user); diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/web/UserController.java" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/web/UserController.java" similarity index 88% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/web/UserController.java" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/web/UserController.java" index eb74122..beb7e9a 100644 --- "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/java/com/neo/web/UserController.java" +++ "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/java/com/neo/web/UserController.java" @@ -1,6 +1,6 @@ package com.neo.web; -import com.neo.entity.UserEntity; +import com.neo.model.User; import com.neo.param.UserParam; import com.neo.repository.UserRepository; import org.slf4j.Logger; @@ -35,8 +35,8 @@ public class UserController { public String list(Model model,@RequestParam(value = "page", defaultValue = "0") Integer page, @RequestParam(value = "size", defaultValue = "6") Integer size) { Sort sort = new Sort(Sort.Direction.DESC, "id"); - Pageable pageable = new PageRequest(page, size, sort); - Page users=userRepository.findAll(pageable); + Pageable pageable = PageRequest.of(page, size, sort); + Page users=userRepository.findAll(pageable); model.addAttribute("users", users); logger.info("user list "+ users.getContent()); return "user/list"; @@ -58,12 +58,12 @@ public String add(@Valid UserParam userParam,BindingResult result, ModelMap mode model.addAttribute("errorMsg",errorMsg); return "user/userAdd"; } - UserEntity u= userRepository.findByUserNameOrEmail(userParam.getUserName(),userParam.getEmail()); + User u= userRepository.findByUserNameOrEmail(userParam.getUserName(),userParam.getEmail()); if(u!=null){ model.addAttribute("errorMsg","用户已存在!"); return "user/userAdd"; } - UserEntity user=new UserEntity(); + User user=new User(); BeanUtils.copyProperties(userParam,user); user.setRegTime(new Date()); user.setUserType("user"); @@ -73,7 +73,7 @@ public String add(@Valid UserParam userParam,BindingResult result, ModelMap mode @RequestMapping("/toEdit") public String toEdit(Model model,String id) { - UserEntity user=userRepository.findById(id); + User user=userRepository.findById(id).get(); model.addAttribute("user", user); return "user/userEdit"; } @@ -91,7 +91,7 @@ public String edit(@Valid UserParam userParam, BindingResult result,ModelMap mod return "user/userEdit"; } - UserEntity user=userRepository.findById(userParam.getId()); + User user=userRepository.findById(userParam.getId()).get(); BeanUtils.copyProperties(userParam,user); user.setRegTime(new Date()); userRepository.save(user); @@ -100,7 +100,7 @@ public String edit(@Valid UserParam userParam, BindingResult result,ModelMap mod @RequestMapping("/delete") public String delete(String id) { - userRepository.delete(id); + userRepository.deleteById(id); return "redirect:/list"; } } diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/application.properties" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/application.properties" similarity index 74% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/application.properties" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/application.properties" index 7ea1d27..046be02 100644 --- "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/application.properties" +++ "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/application.properties" @@ -2,28 +2,27 @@ spring.data.mongodb.uri=mongodb://localhost:27017/manage # \u6D4B\u8BD5\u73AF\u5883\u53D6\u6D88thymeleaf\u7F13\u5B58 spring.thymeleaf.cache=false +spring.session.store-type=redis # \u8BBE\u7F6Esession\u5931\u6548\u65F6\u95F4 -server.session-timeout=60 +spring.session.timeout=3600 -spring.redis.database=0 # Redis\u670D\u52A1\u5668\u5730\u5740 spring.redis.host=192.168.0.71 # Redis\u670D\u52A1\u5668\u8FDE\u63A5\u7AEF\u53E3 spring.redis.port=6379 # Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09 spring.redis.password= -# \u8FDE\u63A5\u6C60\u6700\u5927\u8FDE\u63A5\u6570\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09 -spring.redis.pool.max-active=8 -# \u8FDE\u63A5\u6C60\u6700\u5927\u963B\u585E\u7B49\u5F85\u65F6\u95F4\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09 -spring.redis.pool.max-wait=-1 -# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5927\u7A7A\u95F2\u8FDE\u63A5 -spring.redis.pool.max-idle=8 -# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5C0F\u7A7A\u95F2\u8FDE\u63A5 -spring.redis.pool.min-idle=0 +# \u8FDE\u63A5\u6C60\u6700\u5927\u8FDE\u63A5\u6570\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09 \u9ED8\u8BA4 8 +spring.redis.lettuce.pool.max-active=8 +# \u8FDE\u63A5\u6C60\u6700\u5927\u963B\u585E\u7B49\u5F85\u65F6\u95F4\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09 \u9ED8\u8BA4 -1 +spring.redis.lettuce.pool.max-wait=-1 +# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5927\u7A7A\u95F2\u8FDE\u63A5 \u9ED8\u8BA4 8 +spring.redis.lettuce.pool.max-idle=8 +# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5C0F\u7A7A\u95F2\u8FDE\u63A5 \u9ED8\u8BA4 0 +spring.redis.lettuce.pool.min-idle=0 # \u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09 spring.redis.timeout=0 - spring.mail.host=smtp.126.com spring.mail.username=youremail@126.com spring.mail.password=yourpass diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/static/css/bootstrap.css" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/static/css/bootstrap.css" similarity index 100% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/static/css/bootstrap.css" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/static/css/bootstrap.css" diff --git "a/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/static/css/main.css" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/static/css/main.css" new file mode 100644 index 0000000..8476f71 --- /dev/null +++ "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/static/css/main.css" @@ -0,0 +1,4 @@ + +header { + height: 60px; +} \ No newline at end of file diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/static/js/jquery.js" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/static/js/jquery.js" similarity index 100% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/static/js/jquery.js" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/static/js/jquery.js" diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/emailTemplate.html" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/emailTemplate.html" similarity index 100% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/emailTemplate.html" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/emailTemplate.html" diff --git "a/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/layout.html" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/layout.html" new file mode 100644 index 0000000..83ea755 --- /dev/null +++ "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/layout.html" @@ -0,0 +1,15 @@ + + + + + comm title + + + + +
+ + +
+ + \ No newline at end of file diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/layout/footer.html" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/layout/footer.html" similarity index 67% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/layout/footer.html" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/layout/footer.html" index 7cb482a..79bd1b9 100644 --- "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/layout/footer.html" +++ "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/layout/footer.html" @@ -6,8 +6,7 @@
-

纯洁的微笑@2017

+

© 2018-2020 版权所有 纯洁的微笑

- \ No newline at end of file diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/layout/header.html" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/layout/header.html" similarity index 92% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/layout/header.html" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/layout/header.html" index c06bdc0..350d7f9 100644 --- "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/layout/header.html" +++ "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/layout/header.html" @@ -6,7 +6,7 @@
-
+
欢迎登录, ! 退出
diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/login.html" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/login.html" similarity index 100% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/login.html" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/login.html" diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/page.html" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/page.html" similarity index 98% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/page.html" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/page.html" index ff662ca..82b03a0 100644 --- "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/page.html" +++ "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/page.html" @@ -2,7 +2,7 @@ + layout:decorate="page">
diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/register.html" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/register.html" similarity index 100% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/register.html" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/register.html" diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/user/list.html" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/user/list.html" similarity index 77% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/user/list.html" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/user/list.html" index 3333756..1cce4ac 100644 --- "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/user/list.html" +++ "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/user/list.html" @@ -1,13 +1,12 @@ - - + + + + 用户列表 + -
- - - 用户列表 - - - + + +

用户列表



@@ -45,8 +44,7 @@

用户列表

添加
- - -
+
+ diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/user/userAdd.html" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/user/userAdd.html" similarity index 83% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/user/userAdd.html" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/user/userAdd.html" index d08eae1..4a25916 100644 --- "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/user/userAdd.html" +++ "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/user/userAdd.html" @@ -1,13 +1,11 @@ - - + + + +添加用户 + -
- - - user - - - + +

添加用户



@@ -58,7 +56,7 @@

添加用户

- -
+
+ diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/user/userEdit.html" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/user/userEdit.html" similarity index 83% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/user/userEdit.html" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/user/userEdit.html" index bfd9c7e..225fee9 100644 --- "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/user/userEdit.html" +++ "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/user/userEdit.html" @@ -1,13 +1,11 @@ - - + + + + 修改用户 + -
- - - user - - - + +

修改用户



@@ -58,7 +56,7 @@

修改用户

- -
+ + diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/verified.html" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/verified.html" similarity index 100% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/main/resources/templates/verified.html" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/main/resources/templates/verified.html" diff --git "a/\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/test/java/com/neo/UserManageApplicationTests.java" "b/\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/test/java/com/neo/UserManageApplicationTests.java" similarity index 100% rename from "\347\254\25416\350\257\276\357\274\232\347\273\274\345\220\210\345\256\236\346\210\230\347\224\250\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237/user-manage/src/test/java/com/neo/UserManageApplicationTests.java" rename to "\347\254\254 5-7 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\270\200\357\274\211/user-manage/src/test/java/com/neo/UserManageApplicationTests.java" diff --git "a/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/pom.xml" "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/pom.xml" new file mode 100644 index 0000000..36a091a --- /dev/null +++ "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/pom.xml" @@ -0,0 +1,92 @@ + + + 4.0.0 + user-manage-plus + 1.0 + user-manage-plus + user management system + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + UTF-8 + UTF-8 + 1.8 + springboot + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + nz.net.ultraq.thymeleaf + thymeleaf-layout-dialect + + + org.springframework.boot + spring-boot-starter-data-mongodb + + + org.springframework.boot + spring-boot-starter-data-redis + + + org.apache.commons + commons-pool2 + + + org.springframework.boot + spring-boot-starter-cache + + + org.springframework.boot + spring-boot-starter-mail + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-devtools + true + + + + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + + com.spotify + docker-maven-plugin + 1.0.0 + + ${docker.image.prefix}/${project.artifactId} + src/main/docker + + + / + ${project.build.directory} + ${project.build.finalName}.jar + + + + + + + \ No newline at end of file diff --git "a/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/docker/Dockerfile" "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/docker/Dockerfile" new file mode 100644 index 0000000..5832543 --- /dev/null +++ "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/docker/Dockerfile" @@ -0,0 +1,4 @@ +FROM openjdk:8-jdk-alpine +VOLUME /tmp +ADD user-manage-plus-1.0.jar app.jar +ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] \ No newline at end of file diff --git "a/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/UserPlusManageApplication.java" "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/UserPlusManageApplication.java" new file mode 100644 index 0000000..3aa1e1a --- /dev/null +++ "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/UserPlusManageApplication.java" @@ -0,0 +1,20 @@ +package com.neo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; + + +@SpringBootApplication +public class UserPlusManageApplication extends SpringBootServletInitializer { + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(UserPlusManageApplication.class); + } + + public static void main(String[] args) throws Exception { + SpringApplication.run(UserPlusManageApplication.class, args); + } +} + diff --git "a/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/config/GlobalExceptionHandler.java" "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/config/GlobalExceptionHandler.java" new file mode 100644 index 0000000..71cbda5 --- /dev/null +++ "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/config/GlobalExceptionHandler.java" @@ -0,0 +1,26 @@ +package com.neo.config; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; + +@ControllerAdvice +public class GlobalExceptionHandler { + protected Logger logger = LoggerFactory.getLogger(this.getClass()); + public static final String DEFAULT_ERROR_VIEW = "error"; + + @ExceptionHandler(value = Exception.class) + public ModelAndView defaultErrorHandler(Exception e, HttpServletRequest request) throws Exception { + logger.info("request url:" + request.getRequestURL()); + ModelAndView mav = new ModelAndView(); + mav.addObject("exception", e); + mav.addObject("url", request.getRequestURL()); + logger.error("exception:",e); + mav.setViewName(DEFAULT_ERROR_VIEW); + return mav; + } +} \ No newline at end of file diff --git "a/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/config/SessionFilter.java" "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/config/SessionFilter.java" new file mode 100644 index 0000000..b753f25 --- /dev/null +++ "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/config/SessionFilter.java" @@ -0,0 +1,66 @@ +package com.neo.config; + + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.util.StringUtils; + +import javax.servlet.*; +import javax.servlet.annotation.WebFilter; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +public class SessionFilter implements Filter { + protected Logger log = LoggerFactory.getLogger(SessionFilter.class); + // 不登陆也可以访问的资源 + private static Set GreenUrlSet = new HashSet(); + + public void doFilter(ServletRequest srequest, ServletResponse sresponse, + FilterChain filterChain) throws IOException, ServletException { + HttpServletRequest request = (HttpServletRequest) srequest; + String uri = request.getRequestURI(); + sresponse.setCharacterEncoding("UTF-8");//设置响应编码格式 + sresponse.setContentType("text/html;charset=UTF-8");//设置响应编码格式 + if (uri.endsWith(".js") + || uri.endsWith(".css") + || uri.endsWith(".jpg") + || uri.endsWith(".gif") + || uri.endsWith(".png") + || uri.endsWith(".ico")) { + log.debug("security filter, pass, " + request.getRequestURI()); + filterChain.doFilter(srequest, sresponse); + return; + } + + System.out.println("request uri is : "+uri); + //不处理指定的action, jsp + if (GreenUrlSet.contains(uri) || uri.contains("/verified/")) { + log.debug("security filter, pass, " + request.getRequestURI()); + filterChain.doFilter(srequest, sresponse); + return; + } + String id=(String)request.getSession().getAttribute(WebConfiguration.LOGIN_KEY); + if(StringUtils.isEmpty(id)){ + String html = ""; + sresponse.getWriter().write(html); + }else { + filterChain.doFilter(srequest, sresponse); + } + } + + public void destroy() { + + } + + @Override + public void init(FilterConfig filterconfig) throws ServletException { + GreenUrlSet.add("/toRegister"); + GreenUrlSet.add("/toLogin"); + GreenUrlSet.add("/login"); + GreenUrlSet.add("/loginOut"); + GreenUrlSet.add("/register"); + GreenUrlSet.add("/verified"); + } +} diff --git "a/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/config/WebConfiguration.java" "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/config/WebConfiguration.java" new file mode 100644 index 0000000..43f2a41 --- /dev/null +++ "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/config/WebConfiguration.java" @@ -0,0 +1,31 @@ +package com.neo.config; + +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.servlet.Filter; + +@Configuration +public class WebConfiguration { + + public static final String LOGIN_KEY="LOGIN_SESSION_KEY"; + public static final String LOGIN_USER="LOGIN_SESSION_USER"; + + @Bean(name = "sessionFilter") + public Filter sessionFilter() { + return new SessionFilter(); + } + + @Bean + public FilterRegistrationBean testFilterRegistration() { + + FilterRegistrationBean registration = new FilterRegistrationBean(); + registration.setFilter(sessionFilter()); + registration.addUrlPatterns("/*"); + registration.addInitParameter("paramName", "paramValue"); + registration.setName("sessionFilter"); + registration.setOrder(1); + return registration; + } +} \ No newline at end of file diff --git "a/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/model/User.java" "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/model/User.java" new file mode 100644 index 0000000..8e06f26 --- /dev/null +++ "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/model/User.java" @@ -0,0 +1,82 @@ +package com.neo.model; + + +import java.io.Serializable; +import java.util.Date; + +public class User implements Serializable{ + private String id; + private String userName; + private String userType; + private String password; + private String email; + private int age; + private Date regTime; + private String state; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getUserType() { + return userType; + } + + public void setUserType(String userType) { + this.userType = userType; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + public Date getRegTime() { + return regTime; + } + + public void setRegTime(Date regTime) { + this.regTime = regTime; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + +} diff --git "a/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/param/LoginParam.java" "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/param/LoginParam.java" new file mode 100644 index 0000000..3fdfc9f --- /dev/null +++ "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/param/LoginParam.java" @@ -0,0 +1,43 @@ +package com.neo.param; + +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.Max; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotEmpty; + +import javax.validation.constraints.Max; +import javax.validation.constraints.Min; + + +public class LoginParam { + @NotEmpty(message="姓名不能为空") + private String loginName; + @NotEmpty(message="密码不能为空") + @Length(min=6,message="密码长度不能小于6位") + private String password; + + public String getLoginName() { + return loginName; + } + + public void setLoginName(String loginName) { + this.loginName = loginName; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public String toString() { + return "LoginParam{" + + "loginName='" + loginName + '\'' + + ", password='" + password + '\'' + + '}'; + } +} diff --git "a/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/param/RegisterParam.java" "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/param/RegisterParam.java" new file mode 100644 index 0000000..e7e4eac --- /dev/null +++ "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/param/RegisterParam.java" @@ -0,0 +1,55 @@ +package com.neo.param; + + + + +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.Email; +import javax.validation.constraints.Max; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotEmpty; + + +public class RegisterParam { + @NotEmpty(message="姓名不能为空") + private String userName; + @NotEmpty(message="密码不能为空") + @Length(min=6,message="密码长度不能小于6位") + private String password; + @Email + private String email; + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + @Override + public String toString() { + return "RegisterParam{" + + "userName='" + userName + '\'' + + ", password='" + password + '\'' + + ", email='" + email + '\'' + + '}'; + } +} diff --git "a/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/param/UserParam.java" "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/param/UserParam.java" new file mode 100644 index 0000000..b8b15f7 --- /dev/null +++ "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/param/UserParam.java" @@ -0,0 +1,75 @@ +package com.neo.param; + + +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.Email; +import javax.validation.constraints.Max; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotEmpty; + + +public class UserParam { + private String id; + @NotEmpty(message="姓名不能为空") + private String userName; + @NotEmpty(message="密码不能为空") + @Length(min=6,message="密码长度不能小于6位") + private String password; + @Email + private String email; + @Max(value = 100, message = "年龄不能大于100岁") + @Min(value= 18 ,message= "必须年满18岁!" ) + private int age; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + @Override + public String toString() { + return "UserParam{" + + "id='" + id + '\'' + + ", userName='" + userName + '\'' + + ", password='" + password + '\'' + + ", email='" + email + '\'' + + ", age=" + age + + '}'; + } +} diff --git "a/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/repository/UserRepository.java" "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/repository/UserRepository.java" new file mode 100644 index 0000000..f0528f6 --- /dev/null +++ "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/repository/UserRepository.java" @@ -0,0 +1,17 @@ +package com.neo.repository; + +import com.neo.model.User; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.mongodb.repository.MongoRepository; + +import java.util.Optional; + +public interface UserRepository extends MongoRepository { + Page findAll(Pageable pageable); + Optional findById(String id); + User findByUserNameOrEmail(String userName, String email); + User findByUserName(String userName); + User findByEmail(String email); + void deleteById(String id); +} \ No newline at end of file diff --git "a/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/web/IndexController.java" "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/web/IndexController.java" new file mode 100644 index 0000000..32d5838 --- /dev/null +++ "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/web/IndexController.java" @@ -0,0 +1,158 @@ +package com.neo.web; + +import com.neo.config.WebConfiguration; +import com.neo.model.User; +import com.neo.param.LoginParam; +import com.neo.param.RegisterParam; +import com.neo.repository.UserRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.mail.javamail.JavaMailSender; +import org.springframework.mail.javamail.MimeMessageHelper; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.validation.BindingResult; +import org.springframework.validation.ObjectError; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.thymeleaf.TemplateEngine; +import org.thymeleaf.context.Context; +import org.thymeleaf.util.StringUtils; + +import javax.mail.internet.MimeMessage; +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; +import java.util.Date; +import java.util.List; + +@Controller +public class IndexController { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + @Autowired + private UserRepository userRepository; + @Autowired + private TemplateEngine templateEngine; + @Autowired + private JavaMailSender mailSender; + + @Value("${spring.mail.username}") + private String from; + + @RequestMapping("/") + public String index(HttpServletRequest request) { + String id = (String) request.getSession().getAttribute(WebConfiguration.LOGIN_KEY); + if (StringUtils.isEmpty(id)) { + return "login"; + } else { + return "redirect:/list"; + } + } + + @RequestMapping("/toLogin") + public String toLogin() { + /* if (true) + throw new RuntimeException("test");*/ + return "login"; + } + + @RequestMapping("/login") + public String login(@Valid LoginParam loginParam, BindingResult result, ModelMap model, HttpServletRequest request) { + String errorMsg = ""; + if (result.hasErrors()) { + List list = result.getAllErrors(); + for (ObjectError error : list) { + errorMsg = errorMsg + error.getCode() + "-" + error.getDefaultMessage() + ";"; + } + model.addAttribute("errorMsg", errorMsg); + return "login"; + } + User user = userRepository.findByUserName(loginParam.getLoginName()); + if (user == null) { + user = userRepository.findByEmail(loginParam.getLoginName()); + } + if (user == null) { + model.addAttribute("errorMsg", "用户名不存在!"); + return "login"; + } else if (!user.getPassword().equals(loginParam.getPassword())) { + model.addAttribute("errorMsg", "密码错误!"); + return "login"; + } + + request.getSession().setAttribute(WebConfiguration.LOGIN_KEY, user.getId()); + request.getSession().setAttribute(WebConfiguration.LOGIN_USER, user); + return "redirect:/list"; + } + + @RequestMapping("/loginOut") + public String loginOut(HttpServletRequest request) { + request.getSession().removeAttribute(WebConfiguration.LOGIN_KEY); + request.getSession().removeAttribute(WebConfiguration.LOGIN_USER); + return "login"; + } + + @RequestMapping("/toRegister") + public String toRegister() { + return "register"; + } + + @RequestMapping("/register") + public String register(@Valid RegisterParam registerParam, BindingResult result, ModelMap model) { + logger.info("register param"+ registerParam.toString()); + String errorMsg = ""; + if (result.hasErrors()) { + List list = result.getAllErrors(); + for (ObjectError error : list) { + errorMsg = errorMsg + error.getCode() + "-" + error.getDefaultMessage() + ";"; + } + model.addAttribute("errorMsg", errorMsg); + return "register"; + } + User u = userRepository.findByUserNameOrEmail(registerParam.getUserName(), registerParam.getEmail()); + if (u != null) { + model.addAttribute("errorMsg", "用户已存在!"); + return "register"; + } + User user = new User(); + BeanUtils.copyProperties(registerParam, user); + user.setRegTime(new Date()); + user.setUserType("manage"); + user.setState("unverified"); + userRepository.save(user); + sendRegisterMail(user); + logger.info("register user "+ user.toString()); + return "login"; + } + + public void sendRegisterMail(User user) { + Context context = new Context(); + context.setVariable("id", user.getId()); + String emailContent = templateEngine.process("emailTemplate", context); + MimeMessage message = mailSender.createMimeMessage(); + try { + MimeMessageHelper helper = new MimeMessageHelper(message, true); + helper.setFrom(from); + helper.setTo(user.getEmail()); + helper.setSubject("注册验证邮件"); + helper.setText(emailContent, true); + mailSender.send(message); + } catch (Exception e) { + logger.error("发送注册邮件时异常!", e); + } + } + + + @RequestMapping("/verified/{id}") + public String verified(@PathVariable("id") String id,ModelMap model) { + User user=userRepository.findById(id).get(); + if (user!=null && "unverified".equals(user.getState())){ + user.setState("verified"); + userRepository.save(user); + model.put("userName",user.getUserName()); + } + return "verified"; + } + +} diff --git "a/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/web/UserController.java" "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/web/UserController.java" new file mode 100644 index 0000000..beb7e9a --- /dev/null +++ "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/java/com/neo/web/UserController.java" @@ -0,0 +1,106 @@ +package com.neo.web; + +import com.neo.model.User; +import com.neo.param.UserParam; +import com.neo.repository.UserRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.ui.ModelMap; +import org.springframework.validation.BindingResult; +import org.springframework.validation.ObjectError; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; + +import javax.validation.Valid; +import java.util.Date; +import java.util.List; + +@Controller +public class UserController { + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + @Autowired + private UserRepository userRepository; + + @RequestMapping("/list") + @Cacheable(value="user_list") + public String list(Model model,@RequestParam(value = "page", defaultValue = "0") Integer page, + @RequestParam(value = "size", defaultValue = "6") Integer size) { + Sort sort = new Sort(Sort.Direction.DESC, "id"); + Pageable pageable = PageRequest.of(page, size, sort); + Page users=userRepository.findAll(pageable); + model.addAttribute("users", users); + logger.info("user list "+ users.getContent()); + return "user/list"; + } + + @RequestMapping("/toAdd") + public String toAdd() { + return "user/userAdd"; + } + + @RequestMapping("/add") + public String add(@Valid UserParam userParam,BindingResult result, ModelMap model) { + String errorMsg=""; + if(result.hasErrors()) { + List list = result.getAllErrors(); + for (ObjectError error : list) { + errorMsg=errorMsg + error.getCode() + "-" + error.getDefaultMessage() +";"; + } + model.addAttribute("errorMsg",errorMsg); + return "user/userAdd"; + } + User u= userRepository.findByUserNameOrEmail(userParam.getUserName(),userParam.getEmail()); + if(u!=null){ + model.addAttribute("errorMsg","用户已存在!"); + return "user/userAdd"; + } + User user=new User(); + BeanUtils.copyProperties(userParam,user); + user.setRegTime(new Date()); + user.setUserType("user"); + userRepository.save(user); + return "redirect:/list"; + } + + @RequestMapping("/toEdit") + public String toEdit(Model model,String id) { + User user=userRepository.findById(id).get(); + model.addAttribute("user", user); + return "user/userEdit"; + } + + @RequestMapping("/edit") + public String edit(@Valid UserParam userParam, BindingResult result,ModelMap model) { + String errorMsg=""; + if(result.hasErrors()) { + List list = result.getAllErrors(); + for (ObjectError error : list) { + errorMsg=errorMsg + error.getCode() + "-" + error.getDefaultMessage() +";"; + } + model.addAttribute("errorMsg",errorMsg); + model.addAttribute("user", userParam); + return "user/userEdit"; + } + + User user=userRepository.findById(userParam.getId()).get(); + BeanUtils.copyProperties(userParam,user); + user.setRegTime(new Date()); + userRepository.save(user); + return "redirect:/list"; + } + + @RequestMapping("/delete") + public String delete(String id) { + userRepository.deleteById(id); + return "redirect:/list"; + } +} diff --git "a/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/resources/application.properties" "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/resources/application.properties" new file mode 100644 index 0000000..ad0ad51 --- /dev/null +++ "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/resources/application.properties" @@ -0,0 +1,30 @@ +# mongodb \u914D\u7F6E +spring.data.mongodb.uri=mongodb://192.168.0.75:20000/manage +#spring.data.mongodb.uri=mongodb://localhost:27017/manage +# \u6D4B\u8BD5\u73AF\u5883\u53D6\u6D88thymeleaf\u7F13\u5B58 +spring.thymeleaf.cache=false +spring.session.store-type=redis +# \u8BBE\u7F6Esession\u5931\u6548\u65F6\u95F4 +spring.session.timeout=3600 + +# Redis\u670D\u52A1\u5668\u5730\u5740 +spring.redis.host=192.168.0.71 +# Redis\u670D\u52A1\u5668\u8FDE\u63A5\u7AEF\u53E3 +spring.redis.port=6379 +# Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09 +spring.redis.password= +# \u8FDE\u63A5\u6C60\u6700\u5927\u8FDE\u63A5\u6570\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09 \u9ED8\u8BA4 8 +spring.redis.lettuce.pool.max-active=8 +# \u8FDE\u63A5\u6C60\u6700\u5927\u963B\u585E\u7B49\u5F85\u65F6\u95F4\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09 \u9ED8\u8BA4 -1 +spring.redis.lettuce.pool.max-wait=-1 +# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5927\u7A7A\u95F2\u8FDE\u63A5 \u9ED8\u8BA4 8 +spring.redis.lettuce.pool.max-idle=8 +# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5C0F\u7A7A\u95F2\u8FDE\u63A5 \u9ED8\u8BA4 0 +spring.redis.lettuce.pool.min-idle=0 +# \u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09 +spring.redis.timeout=0 + +spring.mail.host=smtp.126.com +spring.mail.username=youremail@126.com +spring.mail.password=yourpass +spring.mail.default-encoding=UTF-8 diff --git "a/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/resources/static/css/bootstrap.css" "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/resources/static/css/bootstrap.css" new file mode 100644 index 0000000..58b7b39 --- /dev/null +++ "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/resources/static/css/bootstrap.css" @@ -0,0 +1,6757 @@ +/*! + * Bootstrap v3.3.6 (http://getbootstrap.com) + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ +/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ +html { + font-family: sans-serif; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} +body { + margin: 0; +} +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block; +} +audio, +canvas, +progress, +video { + display: inline-block; + vertical-align: baseline; +} +audio:not([controls]) { + display: none; + height: 0; +} +[hidden], +template { + display: none; +} +a { + background-color: transparent; +} +a:active, +a:hover { + outline: 0; +} +abbr[title] { + border-bottom: 1px dotted; +} +b, +strong { + font-weight: bold; +} +dfn { + font-style: italic; +} +h1 { + margin: .67em 0; + font-size: 2em; +} +mark { + color: #000; + background: #ff0; +} +small { + font-size: 80%; +} +sub, +sup { + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; +} +sup { + top: -.5em; +} +sub { + bottom: -.25em; +} +img { + border: 0; +} +svg:not(:root) { + overflow: hidden; +} +figure { + margin: 1em 40px; +} +hr { + height: 0; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +pre { + overflow: auto; +} +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} +button, +input, +optgroup, +select, +textarea { + margin: 0; + font: inherit; + color: inherit; +} +button { + overflow: visible; +} +button, +select { + text-transform: none; +} +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; +} +button[disabled], +html input[disabled] { + cursor: default; +} +button::-moz-focus-inner, +input::-moz-focus-inner { + padding: 0; + border: 0; +} +input { + line-height: normal; +} +input[type="checkbox"], +input[type="radio"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 0; +} +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} +input[type="search"] { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + -webkit-appearance: textfield; +} +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +fieldset { + padding: .35em .625em .75em; + margin: 0 2px; + border: 1px solid #c0c0c0; +} +legend { + padding: 0; + border: 0; +} +textarea { + overflow: auto; +} +optgroup { + font-weight: bold; +} +table { + border-spacing: 0; + border-collapse: collapse; +} +td, +th { + padding: 0; +} +/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ +@media print { + *, + *:before, + *:after { + color: #000 !important; + text-shadow: none !important; + background: transparent !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; + } + a, + a:visited { + text-decoration: underline; + } + a[href]:after { + content: " (" attr(href) ")"; + } + abbr[title]:after { + content: " (" attr(title) ")"; + } + a[href^="#"]:after, + a[href^="javascript:"]:after { + content: ""; + } + pre, + blockquote { + border: 1px solid #999; + + page-break-inside: avoid; + } + thead { + display: table-header-group; + } + tr, + img { + page-break-inside: avoid; + } + img { + max-width: 100% !important; + } + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + h2, + h3 { + page-break-after: avoid; + } + .navbar { + display: none; + } + .btn > .caret, + .dropup > .btn > .caret { + border-top-color: #000 !important; + } + .label { + border: 1px solid #000; + } + .table { + border-collapse: collapse !important; + } + .table td, + .table th { + background-color: #fff !important; + } + .table-bordered th, + .table-bordered td { + border: 1px solid #ddd !important; + } +} +@font-face { + font-family: 'Glyphicons Halflings'; +} +.glyphicon { + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: normal; + line-height: 1; + + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.glyphicon-asterisk:before { + content: "\002a"; +} +.glyphicon-plus:before { + content: "\002b"; +} +.glyphicon-euro:before, +.glyphicon-eur:before { + content: "\20ac"; +} +.glyphicon-minus:before { + content: "\2212"; +} +.glyphicon-cloud:before { + content: "\2601"; +} +.glyphicon-envelope:before { + content: "\2709"; +} +.glyphicon-pencil:before { + content: "\270f"; +} +.glyphicon-glass:before { + content: "\e001"; +} +.glyphicon-music:before { + content: "\e002"; +} +.glyphicon-search:before { + content: "\e003"; +} +.glyphicon-heart:before { + content: "\e005"; +} +.glyphicon-star:before { + content: "\e006"; +} +.glyphicon-star-empty:before { + content: "\e007"; +} +.glyphicon-user:before { + content: "\e008"; +} +.glyphicon-film:before { + content: "\e009"; +} +.glyphicon-th-large:before { + content: "\e010"; +} +.glyphicon-th:before { + content: "\e011"; +} +.glyphicon-th-list:before { + content: "\e012"; +} +.glyphicon-ok:before { + content: "\e013"; +} +.glyphicon-remove:before { + content: "\e014"; +} +.glyphicon-zoom-in:before { + content: "\e015"; +} +.glyphicon-zoom-out:before { + content: "\e016"; +} +.glyphicon-off:before { + content: "\e017"; +} +.glyphicon-signal:before { + content: "\e018"; +} +.glyphicon-cog:before { + content: "\e019"; +} +.glyphicon-trash:before { + content: "\e020"; +} +.glyphicon-home:before { + content: "\e021"; +} +.glyphicon-file:before { + content: "\e022"; +} +.glyphicon-time:before { + content: "\e023"; +} +.glyphicon-road:before { + content: "\e024"; +} +.glyphicon-download-alt:before { + content: "\e025"; +} +.glyphicon-download:before { + content: "\e026"; +} +.glyphicon-upload:before { + content: "\e027"; +} +.glyphicon-inbox:before { + content: "\e028"; +} +.glyphicon-play-circle:before { + content: "\e029"; +} +.glyphicon-repeat:before { + content: "\e030"; +} +.glyphicon-refresh:before { + content: "\e031"; +} +.glyphicon-list-alt:before { + content: "\e032"; +} +.glyphicon-lock:before { + content: "\e033"; +} +.glyphicon-flag:before { + content: "\e034"; +} +.glyphicon-headphones:before { + content: "\e035"; +} +.glyphicon-volume-off:before { + content: "\e036"; +} +.glyphicon-volume-down:before { + content: "\e037"; +} +.glyphicon-volume-up:before { + content: "\e038"; +} +.glyphicon-qrcode:before { + content: "\e039"; +} +.glyphicon-barcode:before { + content: "\e040"; +} +.glyphicon-tag:before { + content: "\e041"; +} +.glyphicon-tags:before { + content: "\e042"; +} +.glyphicon-book:before { + content: "\e043"; +} +.glyphicon-bookmark:before { + content: "\e044"; +} +.glyphicon-print:before { + content: "\e045"; +} +.glyphicon-camera:before { + content: "\e046"; +} +.glyphicon-font:before { + content: "\e047"; +} +.glyphicon-bold:before { + content: "\e048"; +} +.glyphicon-italic:before { + content: "\e049"; +} +.glyphicon-text-height:before { + content: "\e050"; +} +.glyphicon-text-width:before { + content: "\e051"; +} +.glyphicon-align-left:before { + content: "\e052"; +} +.glyphicon-align-center:before { + content: "\e053"; +} +.glyphicon-align-right:before { + content: "\e054"; +} +.glyphicon-align-justify:before { + content: "\e055"; +} +.glyphicon-list:before { + content: "\e056"; +} +.glyphicon-indent-left:before { + content: "\e057"; +} +.glyphicon-indent-right:before { + content: "\e058"; +} +.glyphicon-facetime-video:before { + content: "\e059"; +} +.glyphicon-picture:before { + content: "\e060"; +} +.glyphicon-map-marker:before { + content: "\e062"; +} +.glyphicon-adjust:before { + content: "\e063"; +} +.glyphicon-tint:before { + content: "\e064"; +} +.glyphicon-edit:before { + content: "\e065"; +} +.glyphicon-share:before { + content: "\e066"; +} +.glyphicon-check:before { + content: "\e067"; +} +.glyphicon-move:before { + content: "\e068"; +} +.glyphicon-step-backward:before { + content: "\e069"; +} +.glyphicon-fast-backward:before { + content: "\e070"; +} +.glyphicon-backward:before { + content: "\e071"; +} +.glyphicon-play:before { + content: "\e072"; +} +.glyphicon-pause:before { + content: "\e073"; +} +.glyphicon-stop:before { + content: "\e074"; +} +.glyphicon-forward:before { + content: "\e075"; +} +.glyphicon-fast-forward:before { + content: "\e076"; +} +.glyphicon-step-forward:before { + content: "\e077"; +} +.glyphicon-eject:before { + content: "\e078"; +} +.glyphicon-chevron-left:before { + content: "\e079"; +} +.glyphicon-chevron-right:before { + content: "\e080"; +} +.glyphicon-plus-sign:before { + content: "\e081"; +} +.glyphicon-minus-sign:before { + content: "\e082"; +} +.glyphicon-remove-sign:before { + content: "\e083"; +} +.glyphicon-ok-sign:before { + content: "\e084"; +} +.glyphicon-question-sign:before { + content: "\e085"; +} +.glyphicon-info-sign:before { + content: "\e086"; +} +.glyphicon-screenshot:before { + content: "\e087"; +} +.glyphicon-remove-circle:before { + content: "\e088"; +} +.glyphicon-ok-circle:before { + content: "\e089"; +} +.glyphicon-ban-circle:before { + content: "\e090"; +} +.glyphicon-arrow-left:before { + content: "\e091"; +} +.glyphicon-arrow-right:before { + content: "\e092"; +} +.glyphicon-arrow-up:before { + content: "\e093"; +} +.glyphicon-arrow-down:before { + content: "\e094"; +} +.glyphicon-share-alt:before { + content: "\e095"; +} +.glyphicon-resize-full:before { + content: "\e096"; +} +.glyphicon-resize-small:before { + content: "\e097"; +} +.glyphicon-exclamation-sign:before { + content: "\e101"; +} +.glyphicon-gift:before { + content: "\e102"; +} +.glyphicon-leaf:before { + content: "\e103"; +} +.glyphicon-fire:before { + content: "\e104"; +} +.glyphicon-eye-open:before { + content: "\e105"; +} +.glyphicon-eye-close:before { + content: "\e106"; +} +.glyphicon-warning-sign:before { + content: "\e107"; +} +.glyphicon-plane:before { + content: "\e108"; +} +.glyphicon-calendar:before { + content: "\e109"; +} +.glyphicon-random:before { + content: "\e110"; +} +.glyphicon-comment:before { + content: "\e111"; +} +.glyphicon-magnet:before { + content: "\e112"; +} +.glyphicon-chevron-up:before { + content: "\e113"; +} +.glyphicon-chevron-down:before { + content: "\e114"; +} +.glyphicon-retweet:before { + content: "\e115"; +} +.glyphicon-shopping-cart:before { + content: "\e116"; +} +.glyphicon-folder-close:before { + content: "\e117"; +} +.glyphicon-folder-open:before { + content: "\e118"; +} +.glyphicon-resize-vertical:before { + content: "\e119"; +} +.glyphicon-resize-horizontal:before { + content: "\e120"; +} +.glyphicon-hdd:before { + content: "\e121"; +} +.glyphicon-bullhorn:before { + content: "\e122"; +} +.glyphicon-bell:before { + content: "\e123"; +} +.glyphicon-certificate:before { + content: "\e124"; +} +.glyphicon-thumbs-up:before { + content: "\e125"; +} +.glyphicon-thumbs-down:before { + content: "\e126"; +} +.glyphicon-hand-right:before { + content: "\e127"; +} +.glyphicon-hand-left:before { + content: "\e128"; +} +.glyphicon-hand-up:before { + content: "\e129"; +} +.glyphicon-hand-down:before { + content: "\e130"; +} +.glyphicon-circle-arrow-right:before { + content: "\e131"; +} +.glyphicon-circle-arrow-left:before { + content: "\e132"; +} +.glyphicon-circle-arrow-up:before { + content: "\e133"; +} +.glyphicon-circle-arrow-down:before { + content: "\e134"; +} +.glyphicon-globe:before { + content: "\e135"; +} +.glyphicon-wrench:before { + content: "\e136"; +} +.glyphicon-tasks:before { + content: "\e137"; +} +.glyphicon-filter:before { + content: "\e138"; +} +.glyphicon-briefcase:before { + content: "\e139"; +} +.glyphicon-fullscreen:before { + content: "\e140"; +} +.glyphicon-dashboard:before { + content: "\e141"; +} +.glyphicon-paperclip:before { + content: "\e142"; +} +.glyphicon-heart-empty:before { + content: "\e143"; +} +.glyphicon-link:before { + content: "\e144"; +} +.glyphicon-phone:before { + content: "\e145"; +} +.glyphicon-pushpin:before { + content: "\e146"; +} +.glyphicon-usd:before { + content: "\e148"; +} +.glyphicon-gbp:before { + content: "\e149"; +} +.glyphicon-sort:before { + content: "\e150"; +} +.glyphicon-sort-by-alphabet:before { + content: "\e151"; +} +.glyphicon-sort-by-alphabet-alt:before { + content: "\e152"; +} +.glyphicon-sort-by-order:before { + content: "\e153"; +} +.glyphicon-sort-by-order-alt:before { + content: "\e154"; +} +.glyphicon-sort-by-attributes:before { + content: "\e155"; +} +.glyphicon-sort-by-attributes-alt:before { + content: "\e156"; +} +.glyphicon-unchecked:before { + content: "\e157"; +} +.glyphicon-expand:before { + content: "\e158"; +} +.glyphicon-collapse-down:before { + content: "\e159"; +} +.glyphicon-collapse-up:before { + content: "\e160"; +} +.glyphicon-log-in:before { + content: "\e161"; +} +.glyphicon-flash:before { + content: "\e162"; +} +.glyphicon-log-out:before { + content: "\e163"; +} +.glyphicon-new-window:before { + content: "\e164"; +} +.glyphicon-record:before { + content: "\e165"; +} +.glyphicon-save:before { + content: "\e166"; +} +.glyphicon-open:before { + content: "\e167"; +} +.glyphicon-saved:before { + content: "\e168"; +} +.glyphicon-import:before { + content: "\e169"; +} +.glyphicon-export:before { + content: "\e170"; +} +.glyphicon-send:before { + content: "\e171"; +} +.glyphicon-floppy-disk:before { + content: "\e172"; +} +.glyphicon-floppy-saved:before { + content: "\e173"; +} +.glyphicon-floppy-remove:before { + content: "\e174"; +} +.glyphicon-floppy-save:before { + content: "\e175"; +} +.glyphicon-floppy-open:before { + content: "\e176"; +} +.glyphicon-credit-card:before { + content: "\e177"; +} +.glyphicon-transfer:before { + content: "\e178"; +} +.glyphicon-cutlery:before { + content: "\e179"; +} +.glyphicon-header:before { + content: "\e180"; +} +.glyphicon-compressed:before { + content: "\e181"; +} +.glyphicon-earphone:before { + content: "\e182"; +} +.glyphicon-phone-alt:before { + content: "\e183"; +} +.glyphicon-tower:before { + content: "\e184"; +} +.glyphicon-stats:before { + content: "\e185"; +} +.glyphicon-sd-video:before { + content: "\e186"; +} +.glyphicon-hd-video:before { + content: "\e187"; +} +.glyphicon-subtitles:before { + content: "\e188"; +} +.glyphicon-sound-stereo:before { + content: "\e189"; +} +.glyphicon-sound-dolby:before { + content: "\e190"; +} +.glyphicon-sound-5-1:before { + content: "\e191"; +} +.glyphicon-sound-6-1:before { + content: "\e192"; +} +.glyphicon-sound-7-1:before { + content: "\e193"; +} +.glyphicon-copyright-mark:before { + content: "\e194"; +} +.glyphicon-registration-mark:before { + content: "\e195"; +} +.glyphicon-cloud-download:before { + content: "\e197"; +} +.glyphicon-cloud-upload:before { + content: "\e198"; +} +.glyphicon-tree-conifer:before { + content: "\e199"; +} +.glyphicon-tree-deciduous:before { + content: "\e200"; +} +.glyphicon-cd:before { + content: "\e201"; +} +.glyphicon-save-file:before { + content: "\e202"; +} +.glyphicon-open-file:before { + content: "\e203"; +} +.glyphicon-level-up:before { + content: "\e204"; +} +.glyphicon-copy:before { + content: "\e205"; +} +.glyphicon-paste:before { + content: "\e206"; +} +.glyphicon-alert:before { + content: "\e209"; +} +.glyphicon-equalizer:before { + content: "\e210"; +} +.glyphicon-king:before { + content: "\e211"; +} +.glyphicon-queen:before { + content: "\e212"; +} +.glyphicon-pawn:before { + content: "\e213"; +} +.glyphicon-bishop:before { + content: "\e214"; +} +.glyphicon-knight:before { + content: "\e215"; +} +.glyphicon-baby-formula:before { + content: "\e216"; +} +.glyphicon-tent:before { + content: "\26fa"; +} +.glyphicon-blackboard:before { + content: "\e218"; +} +.glyphicon-bed:before { + content: "\e219"; +} +.glyphicon-apple:before { + content: "\f8ff"; +} +.glyphicon-erase:before { + content: "\e221"; +} +.glyphicon-hourglass:before { + content: "\231b"; +} +.glyphicon-lamp:before { + content: "\e223"; +} +.glyphicon-duplicate:before { + content: "\e224"; +} +.glyphicon-piggy-bank:before { + content: "\e225"; +} +.glyphicon-scissors:before { + content: "\e226"; +} +.glyphicon-bitcoin:before { + content: "\e227"; +} +.glyphicon-btc:before { + content: "\e227"; +} +.glyphicon-xbt:before { + content: "\e227"; +} +.glyphicon-yen:before { + content: "\00a5"; +} +.glyphicon-jpy:before { + content: "\00a5"; +} +.glyphicon-ruble:before { + content: "\20bd"; +} +.glyphicon-rub:before { + content: "\20bd"; +} +.glyphicon-scale:before { + content: "\e230"; +} +.glyphicon-ice-lolly:before { + content: "\e231"; +} +.glyphicon-ice-lolly-tasted:before { + content: "\e232"; +} +.glyphicon-education:before { + content: "\e233"; +} +.glyphicon-option-horizontal:before { + content: "\e234"; +} +.glyphicon-option-vertical:before { + content: "\e235"; +} +.glyphicon-menu-hamburger:before { + content: "\e236"; +} +.glyphicon-modal-window:before { + content: "\e237"; +} +.glyphicon-oil:before { + content: "\e238"; +} +.glyphicon-grain:before { + content: "\e239"; +} +.glyphicon-sunglasses:before { + content: "\e240"; +} +.glyphicon-text-size:before { + content: "\e241"; +} +.glyphicon-text-color:before { + content: "\e242"; +} +.glyphicon-text-background:before { + content: "\e243"; +} +.glyphicon-object-align-top:before { + content: "\e244"; +} +.glyphicon-object-align-bottom:before { + content: "\e245"; +} +.glyphicon-object-align-horizontal:before { + content: "\e246"; +} +.glyphicon-object-align-left:before { + content: "\e247"; +} +.glyphicon-object-align-vertical:before { + content: "\e248"; +} +.glyphicon-object-align-right:before { + content: "\e249"; +} +.glyphicon-triangle-right:before { + content: "\e250"; +} +.glyphicon-triangle-left:before { + content: "\e251"; +} +.glyphicon-triangle-bottom:before { + content: "\e252"; +} +.glyphicon-triangle-top:before { + content: "\e253"; +} +.glyphicon-console:before { + content: "\e254"; +} +.glyphicon-superscript:before { + content: "\e255"; +} +.glyphicon-subscript:before { + content: "\e256"; +} +.glyphicon-menu-left:before { + content: "\e257"; +} +.glyphicon-menu-right:before { + content: "\e258"; +} +.glyphicon-menu-down:before { + content: "\e259"; +} +.glyphicon-menu-up:before { + content: "\e260"; +} +* { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +*:before, +*:after { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +html { + font-size: 10px; + + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} +body { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.42857143; + color: #333; + background-color: #fff; +} +input, +button, +select, +textarea { + font-family: inherit; + font-size: inherit; + line-height: inherit; +} +a { + color: #337ab7; + text-decoration: none; +} +a:hover, +a:focus { + color: #23527c; + text-decoration: underline; +} +a:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +figure { + margin: 0; +} +img { + vertical-align: middle; +} +.img-responsive, +.thumbnail > img, +.thumbnail a > img, +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + display: block; + max-width: 100%; + height: auto; +} +.img-rounded { + border-radius: 6px; +} +.img-thumbnail { + display: inline-block; + max-width: 100%; + height: auto; + padding: 4px; + line-height: 1.42857143; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 4px; + -webkit-transition: all .2s ease-in-out; + -o-transition: all .2s ease-in-out; + transition: all .2s ease-in-out; +} +.img-circle { + border-radius: 50%; +} +hr { + margin-top: 20px; + margin-bottom: 20px; + border: 0; + border-top: 1px solid #eee; +} +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} +.sr-only-focusable:active, +.sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + margin: 0; + overflow: visible; + clip: auto; +} +[role="button"] { + cursor: pointer; +} +h1, +h2, +h3, +h4, +h5, +h6, +.h1, +.h2, +.h3, +.h4, +.h5, +.h6 { + font-family: inherit; + font-weight: 500; + line-height: 1.1; + color: inherit; +} +h1 small, +h2 small, +h3 small, +h4 small, +h5 small, +h6 small, +.h1 small, +.h2 small, +.h3 small, +.h4 small, +.h5 small, +.h6 small, +h1 .small, +h2 .small, +h3 .small, +h4 .small, +h5 .small, +h6 .small, +.h1 .small, +.h2 .small, +.h3 .small, +.h4 .small, +.h5 .small, +.h6 .small { + font-weight: normal; + line-height: 1; + color: #777; +} +h1, +.h1, +h2, +.h2, +h3, +.h3 { + margin-top: 20px; + margin-bottom: 10px; +} +h1 small, +.h1 small, +h2 small, +.h2 small, +h3 small, +.h3 small, +h1 .small, +.h1 .small, +h2 .small, +.h2 .small, +h3 .small, +.h3 .small { + font-size: 65%; +} +h4, +.h4, +h5, +.h5, +h6, +.h6 { + margin-top: 10px; + margin-bottom: 10px; +} +h4 small, +.h4 small, +h5 small, +.h5 small, +h6 small, +.h6 small, +h4 .small, +.h4 .small, +h5 .small, +.h5 .small, +h6 .small, +.h6 .small { + font-size: 75%; +} +h1, +.h1 { + font-size: 36px; +} +h2, +.h2 { + font-size: 30px; +} +h3, +.h3 { + font-size: 24px; +} +h4, +.h4 { + font-size: 18px; +} +h5, +.h5 { + font-size: 14px; +} +h6, +.h6 { + font-size: 12px; +} +p { + margin: 0 0 10px; +} +.lead { + margin-bottom: 20px; + font-size: 16px; + font-weight: 300; + line-height: 1.4; +} +@media (min-width: 768px) { + .lead { + font-size: 21px; + } +} +small, +.small { + font-size: 85%; +} +mark, +.mark { + padding: .2em; + background-color: #fcf8e3; +} +.text-left { + text-align: left; +} +.text-right { + text-align: right; +} +.text-center { + text-align: center; +} +.text-justify { + text-align: justify; +} +.text-nowrap { + white-space: nowrap; +} +.text-lowercase { + text-transform: lowercase; +} +.text-uppercase { + text-transform: uppercase; +} +.text-capitalize { + text-transform: capitalize; +} +.text-muted { + color: #777; +} +.text-primary { + color: #337ab7; +} +a.text-primary:hover, +a.text-primary:focus { + color: #286090; +} +.text-success { + color: #3c763d; +} +a.text-success:hover, +a.text-success:focus { + color: #2b542c; +} +.text-info { + color: #31708f; +} +a.text-info:hover, +a.text-info:focus { + color: #245269; +} +.text-warning { + color: #8a6d3b; +} +a.text-warning:hover, +a.text-warning:focus { + color: #66512c; +} +.text-danger { + color: #a94442; +} +a.text-danger:hover, +a.text-danger:focus { + color: #843534; +} +.bg-primary { + color: #fff; + background-color: #337ab7; +} +a.bg-primary:hover, +a.bg-primary:focus { + background-color: #286090; +} +.bg-success { + background-color: #dff0d8; +} +a.bg-success:hover, +a.bg-success:focus { + background-color: #c1e2b3; +} +.bg-info { + background-color: #d9edf7; +} +a.bg-info:hover, +a.bg-info:focus { + background-color: #afd9ee; +} +.bg-warning { + background-color: #fcf8e3; +} +a.bg-warning:hover, +a.bg-warning:focus { + background-color: #f7ecb5; +} +.bg-danger { + background-color: #f2dede; +} +a.bg-danger:hover, +a.bg-danger:focus { + background-color: #e4b9b9; +} +.page-header { + padding-bottom: 9px; + margin: 40px 0 20px; + border-bottom: 1px solid #eee; +} +ul, +ol { + margin-top: 0; + margin-bottom: 10px; +} +ul ul, +ol ul, +ul ol, +ol ol { + margin-bottom: 0; +} +.list-unstyled { + padding-left: 0; + list-style: none; +} +.list-inline { + padding-left: 0; + margin-left: -5px; + list-style: none; +} +.list-inline > li { + display: inline-block; + padding-right: 5px; + padding-left: 5px; +} +dl { + margin-top: 0; + margin-bottom: 20px; +} +dt, +dd { + line-height: 1.42857143; +} +dt { + font-weight: bold; +} +dd { + margin-left: 0; +} +@media (min-width: 768px) { + .dl-horizontal dt { + float: left; + width: 160px; + overflow: hidden; + clear: left; + text-align: right; + text-overflow: ellipsis; + white-space: nowrap; + } + .dl-horizontal dd { + margin-left: 180px; + } +} +abbr[title], +abbr[data-original-title] { + cursor: help; + border-bottom: 1px dotted #777; +} +.initialism { + font-size: 90%; + text-transform: uppercase; +} +blockquote { + padding: 10px 20px; + margin: 0 0 20px; + font-size: 17.5px; + border-left: 5px solid #eee; +} +blockquote p:last-child, +blockquote ul:last-child, +blockquote ol:last-child { + margin-bottom: 0; +} +blockquote footer, +blockquote small, +blockquote .small { + display: block; + font-size: 80%; + line-height: 1.42857143; + color: #777; +} +blockquote footer:before, +blockquote small:before, +blockquote .small:before { + content: '\2014 \00A0'; +} +.blockquote-reverse, +blockquote.pull-right { + padding-right: 15px; + padding-left: 0; + text-align: right; + border-right: 5px solid #eee; + border-left: 0; +} +.blockquote-reverse footer:before, +blockquote.pull-right footer:before, +.blockquote-reverse small:before, +blockquote.pull-right small:before, +.blockquote-reverse .small:before, +blockquote.pull-right .small:before { + content: ''; +} +.blockquote-reverse footer:after, +blockquote.pull-right footer:after, +.blockquote-reverse small:after, +blockquote.pull-right small:after, +.blockquote-reverse .small:after, +blockquote.pull-right .small:after { + content: '\00A0 \2014'; +} +address { + margin-bottom: 20px; + font-style: normal; + line-height: 1.42857143; +} +code, +kbd, +pre, +samp { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; +} +code { + padding: 2px 4px; + font-size: 90%; + color: #c7254e; + background-color: #f9f2f4; + border-radius: 4px; +} +kbd { + padding: 2px 4px; + font-size: 90%; + color: #fff; + background-color: #333; + border-radius: 3px; + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25); +} +kbd kbd { + padding: 0; + font-size: 100%; + font-weight: bold; + -webkit-box-shadow: none; + box-shadow: none; +} +pre { + display: block; + padding: 9.5px; + margin: 0 0 10px; + font-size: 13px; + line-height: 1.42857143; + color: #333; + word-break: break-all; + word-wrap: break-word; + background-color: #f5f5f5; + border: 1px solid #ccc; + border-radius: 4px; +} +pre code { + padding: 0; + font-size: inherit; + color: inherit; + white-space: pre-wrap; + background-color: transparent; + border-radius: 0; +} +.pre-scrollable { + max-height: 340px; + overflow-y: scroll; +} +.container { + padding-right: 15px; + padding-left: 15px; + margin-right: auto; + margin-left: auto; +} +@media (min-width: 768px) { + .container { + width: 750px; + } +} +@media (min-width: 992px) { + .container { + width: 970px; + } +} +@media (min-width: 1200px) { + .container { + width: 1170px; + } +} +.container-fluid { + padding-right: 15px; + padding-left: 15px; + margin-right: auto; + margin-left: auto; +} +.row { + margin-right: -15px; + margin-left: -15px; +} +.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { + position: relative; + min-height: 1px; + padding-right: 15px; + padding-left: 15px; +} +.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { + float: left; +} +.col-xs-12 { + width: 100%; +} +.col-xs-11 { + width: 91.66666667%; +} +.col-xs-10 { + width: 83.33333333%; +} +.col-xs-9 { + width: 75%; +} +.col-xs-8 { + width: 66.66666667%; +} +.col-xs-7 { + width: 58.33333333%; +} +.col-xs-6 { + width: 50%; +} +.col-xs-5 { + width: 41.66666667%; +} +.col-xs-4 { + width: 33.33333333%; +} +.col-xs-3 { + width: 25%; +} +.col-xs-2 { + width: 16.66666667%; +} +.col-xs-1 { + width: 8.33333333%; +} +.col-xs-pull-12 { + right: 100%; +} +.col-xs-pull-11 { + right: 91.66666667%; +} +.col-xs-pull-10 { + right: 83.33333333%; +} +.col-xs-pull-9 { + right: 75%; +} +.col-xs-pull-8 { + right: 66.66666667%; +} +.col-xs-pull-7 { + right: 58.33333333%; +} +.col-xs-pull-6 { + right: 50%; +} +.col-xs-pull-5 { + right: 41.66666667%; +} +.col-xs-pull-4 { + right: 33.33333333%; +} +.col-xs-pull-3 { + right: 25%; +} +.col-xs-pull-2 { + right: 16.66666667%; +} +.col-xs-pull-1 { + right: 8.33333333%; +} +.col-xs-pull-0 { + right: auto; +} +.col-xs-push-12 { + left: 100%; +} +.col-xs-push-11 { + left: 91.66666667%; +} +.col-xs-push-10 { + left: 83.33333333%; +} +.col-xs-push-9 { + left: 75%; +} +.col-xs-push-8 { + left: 66.66666667%; +} +.col-xs-push-7 { + left: 58.33333333%; +} +.col-xs-push-6 { + left: 50%; +} +.col-xs-push-5 { + left: 41.66666667%; +} +.col-xs-push-4 { + left: 33.33333333%; +} +.col-xs-push-3 { + left: 25%; +} +.col-xs-push-2 { + left: 16.66666667%; +} +.col-xs-push-1 { + left: 8.33333333%; +} +.col-xs-push-0 { + left: auto; +} +.col-xs-offset-12 { + margin-left: 100%; +} +.col-xs-offset-11 { + margin-left: 91.66666667%; +} +.col-xs-offset-10 { + margin-left: 83.33333333%; +} +.col-xs-offset-9 { + margin-left: 75%; +} +.col-xs-offset-8 { + margin-left: 66.66666667%; +} +.col-xs-offset-7 { + margin-left: 58.33333333%; +} +.col-xs-offset-6 { + margin-left: 50%; +} +.col-xs-offset-5 { + margin-left: 41.66666667%; +} +.col-xs-offset-4 { + margin-left: 33.33333333%; +} +.col-xs-offset-3 { + margin-left: 25%; +} +.col-xs-offset-2 { + margin-left: 16.66666667%; +} +.col-xs-offset-1 { + margin-left: 8.33333333%; +} +.col-xs-offset-0 { + margin-left: 0; +} +@media (min-width: 768px) { + .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { + float: left; + } + .col-sm-12 { + width: 100%; + } + .col-sm-11 { + width: 91.66666667%; + } + .col-sm-10 { + width: 83.33333333%; + } + .col-sm-9 { + width: 75%; + } + .col-sm-8 { + width: 66.66666667%; + } + .col-sm-7 { + width: 58.33333333%; + } + .col-sm-6 { + width: 50%; + } + .col-sm-5 { + width: 41.66666667%; + } + .col-sm-4 { + width: 33.33333333%; + } + .col-sm-3 { + width: 25%; + } + .col-sm-2 { + width: 16.66666667%; + } + .col-sm-1 { + width: 8.33333333%; + } + .col-sm-pull-12 { + right: 100%; + } + .col-sm-pull-11 { + right: 91.66666667%; + } + .col-sm-pull-10 { + right: 83.33333333%; + } + .col-sm-pull-9 { + right: 75%; + } + .col-sm-pull-8 { + right: 66.66666667%; + } + .col-sm-pull-7 { + right: 58.33333333%; + } + .col-sm-pull-6 { + right: 50%; + } + .col-sm-pull-5 { + right: 41.66666667%; + } + .col-sm-pull-4 { + right: 33.33333333%; + } + .col-sm-pull-3 { + right: 25%; + } + .col-sm-pull-2 { + right: 16.66666667%; + } + .col-sm-pull-1 { + right: 8.33333333%; + } + .col-sm-pull-0 { + right: auto; + } + .col-sm-push-12 { + left: 100%; + } + .col-sm-push-11 { + left: 91.66666667%; + } + .col-sm-push-10 { + left: 83.33333333%; + } + .col-sm-push-9 { + left: 75%; + } + .col-sm-push-8 { + left: 66.66666667%; + } + .col-sm-push-7 { + left: 58.33333333%; + } + .col-sm-push-6 { + left: 50%; + } + .col-sm-push-5 { + left: 41.66666667%; + } + .col-sm-push-4 { + left: 33.33333333%; + } + .col-sm-push-3 { + left: 25%; + } + .col-sm-push-2 { + left: 16.66666667%; + } + .col-sm-push-1 { + left: 8.33333333%; + } + .col-sm-push-0 { + left: auto; + } + .col-sm-offset-12 { + margin-left: 100%; + } + .col-sm-offset-11 { + margin-left: 91.66666667%; + } + .col-sm-offset-10 { + margin-left: 83.33333333%; + } + .col-sm-offset-9 { + margin-left: 75%; + } + .col-sm-offset-8 { + margin-left: 66.66666667%; + } + .col-sm-offset-7 { + margin-left: 58.33333333%; + } + .col-sm-offset-6 { + margin-left: 50%; + } + .col-sm-offset-5 { + margin-left: 41.66666667%; + } + .col-sm-offset-4 { + margin-left: 33.33333333%; + } + .col-sm-offset-3 { + margin-left: 25%; + } + .col-sm-offset-2 { + margin-left: 16.66666667%; + } + .col-sm-offset-1 { + margin-left: 8.33333333%; + } + .col-sm-offset-0 { + margin-left: 0; + } +} +@media (min-width: 992px) { + .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { + float: left; + } + .col-md-12 { + width: 100%; + } + .col-md-11 { + width: 91.66666667%; + } + .col-md-10 { + width: 83.33333333%; + } + .col-md-9 { + width: 75%; + } + .col-md-8 { + width: 66.66666667%; + } + .col-md-7 { + width: 58.33333333%; + } + .col-md-6 { + width: 50%; + } + .col-md-5 { + width: 41.66666667%; + } + .col-md-4 { + width: 33.33333333%; + } + .col-md-3 { + width: 25%; + } + .col-md-2 { + width: 16.66666667%; + } + .col-md-1 { + width: 8.33333333%; + } + .col-md-pull-12 { + right: 100%; + } + .col-md-pull-11 { + right: 91.66666667%; + } + .col-md-pull-10 { + right: 83.33333333%; + } + .col-md-pull-9 { + right: 75%; + } + .col-md-pull-8 { + right: 66.66666667%; + } + .col-md-pull-7 { + right: 58.33333333%; + } + .col-md-pull-6 { + right: 50%; + } + .col-md-pull-5 { + right: 41.66666667%; + } + .col-md-pull-4 { + right: 33.33333333%; + } + .col-md-pull-3 { + right: 25%; + } + .col-md-pull-2 { + right: 16.66666667%; + } + .col-md-pull-1 { + right: 8.33333333%; + } + .col-md-pull-0 { + right: auto; + } + .col-md-push-12 { + left: 100%; + } + .col-md-push-11 { + left: 91.66666667%; + } + .col-md-push-10 { + left: 83.33333333%; + } + .col-md-push-9 { + left: 75%; + } + .col-md-push-8 { + left: 66.66666667%; + } + .col-md-push-7 { + left: 58.33333333%; + } + .col-md-push-6 { + left: 50%; + } + .col-md-push-5 { + left: 41.66666667%; + } + .col-md-push-4 { + left: 33.33333333%; + } + .col-md-push-3 { + left: 25%; + } + .col-md-push-2 { + left: 16.66666667%; + } + .col-md-push-1 { + left: 8.33333333%; + } + .col-md-push-0 { + left: auto; + } + .col-md-offset-12 { + margin-left: 100%; + } + .col-md-offset-11 { + margin-left: 91.66666667%; + } + .col-md-offset-10 { + margin-left: 83.33333333%; + } + .col-md-offset-9 { + margin-left: 75%; + } + .col-md-offset-8 { + margin-left: 66.66666667%; + } + .col-md-offset-7 { + margin-left: 58.33333333%; + } + .col-md-offset-6 { + margin-left: 50%; + } + .col-md-offset-5 { + margin-left: 41.66666667%; + } + .col-md-offset-4 { + margin-left: 33.33333333%; + } + .col-md-offset-3 { + margin-left: 25%; + } + .col-md-offset-2 { + margin-left: 16.66666667%; + } + .col-md-offset-1 { + margin-left: 8.33333333%; + } + .col-md-offset-0 { + margin-left: 0; + } +} +@media (min-width: 1200px) { + .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { + float: left; + } + .col-lg-12 { + width: 100%; + } + .col-lg-11 { + width: 91.66666667%; + } + .col-lg-10 { + width: 83.33333333%; + } + .col-lg-9 { + width: 75%; + } + .col-lg-8 { + width: 66.66666667%; + } + .col-lg-7 { + width: 58.33333333%; + } + .col-lg-6 { + width: 50%; + } + .col-lg-5 { + width: 41.66666667%; + } + .col-lg-4 { + width: 33.33333333%; + } + .col-lg-3 { + width: 25%; + } + .col-lg-2 { + width: 16.66666667%; + } + .col-lg-1 { + width: 8.33333333%; + } + .col-lg-pull-12 { + right: 100%; + } + .col-lg-pull-11 { + right: 91.66666667%; + } + .col-lg-pull-10 { + right: 83.33333333%; + } + .col-lg-pull-9 { + right: 75%; + } + .col-lg-pull-8 { + right: 66.66666667%; + } + .col-lg-pull-7 { + right: 58.33333333%; + } + .col-lg-pull-6 { + right: 50%; + } + .col-lg-pull-5 { + right: 41.66666667%; + } + .col-lg-pull-4 { + right: 33.33333333%; + } + .col-lg-pull-3 { + right: 25%; + } + .col-lg-pull-2 { + right: 16.66666667%; + } + .col-lg-pull-1 { + right: 8.33333333%; + } + .col-lg-pull-0 { + right: auto; + } + .col-lg-push-12 { + left: 100%; + } + .col-lg-push-11 { + left: 91.66666667%; + } + .col-lg-push-10 { + left: 83.33333333%; + } + .col-lg-push-9 { + left: 75%; + } + .col-lg-push-8 { + left: 66.66666667%; + } + .col-lg-push-7 { + left: 58.33333333%; + } + .col-lg-push-6 { + left: 50%; + } + .col-lg-push-5 { + left: 41.66666667%; + } + .col-lg-push-4 { + left: 33.33333333%; + } + .col-lg-push-3 { + left: 25%; + } + .col-lg-push-2 { + left: 16.66666667%; + } + .col-lg-push-1 { + left: 8.33333333%; + } + .col-lg-push-0 { + left: auto; + } + .col-lg-offset-12 { + margin-left: 100%; + } + .col-lg-offset-11 { + margin-left: 91.66666667%; + } + .col-lg-offset-10 { + margin-left: 83.33333333%; + } + .col-lg-offset-9 { + margin-left: 75%; + } + .col-lg-offset-8 { + margin-left: 66.66666667%; + } + .col-lg-offset-7 { + margin-left: 58.33333333%; + } + .col-lg-offset-6 { + margin-left: 50%; + } + .col-lg-offset-5 { + margin-left: 41.66666667%; + } + .col-lg-offset-4 { + margin-left: 33.33333333%; + } + .col-lg-offset-3 { + margin-left: 25%; + } + .col-lg-offset-2 { + margin-left: 16.66666667%; + } + .col-lg-offset-1 { + margin-left: 8.33333333%; + } + .col-lg-offset-0 { + margin-left: 0; + } +} +table { + background-color: transparent; +} +caption { + padding-top: 8px; + padding-bottom: 8px; + color: #777; + text-align: left; +} +th { + text-align: left; +} +.table { + width: 100%; + max-width: 100%; + margin-bottom: 20px; +} +.table > thead > tr > th, +.table > tbody > tr > th, +.table > tfoot > tr > th, +.table > thead > tr > td, +.table > tbody > tr > td, +.table > tfoot > tr > td { + padding: 8px; + line-height: 1.42857143; + vertical-align: top; + border-top: 1px solid #ddd; +} +.table > thead > tr > th { + vertical-align: bottom; + border-bottom: 2px solid #ddd; +} +.table > caption + thead > tr:first-child > th, +.table > colgroup + thead > tr:first-child > th, +.table > thead:first-child > tr:first-child > th, +.table > caption + thead > tr:first-child > td, +.table > colgroup + thead > tr:first-child > td, +.table > thead:first-child > tr:first-child > td { + border-top: 0; +} +.table > tbody + tbody { + border-top: 2px solid #ddd; +} +.table .table { + background-color: #fff; +} +.table-condensed > thead > tr > th, +.table-condensed > tbody > tr > th, +.table-condensed > tfoot > tr > th, +.table-condensed > thead > tr > td, +.table-condensed > tbody > tr > td, +.table-condensed > tfoot > tr > td { + padding: 5px; +} +.table-bordered { + border: 1px solid #ddd; +} +.table-bordered > thead > tr > th, +.table-bordered > tbody > tr > th, +.table-bordered > tfoot > tr > th, +.table-bordered > thead > tr > td, +.table-bordered > tbody > tr > td, +.table-bordered > tfoot > tr > td { + border: 1px solid #ddd; +} +.table-bordered > thead > tr > th, +.table-bordered > thead > tr > td { + border-bottom-width: 2px; +} +.table-striped > tbody > tr:nth-of-type(odd) { + background-color: #f9f9f9; +} +.table-hover > tbody > tr:hover { + background-color: #f5f5f5; +} +table col[class*="col-"] { + position: static; + display: table-column; + float: none; +} +table td[class*="col-"], +table th[class*="col-"] { + position: static; + display: table-cell; + float: none; +} +.table > thead > tr > td.active, +.table > tbody > tr > td.active, +.table > tfoot > tr > td.active, +.table > thead > tr > th.active, +.table > tbody > tr > th.active, +.table > tfoot > tr > th.active, +.table > thead > tr.active > td, +.table > tbody > tr.active > td, +.table > tfoot > tr.active > td, +.table > thead > tr.active > th, +.table > tbody > tr.active > th, +.table > tfoot > tr.active > th { + background-color: #f5f5f5; +} +.table-hover > tbody > tr > td.active:hover, +.table-hover > tbody > tr > th.active:hover, +.table-hover > tbody > tr.active:hover > td, +.table-hover > tbody > tr:hover > .active, +.table-hover > tbody > tr.active:hover > th { + background-color: #e8e8e8; +} +.table > thead > tr > td.success, +.table > tbody > tr > td.success, +.table > tfoot > tr > td.success, +.table > thead > tr > th.success, +.table > tbody > tr > th.success, +.table > tfoot > tr > th.success, +.table > thead > tr.success > td, +.table > tbody > tr.success > td, +.table > tfoot > tr.success > td, +.table > thead > tr.success > th, +.table > tbody > tr.success > th, +.table > tfoot > tr.success > th { + background-color: #dff0d8; +} +.table-hover > tbody > tr > td.success:hover, +.table-hover > tbody > tr > th.success:hover, +.table-hover > tbody > tr.success:hover > td, +.table-hover > tbody > tr:hover > .success, +.table-hover > tbody > tr.success:hover > th { + background-color: #d0e9c6; +} +.table > thead > tr > td.info, +.table > tbody > tr > td.info, +.table > tfoot > tr > td.info, +.table > thead > tr > th.info, +.table > tbody > tr > th.info, +.table > tfoot > tr > th.info, +.table > thead > tr.info > td, +.table > tbody > tr.info > td, +.table > tfoot > tr.info > td, +.table > thead > tr.info > th, +.table > tbody > tr.info > th, +.table > tfoot > tr.info > th { + background-color: #d9edf7; +} +.table-hover > tbody > tr > td.info:hover, +.table-hover > tbody > tr > th.info:hover, +.table-hover > tbody > tr.info:hover > td, +.table-hover > tbody > tr:hover > .info, +.table-hover > tbody > tr.info:hover > th { + background-color: #c4e3f3; +} +.table > thead > tr > td.warning, +.table > tbody > tr > td.warning, +.table > tfoot > tr > td.warning, +.table > thead > tr > th.warning, +.table > tbody > tr > th.warning, +.table > tfoot > tr > th.warning, +.table > thead > tr.warning > td, +.table > tbody > tr.warning > td, +.table > tfoot > tr.warning > td, +.table > thead > tr.warning > th, +.table > tbody > tr.warning > th, +.table > tfoot > tr.warning > th { + background-color: #fcf8e3; +} +.table-hover > tbody > tr > td.warning:hover, +.table-hover > tbody > tr > th.warning:hover, +.table-hover > tbody > tr.warning:hover > td, +.table-hover > tbody > tr:hover > .warning, +.table-hover > tbody > tr.warning:hover > th { + background-color: #faf2cc; +} +.table > thead > tr > td.danger, +.table > tbody > tr > td.danger, +.table > tfoot > tr > td.danger, +.table > thead > tr > th.danger, +.table > tbody > tr > th.danger, +.table > tfoot > tr > th.danger, +.table > thead > tr.danger > td, +.table > tbody > tr.danger > td, +.table > tfoot > tr.danger > td, +.table > thead > tr.danger > th, +.table > tbody > tr.danger > th, +.table > tfoot > tr.danger > th { + background-color: #f2dede; +} +.table-hover > tbody > tr > td.danger:hover, +.table-hover > tbody > tr > th.danger:hover, +.table-hover > tbody > tr.danger:hover > td, +.table-hover > tbody > tr:hover > .danger, +.table-hover > tbody > tr.danger:hover > th { + background-color: #ebcccc; +} +.table-responsive { + min-height: .01%; + overflow-x: auto; +} +@media screen and (max-width: 767px) { + .table-responsive { + width: 100%; + margin-bottom: 15px; + overflow-y: hidden; + -ms-overflow-style: -ms-autohiding-scrollbar; + border: 1px solid #ddd; + } + .table-responsive > .table { + margin-bottom: 0; + } + .table-responsive > .table > thead > tr > th, + .table-responsive > .table > tbody > tr > th, + .table-responsive > .table > tfoot > tr > th, + .table-responsive > .table > thead > tr > td, + .table-responsive > .table > tbody > tr > td, + .table-responsive > .table > tfoot > tr > td { + white-space: nowrap; + } + .table-responsive > .table-bordered { + border: 0; + } + .table-responsive > .table-bordered > thead > tr > th:first-child, + .table-responsive > .table-bordered > tbody > tr > th:first-child, + .table-responsive > .table-bordered > tfoot > tr > th:first-child, + .table-responsive > .table-bordered > thead > tr > td:first-child, + .table-responsive > .table-bordered > tbody > tr > td:first-child, + .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; + } + .table-responsive > .table-bordered > thead > tr > th:last-child, + .table-responsive > .table-bordered > tbody > tr > th:last-child, + .table-responsive > .table-bordered > tfoot > tr > th:last-child, + .table-responsive > .table-bordered > thead > tr > td:last-child, + .table-responsive > .table-bordered > tbody > tr > td:last-child, + .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; + } + .table-responsive > .table-bordered > tbody > tr:last-child > th, + .table-responsive > .table-bordered > tfoot > tr:last-child > th, + .table-responsive > .table-bordered > tbody > tr:last-child > td, + .table-responsive > .table-bordered > tfoot > tr:last-child > td { + border-bottom: 0; + } +} +fieldset { + min-width: 0; + padding: 0; + margin: 0; + border: 0; +} +legend { + display: block; + width: 100%; + padding: 0; + margin-bottom: 20px; + font-size: 21px; + line-height: inherit; + color: #333; + border: 0; + border-bottom: 1px solid #e5e5e5; +} +label { + display: inline-block; + max-width: 100%; + margin-bottom: 5px; + font-weight: bold; +} +input[type="search"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +input[type="radio"], +input[type="checkbox"] { + margin: 4px 0 0; + margin-top: 1px \9; + line-height: normal; +} +input[type="file"] { + display: block; +} +input[type="range"] { + display: block; + width: 100%; +} +select[multiple], +select[size] { + height: auto; +} +input[type="file"]:focus, +input[type="radio"]:focus, +input[type="checkbox"]:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +output { + display: block; + padding-top: 7px; + font-size: 14px; + line-height: 1.42857143; + color: #555; +} +.form-control { + display: block; + width: 100%; + height: 34px; + padding: 6px 12px; + font-size: 14px; + line-height: 1.42857143; + color: #555; + background-color: #fff; + background-image: none; + border: 1px solid #ccc; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; + -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} +.form-control:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6); +} +.form-control::-moz-placeholder { + color: #999; + opacity: 1; +} +.form-control:-ms-input-placeholder { + color: #999; +} +.form-control::-webkit-input-placeholder { + color: #999; +} +.form-control::-ms-expand { + background-color: transparent; + border: 0; +} +.form-control[disabled], +.form-control[readonly], +fieldset[disabled] .form-control { + background-color: #eee; + opacity: 1; +} +.form-control[disabled], +fieldset[disabled] .form-control { + cursor: not-allowed; +} +textarea.form-control { + height: auto; +} +input[type="search"] { + -webkit-appearance: none; +} +@media screen and (-webkit-min-device-pixel-ratio: 0) { + input[type="date"].form-control, + input[type="time"].form-control, + input[type="datetime-local"].form-control, + input[type="month"].form-control { + line-height: 34px; + } + input[type="date"].input-sm, + input[type="time"].input-sm, + input[type="datetime-local"].input-sm, + input[type="month"].input-sm, + .input-group-sm input[type="date"], + .input-group-sm input[type="time"], + .input-group-sm input[type="datetime-local"], + .input-group-sm input[type="month"] { + line-height: 30px; + } + input[type="date"].input-lg, + input[type="time"].input-lg, + input[type="datetime-local"].input-lg, + input[type="month"].input-lg, + .input-group-lg input[type="date"], + .input-group-lg input[type="time"], + .input-group-lg input[type="datetime-local"], + .input-group-lg input[type="month"] { + line-height: 46px; + } +} +.form-group { + margin-bottom: 15px; +} +.radio, +.checkbox { + position: relative; + display: block; + margin-top: 10px; + margin-bottom: 10px; +} +.radio label, +.checkbox label { + min-height: 20px; + padding-left: 20px; + margin-bottom: 0; + font-weight: normal; + cursor: pointer; +} +.radio input[type="radio"], +.radio-inline input[type="radio"], +.checkbox input[type="checkbox"], +.checkbox-inline input[type="checkbox"] { + position: absolute; + margin-top: 4px \9; + margin-left: -20px; +} +.radio + .radio, +.checkbox + .checkbox { + margin-top: -5px; +} +.radio-inline, +.checkbox-inline { + position: relative; + display: inline-block; + padding-left: 20px; + margin-bottom: 0; + font-weight: normal; + vertical-align: middle; + cursor: pointer; +} +.radio-inline + .radio-inline, +.checkbox-inline + .checkbox-inline { + margin-top: 0; + margin-left: 10px; +} +input[type="radio"][disabled], +input[type="checkbox"][disabled], +input[type="radio"].disabled, +input[type="checkbox"].disabled, +fieldset[disabled] input[type="radio"], +fieldset[disabled] input[type="checkbox"] { + cursor: not-allowed; +} +.radio-inline.disabled, +.checkbox-inline.disabled, +fieldset[disabled] .radio-inline, +fieldset[disabled] .checkbox-inline { + cursor: not-allowed; +} +.radio.disabled label, +.checkbox.disabled label, +fieldset[disabled] .radio label, +fieldset[disabled] .checkbox label { + cursor: not-allowed; +} +.form-control-static { + min-height: 34px; + padding-top: 7px; + padding-bottom: 7px; + margin-bottom: 0; +} +.form-control-static.input-lg, +.form-control-static.input-sm { + padding-right: 0; + padding-left: 0; +} +.input-sm { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-sm { + height: 30px; + line-height: 30px; +} +textarea.input-sm, +select[multiple].input-sm { + height: auto; +} +.form-group-sm .form-control { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.form-group-sm select.form-control { + height: 30px; + line-height: 30px; +} +.form-group-sm textarea.form-control, +.form-group-sm select[multiple].form-control { + height: auto; +} +.form-group-sm .form-control-static { + height: 30px; + min-height: 32px; + padding: 6px 10px; + font-size: 12px; + line-height: 1.5; +} +.input-lg { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; +} +select.input-lg { + height: 46px; + line-height: 46px; +} +textarea.input-lg, +select[multiple].input-lg { + height: auto; +} +.form-group-lg .form-control { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; +} +.form-group-lg select.form-control { + height: 46px; + line-height: 46px; +} +.form-group-lg textarea.form-control, +.form-group-lg select[multiple].form-control { + height: auto; +} +.form-group-lg .form-control-static { + height: 46px; + min-height: 38px; + padding: 11px 16px; + font-size: 18px; + line-height: 1.3333333; +} +.has-feedback { + position: relative; +} +.has-feedback .form-control { + padding-right: 42.5px; +} +.form-control-feedback { + position: absolute; + top: 0; + right: 0; + z-index: 2; + display: block; + width: 34px; + height: 34px; + line-height: 34px; + text-align: center; + pointer-events: none; +} +.input-lg + .form-control-feedback, +.input-group-lg + .form-control-feedback, +.form-group-lg .form-control + .form-control-feedback { + width: 46px; + height: 46px; + line-height: 46px; +} +.input-sm + .form-control-feedback, +.input-group-sm + .form-control-feedback, +.form-group-sm .form-control + .form-control-feedback { + width: 30px; + height: 30px; + line-height: 30px; +} +.has-success .help-block, +.has-success .control-label, +.has-success .radio, +.has-success .checkbox, +.has-success .radio-inline, +.has-success .checkbox-inline, +.has-success.radio label, +.has-success.checkbox label, +.has-success.radio-inline label, +.has-success.checkbox-inline label { + color: #3c763d; +} +.has-success .form-control { + border-color: #3c763d; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); +} +.has-success .form-control:focus { + border-color: #2b542c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168; +} +.has-success .input-group-addon { + color: #3c763d; + background-color: #dff0d8; + border-color: #3c763d; +} +.has-success .form-control-feedback { + color: #3c763d; +} +.has-warning .help-block, +.has-warning .control-label, +.has-warning .radio, +.has-warning .checkbox, +.has-warning .radio-inline, +.has-warning .checkbox-inline, +.has-warning.radio label, +.has-warning.checkbox label, +.has-warning.radio-inline label, +.has-warning.checkbox-inline label { + color: #8a6d3b; +} +.has-warning .form-control { + border-color: #8a6d3b; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); +} +.has-warning .form-control:focus { + border-color: #66512c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b; +} +.has-warning .input-group-addon { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #8a6d3b; +} +.has-warning .form-control-feedback { + color: #8a6d3b; +} +.has-error .help-block, +.has-error .control-label, +.has-error .radio, +.has-error .checkbox, +.has-error .radio-inline, +.has-error .checkbox-inline, +.has-error.radio label, +.has-error.checkbox label, +.has-error.radio-inline label, +.has-error.checkbox-inline label { + color: #a94442; +} +.has-error .form-control { + border-color: #a94442; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); +} +.has-error .form-control:focus { + border-color: #843534; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483; +} +.has-error .input-group-addon { + color: #a94442; + background-color: #f2dede; + border-color: #a94442; +} +.has-error .form-control-feedback { + color: #a94442; +} +.has-feedback label ~ .form-control-feedback { + top: 25px; +} +.has-feedback label.sr-only ~ .form-control-feedback { + top: 0; +} +.help-block { + display: block; + margin-top: 5px; + margin-bottom: 10px; + color: #737373; +} +@media (min-width: 768px) { + .form-inline .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .form-inline .form-control-static { + display: inline-block; + } + .form-inline .input-group { + display: inline-table; + vertical-align: middle; + } + .form-inline .input-group .input-group-addon, + .form-inline .input-group .input-group-btn, + .form-inline .input-group .form-control { + width: auto; + } + .form-inline .input-group > .form-control { + width: 100%; + } + .form-inline .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio, + .form-inline .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio label, + .form-inline .checkbox label { + padding-left: 0; + } + .form-inline .radio input[type="radio"], + .form-inline .checkbox input[type="checkbox"] { + position: relative; + margin-left: 0; + } + .form-inline .has-feedback .form-control-feedback { + top: 0; + } +} +.form-horizontal .radio, +.form-horizontal .checkbox, +.form-horizontal .radio-inline, +.form-horizontal .checkbox-inline { + padding-top: 7px; + margin-top: 0; + margin-bottom: 0; +} +.form-horizontal .radio, +.form-horizontal .checkbox { + min-height: 27px; +} +.form-horizontal .form-group { + margin-right: -15px; + margin-left: -15px; +} +@media (min-width: 768px) { + .form-horizontal .control-label { + padding-top: 7px; + margin-bottom: 0; + text-align: right; + } +} +.form-horizontal .has-feedback .form-control-feedback { + right: 15px; +} +@media (min-width: 768px) { + .form-horizontal .form-group-lg .control-label { + padding-top: 11px; + font-size: 18px; + } +} +@media (min-width: 768px) { + .form-horizontal .form-group-sm .control-label { + padding-top: 6px; + font-size: 12px; + } +} +.btn { + display: inline-block; + padding: 6px 12px; + margin-bottom: 0; + font-size: 14px; + font-weight: normal; + line-height: 1.42857143; + text-align: center; + white-space: nowrap; + vertical-align: middle; + -ms-touch-action: manipulation; + touch-action: manipulation; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; +} +.btn:focus, +.btn:active:focus, +.btn.active:focus, +.btn.focus, +.btn:active.focus, +.btn.active.focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.btn:hover, +.btn:focus, +.btn.focus { + color: #333; + text-decoration: none; +} +.btn:active, +.btn.active { + background-image: none; + outline: 0; + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); +} +.btn.disabled, +.btn[disabled], +fieldset[disabled] .btn { + cursor: not-allowed; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + box-shadow: none; + opacity: .65; +} +a.btn.disabled, +fieldset[disabled] a.btn { + pointer-events: none; +} +.btn-default { + color: #333; + background-color: #fff; + border-color: #ccc; +} +.btn-default:focus, +.btn-default.focus { + color: #333; + background-color: #e6e6e6; + border-color: #8c8c8c; +} +.btn-default:hover { + color: #333; + background-color: #e6e6e6; + border-color: #adadad; +} +.btn-default:active, +.btn-default.active, +.open > .dropdown-toggle.btn-default { + color: #333; + background-color: #e6e6e6; + border-color: #adadad; +} +.btn-default:active:hover, +.btn-default.active:hover, +.open > .dropdown-toggle.btn-default:hover, +.btn-default:active:focus, +.btn-default.active:focus, +.open > .dropdown-toggle.btn-default:focus, +.btn-default:active.focus, +.btn-default.active.focus, +.open > .dropdown-toggle.btn-default.focus { + color: #333; + background-color: #d4d4d4; + border-color: #8c8c8c; +} +.btn-default:active, +.btn-default.active, +.open > .dropdown-toggle.btn-default { + background-image: none; +} +.btn-default.disabled:hover, +.btn-default[disabled]:hover, +fieldset[disabled] .btn-default:hover, +.btn-default.disabled:focus, +.btn-default[disabled]:focus, +fieldset[disabled] .btn-default:focus, +.btn-default.disabled.focus, +.btn-default[disabled].focus, +fieldset[disabled] .btn-default.focus { + background-color: #fff; + border-color: #ccc; +} +.btn-default .badge { + color: #fff; + background-color: #333; +} +.btn-primary { + color: #fff; + background-color: #337ab7; + border-color: #2e6da4; +} +.btn-primary:focus, +.btn-primary.focus { + color: #fff; + background-color: #286090; + border-color: #122b40; +} +.btn-primary:hover { + color: #fff; + background-color: #286090; + border-color: #204d74; +} +.btn-primary:active, +.btn-primary.active, +.open > .dropdown-toggle.btn-primary { + color: #fff; + background-color: #286090; + border-color: #204d74; +} +.btn-primary:active:hover, +.btn-primary.active:hover, +.open > .dropdown-toggle.btn-primary:hover, +.btn-primary:active:focus, +.btn-primary.active:focus, +.open > .dropdown-toggle.btn-primary:focus, +.btn-primary:active.focus, +.btn-primary.active.focus, +.open > .dropdown-toggle.btn-primary.focus { + color: #fff; + background-color: #204d74; + border-color: #122b40; +} +.btn-primary:active, +.btn-primary.active, +.open > .dropdown-toggle.btn-primary { + background-image: none; +} +.btn-primary.disabled:hover, +.btn-primary[disabled]:hover, +fieldset[disabled] .btn-primary:hover, +.btn-primary.disabled:focus, +.btn-primary[disabled]:focus, +fieldset[disabled] .btn-primary:focus, +.btn-primary.disabled.focus, +.btn-primary[disabled].focus, +fieldset[disabled] .btn-primary.focus { + background-color: #337ab7; + border-color: #2e6da4; +} +.btn-primary .badge { + color: #337ab7; + background-color: #fff; +} +.btn-success { + color: #fff; + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success:focus, +.btn-success.focus { + color: #fff; + background-color: #449d44; + border-color: #255625; +} +.btn-success:hover { + color: #fff; + background-color: #449d44; + border-color: #398439; +} +.btn-success:active, +.btn-success.active, +.open > .dropdown-toggle.btn-success { + color: #fff; + background-color: #449d44; + border-color: #398439; +} +.btn-success:active:hover, +.btn-success.active:hover, +.open > .dropdown-toggle.btn-success:hover, +.btn-success:active:focus, +.btn-success.active:focus, +.open > .dropdown-toggle.btn-success:focus, +.btn-success:active.focus, +.btn-success.active.focus, +.open > .dropdown-toggle.btn-success.focus { + color: #fff; + background-color: #398439; + border-color: #255625; +} +.btn-success:active, +.btn-success.active, +.open > .dropdown-toggle.btn-success { + background-image: none; +} +.btn-success.disabled:hover, +.btn-success[disabled]:hover, +fieldset[disabled] .btn-success:hover, +.btn-success.disabled:focus, +.btn-success[disabled]:focus, +fieldset[disabled] .btn-success:focus, +.btn-success.disabled.focus, +.btn-success[disabled].focus, +fieldset[disabled] .btn-success.focus { + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success .badge { + color: #5cb85c; + background-color: #fff; +} +.btn-info { + color: #fff; + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info:focus, +.btn-info.focus { + color: #fff; + background-color: #31b0d5; + border-color: #1b6d85; +} +.btn-info:hover { + color: #fff; + background-color: #31b0d5; + border-color: #269abc; +} +.btn-info:active, +.btn-info.active, +.open > .dropdown-toggle.btn-info { + color: #fff; + background-color: #31b0d5; + border-color: #269abc; +} +.btn-info:active:hover, +.btn-info.active:hover, +.open > .dropdown-toggle.btn-info:hover, +.btn-info:active:focus, +.btn-info.active:focus, +.open > .dropdown-toggle.btn-info:focus, +.btn-info:active.focus, +.btn-info.active.focus, +.open > .dropdown-toggle.btn-info.focus { + color: #fff; + background-color: #269abc; + border-color: #1b6d85; +} +.btn-info:active, +.btn-info.active, +.open > .dropdown-toggle.btn-info { + background-image: none; +} +.btn-info.disabled:hover, +.btn-info[disabled]:hover, +fieldset[disabled] .btn-info:hover, +.btn-info.disabled:focus, +.btn-info[disabled]:focus, +fieldset[disabled] .btn-info:focus, +.btn-info.disabled.focus, +.btn-info[disabled].focus, +fieldset[disabled] .btn-info.focus { + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info .badge { + color: #5bc0de; + background-color: #fff; +} +.btn-warning { + color: #fff; + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning:focus, +.btn-warning.focus { + color: #fff; + background-color: #ec971f; + border-color: #985f0d; +} +.btn-warning:hover { + color: #fff; + background-color: #ec971f; + border-color: #d58512; +} +.btn-warning:active, +.btn-warning.active, +.open > .dropdown-toggle.btn-warning { + color: #fff; + background-color: #ec971f; + border-color: #d58512; +} +.btn-warning:active:hover, +.btn-warning.active:hover, +.open > .dropdown-toggle.btn-warning:hover, +.btn-warning:active:focus, +.btn-warning.active:focus, +.open > .dropdown-toggle.btn-warning:focus, +.btn-warning:active.focus, +.btn-warning.active.focus, +.open > .dropdown-toggle.btn-warning.focus { + color: #fff; + background-color: #d58512; + border-color: #985f0d; +} +.btn-warning:active, +.btn-warning.active, +.open > .dropdown-toggle.btn-warning { + background-image: none; +} +.btn-warning.disabled:hover, +.btn-warning[disabled]:hover, +fieldset[disabled] .btn-warning:hover, +.btn-warning.disabled:focus, +.btn-warning[disabled]:focus, +fieldset[disabled] .btn-warning:focus, +.btn-warning.disabled.focus, +.btn-warning[disabled].focus, +fieldset[disabled] .btn-warning.focus { + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning .badge { + color: #f0ad4e; + background-color: #fff; +} +.btn-danger { + color: #fff; + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger:focus, +.btn-danger.focus { + color: #fff; + background-color: #c9302c; + border-color: #761c19; +} +.btn-danger:hover { + color: #fff; + background-color: #c9302c; + border-color: #ac2925; +} +.btn-danger:active, +.btn-danger.active, +.open > .dropdown-toggle.btn-danger { + color: #fff; + background-color: #c9302c; + border-color: #ac2925; +} +.btn-danger:active:hover, +.btn-danger.active:hover, +.open > .dropdown-toggle.btn-danger:hover, +.btn-danger:active:focus, +.btn-danger.active:focus, +.open > .dropdown-toggle.btn-danger:focus, +.btn-danger:active.focus, +.btn-danger.active.focus, +.open > .dropdown-toggle.btn-danger.focus { + color: #fff; + background-color: #ac2925; + border-color: #761c19; +} +.btn-danger:active, +.btn-danger.active, +.open > .dropdown-toggle.btn-danger { + background-image: none; +} +.btn-danger.disabled:hover, +.btn-danger[disabled]:hover, +fieldset[disabled] .btn-danger:hover, +.btn-danger.disabled:focus, +.btn-danger[disabled]:focus, +fieldset[disabled] .btn-danger:focus, +.btn-danger.disabled.focus, +.btn-danger[disabled].focus, +fieldset[disabled] .btn-danger.focus { + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger .badge { + color: #d9534f; + background-color: #fff; +} +.btn-link { + font-weight: normal; + color: #337ab7; + border-radius: 0; +} +.btn-link, +.btn-link:active, +.btn-link.active, +.btn-link[disabled], +fieldset[disabled] .btn-link { + background-color: transparent; + -webkit-box-shadow: none; + box-shadow: none; +} +.btn-link, +.btn-link:hover, +.btn-link:focus, +.btn-link:active { + border-color: transparent; +} +.btn-link:hover, +.btn-link:focus { + color: #23527c; + text-decoration: underline; + background-color: transparent; +} +.btn-link[disabled]:hover, +fieldset[disabled] .btn-link:hover, +.btn-link[disabled]:focus, +fieldset[disabled] .btn-link:focus { + color: #777; + text-decoration: none; +} +.btn-lg, +.btn-group-lg > .btn { + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; +} +.btn-sm, +.btn-group-sm > .btn { + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-xs, +.btn-group-xs > .btn { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-block { + display: block; + width: 100%; +} +.btn-block + .btn-block { + margin-top: 5px; +} +input[type="submit"].btn-block, +input[type="reset"].btn-block, +input[type="button"].btn-block { + width: 100%; +} +.fade { + opacity: 0; + -webkit-transition: opacity .15s linear; + -o-transition: opacity .15s linear; + transition: opacity .15s linear; +} +.fade.in { + opacity: 1; +} +.collapse { + display: none; +} +.collapse.in { + display: block; +} +tr.collapse.in { + display: table-row; +} +tbody.collapse.in { + display: table-row-group; +} +.collapsing { + position: relative; + height: 0; + overflow: hidden; + -webkit-transition-timing-function: ease; + -o-transition-timing-function: ease; + transition-timing-function: ease; + -webkit-transition-duration: .35s; + -o-transition-duration: .35s; + transition-duration: .35s; + -webkit-transition-property: height, visibility; + -o-transition-property: height, visibility; + transition-property: height, visibility; +} +.caret { + display: inline-block; + width: 0; + height: 0; + margin-left: 2px; + vertical-align: middle; + border-top: 4px dashed; + border-top: 4px solid \9; + border-right: 4px solid transparent; + border-left: 4px solid transparent; +} +.dropup, +.dropdown { + position: relative; +} +.dropdown-toggle:focus { + outline: 0; +} +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + font-size: 14px; + text-align: left; + list-style: none; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, .15); + border-radius: 4px; + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175); + box-shadow: 0 6px 12px rgba(0, 0, 0, .175); +} +.dropdown-menu.pull-right { + right: 0; + left: auto; +} +.dropdown-menu .divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.dropdown-menu > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 1.42857143; + color: #333; + white-space: nowrap; +} +.dropdown-menu > li > a:hover, +.dropdown-menu > li > a:focus { + color: #262626; + text-decoration: none; + background-color: #f5f5f5; +} +.dropdown-menu > .active > a, +.dropdown-menu > .active > a:hover, +.dropdown-menu > .active > a:focus { + color: #fff; + text-decoration: none; + background-color: #337ab7; + outline: 0; +} +.dropdown-menu > .disabled > a, +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + color: #777; +} +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + text-decoration: none; + cursor: not-allowed; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} +.open > .dropdown-menu { + display: block; +} +.open > a { + outline: 0; +} +.dropdown-menu-right { + right: 0; + left: auto; +} +.dropdown-menu-left { + right: auto; + left: 0; +} +.dropdown-header { + display: block; + padding: 3px 20px; + font-size: 12px; + line-height: 1.42857143; + color: #777; + white-space: nowrap; +} +.dropdown-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 990; +} +.pull-right > .dropdown-menu { + right: 0; + left: auto; +} +.dropup .caret, +.navbar-fixed-bottom .dropdown .caret { + content: ""; + border-top: 0; + border-bottom: 4px dashed; + border-bottom: 4px solid \9; +} +.dropup .dropdown-menu, +.navbar-fixed-bottom .dropdown .dropdown-menu { + top: auto; + bottom: 100%; + margin-bottom: 2px; +} +@media (min-width: 768px) { + .navbar-right .dropdown-menu { + right: 0; + left: auto; + } + .navbar-right .dropdown-menu-left { + right: auto; + left: 0; + } +} +.btn-group, +.btn-group-vertical { + position: relative; + display: inline-block; + vertical-align: middle; +} +.btn-group > .btn, +.btn-group-vertical > .btn { + position: relative; + float: left; +} +.btn-group > .btn:hover, +.btn-group-vertical > .btn:hover, +.btn-group > .btn:focus, +.btn-group-vertical > .btn:focus, +.btn-group > .btn:active, +.btn-group-vertical > .btn:active, +.btn-group > .btn.active, +.btn-group-vertical > .btn.active { + z-index: 2; +} +.btn-group .btn + .btn, +.btn-group .btn + .btn-group, +.btn-group .btn-group + .btn, +.btn-group .btn-group + .btn-group { + margin-left: -1px; +} +.btn-toolbar { + margin-left: -5px; +} +.btn-toolbar .btn, +.btn-toolbar .btn-group, +.btn-toolbar .input-group { + float: left; +} +.btn-toolbar > .btn, +.btn-toolbar > .btn-group, +.btn-toolbar > .input-group { + margin-left: 5px; +} +.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { + border-radius: 0; +} +.btn-group > .btn:first-child { + margin-left: 0; +} +.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.btn-group > .btn:last-child:not(:first-child), +.btn-group > .dropdown-toggle:not(:first-child) { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group > .btn-group { + float: left; +} +.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group .dropdown-toggle:active, +.btn-group.open .dropdown-toggle { + outline: 0; +} +.btn-group > .btn + .dropdown-toggle { + padding-right: 8px; + padding-left: 8px; +} +.btn-group > .btn-lg + .dropdown-toggle { + padding-right: 12px; + padding-left: 12px; +} +.btn-group.open .dropdown-toggle { + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125); +} +.btn-group.open .dropdown-toggle.btn-link { + -webkit-box-shadow: none; + box-shadow: none; +} +.btn .caret { + margin-left: 0; +} +.btn-lg .caret { + border-width: 5px 5px 0; + border-bottom-width: 0; +} +.dropup .btn-lg .caret { + border-width: 0 5px 5px; +} +.btn-group-vertical > .btn, +.btn-group-vertical > .btn-group, +.btn-group-vertical > .btn-group > .btn { + display: block; + float: none; + width: 100%; + max-width: 100%; +} +.btn-group-vertical > .btn-group > .btn { + float: none; +} +.btn-group-vertical > .btn + .btn, +.btn-group-vertical > .btn + .btn-group, +.btn-group-vertical > .btn-group + .btn, +.btn-group-vertical > .btn-group + .btn-group { + margin-top: -1px; + margin-left: 0; +} +.btn-group-vertical > .btn:not(:first-child):not(:last-child) { + border-radius: 0; +} +.btn-group-vertical > .btn:first-child:not(:last-child) { + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn:last-child:not(:first-child) { + border-top-left-radius: 0; + border-top-right-radius: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; +} +.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.btn-group-justified { + display: table; + width: 100%; + table-layout: fixed; + border-collapse: separate; +} +.btn-group-justified > .btn, +.btn-group-justified > .btn-group { + display: table-cell; + float: none; + width: 1%; +} +.btn-group-justified > .btn-group .btn { + width: 100%; +} +.btn-group-justified > .btn-group .dropdown-menu { + left: auto; +} +[data-toggle="buttons"] > .btn input[type="radio"], +[data-toggle="buttons"] > .btn-group > .btn input[type="radio"], +[data-toggle="buttons"] > .btn input[type="checkbox"], +[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] { + position: absolute; + clip: rect(0, 0, 0, 0); + pointer-events: none; +} +.input-group { + position: relative; + display: table; + border-collapse: separate; +} +.input-group[class*="col-"] { + float: none; + padding-right: 0; + padding-left: 0; +} +.input-group .form-control { + position: relative; + z-index: 2; + float: left; + width: 100%; + margin-bottom: 0; +} +.input-group .form-control:focus { + z-index: 3; +} +.input-group-lg > .form-control, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .btn { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; + border-radius: 6px; +} +select.input-group-lg > .form-control, +select.input-group-lg > .input-group-addon, +select.input-group-lg > .input-group-btn > .btn { + height: 46px; + line-height: 46px; +} +textarea.input-group-lg > .form-control, +textarea.input-group-lg > .input-group-addon, +textarea.input-group-lg > .input-group-btn > .btn, +select[multiple].input-group-lg > .form-control, +select[multiple].input-group-lg > .input-group-addon, +select[multiple].input-group-lg > .input-group-btn > .btn { + height: auto; +} +.input-group-sm > .form-control, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .btn { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-group-sm > .form-control, +select.input-group-sm > .input-group-addon, +select.input-group-sm > .input-group-btn > .btn { + height: 30px; + line-height: 30px; +} +textarea.input-group-sm > .form-control, +textarea.input-group-sm > .input-group-addon, +textarea.input-group-sm > .input-group-btn > .btn, +select[multiple].input-group-sm > .form-control, +select[multiple].input-group-sm > .input-group-addon, +select[multiple].input-group-sm > .input-group-btn > .btn { + height: auto; +} +.input-group-addon, +.input-group-btn, +.input-group .form-control { + display: table-cell; +} +.input-group-addon:not(:first-child):not(:last-child), +.input-group-btn:not(:first-child):not(:last-child), +.input-group .form-control:not(:first-child):not(:last-child) { + border-radius: 0; +} +.input-group-addon, +.input-group-btn { + width: 1%; + white-space: nowrap; + vertical-align: middle; +} +.input-group-addon { + padding: 6px 12px; + font-size: 14px; + font-weight: normal; + line-height: 1; + color: #555; + text-align: center; + background-color: #eee; + border: 1px solid #ccc; + border-radius: 4px; +} +.input-group-addon.input-sm { + padding: 5px 10px; + font-size: 12px; + border-radius: 3px; +} +.input-group-addon.input-lg { + padding: 10px 16px; + font-size: 18px; + border-radius: 6px; +} +.input-group-addon input[type="radio"], +.input-group-addon input[type="checkbox"] { + margin-top: 0; +} +.input-group .form-control:first-child, +.input-group-addon:first-child, +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group > .btn, +.input-group-btn:first-child > .dropdown-toggle, +.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), +.input-group-btn:last-child > .btn-group:not(:last-child) > .btn { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.input-group-addon:first-child { + border-right: 0; +} +.input-group .form-control:last-child, +.input-group-addon:last-child, +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group > .btn, +.input-group-btn:last-child > .dropdown-toggle, +.input-group-btn:first-child > .btn:not(:first-child), +.input-group-btn:first-child > .btn-group:not(:first-child) > .btn { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.input-group-addon:last-child { + border-left: 0; +} +.input-group-btn { + position: relative; + font-size: 0; + white-space: nowrap; +} +.input-group-btn > .btn { + position: relative; +} +.input-group-btn > .btn + .btn { + margin-left: -1px; +} +.input-group-btn > .btn:hover, +.input-group-btn > .btn:focus, +.input-group-btn > .btn:active { + z-index: 2; +} +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group { + margin-right: -1px; +} +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group { + z-index: 2; + margin-left: -1px; +} +.nav { + padding-left: 0; + margin-bottom: 0; + list-style: none; +} +.nav > li { + position: relative; + display: block; +} +.nav > li > a { + position: relative; + display: block; + padding: 10px 15px; +} +.nav > li > a:hover, +.nav > li > a:focus { + text-decoration: none; + background-color: #eee; +} +.nav > li.disabled > a { + color: #777; +} +.nav > li.disabled > a:hover, +.nav > li.disabled > a:focus { + color: #777; + text-decoration: none; + cursor: not-allowed; + background-color: transparent; +} +.nav .open > a, +.nav .open > a:hover, +.nav .open > a:focus { + background-color: #eee; + border-color: #337ab7; +} +.nav .nav-divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.nav > li > a > img { + max-width: none; +} +.nav-tabs { + border-bottom: 1px solid #ddd; +} +.nav-tabs > li { + float: left; + margin-bottom: -1px; +} +.nav-tabs > li > a { + margin-right: 2px; + line-height: 1.42857143; + border: 1px solid transparent; + border-radius: 4px 4px 0 0; +} +.nav-tabs > li > a:hover { + border-color: #eee #eee #ddd; +} +.nav-tabs > li.active > a, +.nav-tabs > li.active > a:hover, +.nav-tabs > li.active > a:focus { + color: #555; + cursor: default; + background-color: #fff; + border: 1px solid #ddd; + border-bottom-color: transparent; +} +.nav-tabs.nav-justified { + width: 100%; + border-bottom: 0; +} +.nav-tabs.nav-justified > li { + float: none; +} +.nav-tabs.nav-justified > li > a { + margin-bottom: 5px; + text-align: center; +} +.nav-tabs.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-tabs.nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs.nav-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs.nav-justified > .active > a, +.nav-tabs.nav-justified > .active > a:hover, +.nav-tabs.nav-justified > .active > a:focus { + border: 1px solid #ddd; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li > a { + border-bottom: 1px solid #ddd; + border-radius: 4px 4px 0 0; + } + .nav-tabs.nav-justified > .active > a, + .nav-tabs.nav-justified > .active > a:hover, + .nav-tabs.nav-justified > .active > a:focus { + border-bottom-color: #fff; + } +} +.nav-pills > li { + float: left; +} +.nav-pills > li > a { + border-radius: 4px; +} +.nav-pills > li + li { + margin-left: 2px; +} +.nav-pills > li.active > a, +.nav-pills > li.active > a:hover, +.nav-pills > li.active > a:focus { + color: #fff; + background-color: #337ab7; +} +.nav-stacked > li { + float: none; +} +.nav-stacked > li + li { + margin-top: 2px; + margin-left: 0; +} +.nav-justified { + width: 100%; +} +.nav-justified > li { + float: none; +} +.nav-justified > li > a { + margin-bottom: 5px; + text-align: center; +} +.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs-justified { + border-bottom: 0; +} +.nav-tabs-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs-justified > .active > a, +.nav-tabs-justified > .active > a:hover, +.nav-tabs-justified > .active > a:focus { + border: 1px solid #ddd; +} +@media (min-width: 768px) { + .nav-tabs-justified > li > a { + border-bottom: 1px solid #ddd; + border-radius: 4px 4px 0 0; + } + .nav-tabs-justified > .active > a, + .nav-tabs-justified > .active > a:hover, + .nav-tabs-justified > .active > a:focus { + border-bottom-color: #fff; + } +} +.tab-content > .tab-pane { + display: none; +} +.tab-content > .active { + display: block; +} +.nav-tabs .dropdown-menu { + margin-top: -1px; + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.navbar { + position: relative; + min-height: 50px; + margin-bottom: 20px; + border: 1px solid transparent; +} +@media (min-width: 768px) { + .navbar { + border-radius: 4px; + } +} +@media (min-width: 768px) { + .navbar-header { + float: left; + } +} +.navbar-collapse { + padding-right: 15px; + padding-left: 15px; + overflow-x: visible; + -webkit-overflow-scrolling: touch; + border-top: 1px solid transparent; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); +} +.navbar-collapse.in { + overflow-y: auto; +} +@media (min-width: 768px) { + .navbar-collapse { + width: auto; + border-top: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .navbar-collapse.collapse { + display: block !important; + height: auto !important; + padding-bottom: 0; + overflow: visible !important; + } + .navbar-collapse.in { + overflow-y: visible; + } + .navbar-fixed-top .navbar-collapse, + .navbar-static-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + padding-right: 0; + padding-left: 0; + } +} +.navbar-fixed-top .navbar-collapse, +.navbar-fixed-bottom .navbar-collapse { + max-height: 340px; +} +@media (max-device-width: 480px) and (orientation: landscape) { + .navbar-fixed-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + max-height: 200px; + } +} +.container > .navbar-header, +.container-fluid > .navbar-header, +.container > .navbar-collapse, +.container-fluid > .navbar-collapse { + margin-right: -15px; + margin-left: -15px; +} +@media (min-width: 768px) { + .container > .navbar-header, + .container-fluid > .navbar-header, + .container > .navbar-collapse, + .container-fluid > .navbar-collapse { + margin-right: 0; + margin-left: 0; + } +} +.navbar-static-top { + z-index: 1000; + border-width: 0 0 1px; +} +@media (min-width: 768px) { + .navbar-static-top { + border-radius: 0; + } +} +.navbar-fixed-top, +.navbar-fixed-bottom { + position: fixed; + right: 0; + left: 0; + z-index: 1030; +} +@media (min-width: 768px) { + .navbar-fixed-top, + .navbar-fixed-bottom { + border-radius: 0; + } +} +.navbar-fixed-top { + top: 0; + border-width: 0 0 1px; +} +.navbar-fixed-bottom { + bottom: 0; + margin-bottom: 0; + border-width: 1px 0 0; +} +.navbar-brand { + float: left; + height: 50px; + padding: 15px 15px; + font-size: 18px; + line-height: 20px; +} +.navbar-brand:hover, +.navbar-brand:focus { + text-decoration: none; +} +.navbar-brand > img { + display: block; +} +@media (min-width: 768px) { + .navbar > .container .navbar-brand, + .navbar > .container-fluid .navbar-brand { + margin-left: -15px; + } +} +.navbar-toggle { + position: relative; + float: right; + padding: 9px 10px; + margin-top: 8px; + margin-right: 15px; + margin-bottom: 8px; + background-color: transparent; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; +} +.navbar-toggle:focus { + outline: 0; +} +.navbar-toggle .icon-bar { + display: block; + width: 22px; + height: 2px; + border-radius: 1px; +} +.navbar-toggle .icon-bar + .icon-bar { + margin-top: 4px; +} +@media (min-width: 768px) { + .navbar-toggle { + display: none; + } +} +.navbar-nav { + margin: 7.5px -15px; +} +.navbar-nav > li > a { + padding-top: 10px; + padding-bottom: 10px; + line-height: 20px; +} +@media (max-width: 767px) { + .navbar-nav .open .dropdown-menu { + position: static; + float: none; + width: auto; + margin-top: 0; + background-color: transparent; + border: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .navbar-nav .open .dropdown-menu > li > a, + .navbar-nav .open .dropdown-menu .dropdown-header { + padding: 5px 15px 5px 25px; + } + .navbar-nav .open .dropdown-menu > li > a { + line-height: 20px; + } + .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-nav .open .dropdown-menu > li > a:focus { + background-image: none; + } +} +@media (min-width: 768px) { + .navbar-nav { + float: left; + margin: 0; + } + .navbar-nav > li { + float: left; + } + .navbar-nav > li > a { + padding-top: 15px; + padding-bottom: 15px; + } +} +.navbar-form { + padding: 10px 15px; + margin-top: 8px; + margin-right: -15px; + margin-bottom: 8px; + margin-left: -15px; + border-top: 1px solid transparent; + border-bottom: 1px solid transparent; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1); +} +@media (min-width: 768px) { + .navbar-form .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .navbar-form .form-control-static { + display: inline-block; + } + .navbar-form .input-group { + display: inline-table; + vertical-align: middle; + } + .navbar-form .input-group .input-group-addon, + .navbar-form .input-group .input-group-btn, + .navbar-form .input-group .form-control { + width: auto; + } + .navbar-form .input-group > .form-control { + width: 100%; + } + .navbar-form .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .radio, + .navbar-form .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .radio label, + .navbar-form .checkbox label { + padding-left: 0; + } + .navbar-form .radio input[type="radio"], + .navbar-form .checkbox input[type="checkbox"] { + position: relative; + margin-left: 0; + } + .navbar-form .has-feedback .form-control-feedback { + top: 0; + } +} +@media (max-width: 767px) { + .navbar-form .form-group { + margin-bottom: 5px; + } + .navbar-form .form-group:last-child { + margin-bottom: 0; + } +} +@media (min-width: 768px) { + .navbar-form { + width: auto; + padding-top: 0; + padding-bottom: 0; + margin-right: 0; + margin-left: 0; + border: 0; + -webkit-box-shadow: none; + box-shadow: none; + } +} +.navbar-nav > li > .dropdown-menu { + margin-top: 0; + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { + margin-bottom: 0; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.navbar-btn { + margin-top: 8px; + margin-bottom: 8px; +} +.navbar-btn.btn-sm { + margin-top: 10px; + margin-bottom: 10px; +} +.navbar-btn.btn-xs { + margin-top: 14px; + margin-bottom: 14px; +} +.navbar-text { + margin-top: 15px; + margin-bottom: 15px; +} +@media (min-width: 768px) { + .navbar-text { + float: left; + margin-right: 15px; + margin-left: 15px; + } +} +@media (min-width: 768px) { + .navbar-left { + float: left !important; + } + .navbar-right { + float: right !important; + margin-right: -15px; + } + .navbar-right ~ .navbar-right { + margin-right: 0; + } +} +.navbar-default { + background-color: #f8f8f8; + border-color: #e7e7e7; +} +.navbar-default .navbar-brand { + color: #777; +} +.navbar-default .navbar-brand:hover, +.navbar-default .navbar-brand:focus { + color: #5e5e5e; + background-color: transparent; +} +.navbar-default .navbar-text { + color: #777; +} +.navbar-default .navbar-nav > li > a { + color: #777; +} +.navbar-default .navbar-nav > li > a:hover, +.navbar-default .navbar-nav > li > a:focus { + color: #333; + background-color: transparent; +} +.navbar-default .navbar-nav > .active > a, +.navbar-default .navbar-nav > .active > a:hover, +.navbar-default .navbar-nav > .active > a:focus { + color: #555; + background-color: #e7e7e7; +} +.navbar-default .navbar-nav > .disabled > a, +.navbar-default .navbar-nav > .disabled > a:hover, +.navbar-default .navbar-nav > .disabled > a:focus { + color: #ccc; + background-color: transparent; +} +.navbar-default .navbar-toggle { + border-color: #ddd; +} +.navbar-default .navbar-toggle:hover, +.navbar-default .navbar-toggle:focus { + background-color: #ddd; +} +.navbar-default .navbar-toggle .icon-bar { + background-color: #888; +} +.navbar-default .navbar-collapse, +.navbar-default .navbar-form { + border-color: #e7e7e7; +} +.navbar-default .navbar-nav > .open > a, +.navbar-default .navbar-nav > .open > a:hover, +.navbar-default .navbar-nav > .open > a:focus { + color: #555; + background-color: #e7e7e7; +} +@media (max-width: 767px) { + .navbar-default .navbar-nav .open .dropdown-menu > li > a { + color: #777; + } + .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { + color: #333; + background-color: transparent; + } + .navbar-default .navbar-nav .open .dropdown-menu > .active > a, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #555; + background-color: #e7e7e7; + } + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #ccc; + background-color: transparent; + } +} +.navbar-default .navbar-link { + color: #777; +} +.navbar-default .navbar-link:hover { + color: #333; +} +.navbar-default .btn-link { + color: #777; +} +.navbar-default .btn-link:hover, +.navbar-default .btn-link:focus { + color: #333; +} +.navbar-default .btn-link[disabled]:hover, +fieldset[disabled] .navbar-default .btn-link:hover, +.navbar-default .btn-link[disabled]:focus, +fieldset[disabled] .navbar-default .btn-link:focus { + color: #ccc; +} +.navbar-inverse { + background-color: #222; + border-color: #080808; +} +.navbar-inverse .navbar-brand { + color: #9d9d9d; +} +.navbar-inverse .navbar-brand:hover, +.navbar-inverse .navbar-brand:focus { + color: #fff; + background-color: transparent; +} +.navbar-inverse .navbar-text { + color: #9d9d9d; +} +.navbar-inverse .navbar-nav > li > a { + color: #9d9d9d; +} +.navbar-inverse .navbar-nav > li > a:hover, +.navbar-inverse .navbar-nav > li > a:focus { + color: #fff; + background-color: transparent; +} +.navbar-inverse .navbar-nav > .active > a, +.navbar-inverse .navbar-nav > .active > a:hover, +.navbar-inverse .navbar-nav > .active > a:focus { + color: #fff; + background-color: #080808; +} +.navbar-inverse .navbar-nav > .disabled > a, +.navbar-inverse .navbar-nav > .disabled > a:hover, +.navbar-inverse .navbar-nav > .disabled > a:focus { + color: #444; + background-color: transparent; +} +.navbar-inverse .navbar-toggle { + border-color: #333; +} +.navbar-inverse .navbar-toggle:hover, +.navbar-inverse .navbar-toggle:focus { + background-color: #333; +} +.navbar-inverse .navbar-toggle .icon-bar { + background-color: #fff; +} +.navbar-inverse .navbar-collapse, +.navbar-inverse .navbar-form { + border-color: #101010; +} +.navbar-inverse .navbar-nav > .open > a, +.navbar-inverse .navbar-nav > .open > a:hover, +.navbar-inverse .navbar-nav > .open > a:focus { + color: #fff; + background-color: #080808; +} +@media (max-width: 767px) { + .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { + border-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu .divider { + background-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { + color: #9d9d9d; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { + color: #fff; + background-color: transparent; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #fff; + background-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #444; + background-color: transparent; + } +} +.navbar-inverse .navbar-link { + color: #9d9d9d; +} +.navbar-inverse .navbar-link:hover { + color: #fff; +} +.navbar-inverse .btn-link { + color: #9d9d9d; +} +.navbar-inverse .btn-link:hover, +.navbar-inverse .btn-link:focus { + color: #fff; +} +.navbar-inverse .btn-link[disabled]:hover, +fieldset[disabled] .navbar-inverse .btn-link:hover, +.navbar-inverse .btn-link[disabled]:focus, +fieldset[disabled] .navbar-inverse .btn-link:focus { + color: #444; +} +.breadcrumb { + padding: 8px 15px; + margin-bottom: 20px; + list-style: none; + background-color: #f5f5f5; + border-radius: 4px; +} +.breadcrumb > li { + display: inline-block; +} +.breadcrumb > li + li:before { + padding: 0 5px; + color: #ccc; + content: "/\00a0"; +} +.breadcrumb > .active { + color: #777; +} +.pagination { + display: inline-block; + padding-left: 0; + margin: 20px 0; + border-radius: 4px; +} +.pagination > li { + display: inline; +} +.pagination > li > a, +.pagination > li > span { + position: relative; + float: left; + padding: 6px 12px; + margin-left: -1px; + line-height: 1.42857143; + color: #337ab7; + text-decoration: none; + background-color: #fff; + border: 1px solid #ddd; +} +.pagination > li:first-child > a, +.pagination > li:first-child > span { + margin-left: 0; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; +} +.pagination > li:last-child > a, +.pagination > li:last-child > span { + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; +} +.pagination > li > a:hover, +.pagination > li > span:hover, +.pagination > li > a:focus, +.pagination > li > span:focus { + z-index: 2; + color: #23527c; + background-color: #eee; + border-color: #ddd; +} +.pagination > .active > a, +.pagination > .active > span, +.pagination > .active > a:hover, +.pagination > .active > span:hover, +.pagination > .active > a:focus, +.pagination > .active > span:focus { + z-index: 3; + color: #fff; + cursor: default; + background-color: #337ab7; + border-color: #337ab7; +} +.pagination > .disabled > span, +.pagination > .disabled > span:hover, +.pagination > .disabled > span:focus, +.pagination > .disabled > a, +.pagination > .disabled > a:hover, +.pagination > .disabled > a:focus { + color: #777; + cursor: not-allowed; + background-color: #fff; + border-color: #ddd; +} +.pagination-lg > li > a, +.pagination-lg > li > span { + padding: 10px 16px; + font-size: 18px; + line-height: 1.3333333; +} +.pagination-lg > li:first-child > a, +.pagination-lg > li:first-child > span { + border-top-left-radius: 6px; + border-bottom-left-radius: 6px; +} +.pagination-lg > li:last-child > a, +.pagination-lg > li:last-child > span { + border-top-right-radius: 6px; + border-bottom-right-radius: 6px; +} +.pagination-sm > li > a, +.pagination-sm > li > span { + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; +} +.pagination-sm > li:first-child > a, +.pagination-sm > li:first-child > span { + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; +} +.pagination-sm > li:last-child > a, +.pagination-sm > li:last-child > span { + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; +} +.pager { + padding-left: 0; + margin: 20px 0; + text-align: center; + list-style: none; +} +.pager li { + display: inline; +} +.pager li > a, +.pager li > span { + display: inline-block; + padding: 5px 14px; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 15px; +} +.pager li > a:hover, +.pager li > a:focus { + text-decoration: none; + background-color: #eee; +} +.pager .next > a, +.pager .next > span { + float: right; +} +.pager .previous > a, +.pager .previous > span { + float: left; +} +.pager .disabled > a, +.pager .disabled > a:hover, +.pager .disabled > a:focus, +.pager .disabled > span { + color: #777; + cursor: not-allowed; + background-color: #fff; +} +.label { + display: inline; + padding: .2em .6em .3em; + font-size: 75%; + font-weight: bold; + line-height: 1; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: .25em; +} +a.label:hover, +a.label:focus { + color: #fff; + text-decoration: none; + cursor: pointer; +} +.label:empty { + display: none; +} +.btn .label { + position: relative; + top: -1px; +} +.label-default { + background-color: #777; +} +.label-default[href]:hover, +.label-default[href]:focus { + background-color: #5e5e5e; +} +.label-primary { + background-color: #337ab7; +} +.label-primary[href]:hover, +.label-primary[href]:focus { + background-color: #286090; +} +.label-success { + background-color: #5cb85c; +} +.label-success[href]:hover, +.label-success[href]:focus { + background-color: #449d44; +} +.label-info { + background-color: #5bc0de; +} +.label-info[href]:hover, +.label-info[href]:focus { + background-color: #31b0d5; +} +.label-warning { + background-color: #f0ad4e; +} +.label-warning[href]:hover, +.label-warning[href]:focus { + background-color: #ec971f; +} +.label-danger { + background-color: #d9534f; +} +.label-danger[href]:hover, +.label-danger[href]:focus { + background-color: #c9302c; +} +.badge { + display: inline-block; + min-width: 10px; + padding: 3px 7px; + font-size: 12px; + font-weight: bold; + line-height: 1; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: middle; + background-color: #777; + border-radius: 10px; +} +.badge:empty { + display: none; +} +.btn .badge { + position: relative; + top: -1px; +} +.btn-xs .badge, +.btn-group-xs > .btn .badge { + top: 0; + padding: 1px 5px; +} +a.badge:hover, +a.badge:focus { + color: #fff; + text-decoration: none; + cursor: pointer; +} +.list-group-item.active > .badge, +.nav-pills > .active > a > .badge { + color: #337ab7; + background-color: #fff; +} +.list-group-item > .badge { + float: right; +} +.list-group-item > .badge + .badge { + margin-right: 5px; +} +.nav-pills > li > a > .badge { + margin-left: 3px; +} +.jumbotron { + padding-top: 30px; + padding-bottom: 30px; + margin-bottom: 30px; + color: inherit; + background-color: #eee; +} +.jumbotron h1, +.jumbotron .h1 { + color: inherit; +} +.jumbotron p { + margin-bottom: 15px; + font-size: 21px; + font-weight: 200; +} +.jumbotron > hr { + border-top-color: #d5d5d5; +} +.container .jumbotron, +.container-fluid .jumbotron { + padding-right: 15px; + padding-left: 15px; + border-radius: 6px; +} +.jumbotron .container { + max-width: 100%; +} +@media screen and (min-width: 768px) { + .jumbotron { + padding-top: 48px; + padding-bottom: 48px; + } + .container .jumbotron, + .container-fluid .jumbotron { + padding-right: 60px; + padding-left: 60px; + } + .jumbotron h1, + .jumbotron .h1 { + font-size: 63px; + } +} +.thumbnail { + display: block; + padding: 4px; + margin-bottom: 20px; + line-height: 1.42857143; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 4px; + -webkit-transition: border .2s ease-in-out; + -o-transition: border .2s ease-in-out; + transition: border .2s ease-in-out; +} +.thumbnail > img, +.thumbnail a > img { + margin-right: auto; + margin-left: auto; +} +a.thumbnail:hover, +a.thumbnail:focus, +a.thumbnail.active { + border-color: #337ab7; +} +.thumbnail .caption { + padding: 9px; + color: #333; +} +.alert { + padding: 15px; + margin-bottom: 20px; + border: 1px solid transparent; + border-radius: 4px; +} +.alert h4 { + margin-top: 0; + color: inherit; +} +.alert .alert-link { + font-weight: bold; +} +.alert > p, +.alert > ul { + margin-bottom: 0; +} +.alert > p + p { + margin-top: 5px; +} +.alert-dismissable, +.alert-dismissible { + padding-right: 35px; +} +.alert-dismissable .close, +.alert-dismissible .close { + position: relative; + top: -2px; + right: -21px; + color: inherit; +} +.alert-success { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; +} +.alert-success hr { + border-top-color: #c9e2b3; +} +.alert-success .alert-link { + color: #2b542c; +} +.alert-info { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; +} +.alert-info hr { + border-top-color: #a6e1ec; +} +.alert-info .alert-link { + color: #245269; +} +.alert-warning { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; +} +.alert-warning hr { + border-top-color: #f7e1b5; +} +.alert-warning .alert-link { + color: #66512c; +} +.alert-danger { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; +} +.alert-danger hr { + border-top-color: #e4b9c0; +} +.alert-danger .alert-link { + color: #843534; +} +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@-o-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +.progress { + height: 20px; + margin-bottom: 20px; + overflow: hidden; + background-color: #f5f5f5; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1); +} +.progress-bar { + float: left; + width: 0; + height: 100%; + font-size: 12px; + line-height: 20px; + color: #fff; + text-align: center; + background-color: #337ab7; + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15); + -webkit-transition: width .6s ease; + -o-transition: width .6s ease; + transition: width .6s ease; +} +.progress-striped .progress-bar, +.progress-bar-striped { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + -webkit-background-size: 40px 40px; + background-size: 40px 40px; +} +.progress.active .progress-bar, +.progress-bar.active { + -webkit-animation: progress-bar-stripes 2s linear infinite; + -o-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; +} +.progress-bar-success { + background-color: #5cb85c; +} +.progress-striped .progress-bar-success { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.progress-bar-info { + background-color: #5bc0de; +} +.progress-striped .progress-bar-info { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.progress-bar-warning { + background-color: #f0ad4e; +} +.progress-striped .progress-bar-warning { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.progress-bar-danger { + background-color: #d9534f; +} +.progress-striped .progress-bar-danger { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); +} +.media { + margin-top: 15px; +} +.media:first-child { + margin-top: 0; +} +.media, +.media-body { + overflow: hidden; + zoom: 1; +} +.media-body { + width: 10000px; +} +.media-object { + display: block; +} +.media-object.img-thumbnail { + max-width: none; +} +.media-right, +.media > .pull-right { + padding-left: 10px; +} +.media-left, +.media > .pull-left { + padding-right: 10px; +} +.media-left, +.media-right, +.media-body { + display: table-cell; + vertical-align: top; +} +.media-middle { + vertical-align: middle; +} +.media-bottom { + vertical-align: bottom; +} +.media-heading { + margin-top: 0; + margin-bottom: 5px; +} +.media-list { + padding-left: 0; + list-style: none; +} +.list-group { + padding-left: 0; + margin-bottom: 20px; +} +.list-group-item { + position: relative; + display: block; + padding: 10px 15px; + margin-bottom: -1px; + background-color: #fff; + border: 1px solid #ddd; +} +.list-group-item:first-child { + border-top-left-radius: 4px; + border-top-right-radius: 4px; +} +.list-group-item:last-child { + margin-bottom: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; +} +a.list-group-item, +button.list-group-item { + color: #555; +} +a.list-group-item .list-group-item-heading, +button.list-group-item .list-group-item-heading { + color: #333; +} +a.list-group-item:hover, +button.list-group-item:hover, +a.list-group-item:focus, +button.list-group-item:focus { + color: #555; + text-decoration: none; + background-color: #f5f5f5; +} +button.list-group-item { + width: 100%; + text-align: left; +} +.list-group-item.disabled, +.list-group-item.disabled:hover, +.list-group-item.disabled:focus { + color: #777; + cursor: not-allowed; + background-color: #eee; +} +.list-group-item.disabled .list-group-item-heading, +.list-group-item.disabled:hover .list-group-item-heading, +.list-group-item.disabled:focus .list-group-item-heading { + color: inherit; +} +.list-group-item.disabled .list-group-item-text, +.list-group-item.disabled:hover .list-group-item-text, +.list-group-item.disabled:focus .list-group-item-text { + color: #777; +} +.list-group-item.active, +.list-group-item.active:hover, +.list-group-item.active:focus { + z-index: 2; + color: #fff; + background-color: #337ab7; + border-color: #337ab7; +} +.list-group-item.active .list-group-item-heading, +.list-group-item.active:hover .list-group-item-heading, +.list-group-item.active:focus .list-group-item-heading, +.list-group-item.active .list-group-item-heading > small, +.list-group-item.active:hover .list-group-item-heading > small, +.list-group-item.active:focus .list-group-item-heading > small, +.list-group-item.active .list-group-item-heading > .small, +.list-group-item.active:hover .list-group-item-heading > .small, +.list-group-item.active:focus .list-group-item-heading > .small { + color: inherit; +} +.list-group-item.active .list-group-item-text, +.list-group-item.active:hover .list-group-item-text, +.list-group-item.active:focus .list-group-item-text { + color: #c7ddef; +} +.list-group-item-success { + color: #3c763d; + background-color: #dff0d8; +} +a.list-group-item-success, +button.list-group-item-success { + color: #3c763d; +} +a.list-group-item-success .list-group-item-heading, +button.list-group-item-success .list-group-item-heading { + color: inherit; +} +a.list-group-item-success:hover, +button.list-group-item-success:hover, +a.list-group-item-success:focus, +button.list-group-item-success:focus { + color: #3c763d; + background-color: #d0e9c6; +} +a.list-group-item-success.active, +button.list-group-item-success.active, +a.list-group-item-success.active:hover, +button.list-group-item-success.active:hover, +a.list-group-item-success.active:focus, +button.list-group-item-success.active:focus { + color: #fff; + background-color: #3c763d; + border-color: #3c763d; +} +.list-group-item-info { + color: #31708f; + background-color: #d9edf7; +} +a.list-group-item-info, +button.list-group-item-info { + color: #31708f; +} +a.list-group-item-info .list-group-item-heading, +button.list-group-item-info .list-group-item-heading { + color: inherit; +} +a.list-group-item-info:hover, +button.list-group-item-info:hover, +a.list-group-item-info:focus, +button.list-group-item-info:focus { + color: #31708f; + background-color: #c4e3f3; +} +a.list-group-item-info.active, +button.list-group-item-info.active, +a.list-group-item-info.active:hover, +button.list-group-item-info.active:hover, +a.list-group-item-info.active:focus, +button.list-group-item-info.active:focus { + color: #fff; + background-color: #31708f; + border-color: #31708f; +} +.list-group-item-warning { + color: #8a6d3b; + background-color: #fcf8e3; +} +a.list-group-item-warning, +button.list-group-item-warning { + color: #8a6d3b; +} +a.list-group-item-warning .list-group-item-heading, +button.list-group-item-warning .list-group-item-heading { + color: inherit; +} +a.list-group-item-warning:hover, +button.list-group-item-warning:hover, +a.list-group-item-warning:focus, +button.list-group-item-warning:focus { + color: #8a6d3b; + background-color: #faf2cc; +} +a.list-group-item-warning.active, +button.list-group-item-warning.active, +a.list-group-item-warning.active:hover, +button.list-group-item-warning.active:hover, +a.list-group-item-warning.active:focus, +button.list-group-item-warning.active:focus { + color: #fff; + background-color: #8a6d3b; + border-color: #8a6d3b; +} +.list-group-item-danger { + color: #a94442; + background-color: #f2dede; +} +a.list-group-item-danger, +button.list-group-item-danger { + color: #a94442; +} +a.list-group-item-danger .list-group-item-heading, +button.list-group-item-danger .list-group-item-heading { + color: inherit; +} +a.list-group-item-danger:hover, +button.list-group-item-danger:hover, +a.list-group-item-danger:focus, +button.list-group-item-danger:focus { + color: #a94442; + background-color: #ebcccc; +} +a.list-group-item-danger.active, +button.list-group-item-danger.active, +a.list-group-item-danger.active:hover, +button.list-group-item-danger.active:hover, +a.list-group-item-danger.active:focus, +button.list-group-item-danger.active:focus { + color: #fff; + background-color: #a94442; + border-color: #a94442; +} +.list-group-item-heading { + margin-top: 0; + margin-bottom: 5px; +} +.list-group-item-text { + margin-bottom: 0; + line-height: 1.3; +} +.panel { + margin-bottom: 20px; + background-color: #fff; + border: 1px solid transparent; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05); + box-shadow: 0 1px 1px rgba(0, 0, 0, .05); +} +.panel-body { + padding: 15px; +} +.panel-heading { + padding: 10px 15px; + border-bottom: 1px solid transparent; + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel-heading > .dropdown .dropdown-toggle { + color: inherit; +} +.panel-title { + margin-top: 0; + margin-bottom: 0; + font-size: 16px; + color: inherit; +} +.panel-title > a, +.panel-title > small, +.panel-title > .small, +.panel-title > small > a, +.panel-title > .small > a { + color: inherit; +} +.panel-footer { + padding: 10px 15px; + background-color: #f5f5f5; + border-top: 1px solid #ddd; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .list-group, +.panel > .panel-collapse > .list-group { + margin-bottom: 0; +} +.panel > .list-group .list-group-item, +.panel > .panel-collapse > .list-group .list-group-item { + border-width: 1px 0; + border-radius: 0; +} +.panel > .list-group:first-child .list-group-item:first-child, +.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child { + border-top: 0; + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel > .list-group:last-child .list-group-item:last-child, +.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child { + border-bottom: 0; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child { + border-top-left-radius: 0; + border-top-right-radius: 0; +} +.panel-heading + .list-group .list-group-item:first-child { + border-top-width: 0; +} +.list-group + .panel-footer { + border-top-width: 0; +} +.panel > .table, +.panel > .table-responsive > .table, +.panel > .panel-collapse > .table { + margin-bottom: 0; +} +.panel > .table caption, +.panel > .table-responsive > .table caption, +.panel > .panel-collapse > .table caption { + padding-right: 15px; + padding-left: 15px; +} +.panel > .table:first-child, +.panel > .table-responsive:first-child > .table:first-child { + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child { + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { + border-top-left-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { + border-top-right-radius: 3px; +} +.panel > .table:last-child, +.panel > .table-responsive:last-child > .table:last-child { + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child { + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { + border-bottom-right-radius: 3px; +} +.panel > .panel-body + .table, +.panel > .panel-body + .table-responsive, +.panel > .table + .panel-body, +.panel > .table-responsive + .panel-body { + border-top: 1px solid #ddd; +} +.panel > .table > tbody:first-child > tr:first-child th, +.panel > .table > tbody:first-child > tr:first-child td { + border-top: 0; +} +.panel > .table-bordered, +.panel > .table-responsive > .table-bordered { + border: 0; +} +.panel > .table-bordered > thead > tr > th:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:first-child, +.panel > .table-bordered > tbody > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, +.panel > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-bordered > thead > tr > td:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:first-child, +.panel > .table-bordered > tbody > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, +.panel > .table-bordered > tfoot > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; +} +.panel > .table-bordered > thead > tr > th:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:last-child, +.panel > .table-bordered > tbody > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, +.panel > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-bordered > thead > tr > td:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:last-child, +.panel > .table-bordered > tbody > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, +.panel > .table-bordered > tfoot > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; +} +.panel > .table-bordered > thead > tr:first-child > td, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > td, +.panel > .table-bordered > tbody > tr:first-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, +.panel > .table-bordered > thead > tr:first-child > th, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > th, +.panel > .table-bordered > tbody > tr:first-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { + border-bottom: 0; +} +.panel > .table-bordered > tbody > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, +.panel > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-bordered > tbody > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, +.panel > .table-bordered > tfoot > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { + border-bottom: 0; +} +.panel > .table-responsive { + margin-bottom: 0; + border: 0; +} +.panel-group { + margin-bottom: 20px; +} +.panel-group .panel { + margin-bottom: 0; + border-radius: 4px; +} +.panel-group .panel + .panel { + margin-top: 5px; +} +.panel-group .panel-heading { + border-bottom: 0; +} +.panel-group .panel-heading + .panel-collapse > .panel-body, +.panel-group .panel-heading + .panel-collapse > .list-group { + border-top: 1px solid #ddd; +} +.panel-group .panel-footer { + border-top: 0; +} +.panel-group .panel-footer + .panel-collapse .panel-body { + border-bottom: 1px solid #ddd; +} +.panel-default { + border-color: #ddd; +} +.panel-default > .panel-heading { + color: #333; + background-color: #f5f5f5; + border-color: #ddd; +} +.panel-default > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #ddd; +} +.panel-default > .panel-heading .badge { + color: #f5f5f5; + background-color: #333; +} +.panel-default > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #ddd; +} +.panel-primary { + border-color: #337ab7; +} +.panel-primary > .panel-heading { + color: #fff; + background-color: #337ab7; + border-color: #337ab7; +} +.panel-primary > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #337ab7; +} +.panel-primary > .panel-heading .badge { + color: #337ab7; + background-color: #fff; +} +.panel-primary > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #337ab7; +} +.panel-success { + border-color: #d6e9c6; +} +.panel-success > .panel-heading { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; +} +.panel-success > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #d6e9c6; +} +.panel-success > .panel-heading .badge { + color: #dff0d8; + background-color: #3c763d; +} +.panel-success > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #d6e9c6; +} +.panel-info { + border-color: #bce8f1; +} +.panel-info > .panel-heading { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; +} +.panel-info > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #bce8f1; +} +.panel-info > .panel-heading .badge { + color: #d9edf7; + background-color: #31708f; +} +.panel-info > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #bce8f1; +} +.panel-warning { + border-color: #faebcc; +} +.panel-warning > .panel-heading { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; +} +.panel-warning > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #faebcc; +} +.panel-warning > .panel-heading .badge { + color: #fcf8e3; + background-color: #8a6d3b; +} +.panel-warning > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #faebcc; +} +.panel-danger { + border-color: #ebccd1; +} +.panel-danger > .panel-heading { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; +} +.panel-danger > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #ebccd1; +} +.panel-danger > .panel-heading .badge { + color: #f2dede; + background-color: #a94442; +} +.panel-danger > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #ebccd1; +} +.embed-responsive { + position: relative; + display: block; + height: 0; + padding: 0; + overflow: hidden; +} +.embed-responsive .embed-responsive-item, +.embed-responsive iframe, +.embed-responsive embed, +.embed-responsive object, +.embed-responsive video { + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + border: 0; +} +.embed-responsive-16by9 { + padding-bottom: 56.25%; +} +.embed-responsive-4by3 { + padding-bottom: 75%; +} +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #e3e3e3; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); +} +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, .15); +} +.well-lg { + padding: 24px; + border-radius: 6px; +} +.well-sm { + padding: 9px; + border-radius: 3px; +} +.close { + float: right; + font-size: 21px; + font-weight: bold; + line-height: 1; + color: #000; + text-shadow: 0 1px 0 #fff; + filter: alpha(opacity=20); + opacity: .2; +} +.close:hover, +.close:focus { + color: #000; + text-decoration: none; + cursor: pointer; + filter: alpha(opacity=50); + opacity: .5; +} +button.close { + -webkit-appearance: none; + padding: 0; + cursor: pointer; + background: transparent; + border: 0; +} +.modal-open { + overflow: hidden; +} +.modal { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1050; + display: none; + overflow: hidden; + -webkit-overflow-scrolling: touch; + outline: 0; +} +.modal.fade .modal-dialog { + -webkit-transition: -webkit-transform .3s ease-out; + -o-transition: -o-transform .3s ease-out; + transition: transform .3s ease-out; + -webkit-transform: translate(0, -25%); + -ms-transform: translate(0, -25%); + -o-transform: translate(0, -25%); + transform: translate(0, -25%); +} +.modal.in .modal-dialog { + -webkit-transform: translate(0, 0); + -ms-transform: translate(0, 0); + -o-transform: translate(0, 0); + transform: translate(0, 0); +} +.modal-open .modal { + overflow-x: hidden; + overflow-y: auto; +} +.modal-dialog { + position: relative; + width: auto; + margin: 10px; +} +.modal-content { + position: relative; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #999; + border: 1px solid rgba(0, 0, 0, .2); + border-radius: 6px; + outline: 0; + -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, .5); + box-shadow: 0 3px 9px rgba(0, 0, 0, .5); +} +.modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + background-color: #000; +} +.modal-backdrop.fade { + filter: alpha(opacity=0); + opacity: 0; +} +.modal-backdrop.in { + filter: alpha(opacity=50); + opacity: .5; +} +.modal-header { + padding: 15px; + border-bottom: 1px solid #e5e5e5; +} +.modal-header .close { + margin-top: -2px; +} +.modal-title { + margin: 0; + line-height: 1.42857143; +} +.modal-body { + position: relative; + padding: 15px; +} +.modal-footer { + padding: 15px; + text-align: right; + border-top: 1px solid #e5e5e5; +} +.modal-footer .btn + .btn { + margin-bottom: 0; + margin-left: 5px; +} +.modal-footer .btn-group .btn + .btn { + margin-left: -1px; +} +.modal-footer .btn-block + .btn-block { + margin-left: 0; +} +.modal-scrollbar-measure { + position: absolute; + top: -9999px; + width: 50px; + height: 50px; + overflow: scroll; +} +@media (min-width: 768px) { + .modal-dialog { + width: 600px; + margin: 30px auto; + } + .modal-content { + -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5); + box-shadow: 0 5px 15px rgba(0, 0, 0, .5); + } + .modal-sm { + width: 300px; + } +} +@media (min-width: 992px) { + .modal-lg { + width: 900px; + } +} +.tooltip { + position: absolute; + z-index: 1070; + display: block; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 12px; + font-style: normal; + font-weight: normal; + line-height: 1.42857143; + text-align: left; + text-align: start; + text-decoration: none; + text-shadow: none; + text-transform: none; + letter-spacing: normal; + word-break: normal; + word-spacing: normal; + word-wrap: normal; + white-space: normal; + filter: alpha(opacity=0); + opacity: 0; + + line-break: auto; +} +.tooltip.in { + filter: alpha(opacity=90); + opacity: .9; +} +.tooltip.top { + padding: 5px 0; + margin-top: -3px; +} +.tooltip.right { + padding: 0 5px; + margin-left: 3px; +} +.tooltip.bottom { + padding: 5px 0; + margin-top: 3px; +} +.tooltip.left { + padding: 0 5px; + margin-left: -3px; +} +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #fff; + text-align: center; + background-color: #000; + border-radius: 4px; +} +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-width: 5px 5px 0; + border-top-color: #000; +} +.tooltip.top-left .tooltip-arrow { + right: 5px; + bottom: 0; + margin-bottom: -5px; + border-width: 5px 5px 0; + border-top-color: #000; +} +.tooltip.top-right .tooltip-arrow { + bottom: 0; + left: 5px; + margin-bottom: -5px; + border-width: 5px 5px 0; + border-top-color: #000; +} +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-width: 5px 5px 5px 0; + border-right-color: #000; +} +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-width: 5px 0 5px 5px; + border-left-color: #000; +} +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000; +} +.tooltip.bottom-left .tooltip-arrow { + top: 0; + right: 5px; + margin-top: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000; +} +.tooltip.bottom-right .tooltip-arrow { + top: 0; + left: 5px; + margin-top: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000; +} +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1060; + display: none; + max-width: 276px; + padding: 1px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + font-style: normal; + font-weight: normal; + line-height: 1.42857143; + text-align: left; + text-align: start; + text-decoration: none; + text-shadow: none; + text-transform: none; + letter-spacing: normal; + word-break: normal; + word-spacing: normal; + word-wrap: normal; + white-space: normal; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, .2); + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2); + box-shadow: 0 5px 10px rgba(0, 0, 0, .2); + + line-break: auto; +} +.popover.top { + margin-top: -10px; +} +.popover.right { + margin-left: 10px; +} +.popover.bottom { + margin-top: 10px; +} +.popover.left { + margin-left: -10px; +} +.popover-title { + padding: 8px 14px; + margin: 0; + font-size: 14px; + background-color: #f7f7f7; + border-bottom: 1px solid #ebebeb; + border-radius: 5px 5px 0 0; +} +.popover-content { + padding: 9px 14px; +} +.popover > .arrow, +.popover > .arrow:after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.popover > .arrow { + border-width: 11px; +} +.popover > .arrow:after { + content: ""; + border-width: 10px; +} +.popover.top > .arrow { + bottom: -11px; + left: 50%; + margin-left: -11px; + border-top-color: #999; + border-top-color: rgba(0, 0, 0, .25); + border-bottom-width: 0; +} +.popover.top > .arrow:after { + bottom: 1px; + margin-left: -10px; + content: " "; + border-top-color: #fff; + border-bottom-width: 0; +} +.popover.right > .arrow { + top: 50%; + left: -11px; + margin-top: -11px; + border-right-color: #999; + border-right-color: rgba(0, 0, 0, .25); + border-left-width: 0; +} +.popover.right > .arrow:after { + bottom: -10px; + left: 1px; + content: " "; + border-right-color: #fff; + border-left-width: 0; +} +.popover.bottom > .arrow { + top: -11px; + left: 50%; + margin-left: -11px; + border-top-width: 0; + border-bottom-color: #999; + border-bottom-color: rgba(0, 0, 0, .25); +} +.popover.bottom > .arrow:after { + top: 1px; + margin-left: -10px; + content: " "; + border-top-width: 0; + border-bottom-color: #fff; +} +.popover.left > .arrow { + top: 50%; + right: -11px; + margin-top: -11px; + border-right-width: 0; + border-left-color: #999; + border-left-color: rgba(0, 0, 0, .25); +} +.popover.left > .arrow:after { + right: 1px; + bottom: -10px; + content: " "; + border-right-width: 0; + border-left-color: #fff; +} +.carousel { + position: relative; +} +.carousel-inner { + position: relative; + width: 100%; + overflow: hidden; +} +.carousel-inner > .item { + position: relative; + display: none; + -webkit-transition: .6s ease-in-out left; + -o-transition: .6s ease-in-out left; + transition: .6s ease-in-out left; +} +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + line-height: 1; +} +@media all and (transform-3d), (-webkit-transform-3d) { + .carousel-inner > .item { + -webkit-transition: -webkit-transform .6s ease-in-out; + -o-transition: -o-transform .6s ease-in-out; + transition: transform .6s ease-in-out; + + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-perspective: 1000px; + perspective: 1000px; + } + .carousel-inner > .item.next, + .carousel-inner > .item.active.right { + left: 0; + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + } + .carousel-inner > .item.prev, + .carousel-inner > .item.active.left { + left: 0; + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } + .carousel-inner > .item.next.left, + .carousel-inner > .item.prev.right, + .carousel-inner > .item.active { + left: 0; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.carousel-inner > .active, +.carousel-inner > .next, +.carousel-inner > .prev { + display: block; +} +.carousel-inner > .active { + left: 0; +} +.carousel-inner > .next, +.carousel-inner > .prev { + position: absolute; + top: 0; + width: 100%; +} +.carousel-inner > .next { + left: 100%; +} +.carousel-inner > .prev { + left: -100%; +} +.carousel-inner > .next.left, +.carousel-inner > .prev.right { + left: 0; +} +.carousel-inner > .active.left { + left: -100%; +} +.carousel-inner > .active.right { + left: 100%; +} +.carousel-control { + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 15%; + font-size: 20px; + color: #fff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, .6); + background-color: rgba(0, 0, 0, 0); + filter: alpha(opacity=50); + opacity: .5; +} +.carousel-control.left { + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); + background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .5)), to(rgba(0, 0, 0, .0001))); + background-image: linear-gradient(to right, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .0001) 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); + background-repeat: repeat-x; +} +.carousel-control.right { + right: 0; + left: auto; + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); + background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, .0001)), to(rgba(0, 0, 0, .5))); + background-image: linear-gradient(to right, rgba(0, 0, 0, .0001) 0%, rgba(0, 0, 0, .5) 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); + background-repeat: repeat-x; +} +.carousel-control:hover, +.carousel-control:focus { + color: #fff; + text-decoration: none; + filter: alpha(opacity=90); + outline: 0; + opacity: .9; +} +.carousel-control .icon-prev, +.carousel-control .icon-next, +.carousel-control .glyphicon-chevron-left, +.carousel-control .glyphicon-chevron-right { + position: absolute; + top: 50%; + z-index: 5; + display: inline-block; + margin-top: -10px; +} +.carousel-control .icon-prev, +.carousel-control .glyphicon-chevron-left { + left: 50%; + margin-left: -10px; +} +.carousel-control .icon-next, +.carousel-control .glyphicon-chevron-right { + right: 50%; + margin-right: -10px; +} +.carousel-control .icon-prev, +.carousel-control .icon-next { + width: 20px; + height: 20px; + font-family: serif; + line-height: 1; +} +.carousel-control .icon-prev:before { + content: '\2039'; +} +.carousel-control .icon-next:before { + content: '\203a'; +} +.carousel-indicators { + position: absolute; + bottom: 10px; + left: 50%; + z-index: 15; + width: 60%; + padding-left: 0; + margin-left: -30%; + text-align: center; + list-style: none; +} +.carousel-indicators li { + display: inline-block; + width: 10px; + height: 10px; + margin: 1px; + text-indent: -999px; + cursor: pointer; + background-color: #000 \9; + background-color: rgba(0, 0, 0, 0); + border: 1px solid #fff; + border-radius: 10px; +} +.carousel-indicators .active { + width: 12px; + height: 12px; + margin: 0; + background-color: #fff; +} +.carousel-caption { + position: absolute; + right: 15%; + bottom: 20px; + left: 15%; + z-index: 10; + padding-top: 20px; + padding-bottom: 20px; + color: #fff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, .6); +} +.carousel-caption .btn { + text-shadow: none; +} +@media screen and (min-width: 768px) { + .carousel-control .glyphicon-chevron-left, + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-prev, + .carousel-control .icon-next { + width: 30px; + height: 30px; + margin-top: -10px; + font-size: 30px; + } + .carousel-control .glyphicon-chevron-left, + .carousel-control .icon-prev { + margin-left: -10px; + } + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-next { + margin-right: -10px; + } + .carousel-caption { + right: 20%; + left: 20%; + padding-bottom: 30px; + } + .carousel-indicators { + bottom: 20px; + } +} +.clearfix:before, +.clearfix:after, +.dl-horizontal dd:before, +.dl-horizontal dd:after, +.container:before, +.container:after, +.container-fluid:before, +.container-fluid:after, +.row:before, +.row:after, +.form-horizontal .form-group:before, +.form-horizontal .form-group:after, +.btn-toolbar:before, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:before, +.btn-group-vertical > .btn-group:after, +.nav:before, +.nav:after, +.navbar:before, +.navbar:after, +.navbar-header:before, +.navbar-header:after, +.navbar-collapse:before, +.navbar-collapse:after, +.pager:before, +.pager:after, +.panel-body:before, +.panel-body:after, +.modal-header:before, +.modal-header:after, +.modal-footer:before, +.modal-footer:after { + display: table; + content: " "; +} +.clearfix:after, +.dl-horizontal dd:after, +.container:after, +.container-fluid:after, +.row:after, +.form-horizontal .form-group:after, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:after, +.nav:after, +.navbar:after, +.navbar-header:after, +.navbar-collapse:after, +.pager:after, +.panel-body:after, +.modal-header:after, +.modal-footer:after { + clear: both; +} +.center-block { + display: block; + margin-right: auto; + margin-left: auto; +} +.pull-right { + float: right !important; +} +.pull-left { + float: left !important; +} +.hide { + display: none !important; +} +.show { + display: block !important; +} +.invisible { + visibility: hidden; +} +.text-hide { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} +.hidden { + display: none !important; +} +.affix { + position: fixed; +} +@-ms-viewport { + width: device-width; +} +.visible-xs, +.visible-sm, +.visible-md, +.visible-lg { + display: none !important; +} +.visible-xs-block, +.visible-xs-inline, +.visible-xs-inline-block, +.visible-sm-block, +.visible-sm-inline, +.visible-sm-inline-block, +.visible-md-block, +.visible-md-inline, +.visible-md-inline-block, +.visible-lg-block, +.visible-lg-inline, +.visible-lg-inline-block { + display: none !important; +} +@media (max-width: 767px) { + .visible-xs { + display: block !important; + } + table.visible-xs { + display: table !important; + } + tr.visible-xs { + display: table-row !important; + } + th.visible-xs, + td.visible-xs { + display: table-cell !important; + } +} +@media (max-width: 767px) { + .visible-xs-block { + display: block !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline { + display: inline !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline-block { + display: inline-block !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm { + display: block !important; + } + table.visible-sm { + display: table !important; + } + tr.visible-sm { + display: table-row !important; + } + th.visible-sm, + td.visible-sm { + display: table-cell !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-block { + display: block !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline { + display: inline !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline-block { + display: inline-block !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md { + display: block !important; + } + table.visible-md { + display: table !important; + } + tr.visible-md { + display: table-row !important; + } + th.visible-md, + td.visible-md { + display: table-cell !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-block { + display: block !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline { + display: inline !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline-block { + display: inline-block !important; + } +} +@media (min-width: 1200px) { + .visible-lg { + display: block !important; + } + table.visible-lg { + display: table !important; + } + tr.visible-lg { + display: table-row !important; + } + th.visible-lg, + td.visible-lg { + display: table-cell !important; + } +} +@media (min-width: 1200px) { + .visible-lg-block { + display: block !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline { + display: inline !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline-block { + display: inline-block !important; + } +} +@media (max-width: 767px) { + .hidden-xs { + display: none !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .hidden-sm { + display: none !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .hidden-md { + display: none !important; + } +} +@media (min-width: 1200px) { + .hidden-lg { + display: none !important; + } +} +.visible-print { + display: none !important; +} +@media print { + .visible-print { + display: block !important; + } + table.visible-print { + display: table !important; + } + tr.visible-print { + display: table-row !important; + } + th.visible-print, + td.visible-print { + display: table-cell !important; + } +} +.visible-print-block { + display: none !important; +} +@media print { + .visible-print-block { + display: block !important; + } +} +.visible-print-inline { + display: none !important; +} +@media print { + .visible-print-inline { + display: inline !important; + } +} +.visible-print-inline-block { + display: none !important; +} +@media print { + .visible-print-inline-block { + display: inline-block !important; + } +} +@media print { + .hidden-print { + display: none !important; + } +} +/*# sourceMappingURL=bootstrap.css.map */ diff --git "a/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/resources/static/css/main.css" "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/resources/static/css/main.css" new file mode 100644 index 0000000..8476f71 --- /dev/null +++ "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/resources/static/css/main.css" @@ -0,0 +1,4 @@ + +header { + height: 60px; +} \ No newline at end of file diff --git "a/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/resources/static/js/jquery.js" "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/resources/static/js/jquery.js" new file mode 100644 index 0000000..5385f05 --- /dev/null +++ "b/\347\254\254 5-8 \350\257\276\357\274\232 \347\273\274\345\220\210\345\256\236\346\210\230\345\256\242\346\210\267\347\256\241\347\220\206\347\263\273\347\273\237\357\274\210\344\272\214\357\274\211/user-manage-plus/src/main/resources/static/js/jquery.js" @@ -0,0 +1,6 @@ +/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license + +*/ +(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="
",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
a",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="
t
",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="
",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t +}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/\s*$/g,At={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?""!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle); +u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("