forked from CCSENS_TECHNOLOGY/braintraining
commit
c8b10b13f2
33 changed files with 1736 additions and 0 deletions
@ -0,0 +1,43 @@ |
|||
# Created by .ignore support plugin (hsz.mobi) |
|||
### Example user template template |
|||
### Example user template |
|||
target |
|||
target/ |
|||
target/* |
|||
# IntelliJ project files |
|||
.idea |
|||
.idea/ |
|||
.idea/* |
|||
*.iml |
|||
.mvn |
|||
.mvn/ |
|||
.mvn/* |
|||
out |
|||
gen |
|||
### Java template |
|||
# Compiled class file |
|||
*.class |
|||
|
|||
# Log file |
|||
*.log |
|||
|
|||
# BlueJ files |
|||
*.ctxt |
|||
|
|||
# Mobile Tools for Java (J2ME) |
|||
.mtj.tmp/ |
|||
|
|||
# Package Files # |
|||
*.jar |
|||
*.war |
|||
*.nar |
|||
*.ear |
|||
*.zip |
|||
*.tar.gz |
|||
*.rar |
|||
|
|||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml |
|||
hs_err_pid* |
|||
mbg.xml |
|||
resources/mbg.xml |
|||
resources/application.yml |
@ -0,0 +1,2 @@ |
|||
# Default ignored files |
|||
/workspace.xml |
@ -0,0 +1,18 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project version="4"> |
|||
<component name="CompilerConfiguration"> |
|||
<annotationProcessing> |
|||
<profile name="Maven default annotation processors profile" enabled="true"> |
|||
<sourceOutputDir name="target/generated-sources/annotations" /> |
|||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> |
|||
<outputRelativeToContentRoot value="true" /> |
|||
<module name="braintraining" /> |
|||
</profile> |
|||
</annotationProcessing> |
|||
</component> |
|||
<component name="JavacSettings"> |
|||
<option name="ADDITIONAL_OPTIONS_OVERRIDE"> |
|||
<module name="braintraining" options="-parameters" /> |
|||
</option> |
|||
</component> |
|||
</project> |
@ -0,0 +1,7 @@ |
|||
<component name="ProjectDictionaryState"> |
|||
<dictionary name="23778"> |
|||
<words> |
|||
<w>tencent</w> |
|||
</words> |
|||
</dictionary> |
|||
</component> |
@ -0,0 +1,6 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project version="4"> |
|||
<component name="Encoding"> |
|||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" /> |
|||
</component> |
|||
</project> |
@ -0,0 +1,36 @@ |
|||
<component name="InspectionProjectProfileManager"> |
|||
<profile version="1.0"> |
|||
<option name="myName" value="Project Default" /> |
|||
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true"> |
|||
<option name="TOP_LEVEL_CLASS_OPTIONS"> |
|||
<value> |
|||
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" /> |
|||
<option name="REQUIRED_TAGS" value="" /> |
|||
</value> |
|||
</option> |
|||
<option name="INNER_CLASS_OPTIONS"> |
|||
<value> |
|||
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" /> |
|||
<option name="REQUIRED_TAGS" value="" /> |
|||
</value> |
|||
</option> |
|||
<option name="METHOD_OPTIONS"> |
|||
<value> |
|||
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" /> |
|||
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" /> |
|||
</value> |
|||
</option> |
|||
<option name="FIELD_OPTIONS"> |
|||
<value> |
|||
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" /> |
|||
<option name="REQUIRED_TAGS" value="" /> |
|||
</value> |
|||
</option> |
|||
<option name="IGNORE_DEPRECATED" value="false" /> |
|||
<option name="IGNORE_JAVADOC_PERIOD" value="true" /> |
|||
<option name="IGNORE_DUPLICATED_THROWS" value="false" /> |
|||
<option name="IGNORE_POINT_TO_ITSELF" value="false" /> |
|||
<option name="myAdditionalJavadocTags" value="date" /> |
|||
</inspection_tool> |
|||
</profile> |
|||
</component> |
@ -0,0 +1,14 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project version="4"> |
|||
<component name="ExternalStorageConfigurationManager" enabled="true" /> |
|||
<component name="MavenProjectsManager"> |
|||
<option name="originalFiles"> |
|||
<list> |
|||
<option value="$PROJECT_DIR$/pom.xml" /> |
|||
</list> |
|||
</option> |
|||
</component> |
|||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="jdk1.8.0_121" project-jdk-type="JavaSDK"> |
|||
<output url="file://$PROJECT_DIR$/out" /> |
|||
</component> |
|||
</project> |
@ -0,0 +1,124 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project version="4"> |
|||
<component name="Palette2"> |
|||
<group name="Swing"> |
|||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
|||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" /> |
|||
</item> |
|||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
|||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" /> |
|||
</item> |
|||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
|||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" /> |
|||
</item> |
|||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true"> |
|||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" /> |
|||
</item> |
|||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
|||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" /> |
|||
<initial-values> |
|||
<property name="text" value="Button" /> |
|||
</initial-values> |
|||
</item> |
|||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
|||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> |
|||
<initial-values> |
|||
<property name="text" value="RadioButton" /> |
|||
</initial-values> |
|||
</item> |
|||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
|||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> |
|||
<initial-values> |
|||
<property name="text" value="CheckBox" /> |
|||
</initial-values> |
|||
</item> |
|||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
|||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" /> |
|||
<initial-values> |
|||
<property name="text" value="Label" /> |
|||
</initial-values> |
|||
</item> |
|||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
|||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
|||
<preferred-size width="150" height="-1" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
|||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
|||
<preferred-size width="150" height="-1" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
|||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
|||
<preferred-size width="150" height="-1" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
|||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
|||
<preferred-size width="150" height="50" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
|||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
|||
<preferred-size width="150" height="50" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
|||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
|||
<preferred-size width="150" height="50" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
|||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" /> |
|||
</item> |
|||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
|||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
|||
<preferred-size width="150" height="50" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
|||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3"> |
|||
<preferred-size width="150" height="50" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
|||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
|||
<preferred-size width="150" height="50" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
|||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> |
|||
<preferred-size width="200" height="200" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
|||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> |
|||
<preferred-size width="200" height="200" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true"> |
|||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> |
|||
</item> |
|||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
|||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> |
|||
</item> |
|||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
|||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" /> |
|||
</item> |
|||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
|||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" /> |
|||
</item> |
|||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
|||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1"> |
|||
<preferred-size width="-1" height="20" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false"> |
|||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" /> |
|||
</item> |
|||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> |
|||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" /> |
|||
</item> |
|||
</group> |
|||
</component> |
|||
</project> |
@ -0,0 +1,2 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<module type="JAVA_MODULE" version="4" /> |
@ -0,0 +1,280 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
|
|||
<groupId>com.ccsens</groupId> |
|||
<artifactId>braintraining</artifactId> |
|||
<version>1.0-SNAPSHOT</version> |
|||
|
|||
<properties> |
|||
<java.version>1.8</java.version> |
|||
</properties> |
|||
<parent> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-parent</artifactId> |
|||
<version>2.1.8.RELEASE</version> |
|||
<relativePath/> <!-- lookup parent from repository --> |
|||
</parent> |
|||
<dependencies> |
|||
<dependency> |
|||
<groupId>com.ccsensptos</groupId> |
|||
<artifactId>wechatutil</artifactId> |
|||
<version>1.0-SNAPSHOT</version> |
|||
<scope>compile</scope> |
|||
<exclusions> |
|||
<exclusion> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-amqp</artifactId> |
|||
</exclusion> |
|||
<exclusion> |
|||
<groupId>com.ccsensptos</groupId> |
|||
<artifactId>cloudutil</artifactId> |
|||
</exclusion> |
|||
</exclusions> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.aspectj</groupId> |
|||
<artifactId>aspectjweaver</artifactId> |
|||
</dependency> |
|||
|
|||
<!-- https://mvnrepository.com/artifact/io.netty/netty-all --> |
|||
<dependency> |
|||
<groupId>io.netty</groupId> |
|||
<artifactId>netty-all</artifactId> |
|||
<version>4.1.32.Final</version> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-data-redis</artifactId> |
|||
</dependency> |
|||
<!--spring 缓存--> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-cache</artifactId> |
|||
</dependency> |
|||
<!--多redis配置--> |
|||
<!--<dependency> |
|||
<groupId>redis.clients</groupId> |
|||
<artifactId>jedis</artifactId> |
|||
</dependency>--> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-jdbc</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-web</artifactId> |
|||
<exclusions> |
|||
<exclusion> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-tomcat</artifactId> |
|||
</exclusion> |
|||
</exclusions> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-jetty</artifactId> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-configuration-processor</artifactId> |
|||
<optional>true</optional> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.projectlombok</groupId> |
|||
<artifactId>lombok</artifactId> |
|||
<optional>true</optional> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-test</artifactId> |
|||
<exclusions> <!--排除android-json,与腾讯短信接口qcloudsms冲突--> |
|||
<exclusion> |
|||
<groupId>com.vaadin.external.google</groupId> |
|||
<artifactId>android-json</artifactId> |
|||
</exclusion> |
|||
</exclusions> |
|||
<scope>test</scope> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-actuator</artifactId> |
|||
</dependency> |
|||
|
|||
<!-- hutool-all --> |
|||
<dependency> |
|||
<groupId>cn.hutool</groupId> |
|||
<artifactId>hutool-all</artifactId> |
|||
<version>4.1.21</version> |
|||
</dependency> |
|||
|
|||
<!--Poi Excel --> |
|||
<dependency> |
|||
<groupId>org.apache.poi</groupId> |
|||
<artifactId>poi</artifactId> |
|||
<version>3.17</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.apache.poi</groupId> |
|||
<artifactId>poi-ooxml</artifactId> |
|||
<version>3.17</version> |
|||
</dependency> |
|||
<!--websocket--> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-websocket</artifactId> |
|||
</dependency> |
|||
<!-- spring RabbitMQ--> |
|||
<!--<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-amqp</artifactId> |
|||
</dependency>--> |
|||
<!-- spring MyBatis --> |
|||
<dependency> |
|||
<groupId>org.mybatis.spring.boot</groupId> |
|||
<artifactId>mybatis-spring-boot-starter</artifactId> |
|||
<version>1.1.1</version> |
|||
</dependency> |
|||
<!-- mybatis pagehelper包--> |
|||
<dependency> |
|||
<groupId>com.github.pagehelper</groupId> |
|||
<artifactId>pagehelper</artifactId> |
|||
<version>4.1.4</version> |
|||
</dependency> |
|||
<!-- MySQL数据库 --> |
|||
<dependency> |
|||
<groupId>mysql</groupId> |
|||
<artifactId>mysql-connector-java</artifactId> |
|||
</dependency> |
|||
<!--Durid数据源--> |
|||
<dependency> |
|||
<groupId>com.alibaba</groupId> |
|||
<artifactId>druid</artifactId> |
|||
<version>1.1.10</version> |
|||
</dependency> |
|||
<!--jjwt--> |
|||
<dependency> |
|||
<groupId>io.jsonwebtoken</groupId> |
|||
<artifactId>jjwt</artifactId> |
|||
<version>0.7.0</version> |
|||
</dependency> |
|||
|
|||
|
|||
<!--Jackson Xml--> |
|||
<dependency> |
|||
<groupId>com.fasterxml.jackson.dataformat</groupId> |
|||
<artifactId>jackson-dataformat-xml</artifactId> |
|||
<version>2.9.0</version> |
|||
</dependency> |
|||
|
|||
<!-- ehcache 缓存 --> |
|||
<!--<dependency> |
|||
<groupId>net.sf.ehcache</groupId> |
|||
<artifactId>ehcache</artifactId> |
|||
</dependency>--> |
|||
<!--Shiro --> |
|||
<dependency> |
|||
<groupId>org.apache.shiro</groupId> |
|||
<artifactId>shiro-spring</artifactId> |
|||
<version>1.4.0</version> |
|||
</dependency> |
|||
<!-- shiro ehcache --> |
|||
<dependency> |
|||
<groupId>org.apache.shiro</groupId> |
|||
<artifactId>shiro-ehcache</artifactId> |
|||
<version>1.4.0</version> |
|||
</dependency> |
|||
<!--HtmlCleaner--> |
|||
<dependency> |
|||
<groupId>net.sourceforge.htmlcleaner</groupId> |
|||
<artifactId>htmlcleaner</artifactId> |
|||
<version>2.22</version> |
|||
</dependency> |
|||
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 --> |
|||
<dependency> |
|||
<groupId>org.apache.commons</groupId> |
|||
<artifactId>commons-lang3</artifactId> |
|||
<version>3.8.1</version> |
|||
</dependency> |
|||
|
|||
|
|||
<!--Swagger --> |
|||
<dependency> |
|||
<groupId>io.springfox</groupId> |
|||
<artifactId>springfox-swagger2</artifactId> |
|||
<version>2.9.2</version> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>io.springfox</groupId> |
|||
<artifactId>springfox-swagger-ui</artifactId> |
|||
<version>2.9.2</version> |
|||
</dependency> |
|||
<!--mybatis generator包--> |
|||
<dependency> |
|||
<groupId>org.mybatis.generator</groupId> |
|||
<artifactId>mybatis-generator-core</artifactId> |
|||
<version>1.3.7</version> |
|||
</dependency> |
|||
|
|||
<!-- https://mvnrepository.com/artifact/org.beanshell/bsh --> |
|||
<dependency> |
|||
<groupId>org.beanshell</groupId> |
|||
<artifactId>bsh</artifactId> |
|||
<version>2.0b5</version> |
|||
</dependency> |
|||
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient --> |
|||
<dependency> |
|||
<groupId>org.apache.httpcomponents</groupId> |
|||
<artifactId>httpclient</artifactId> |
|||
<version>4.5.1</version> |
|||
</dependency> |
|||
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore --> |
|||
<dependency> |
|||
<groupId>org.apache.httpcomponents</groupId> |
|||
<artifactId>httpcore</artifactId> |
|||
<version>4.4.3</version> |
|||
</dependency> |
|||
<!--腾讯短信--> |
|||
<dependency> |
|||
<groupId>com.github.qcloudsms</groupId> |
|||
<artifactId>qcloudsms</artifactId> |
|||
<version>1.0.5</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.alibaba</groupId> |
|||
<artifactId>fastjson</artifactId> |
|||
<version>1.2.62</version> |
|||
</dependency> |
|||
|
|||
</dependencies> |
|||
|
|||
<build> |
|||
<plugins> |
|||
<plugin> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-maven-plugin</artifactId> |
|||
</plugin> |
|||
<plugin> |
|||
<groupId>org.mybatis.generator</groupId> |
|||
<artifactId>mybatis-generator-maven-plugin</artifactId> |
|||
<version>1.3.7</version> |
|||
<configuration> |
|||
<configurationFile>${basedir}/src/main/resources/mbg.xml</configurationFile> |
|||
<overwrite>true</overwrite> |
|||
</configuration> |
|||
<dependencies> |
|||
<dependency> |
|||
<groupId>mysql</groupId> |
|||
<artifactId>mysql-connector-java</artifactId> |
|||
<version>5.1.34</version> |
|||
</dependency> |
|||
</dependencies> |
|||
</plugin> |
|||
</plugins> |
|||
</build> |
|||
</project> |
@ -0,0 +1,24 @@ |
|||
package com.ccsens.braintraining; |
|||
|
|||
import org.mybatis.spring.annotation.MapperScan; |
|||
import org.springframework.boot.SpringApplication; |
|||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
|||
import org.springframework.boot.web.servlet.ServletComponentScan; |
|||
import org.springframework.cache.annotation.EnableCaching; |
|||
import org.springframework.context.annotation.ComponentScan; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: whj |
|||
* @time: 2022/3/4 9:34 |
|||
*/ |
|||
@MapperScan(basePackages = {"com.ccsens.braintraining.persist.*"}) |
|||
@ServletComponentScan |
|||
@EnableCaching |
|||
@SpringBootApplication |
|||
@ComponentScan(basePackages = {"com.ccsens"}) |
|||
public class BrainTrainingApplication { |
|||
public static void main(String[] args) { |
|||
SpringApplication.run(BrainTrainingApplication.class, args); |
|||
} |
|||
} |
@ -0,0 +1,40 @@ |
|||
package com.ccsens.braintraining.api; |
|||
|
|||
import com.ccsens.util.JsonResponse; |
|||
import com.ccsens.wechatutil.bean.dto.wxofficial.WxQrCodeDto; |
|||
import com.ccsens.wechatutil.bean.vo.wxofficial.WxQrCodeVo; |
|||
import com.ccsens.wechatutil.wxofficial.OfficialQrCodeUtil; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiImplicitParams; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import java.util.UUID; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: whj |
|||
* @time: 2022/3/8 8:42 |
|||
*/ |
|||
@Api(tags = "DEBUG" , description = "DebugController | ") |
|||
@RestController |
|||
@RequestMapping("/debug") |
|||
@Slf4j |
|||
public class DebugController { |
|||
|
|||
|
|||
@ApiOperation(value = "/测试",notes = "") |
|||
@ApiImplicitParams({ |
|||
}) |
|||
@RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"}) |
|||
public JsonResponse debug(HttpServletRequest request) throws Exception { |
|||
|
|||
|
|||
return JsonResponse.newInstance().ok("hello world!"); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,102 @@ |
|||
package com.ccsens.braintraining.api; |
|||
|
|||
import cn.hutool.core.util.StrUtil; |
|||
import com.alibaba.fastjson.JSONObject; |
|||
import com.ccsens.braintraining.service.IWxTencentService; |
|||
import com.ccsens.util.JacksonUtil; |
|||
import com.ccsens.util.JsonResponse; |
|||
import com.ccsens.wechatutil.bean.dto.wxmini.NoticeDto; |
|||
import com.ccsens.wechatutil.bean.dto.wxofficial.WxQrCodeDto; |
|||
import com.ccsens.wechatutil.bean.vo.wxofficial.WxQrCodeVo; |
|||
import com.ccsens.wechatutil.wxofficial.OfficialQrCodeUtil; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiImplicitParams; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import javax.annotation.Resource; |
|||
import javax.servlet.http.HttpServletRequest; |
|||
import java.io.BufferedReader; |
|||
import java.io.IOException; |
|||
import java.security.NoSuchAlgorithmException; |
|||
import java.util.UUID; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: whj |
|||
* @time: 2022/3/8 9:31 |
|||
*/ |
|||
@Api(tags = "微信公众号相关" ) |
|||
@RestController |
|||
@RequestMapping("/wxTencent") |
|||
@Slf4j |
|||
public class WxTencentController { |
|||
|
|||
private String token = "ccsensChuanKong"; |
|||
private String encodingAesKey = "nysgv5sKS5HPMMsHiVcDOE9BBCtX7Ho5DSv3s0qS9b9"; |
|||
|
|||
@Resource |
|||
private IWxTencentService wxTencetnService; |
|||
|
|||
|
|||
|
|||
@ApiOperation(value = "/生成公众号临时二维码",notes = "") |
|||
@ApiImplicitParams({ |
|||
}) |
|||
@RequestMapping(value="createQrCode",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"}) |
|||
public JsonResponse createQrCode(Long equipmentId) { |
|||
WxQrCodeVo.QrCodeUrl url = OfficialQrCodeUtil.send(new WxQrCodeDto.Create(7*24*60*60L, OfficialQrCodeUtil.QR_STR_SCENE, null, UUID.randomUUID().toString()), |
|||
"wxb3be21dcd7912555", "9213776254878a8065f1a29d1f58a02c"); |
|||
String qrCodeUrl = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=" + url.getTicket(); |
|||
return JsonResponse.newInstance().ok(qrCodeUrl); |
|||
} |
|||
|
|||
|
|||
@ApiOperation(value = "接收公众号消息通知", notes = "") |
|||
@RequestMapping(value = "/notice", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) |
|||
public String noticeGet(@Validated NoticeDto.ValidMsg validMsg) throws NoSuchAlgorithmException { |
|||
log.info("接收微信小程序token:{},token:{}",validMsg,token); |
|||
boolean check = validMsg.check(token); |
|||
log.info("校验结果:{}", check); |
|||
return check ? validMsg.getEchostr() : null; |
|||
} |
|||
|
|||
@ApiOperation(value = "接收公众号消息通知", notes = "") |
|||
@RequestMapping(value = "/notice", method = RequestMethod.POST) |
|||
public String notice(HttpServletRequest request) throws IOException { |
|||
log.info("接收公众号消息通知:{}", request.getParameterMap()); |
|||
|
|||
BufferedReader reader = request.getReader(); |
|||
StringBuilder builder = new StringBuilder(); |
|||
String line; |
|||
while ((line = reader.readLine()) != null) { |
|||
builder.append(line); |
|||
} |
|||
log.info("获取参数:{}", builder.toString()); |
|||
NoticeDto.Notice notice = JSONObject.parseObject(JacksonUtil.xmlToJson(builder.toString()), NoticeDto.Notice.class); |
|||
|
|||
|
|||
log.info("接收公众号消息息通知:{}", notice); |
|||
if (notice== null || StrUtil.isEmpty(notice.getContent())) { |
|||
return "success"; |
|||
} |
|||
switch (notice.getEvent()) { |
|||
case "subscribe": |
|||
// 用户未关注时,进行关注后的事件推送
|
|||
// 带参数二维码访问,EventKey有值,普通关注没有
|
|||
break; |
|||
case "SCAN": |
|||
// 用户已关注时的事件推送
|
|||
break; |
|||
case "unsubscribe": |
|||
// 取消订阅
|
|||
break; |
|||
} |
|||
return "success"; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,44 @@ |
|||
package com.ccsens.braintraining.config; |
|||
|
|||
import com.ccsens.braintraining.intercept.MybatisInterceptor; |
|||
import org.springframework.context.annotation.Bean; |
|||
import org.springframework.context.annotation.Configuration; |
|||
import org.springframework.web.cors.CorsConfiguration; |
|||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource; |
|||
import org.springframework.web.filter.CorsFilter; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: wuHuiJuan |
|||
* @create: 2019/12/03 18:01 |
|||
*/ |
|||
@Configuration |
|||
public class BeanConfig { |
|||
/** |
|||
* 注册拦截器 |
|||
*/ |
|||
@Bean |
|||
public MybatisInterceptor mybatisInterceptor() { |
|||
MybatisInterceptor interceptor = new MybatisInterceptor(); |
|||
return interceptor; |
|||
} |
|||
private CorsConfiguration buildConfig() { |
|||
CorsConfiguration corsConfiguration = new CorsConfiguration(); |
|||
corsConfiguration.addAllowedOrigin("*"); |
|||
corsConfiguration.addAllowedHeader("*"); |
|||
corsConfiguration.addAllowedMethod("*"); |
|||
// 预检请求的有效期,单位为秒。
|
|||
corsConfiguration.setMaxAge(3600L); |
|||
// 是否支持安全证书(必需参数)
|
|||
corsConfiguration.setAllowCredentials(true); |
|||
return corsConfiguration; |
|||
} |
|||
|
|||
@Bean |
|||
public CorsFilter corsFilter() { |
|||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); |
|||
source.registerCorsConfiguration("/**", buildConfig()); |
|||
return new CorsFilter(source); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,141 @@ |
|||
package com.ccsens.braintraining.config; |
|||
|
|||
|
|||
import cn.hutool.core.lang.Snowflake; |
|||
import cn.hutool.core.util.IdUtil; |
|||
import com.ccsens.util.PropUtil; |
|||
import com.ccsens.util.config.DruidProps; |
|||
import com.fasterxml.jackson.databind.DeserializationFeature; |
|||
import com.fasterxml.jackson.databind.ObjectMapper; |
|||
import com.fasterxml.jackson.databind.module.SimpleModule; |
|||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.context.annotation.Bean; |
|||
import org.springframework.context.annotation.Configuration; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.http.converter.HttpMessageConverter; |
|||
import org.springframework.http.converter.StringHttpMessageConverter; |
|||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; |
|||
import org.springframework.web.servlet.config.annotation.*; |
|||
|
|||
import javax.annotation.Resource; |
|||
import javax.sql.DataSource; |
|||
import java.nio.charset.Charset; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
import java.util.TimeZone; |
|||
|
|||
/** |
|||
* @author whj |
|||
*/ |
|||
@Configuration |
|||
public class SpringConfig implements WebMvcConfigurer { |
|||
@Resource |
|||
private DruidProps druidPropsUtil; |
|||
@Value("${spring.snowflake.workerId}") |
|||
private String workerId; |
|||
@Value("${spring.snowflake.dataCenterId}") |
|||
private String dataCenterId; |
|||
|
|||
|
|||
/** |
|||
* 配置Converter |
|||
* @return |
|||
*/ |
|||
@Bean |
|||
public HttpMessageConverter<String> responseStringConverter() { |
|||
return new StringHttpMessageConverter( |
|||
Charset.forName("UTF-8")); |
|||
} |
|||
|
|||
@Bean |
|||
public HttpMessageConverter<Object> responseJsonConverter(){ |
|||
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); |
|||
List<MediaType> mediaTypeList = new ArrayList<>(); |
|||
mediaTypeList.add(MediaType.TEXT_HTML); |
|||
mediaTypeList.add(MediaType.APPLICATION_JSON_UTF8); |
|||
converter.setSupportedMediaTypes(mediaTypeList); |
|||
|
|||
ObjectMapper objectMapper = new ObjectMapper(); |
|||
SimpleModule simpleModule = new SimpleModule(); |
|||
simpleModule.addSerializer(Long.class, ToStringSerializer.instance); |
|||
simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance); |
|||
objectMapper.registerModule(simpleModule); |
|||
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); |
|||
objectMapper.setTimeZone(TimeZone.getTimeZone("GMT+8")); |
|||
converter.setObjectMapper(objectMapper); |
|||
|
|||
return converter; |
|||
} |
|||
|
|||
@Override |
|||
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { |
|||
converters.add(responseStringConverter()); |
|||
converters.add(responseJsonConverter()); |
|||
} |
|||
|
|||
@Override |
|||
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) { |
|||
configurer.favorPathExtension(false); |
|||
} |
|||
|
|||
@Override |
|||
public void addCorsMappings(CorsRegistry registry) { |
|||
registry.addMapping("/**").allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") |
|||
// 允许提交请求的方法,*表示全部允许
|
|||
.allowedMethods("*") |
|||
// #允许向该服务器提交请求的URI,*表示全部允许
|
|||
.allowedOrigins("*") |
|||
// 允许cookies跨域
|
|||
.allowCredentials(true) |
|||
// #允许访问的头信息,*表示全部
|
|||
.allowedHeaders("*") |
|||
// 预检请求的缓存时间(秒),即在这个时间段里,对于相同的跨域请求不会再预检了
|
|||
.maxAge(18000L); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
* 配置静态资源 |
|||
*/ |
|||
@Override |
|||
public void addResourceHandlers(ResourceHandlerRegistry registry) { |
|||
registry.addResourceHandler("swagger-ui.html") |
|||
.addResourceLocations("classpath:/META-INF/resources/"); |
|||
registry.addResourceHandler("/webjars/**") |
|||
.addResourceLocations("classpath:/META-INF/resources/webjars/"); |
|||
|
|||
registry.addResourceHandler("/uploads/**") |
|||
// .addResourceLocations("file:D:/datang_soft/project/uploads/");
|
|||
.addResourceLocations("file:" + PropUtil.path); |
|||
|
|||
registry.addResourceHandler("/static/**") |
|||
.addResourceLocations("classpath:/static/"); |
|||
} |
|||
|
|||
/** |
|||
* 配置拦截器 |
|||
* @param registry 拦截器 |
|||
*/ |
|||
@Override |
|||
public void addInterceptors(InterceptorRegistry registry) { |
|||
|
|||
} |
|||
|
|||
|
|||
/** |
|||
* 配置数据源(单数据源) |
|||
*/ |
|||
@Bean |
|||
public DataSource dataSource(){ |
|||
return druidPropsUtil.createDruidDataSource(); |
|||
} |
|||
|
|||
@Bean |
|||
public Snowflake snowflake(){ |
|||
return IdUtil.createSnowflake(Long.parseLong(workerId),Long.parseLong(dataCenterId)); |
|||
} |
|||
} |
@ -0,0 +1,58 @@ |
|||
package com.ccsens.braintraining.config; |
|||
|
|||
import com.ccsens.util.WebConstant; |
|||
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; |
|||
import org.springframework.context.annotation.Bean; |
|||
import org.springframework.context.annotation.Configuration; |
|||
import springfox.documentation.builders.ParameterBuilder; |
|||
import springfox.documentation.builders.RequestHandlerSelectors; |
|||
import springfox.documentation.schema.ModelRef; |
|||
import springfox.documentation.service.ApiInfo; |
|||
import springfox.documentation.service.Parameter; |
|||
import springfox.documentation.spi.DocumentationType; |
|||
import springfox.documentation.spring.web.plugins.Docket; |
|||
import springfox.documentation.swagger2.annotations.EnableSwagger2; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author whj |
|||
*/ |
|||
@Configuration |
|||
@EnableSwagger2 |
|||
@ConditionalOnExpression("${swagger.enable}") |
|||
public class SwaggerConfigure { |
|||
@Bean |
|||
public Docket customDocket() { |
|||
//
|
|||
return new Docket(DocumentationType.SWAGGER_2) |
|||
.apiInfo(apiInfo()) |
|||
.select() |
|||
.apis(RequestHandlerSelectors |
|||
.basePackage("com.ccsens.datang.api")) |
|||
.build() |
|||
.globalOperationParameters(setHeaderToken()); |
|||
} |
|||
|
|||
private ApiInfo apiInfo() { |
|||
return new ApiInfo("Swagger Tall-game", |
|||
"This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", |
|||
"1.0.0", |
|||
"http://swagger.io/terms/", |
|||
"zhangsan", |
|||
"Apache 2.0", |
|||
"http://www.apache.org/licenses/LICENSE-2.0.html" |
|||
); |
|||
} |
|||
|
|||
private List<Parameter> setHeaderToken() { |
|||
ParameterBuilder tokenPar = new ParameterBuilder(); |
|||
List<Parameter> pars = new ArrayList<>(); |
|||
tokenPar.name(WebConstant.HEADER_KEY_TOKEN).description("token") |
|||
.defaultValue(WebConstant.HEADER_KEY_TOKEN_PREFIX) |
|||
.modelRef(new ModelRef("string")).parameterType("header").required(false).build(); |
|||
pars.add(tokenPar.build()); |
|||
return pars; |
|||
} |
|||
} |
@ -0,0 +1,159 @@ |
|||
package com.ccsens.braintraining.intercept; |
|||
|
|||
import cn.hutool.core.collection.CollectionUtil; |
|||
import com.ccsens.util.WebConstant; |
|||
import org.apache.ibatis.executor.Executor; |
|||
import org.apache.ibatis.mapping.BoundSql; |
|||
import org.apache.ibatis.mapping.MappedStatement; |
|||
import org.apache.ibatis.mapping.ResultMap; |
|||
import org.apache.ibatis.mapping.SqlSource; |
|||
import org.apache.ibatis.plugin.*; |
|||
import org.apache.ibatis.reflection.DefaultReflectorFactory; |
|||
import org.apache.ibatis.reflection.MetaObject; |
|||
import org.apache.ibatis.reflection.factory.DefaultObjectFactory; |
|||
import org.apache.ibatis.reflection.wrapper.DefaultObjectWrapperFactory; |
|||
import org.apache.ibatis.session.ResultHandler; |
|||
import org.apache.ibatis.session.RowBounds; |
|||
|
|||
import java.lang.reflect.InvocationTargetException; |
|||
import java.lang.reflect.Method; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Properties; |
|||
|
|||
/** |
|||
* @description: 查询添加rec_status = 0 |
|||
* @author: wuHuiJuan |
|||
* @create: 2019/12/11 10:58 |
|||
*/ |
|||
@Intercepts({ |
|||
@Signature( |
|||
type = Executor.class, |
|||
method = "query", |
|||
args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class} |
|||
) |
|||
}) |
|||
public class MybatisInterceptor implements Interceptor { |
|||
@Override |
|||
public Object intercept(Invocation invocation) throws Throwable { |
|||
|
|||
|
|||
String selectByExample = "selectByExample"; |
|||
String countByExample = "countByExample"; |
|||
String countByExample2 = "selectByExample_COUNT"; |
|||
String selectByPrimaryKey = "selectByPrimaryKey"; |
|||
|
|||
Object[] args = invocation.getArgs(); |
|||
MappedStatement statement = (MappedStatement) args[0]; |
|||
if (statement.getId().endsWith(selectByExample) |
|||
|| statement.getId().endsWith(countByExample) |
|||
|| statement.getId().endsWith(countByExample2)) { |
|||
//XXXExample
|
|||
Object example = args[1]; |
|||
|
|||
addCondition(statement, example); |
|||
|
|||
|
|||
|
|||
|
|||
} else if (statement.getId().endsWith(selectByPrimaryKey)) { |
|||
BoundSql boundSql = statement.getBoundSql(args[1]); |
|||
String sql = boundSql.getSql() + " and rec_status = 0"; |
|||
MappedStatement newStatement = newMappedStatement(statement, new BoundSqlSqlSource(boundSql)); |
|||
MetaObject msObject = MetaObject.forObject(newStatement, new DefaultObjectFactory(), new DefaultObjectWrapperFactory(),new DefaultReflectorFactory()); |
|||
msObject.setValue("sqlSource.boundSql.sql", sql); |
|||
args[0] = newStatement; |
|||
} |
|||
|
|||
return invocation.proceed(); |
|||
} |
|||
|
|||
private void addCondition(MappedStatement statement, Object example) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException { |
|||
if (example instanceof Map) { |
|||
example = ((Map) example).get("_ORIGINAL_PARAMETER_OBJECT"); |
|||
} |
|||
|
|||
|
|||
Method method = example.getClass().getMethod("getOredCriteria", null); |
|||
//获取到条件数组,第一个是Criteria
|
|||
List list = (List) method.invoke(example); |
|||
if (CollectionUtil.isEmpty(list)) { |
|||
Class clazz = ((ResultMap) statement.getResultMaps().get(0)).getType(); |
|||
String exampleName = clazz.getName() + "Example"; |
|||
Object paramExample = Class.forName(exampleName).newInstance(); |
|||
Method createCriteria = paramExample.getClass().getMethod("createCriteria"); |
|||
Object criteria = createCriteria.invoke(paramExample); |
|||
Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class); |
|||
andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value); |
|||
list.add(criteria); |
|||
} else { |
|||
Object criteria = list.get(0); |
|||
Method getCriteria = criteria.getClass().getMethod("getCriteria"); |
|||
List params = (List) getCriteria.invoke(criteria); |
|||
boolean hasDel = false; |
|||
for (Object param : params) { |
|||
Method getCondition = param.getClass().getMethod("getCondition"); |
|||
Object condition = getCondition.invoke(param); |
|||
if ("rec_status =".equals(condition)) { |
|||
hasDel = true; |
|||
} |
|||
} |
|||
if (!hasDel) { |
|||
Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class); |
|||
andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value); |
|||
} |
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public Object plugin(Object target) { |
|||
return Plugin.wrap(target, this); |
|||
} |
|||
|
|||
@Override |
|||
public void setProperties(Properties properties) { |
|||
|
|||
} |
|||
|
|||
private MappedStatement newMappedStatement(MappedStatement ms, SqlSource newSqlSource) { |
|||
MappedStatement.Builder builder = |
|||
new MappedStatement.Builder(ms.getConfiguration(), ms.getId(), newSqlSource, ms.getSqlCommandType()); |
|||
builder.resource(ms.getResource()); |
|||
builder.fetchSize(ms.getFetchSize()); |
|||
builder.statementType(ms.getStatementType()); |
|||
builder.keyGenerator(ms.getKeyGenerator()); |
|||
if (ms.getKeyProperties() != null && ms.getKeyProperties().length != 0) { |
|||
StringBuilder keyProperties = new StringBuilder(); |
|||
for (String keyProperty : ms.getKeyProperties()) { |
|||
keyProperties.append(keyProperty).append(","); |
|||
} |
|||
keyProperties.delete(keyProperties.length() - 1, keyProperties.length()); |
|||
builder.keyProperty(keyProperties.toString()); |
|||
} |
|||
builder.timeout(ms.getTimeout()); |
|||
builder.parameterMap(ms.getParameterMap()); |
|||
builder.resultMaps(ms.getResultMaps()); |
|||
builder.resultSetType(ms.getResultSetType()); |
|||
builder.cache(ms.getCache()); |
|||
builder.flushCacheRequired(ms.isFlushCacheRequired()); |
|||
builder.useCache(ms.isUseCache()); |
|||
|
|||
return builder.build(); |
|||
} |
|||
|
|||
|
|||
// 定义一个内部辅助类,作用是包装sq
|
|||
class BoundSqlSqlSource implements SqlSource { |
|||
private BoundSql boundSql; |
|||
public BoundSqlSqlSource(BoundSql boundSql) { |
|||
this.boundSql = boundSql; |
|||
} |
|||
@Override |
|||
public BoundSql getBoundSql(Object parameterObject) { |
|||
return boundSql; |
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,8 @@ |
|||
package com.ccsens.braintraining.service; |
|||
|
|||
/** |
|||
* @author: whj |
|||
* @time: 2022/3/10 15:41 |
|||
*/ |
|||
public interface IWxTencentService { |
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.ccsens.braintraining.service; |
|||
|
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Propagation; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: whj |
|||
* @time: 2022/3/10 15:42 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) |
|||
public class WxTencentService implements IWxTencentService { |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.ccsens.braintraining.util; |
|||
|
|||
import com.ccsens.util.CodeError; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: whj |
|||
* @time: 2022/3/4 9:44 |
|||
*/ |
|||
public class BrainTrainingCodeError extends CodeError { |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,11 @@ |
|||
package com.ccsens.braintraining.util; |
|||
|
|||
import com.ccsens.util.WebConstant; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: whj |
|||
* @time: 2022/3/4 9:44 |
|||
*/ |
|||
public class BrainTrainingConstant extends WebConstant { |
|||
} |
@ -0,0 +1,30 @@ |
|||
logging: |
|||
level: |
|||
com: |
|||
favorites: DEBUG |
|||
org: |
|||
hibernate: ERROR |
|||
springframework: |
|||
web: DEBUG |
|||
mybatis: |
|||
config-location: classpath:mybatis/mybatis-config.xml |
|||
mapper-locations: classpath*:mapper_*/*.xml |
|||
# type-aliases-package: com.ccsens.mtpro.bean |
|||
#server: |
|||
# tomcat: |
|||
# uri-encoding: UTF-8 |
|||
spring: |
|||
http: |
|||
encoding: |
|||
charset: UTF-8 |
|||
enabled: true |
|||
force: true |
|||
log-request-details: true |
|||
servlet: |
|||
multipart: |
|||
max-file-size: 200MB |
|||
max-request-size: 200MB |
|||
snowflake: |
|||
dataCenterId: 2 |
|||
workerId: 2 |
|||
|
@ -0,0 +1,51 @@ |
|||
server: |
|||
port: 7280 |
|||
servlet: |
|||
context-path: /v1.0 |
|||
spring: |
|||
application: |
|||
name: ptccsens |
|||
datasource: |
|||
type: com.alibaba.druid.pool.DruidDataSource |
|||
# rabbitmq: |
|||
# host: 192.168.0.99 |
|||
# password: 111111 |
|||
# port: 5672 |
|||
# username: admin |
|||
# rabbitmq: |
|||
# host: dd.tall.wiki |
|||
# password: 111111 |
|||
# port: 5672 |
|||
# username: admin |
|||
# redis: |
|||
# database: 0 |
|||
# host: 127.0.0.1 |
|||
# jedis: |
|||
# pool: |
|||
# max-active: 200 |
|||
# max-idle: 10 |
|||
# max-wait: -1ms |
|||
# min-idle: 0 |
|||
# password: '' |
|||
# port: 6379 |
|||
# timeout: 1000ms |
|||
swagger: |
|||
enable: true |
|||
#mybatisCache: |
|||
# database: 1 |
|||
# host: 127.0.0.1 |
|||
# jedis: |
|||
# pool: |
|||
# max-active: 200 |
|||
# max-idle: 10 |
|||
# max-wait: -1 |
|||
# min-idle: 0 |
|||
# password: '' |
|||
# port: 6379 |
|||
# timeout: 1000 |
|||
|
|||
notGatewayUrl: http://101.201.226.163:7320/v1.0 |
|||
file: |
|||
path: /home/cloud/datang/uploads/ |
|||
domain: http://127.0.0.1:7270/v1.0/ |
|||
imgDomain: http://127.0.0.1:7270/v1.0/uploads/ |
@ -0,0 +1,16 @@ |
|||
server: |
|||
port: 7280 |
|||
servlet: |
|||
context-path: /v1.0 |
|||
spring: |
|||
application: |
|||
name: datang |
|||
datasource: |
|||
type: com.alibaba.druid.pool.DruidDataSource |
|||
swagger: |
|||
enable: true |
|||
|
|||
file: |
|||
path: /home/cloud/datang/uploads/ |
|||
domain: http://10.119.190.12:8000/v1.0/ |
|||
imgDomain: http://10.119.190.12:8000/v1.0/uploads/ |
@ -0,0 +1,16 @@ |
|||
server: |
|||
port: 7280 |
|||
servlet: |
|||
context-path: /v1.0 |
|||
spring: |
|||
application: |
|||
name: ptccsens |
|||
datasource: |
|||
type: com.alibaba.druid.pool.DruidDataSource |
|||
swagger: |
|||
enable: true |
|||
|
|||
file: |
|||
path: /home/cloud/datang/uploads/ |
|||
domain: http://test.tall.wiki/datang/v1.0/ |
|||
imgDomain: http://test.tall.wiki/datang/v1.0/uploads/ |
@ -0,0 +1,4 @@ |
|||
spring: |
|||
profiles: |
|||
active: test |
|||
include: common, util-test |
@ -0,0 +1,35 @@ |
|||
spring: |
|||
datasource: |
|||
druid: |
|||
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 |
|||
driverClassName: com.mysql.cj.jdbc.Driver |
|||
dynamicUrl: jdbc:mysql://localhost:3306/${schema} |
|||
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*' |
|||
filterName: druidFilter |
|||
filterProfileEnable: true |
|||
filterUrlPattern: /* |
|||
filters: stat,wall |
|||
initialSize: 5 |
|||
maxActive: 20 |
|||
maxPoolPreparedStatementPerConnectionSize: 20 |
|||
maxWait: 60000 |
|||
minEvictableIdleTimeMillis: 300000 |
|||
minIdle: 5 |
|||
# password: 37080c1f223685592316b02dad8816c019290a476e54ebb638f9aa3ba8b6bdb9 |
|||
password: 68073a279b399baa1fa12cf39bfbb65bfc1480ffee7b659ccc81cf19be8c4473 |
|||
poolPreparedStatements: true |
|||
servletLogSlowSql: true |
|||
servletLoginPassword: 111111 |
|||
servletLoginUsername: druid |
|||
servletName: druidServlet |
|||
servletResetEnable: true |
|||
servletUrlMapping: /druid/* |
|||
testOnBorrow: false |
|||
testOnReturn: false |
|||
testWhileIdle: true |
|||
timeBetweenEvictionRunsMillis: 60000 |
|||
url: jdbc:mysql://test.tall.wiki:3306/datang?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true |
|||
username: root |
|||
validationQuery: SELECT 1 FROM DUAL |
|||
# env: CCSENS_GAME |
|||
env: CCSENS_TALL |
@ -0,0 +1,33 @@ |
|||
spring: |
|||
datasource: |
|||
druid: |
|||
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 |
|||
driverClassName: com.mysql.cj.jdbc.Driver |
|||
dynamicUrl: jdbc:mysql://localhost:3306/${schema} |
|||
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*' |
|||
filterName: druidFilter |
|||
filterProfileEnable: true |
|||
filterUrlPattern: /* |
|||
filters: stat,wall |
|||
initialSize: 5 |
|||
maxActive: 20 |
|||
maxPoolPreparedStatementPerConnectionSize: 20 |
|||
maxWait: 60000 |
|||
minEvictableIdleTimeMillis: 300000 |
|||
minIdle: 5 |
|||
password: 68073a279b399baa1fa12cf39bfbb65bfc1480ffee7b659ccc81cf19be8c4473 |
|||
poolPreparedStatements: true |
|||
servletLogSlowSql: true |
|||
servletLoginPassword: 111111 |
|||
servletLoginUsername: druid |
|||
servletName: druidServlet |
|||
servletResetEnable: true |
|||
servletUrlMapping: /druid/* |
|||
testOnBorrow: false |
|||
testOnReturn: false |
|||
testWhileIdle: true |
|||
timeBetweenEvictionRunsMillis: 60000 |
|||
url: jdbc:mysql://127.0.0.1/datang?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true |
|||
username: root |
|||
validationQuery: SELECT 1 FROM DUAL |
|||
env: CCSENS_TALL |
@ -0,0 +1,33 @@ |
|||
spring: |
|||
datasource: |
|||
druid: |
|||
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 |
|||
driverClassName: com.mysql.cj.jdbc.Driver |
|||
dynamicUrl: jdbc:mysql://localhost:3306/${schema} |
|||
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*' |
|||
filterName: druidFilter |
|||
filterProfileEnable: true |
|||
filterUrlPattern: /* |
|||
filters: stat,wall |
|||
initialSize: 5 |
|||
maxActive: 20 |
|||
maxPoolPreparedStatementPerConnectionSize: 20 |
|||
maxWait: 60000 |
|||
minEvictableIdleTimeMillis: 300000 |
|||
minIdle: 5 |
|||
password: |
|||
poolPreparedStatements: true |
|||
servletLogSlowSql: true |
|||
servletLoginPassword: 111111 |
|||
servletLoginUsername: druid |
|||
servletName: druidServlet |
|||
servletResetEnable: true |
|||
servletUrlMapping: /druid/* |
|||
testOnBorrow: false |
|||
testOnReturn: false |
|||
testWhileIdle: true |
|||
timeBetweenEvictionRunsMillis: 60000 |
|||
url: jdbc:mysql://127.0.0.1/datang?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true |
|||
username: root |
|||
validationQuery: SELECT 1 FROM DUAL |
|||
env: CCSENS_TALL |
@ -0,0 +1,37 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd" |
|||
updateCheck="false" |
|||
name="myEhcache"> |
|||
<diskStore path="java.io.tmpdir/Tmp_EhCache"/> |
|||
<defaultCache eternal="false" |
|||
maxElementsInMemory="1000" |
|||
overflowToDisk="false" |
|||
diskPersistent="false" |
|||
timeToIdleSeconds="0" |
|||
timeToLiveSeconds="600" |
|||
memoryStoreEvictionPolicy="LRU"/> |
|||
<cache name="user" |
|||
eternal="false" |
|||
maxElementsInMemory="10000" |
|||
overflowToDisk="false" |
|||
diskPersistent="false" |
|||
timeToIdleSeconds="0" |
|||
timeToLiveSeconds="0" |
|||
memoryStoreEvictionPolicy="LFU"/> |
|||
<!-- |
|||
缓存配置 |
|||
name: 缓存名称。 |
|||
maxElementsInMemory: 缓存最大个数。 |
|||
eternal: 对象是否永久有效,一但设置了,timeout将不起作用。 |
|||
timeToIdleSeconds: 设置对象在失效前的允许闲置时间(单位:秒)。仅当eternal=false对象不是永久有效时使用,可选属性,默认值是0,也就是可闲置时间无穷大。 |
|||
timeToLiveSeconds: 设置对象在失效前允许存活时间(单位:秒)。最大时间介于创建时间和失效时间之间。仅当eternal=false对象不是永久有效时使用,默认是0.,也就是对象存活时间无穷大。 |
|||
overflowToDisk: 当内存中对象数量达到maxElementsInMemory时,Ehcache将会对象写到磁盘中。 |
|||
diskSpoolBufferSizeMB: 这个参数设置DiskStore(磁盘缓存)的缓存区大小。默认是30MB。每个Cache都应该有自己的一个缓冲区。 |
|||
maxElementsOnDisk: 硬盘最大缓存个数。 |
|||
diskPersistent: 是否缓存虚拟机重启期数据 Whether the disk store persists between restarts of the Virtual Machine. The default value is false. |
|||
diskExpiryThreadIntervalSeconds:磁盘失效线程运行时间间隔,默认是120秒。 |
|||
memoryStoreEvictionPolicy: 当达到maxElementsInMemory限制时,Ehcache将会根据指定的策略去清理内存。默认策略是LRU(最近最少使用)。你可以设置为FIFO(先进先出)或是LFU(较少使用)。 |
|||
clearOnFlush: 内存数量最大时是否清除。 |
|||
--> |
|||
</ehcache> |
@ -0,0 +1,196 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 --> |
|||
<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true --> |
|||
<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 --> |
|||
<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 --> |
|||
<configuration scan="true" scanPeriod="10 seconds"> |
|||
|
|||
<!--<include resource="org/springframework/boot/logging/logback/base.xml" />--> |
|||
|
|||
<contextName>logback</contextName> |
|||
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 --> |
|||
<property name="log.path" value="/home/cloud/braintraining/log/" /> |
|||
|
|||
<!-- 彩色日志 --> |
|||
<!-- 彩色日志依赖的渲染类 --> |
|||
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" /> |
|||
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" /> |
|||
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" /> |
|||
<!-- 彩色日志格式 --> |
|||
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
|||
|
|||
|
|||
<!--输出到控制台--> |
|||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
|||
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息--> |
|||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
|||
<level>info</level> |
|||
</filter> |
|||
<encoder> |
|||
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern> |
|||
<!-- 设置字符集 --> |
|||
<charset>UTF-8</charset> |
|||
</encoder> |
|||
</appender> |
|||
|
|||
|
|||
<!--输出到文件--> |
|||
|
|||
<!-- 时间滚动输出 level为 DEBUG 日志 --> |
|||
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<!-- 正在记录的日志文件的路径及文件名 --> |
|||
<file>${log.path}/log_debug.log</file> |
|||
<!--日志文件输出格式--> |
|||
<encoder> |
|||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|||
<charset>UTF-8</charset> <!-- 设置字符集 --> |
|||
</encoder> |
|||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<!-- 日志归档 --> |
|||
<fileNamePattern>${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
|||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
|||
<maxFileSize>100MB</maxFileSize> |
|||
</timeBasedFileNamingAndTriggeringPolicy> |
|||
<!--日志文件保留天数--> |
|||
<maxHistory>15</maxHistory> |
|||
</rollingPolicy> |
|||
<!-- 此日志文件只记录debug级别的 --> |
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|||
<level>debug</level> |
|||
<onMatch>ACCEPT</onMatch> |
|||
<onMismatch>DENY</onMismatch> |
|||
</filter> |
|||
</appender> |
|||
|
|||
<!-- 时间滚动输出 level为 INFO 日志 --> |
|||
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<!-- 正在记录的日志文件的路径及文件名 --> |
|||
<file>${log.path}/log_info.log</file> |
|||
<!--日志文件输出格式--> |
|||
<encoder> |
|||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|||
<charset>UTF-8</charset> |
|||
</encoder> |
|||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<!-- 每天日志归档路径以及格式 --> |
|||
<fileNamePattern>${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
|||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
|||
<maxFileSize>100MB</maxFileSize> |
|||
</timeBasedFileNamingAndTriggeringPolicy> |
|||
<!--日志文件保留天数--> |
|||
<maxHistory>15</maxHistory> |
|||
</rollingPolicy> |
|||
<!-- 此日志文件只记录info级别的 --> |
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|||
<level>info</level> |
|||
<onMatch>ACCEPT</onMatch> |
|||
<onMismatch>DENY</onMismatch> |
|||
</filter> |
|||
</appender> |
|||
|
|||
<!-- 时间滚动输出 level为 WARN 日志 --> |
|||
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<!-- 正在记录的日志文件的路径及文件名 --> |
|||
<file>${log.path}/log_warn.log</file> |
|||
<!--日志文件输出格式--> |
|||
<encoder> |
|||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|||
<charset>UTF-8</charset> <!-- 此处设置字符集 --> |
|||
</encoder> |
|||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<fileNamePattern>${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
|||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
|||
<maxFileSize>100MB</maxFileSize> |
|||
</timeBasedFileNamingAndTriggeringPolicy> |
|||
<!--日志文件保留天数--> |
|||
<maxHistory>15</maxHistory> |
|||
</rollingPolicy> |
|||
<!-- 此日志文件只记录warn级别的 --> |
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|||
<level>warn</level> |
|||
<onMatch>ACCEPT</onMatch> |
|||
<onMismatch>DENY</onMismatch> |
|||
</filter> |
|||
</appender> |
|||
|
|||
|
|||
<!-- 时间滚动输出 level为 ERROR 日志 --> |
|||
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<!-- 正在记录的日志文件的路径及文件名 --> |
|||
<file>${log.path}/log_error.log</file> |
|||
<!--日志文件输出格式--> |
|||
<encoder> |
|||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
|||
<charset>UTF-8</charset> <!-- 此处设置字符集 --> |
|||
</encoder> |
|||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<fileNamePattern>${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
|||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
|||
<maxFileSize>100MB</maxFileSize> |
|||
</timeBasedFileNamingAndTriggeringPolicy> |
|||
<!--日志文件保留天数--> |
|||
<maxHistory>15</maxHistory> |
|||
</rollingPolicy> |
|||
<!-- 此日志文件只记录ERROR级别的 --> |
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|||
<level>ERROR</level> |
|||
<onMatch>ACCEPT</onMatch> |
|||
<onMismatch>DENY</onMismatch> |
|||
</filter> |
|||
</appender> |
|||
|
|||
<!-- |
|||
<logger>用来设置某一个包或者具体的某一个类的日志打印级别、 |
|||
以及指定<appender>。<logger>仅有一个name属性, |
|||
一个可选的level和一个可选的addtivity属性。 |
|||
name:用来指定受此logger约束的某一个包或者具体的某一个类。 |
|||
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF, |
|||
还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。 |
|||
如果未设置此属性,那么当前logger将会继承上级的级别。 |
|||
addtivity:是否向上级logger传递打印信息。默认是true。 |
|||
--> |
|||
<!--<logger name="org.springframework.web" level="info"/>--> |
|||
<!--<logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/>--> |
|||
<!-- |
|||
使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作: |
|||
第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息 |
|||
第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别: |
|||
--> |
|||
|
|||
|
|||
<!-- |
|||
root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性 |
|||
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF, |
|||
不能设置为INHERITED或者同义词NULL。默认是DEBUG |
|||
可以包含零个或多个元素,标识这个appender将会添加到这个logger。 |
|||
--> |
|||
|
|||
<!--开发环境:打印控制台--> |
|||
<springProfile name="dev"> |
|||
<logger name="com.ccsens.ptpro.persist.*" level="debug"/> |
|||
</springProfile> |
|||
|
|||
<root level="info"> |
|||
<appender-ref ref="CONSOLE" /> |
|||
<appender-ref ref="DEBUG_FILE" /> |
|||
<appender-ref ref="INFO_FILE" /> |
|||
<appender-ref ref="WARN_FILE" /> |
|||
<appender-ref ref="ERROR_FILE" /> |
|||
</root> |
|||
|
|||
<!--生产环境:输出到文件--> |
|||
<!--<springProfile name="pro">--> |
|||
<!--<root level="info">--> |
|||
<!--<appender-ref ref="CONSOLE" />--> |
|||
<!--<appender-ref ref="DEBUG_FILE" />--> |
|||
<!--<appender-ref ref="INFO_FILE" />--> |
|||
<!--<appender-ref ref="ERROR_FILE" />--> |
|||
<!--<appender-ref ref="WARN_FILE" />--> |
|||
<!--</root>--> |
|||
<!--</springProfile>--> |
|||
|
|||
</configuration> |
@ -0,0 +1,70 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE generatorConfiguration |
|||
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" |
|||
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> |
|||
|
|||
<generatorConfiguration> |
|||
<context id="MySQL" targetRuntime="MyBatis3"> |
|||
<!-- 为生成的Java模型创建一个toString方法 --> |
|||
<plugin type="org.mybatis.generator.plugins.ToStringPlugin"></plugin> |
|||
|
|||
<!-- 自定义的序列化 类文件 插件 --> |
|||
<plugin type="org.mybatis.generator.plugins.SerializablePlugin"></plugin> |
|||
|
|||
<!-- 重新生成xml文件,而不是追加 --> |
|||
<plugin type="org.mybatis.generator.plugins.UnmergeableXmlMappersPlugin" /> |
|||
|
|||
<commentGenerator> |
|||
<!-- 是否去除自动生成的注释 true:是 : false:否 --> |
|||
<property name="suppressAllComments" value="true" /> |
|||
</commentGenerator> |
|||
|
|||
<!--数据库连接的信息:驱动类、连接地址、用户名、密码 --> |
|||
<jdbcConnection driverClass="com.mysql.jdbc.Driver" |
|||
connectionURL="jdbc:mysql://test.tall.wiki:3306/braintraining?useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false" |
|||
userId="root" |
|||
password="po3OynBO[M3579p6L7)o"> |
|||
</jdbcConnection> |
|||
|
|||
<!-- 默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer,为 true时把JDBC DECIMAL 和 |
|||
NUMERIC 类型解析为java.math.BigDecimal --> |
|||
<javaTypeResolver> |
|||
<property name="forceBigDecimals" value="true" /> |
|||
</javaTypeResolver> |
|||
|
|||
<!-- targetProject:生成PO类的位置 --> |
|||
<javaModelGenerator targetPackage="com.ccsens.braintraining.bean.po" |
|||
targetProject=".\src\main\java"> |
|||
<!-- enableSubPackages:是否让schema作为包的后缀 --> |
|||
<property name="enableSubPackages" value="false" /> |
|||
<!-- 从数据库返回的值被清理前后的空格 --> |
|||
<property name="trimStrings" value="true" /> |
|||
</javaModelGenerator> |
|||
|
|||
<!-- targetProject:mapper映射文件生成的位置 --> |
|||
<sqlMapGenerator targetPackage="mapper_raw" |
|||
targetProject=".\src\main\resources"> |
|||
<!-- enableSubPackages:是否让schema作为包的后缀 --> |
|||
<property name="enableSubPackages" value="false" /> |
|||
</sqlMapGenerator> |
|||
|
|||
<!-- targetPackage:mapper接口生成的位置 --> |
|||
<javaClientGenerator type="XMLMAPPER" |
|||
targetPackage="com.ccsens.braintraining.persist.mapper" |
|||
targetProject=".\src\main\java"> |
|||
<!-- enableSubPackages:是否让schema作为包的后缀 --> |
|||
<property name="enableSubPackages" value="false" /> |
|||
</javaClientGenerator> |
|||
<table tableName="t_content_file" domainObjectName="ContentFile"/> |
|||
<!--<table tableName="t_back_user" domainObjectName="BackUser"></table> |
|||
<table tableName="t_back_role" domainObjectName="BackRole"></table> |
|||
<table tableName="t_back_user_role" domainObjectName="BackUserRole"></table> |
|||
<table tableName="t_back_permission" domainObjectName="BackPermission"></table> |
|||
<table tableName="t_back_role_permission" domainObjectName="BackRolePermission"></table> |
|||
<table tableName="t_carousel" domainObjectName="Carousel"></table> |
|||
<table tableName="t_content_intro" domainObjectName="ContentIntro"></table> |
|||
<table tableName="t_content_detail" domainObjectName="ContentDetail"></table> |
|||
<table tableName="t_content_relation" domainObjectName="ContentRelation"></table> |
|||
<table tableName="t_constant" domainObjectName="Constant"></table>--> |
|||
</context> |
|||
</generatorConfiguration> |
@ -0,0 +1,62 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE configuration |
|||
PUBLIC "-//mybatis.org//DTD Config 3.0//EN" |
|||
"http://mybatis.org/dtd/mybatis-3-config.dtd"> |
|||
|
|||
<configuration> |
|||
<!-- 全局参数 --> |
|||
<settings> |
|||
<!-- 打印SQL语句 --> |
|||
<setting name="logImpl" value="STDOUT_LOGGING" /> |
|||
<!-- 使全局的映射器启用或禁用缓存。 --> |
|||
<setting name="cacheEnabled" value="true"/> |
|||
<!-- 全局启用或禁用延迟加载。当禁用时,所有关联对象都会即时加载。 --> |
|||
<setting name="lazyLoadingEnabled" value="true"/> |
|||
<!-- 当启用时,有延迟加载属性的对象在被调用时将会完全加载任意属性。否则,每种属性将会按需要加载。 --> |
|||
<setting name="aggressiveLazyLoading" value="true"/> |
|||
<!-- 是否允许单条sql 返回多个数据集 (取决于驱动的兼容性) default:true --> |
|||
<setting name="multipleResultSetsEnabled" value="true"/> |
|||
<!-- 是否可以使用列的别名 (取决于驱动的兼容性) default:true --> |
|||
<setting name="useColumnLabel" value="true"/> |
|||
<!-- 允许JDBC 生成主键。需要驱动器支持。如果设为了true,这个设置将强制使用被生成的主键,有一些驱动器不兼容不过仍然可以执行。 default:false --> |
|||
<setting name="useGeneratedKeys" value="true"/> |
|||
<!-- 指定 MyBatis 如何自动映射 数据基表的列 NONE:不隐射 PARTIAL:部分 FULL:全部 --> |
|||
<setting name="autoMappingBehavior" value="PARTIAL"/> |
|||
<!-- 这是默认的执行类型 (SIMPLE: 简单; REUSE: 执行器可能重复使用prepared statements语句;BATCH: 执行器可以重复执行语句和批量更新) --> |
|||
<setting name="defaultExecutorType" value="SIMPLE"/> |
|||
<!-- 使用驼峰命名法转换字段。 --> |
|||
<setting name="mapUnderscoreToCamelCase" value="true"/> |
|||
<!-- 设置本地缓存范围 session:就会有数据的共享 statement:语句范围 (这样就不会有数据的共享 ) defalut:session --> |
|||
<setting name="localCacheScope" value="SESSION"/> |
|||
<!-- 设置但JDBC类型为空时,某些驱动程序 要指定值,default:OTHER,插入空值时不需要指定类型 --> |
|||
<setting name="jdbcTypeForNull" value="NULL"/> |
|||
</settings> |
|||
|
|||
<typeAliases> |
|||
<typeAlias alias="Integer" type="java.lang.Integer" /> |
|||
<typeAlias alias="Long" type="java.lang.Long" /> |
|||
<typeAlias alias="HashMap" type="java.util.HashMap" /> |
|||
<typeAlias alias="LinkedHashMap" type="java.util.LinkedHashMap" /> |
|||
<typeAlias alias="ArrayList" type="java.util.ArrayList" /> |
|||
<typeAlias alias="LinkedList" type="java.util.LinkedList" /> |
|||
<typeAlias alias="String" type="java.lang.String" /> |
|||
</typeAliases> |
|||
|
|||
<plugins> |
|||
<!-- com.github.pagehelper为PageHelper类所在包名 --> |
|||
<plugin interceptor="com.github.pagehelper.PageHelper"> |
|||
<property name="dialect" value="mysql"/> |
|||
<!-- 该参数默认为false --> |
|||
<!-- 设置为true时,会将RowBounds第一个参数offset当成pageNum页码使用 --> |
|||
<!-- 和startPage中的pageNum效果一样--> |
|||
<property name="offsetAsPageNum" value="false"/> |
|||
<!-- 该参数默认为false --> |
|||
<!-- 设置为true时,使用RowBounds分页会进行count查询 --> |
|||
<property name="rowBoundsWithCount" value="false"/> |
|||
<property name="pageSizeZero" value="true"/> |
|||
<property name="reasonable" value="false"/> |
|||
<property name="supportMethodsArguments" value="false"/> |
|||
<property name="returnPageInfo" value="none"/> |
|||
</plugin> |
|||
</plugins> |
|||
</configuration> |
Loading…
Reference in new issue