Commit b9ded713e7946e637b95b816cda2d7933aa078f0

Authored by PurelzMgnead
1 parent f7957dbb

edge

Showing 100 changed files with 1011 additions and 85 deletions

Too many changes to show.

To preserve performance only 100 of 165 files are displayed.

.idea/.gitignore 0 → 100644
  1 +# Default ignored files
  2 +/shelf/
  3 +/workspace.xml
  4 +# Editor-based HTTP Client requests
  5 +/httpRequests/
  6 +# Datasource local storage ignored files
  7 +/dataSources/
  8 +/dataSources.local.xml
.idea/compiler.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="CompilerConfiguration">
  4 + <annotationProcessing>
  5 + <profile default="true" name="Default" enabled="true" />
  6 + <profile name="Maven default annotation processors profile" enabled="true">
  7 + <sourceOutputDir name="target/generated-sources/annotations" />
  8 + <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
  9 + <outputRelativeToContentRoot value="true" />
  10 + <module name="webmagic-canrd-service" />
  11 + </profile>
  12 + </annotationProcessing>
  13 + </component>
  14 + <component name="JavacSettings">
  15 + <option name="ADDITIONAL_OPTIONS_OVERRIDE">
  16 + <module name="webmagic-canrd-service" options="-parameters" />
  17 + </option>
  18 + </component>
  19 +</project>
0 \ No newline at end of file 20 \ No newline at end of file
.idea/encodings.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="Encoding">
  4 + <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
  5 + </component>
  6 +</project>
0 \ No newline at end of file 7 \ No newline at end of file
.idea/inspectionProfiles/Project_Default.xml 0 → 100644
  1 +<component name="InspectionProjectProfileManager">
  2 + <profile version="1.0">
  3 + <option name="myName" value="Project Default" />
  4 + <inspection_tool class="NonSerializableWithSerialVersionUIDField" enabled="true" level="WARNING" enabled_by_default="true" />
  5 + </profile>
  6 +</component>
0 \ No newline at end of file 7 \ No newline at end of file
.idea/jarRepositories.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="RemoteRepositoriesConfiguration">
  4 + <remote-repository>
  5 + <option name="id" value="central" />
  6 + <option name="name" value="Central Repository" />
  7 + <option name="url" value="https://repo.maven.apache.org/maven2" />
  8 + </remote-repository>
  9 + <remote-repository>
  10 + <option name="id" value="central" />
  11 + <option name="name" value="Maven Central repository" />
  12 + <option name="url" value="https://repo1.maven.org/maven2" />
  13 + </remote-repository>
  14 + <remote-repository>
  15 + <option name="id" value="jboss.community" />
  16 + <option name="name" value="JBoss Community repository" />
  17 + <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
  18 + </remote-repository>
  19 + </component>
  20 +</project>
0 \ No newline at end of file 21 \ No newline at end of file
.idea/misc.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="ExternalStorageConfigurationManager" enabled="true" />
  4 + <component name="MavenProjectsManager">
  5 + <option name="originalFiles">
  6 + <list>
  7 + <option value="$PROJECT_DIR$/pom.xml" />
  8 + </list>
  9 + </option>
  10 + </component>
  11 + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
  12 +</project>
0 \ No newline at end of file 13 \ No newline at end of file
.idea/uiDesigner.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="Palette2">
  4 + <group name="Swing">
  5 + <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
  6 + <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
  7 + </item>
  8 + <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
  9 + <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
  10 + </item>
  11 + <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
  12 + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
  13 + </item>
  14 + <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
  15 + <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
  16 + </item>
  17 + <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
  18 + <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
  19 + <initial-values>
  20 + <property name="text" value="Button" />
  21 + </initial-values>
  22 + </item>
  23 + <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
  24 + <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
  25 + <initial-values>
  26 + <property name="text" value="RadioButton" />
  27 + </initial-values>
  28 + </item>
  29 + <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
  30 + <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
  31 + <initial-values>
  32 + <property name="text" value="CheckBox" />
  33 + </initial-values>
  34 + </item>
  35 + <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
  36 + <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
  37 + <initial-values>
  38 + <property name="text" value="Label" />
  39 + </initial-values>
  40 + </item>
  41 + <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
  42 + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
  43 + <preferred-size width="150" height="-1" />
  44 + </default-constraints>
  45 + </item>
  46 + <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
  47 + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
  48 + <preferred-size width="150" height="-1" />
  49 + </default-constraints>
  50 + </item>
  51 + <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
  52 + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
  53 + <preferred-size width="150" height="-1" />
  54 + </default-constraints>
  55 + </item>
  56 + <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
  57 + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
  58 + <preferred-size width="150" height="50" />
  59 + </default-constraints>
  60 + </item>
  61 + <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
  62 + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
  63 + <preferred-size width="150" height="50" />
  64 + </default-constraints>
  65 + </item>
  66 + <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
  67 + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
  68 + <preferred-size width="150" height="50" />
  69 + </default-constraints>
  70 + </item>
  71 + <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
  72 + <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
  73 + </item>
  74 + <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
  75 + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
  76 + <preferred-size width="150" height="50" />
  77 + </default-constraints>
  78 + </item>
  79 + <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
  80 + <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
  81 + <preferred-size width="150" height="50" />
  82 + </default-constraints>
  83 + </item>
  84 + <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
  85 + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
  86 + <preferred-size width="150" height="50" />
  87 + </default-constraints>
  88 + </item>
  89 + <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
  90 + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
  91 + <preferred-size width="200" height="200" />
  92 + </default-constraints>
  93 + </item>
  94 + <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
  95 + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
  96 + <preferred-size width="200" height="200" />
  97 + </default-constraints>
  98 + </item>
  99 + <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
  100 + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
  101 + </item>
  102 + <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
  103 + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
  104 + </item>
  105 + <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
  106 + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
  107 + </item>
  108 + <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
  109 + <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
  110 + </item>
  111 + <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
  112 + <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
  113 + <preferred-size width="-1" height="20" />
  114 + </default-constraints>
  115 + </item>
  116 + <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
  117 + <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
  118 + </item>
  119 + <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
  120 + <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
  121 + </item>
  122 + </group>
  123 + </component>
  124 +</project>
0 \ No newline at end of file 125 \ No newline at end of file
.idea/vcs.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="VcsDirectoryMappings">
  4 + <mapping directory="" vcs="Git" />
  5 + </component>
  6 +</project>
0 \ No newline at end of file 7 \ No newline at end of file
@@ -51,7 +51,6 @@ @@ -51,7 +51,6 @@
51 </properties> 51 </properties>
52 52
53 <dependencies> 53 <dependencies>
54 -  
55 <dependency> 54 <dependency>
56 <groupId>org.springframework.boot</groupId> 55 <groupId>org.springframework.boot</groupId>
57 <artifactId>spring-boot-starter-web</artifactId> 56 <artifactId>spring-boot-starter-web</artifactId>
@@ -63,29 +62,24 @@ @@ -63,29 +62,24 @@
63 </exclusion> 62 </exclusion>
64 </exclusions> 63 </exclusions>
65 </dependency> 64 </dependency>
66 -  
67 <!-- webmagic核心库 --> 65 <!-- webmagic核心库 -->
68 <dependency> 66 <dependency>
69 <groupId>us.codecraft</groupId> 67 <groupId>us.codecraft</groupId>
70 <artifactId>webmagic-core</artifactId> 68 <artifactId>webmagic-core</artifactId>
71 <version>${webmagic.version}</version> 69 <version>${webmagic.version}</version>
72 </dependency> 70 </dependency>
73 -  
74 -  
75 <!-- webmagic扩展库 --> 71 <!-- webmagic扩展库 -->
76 <dependency> 72 <dependency>
77 <groupId>us.codecraft</groupId> 73 <groupId>us.codecraft</groupId>
78 <artifactId>webmagic-extension</artifactId> 74 <artifactId>webmagic-extension</artifactId>
79 <version>${webmagic.version}</version> 75 <version>${webmagic.version}</version>
80 </dependency> 76 </dependency>
81 -  
82 <!-- selenium --> 77 <!-- selenium -->
83 <dependency> 78 <dependency>
84 <groupId>org.seleniumhq.selenium</groupId> 79 <groupId>org.seleniumhq.selenium</groupId>
85 <artifactId>selenium-java</artifactId> 80 <artifactId>selenium-java</artifactId>
86 <version>${selenium.version}</version> 81 <version>${selenium.version}</version>
87 </dependency> 82 </dependency>
88 -  
89 <!-- Lombok 依赖--> 83 <!-- Lombok 依赖-->
90 <dependency> 84 <dependency>
91 <groupId>org.projectlombok</groupId> 85 <groupId>org.projectlombok</groupId>
@@ -104,16 +98,16 @@ @@ -104,16 +98,16 @@
104 <version>${springboot.version}</version> 98 <version>${springboot.version}</version>
105 <scope>test</scope> 99 <scope>test</scope>
106 </dependency> 100 </dependency>
107 - 101 + <dependency>
  102 + <groupId>com.github.xiaoymin</groupId>
  103 + <artifactId>knife4j-spring-boot-starter</artifactId>
  104 + <version>2.0.9</version>
  105 + </dependency>
108 <dependency> 106 <dependency>
109 <groupId>com.baomidou</groupId> 107 <groupId>com.baomidou</groupId>
110 <artifactId>mybatis-plus-boot-starter</artifactId> 108 <artifactId>mybatis-plus-boot-starter</artifactId>
111 <version>${baomidou.version}</version> 109 <version>${baomidou.version}</version>
112 </dependency> 110 </dependency>
113 - <!-- <dependency>-->  
114 - <!-- <groupId>com.baomidou</groupId>-->  
115 - <!-- <artifactId>dynamic-datasource-spring-boot-starter</artifactId>-->  
116 - <!-- </dependency>-->  
117 <dependency> 111 <dependency>
118 <groupId>mysql</groupId> 112 <groupId>mysql</groupId>
119 <artifactId>mysql-connector-java</artifactId> 113 <artifactId>mysql-connector-java</artifactId>
@@ -124,39 +118,31 @@ @@ -124,39 +118,31 @@
124 <artifactId>druid-spring-boot-starter</artifactId> 118 <artifactId>druid-spring-boot-starter</artifactId>
125 <version>${druid.version}</version> 119 <version>${druid.version}</version>
126 </dependency> 120 </dependency>
127 -  
128 <dependency> 121 <dependency>
129 <groupId>org.springframework.boot</groupId> 122 <groupId>org.springframework.boot</groupId>
130 <artifactId>spring-boot-starter-log4j2</artifactId> 123 <artifactId>spring-boot-starter-log4j2</artifactId>
131 <version>${springboot.version}</version> 124 <version>${springboot.version}</version>
132 </dependency> 125 </dependency>
133 -  
134 -  
135 <dependency> 126 <dependency>
136 <groupId>com.alibaba</groupId> 127 <groupId>com.alibaba</groupId>
137 <artifactId>fastjson</artifactId> 128 <artifactId>fastjson</artifactId>
138 <version>${fastjson.version}</version> 129 <version>${fastjson.version}</version>
139 </dependency> 130 </dependency>
140 -  
141 <dependency> 131 <dependency>
142 <groupId>cn.hutool</groupId> 132 <groupId>cn.hutool</groupId>
143 <artifactId>hutool-crypto</artifactId> 133 <artifactId>hutool-crypto</artifactId>
144 <version>${hutool-crypto.version}</version> 134 <version>${hutool-crypto.version}</version>
145 </dependency> 135 </dependency>
146 -  
147 <dependency> 136 <dependency>
148 <groupId>org.springframework.boot</groupId> 137 <groupId>org.springframework.boot</groupId>
149 <artifactId>spring-boot-starter-data-redis</artifactId> 138 <artifactId>spring-boot-starter-data-redis</artifactId>
150 <version>${springboot.version}</version> 139 <version>${springboot.version}</version>
151 </dependency> 140 </dependency>
152 -  
153 <dependency> 141 <dependency>
154 <groupId>org.apache.commons</groupId> 142 <groupId>org.apache.commons</groupId>
155 <artifactId>commons-pool2</artifactId> 143 <artifactId>commons-pool2</artifactId>
156 <version>${commons-pool2.version}</version> 144 <version>${commons-pool2.version}</version>
157 </dependency> 145 </dependency>
158 -  
159 -  
160 <dependency> 146 <dependency>
161 <groupId>org.apache.commons</groupId> 147 <groupId>org.apache.commons</groupId>
162 <artifactId>commons-lang3</artifactId> 148 <artifactId>commons-lang3</artifactId>
@@ -172,7 +158,6 @@ @@ -172,7 +158,6 @@
172 <artifactId>UserAgentUtils</artifactId> 158 <artifactId>UserAgentUtils</artifactId>
173 <version>${userAgentUtils.version}</version> 159 <version>${userAgentUtils.version}</version>
174 </dependency> 160 </dependency>
175 -  
176 <!--工具包--> 161 <!--工具包-->
177 <dependency> 162 <dependency>
178 <groupId>cn.hutool</groupId> 163 <groupId>cn.hutool</groupId>
@@ -189,15 +174,11 @@ @@ -189,15 +174,11 @@
189 <artifactId>poi-ooxml</artifactId> 174 <artifactId>poi-ooxml</artifactId>
190 <version>${poi-ooxml.version}</version> 175 <version>${poi-ooxml.version}</version>
191 </dependency> 176 </dependency>
192 -  
193 <dependency> 177 <dependency>
194 <groupId>joda-time</groupId> 178 <groupId>joda-time</groupId>
195 <artifactId>joda-time</artifactId> 179 <artifactId>joda-time</artifactId>
196 <version>${joda-time.version}</version> 180 <version>${joda-time.version}</version>
197 </dependency> 181 </dependency>
198 -  
199 -  
200 -  
201 </dependencies> 182 </dependencies>
202 <build> 183 <build>
203 <finalName>webmagic-canrd.service-1.0-SNAPSHOT</finalName> 184 <finalName>webmagic-canrd.service-1.0-SNAPSHOT</finalName>
@@ -206,7 +187,6 @@ @@ -206,7 +187,6 @@
206 <groupId>org.apache.maven.plugins</groupId> 187 <groupId>org.apache.maven.plugins</groupId>
207 <artifactId>maven-source-plugin</artifactId> 188 <artifactId>maven-source-plugin</artifactId>
208 </plugin> 189 </plugin>
209 -  
210 <plugin> 190 <plugin>
211 <groupId>org.springframework.boot</groupId> 191 <groupId>org.springframework.boot</groupId>
212 <artifactId>spring-boot-maven-plugin</artifactId> 192 <artifactId>spring-boot-maven-plugin</artifactId>
@@ -214,7 +194,6 @@ @@ -214,7 +194,6 @@
214 <executable>true</executable> 194 <executable>true</executable>
215 </configuration> 195 </configuration>
216 </plugin> 196 </plugin>
217 -  
218 </plugins> 197 </plugins>
219 </build> 198 </build>
220 </project> 199 </project>
221 \ No newline at end of file 200 \ No newline at end of file
src/main/java/com/canrd/webmagic/Application.java
@@ -13,6 +13,7 @@ import org.springframework.context.annotation.Bean; @@ -13,6 +13,7 @@ import org.springframework.context.annotation.Bean;
13 import org.springframework.scheduling.annotation.EnableAsync; 13 import org.springframework.scheduling.annotation.EnableAsync;
14 import org.springframework.scheduling.annotation.EnableScheduling; 14 import org.springframework.scheduling.annotation.EnableScheduling;
15 import org.springframework.transaction.annotation.EnableTransactionManagement; 15 import org.springframework.transaction.annotation.EnableTransactionManagement;
  16 +import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
16 17
17 /** 18 /**
18 * @author: xms 19 * @author: xms
@@ -24,6 +25,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; @@ -24,6 +25,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
24 @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}, scanBasePackages = {"com.canrd.webmagic"}) 25 @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}, scanBasePackages = {"com.canrd.webmagic"})
25 @MapperScan("com.canrd.webmagic.**.mapper") 26 @MapperScan("com.canrd.webmagic.**.mapper")
26 @EnableScheduling 27 @EnableScheduling
  28 +@EnableSwagger2WebMvc
27 @EnableTransactionManagement 29 @EnableTransactionManagement
28 public class Application { 30 public class Application {
29 31
src/main/java/com/canrd/webmagic/config/AdminMetaObjectHandler.java
@@ -13,7 +13,6 @@ import java.time.LocalDateTime; @@ -13,7 +13,6 @@ import java.time.LocalDateTime;
13 @Component 13 @Component
14 public class AdminMetaObjectHandler implements MetaObjectHandler { 14 public class AdminMetaObjectHandler implements MetaObjectHandler {
15 15
16 -  
17 private static final String CREATE_TIME = "createTime"; 16 private static final String CREATE_TIME = "createTime";
18 private static final String MODIFY_TIME = "modifyTime"; 17 private static final String MODIFY_TIME = "modifyTime";
19 private static final String CREATE_BY = "createBy"; 18 private static final String CREATE_BY = "createBy";
@@ -41,7 +40,6 @@ public class AdminMetaObjectHandler implements MetaObjectHandler { @@ -41,7 +40,6 @@ public class AdminMetaObjectHandler implements MetaObjectHandler {
41 this.strictInsertFill(metaObject, MODIFY_BY, String.class, "system"); 40 this.strictInsertFill(metaObject, MODIFY_BY, String.class, "system");
42 } 41 }
43 42
44 -  
45 } 43 }
46 44
47 @Override 45 @Override
src/main/java/com/canrd/webmagic/config/ConfigurerAdapter.java
@@ -17,7 +17,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @@ -17,7 +17,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
17 @EnableWebMvc 17 @EnableWebMvc
18 public class ConfigurerAdapter implements WebMvcConfigurer { 18 public class ConfigurerAdapter implements WebMvcConfigurer {
19 19
20 -  
21 @Bean 20 @Bean
22 public CorsFilter corsFilter() { 21 public CorsFilter corsFilter() {
23 UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); 22 UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
src/main/java/com/canrd/webmagic/config/Knife4jConfig.java 0 → 100644
  1 +package com.canrd.webmagic.config;
  2 +
  3 +import org.springframework.context.annotation.Bean;
  4 +import org.springframework.context.annotation.Configuration;
  5 +import springfox.documentation.builders.ApiInfoBuilder;
  6 +import springfox.documentation.builders.ParameterBuilder;
  7 +import springfox.documentation.builders.PathSelectors;
  8 +import springfox.documentation.builders.RequestHandlerSelectors;
  9 +import springfox.documentation.schema.ModelRef;
  10 +import springfox.documentation.service.ApiInfo;
  11 +import springfox.documentation.service.Contact;
  12 +import springfox.documentation.service.Parameter;
  13 +import springfox.documentation.spi.DocumentationType;
  14 +import springfox.documentation.spring.web.plugins.Docket;
  15 +import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
  16 +
  17 +import java.util.ArrayList;
  18 +import java.util.List;
  19 +
  20 +/**
  21 + * knife4j配置信息
  22 + */
  23 +@Configuration
  24 +@EnableSwagger2WebMvc // 启用swagger支持
  25 +public class Knife4jConfig {
  26 + @Bean
  27 + public Docket adminApiConfig(){
  28 + List<Parameter> pars = new ArrayList<>();
  29 + ParameterBuilder tokenPar = new ParameterBuilder();
  30 + tokenPar.name("token")
  31 + .description("用户token")
  32 + .defaultValue("")
  33 + .modelRef(new ModelRef("string"))
  34 + .parameterType("header")
  35 + .required(false)
  36 + .build();
  37 + pars.add(tokenPar.build());
  38 + //添加head参数end
  39 +
  40 + Docket webMagicApi = new Docket(DocumentationType.SWAGGER_2)
  41 + .groupName("adminApi")
  42 + .apiInfo(adminApiInfo())
  43 + .select()
  44 +
  45 + // 设置扫描的控制器包 第一层过滤
  46 + .apis(RequestHandlerSelectors.any())
  47 +// .apis(RequestHandlerSelectors.basePackage("org.canrd"))
  48 + // //只显示admin路径下的页面 第二层过滤
  49 + .paths(PathSelectors.any())
  50 + .build()
  51 + .globalOperationParameters(pars);
  52 + return webMagicApi;
  53 + }
  54 +
  55 + // 定义文档的说明 标题 联系人 版本号 联系邮箱
  56 + private ApiInfo adminApiInfo(){
  57 +
  58 + return new ApiInfoBuilder()
  59 + .title("爬虫-API文档")
  60 + .description("本文档描述了爬虫系统微服务接口定义")
  61 + .version("1.0")
  62 + .contact(new Contact("凌世锦", "http://qq.com", "1187551704@qq.com"))
  63 + .build();
  64 + }
  65 +}
0 \ No newline at end of file 66 \ No newline at end of file
src/main/java/com/canrd/webmagic/config/MybatisplusObjectMetaHandler.java 0 → 100644
  1 +package com.gec.tra.system.config;
  2 +
  3 +import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
  4 +import org.apache.ibatis.reflection.MetaObject;
  5 +import org.springframework.stereotype.Component;
  6 +
  7 +import java.util.Date;
  8 +
  9 +
  10 +// 做自动填充 工具类
  11 +// mp 讲过 大家可以翻之前视频
  12 +@Component
  13 +public class MybatisplusObjectMetaHandler implements MetaObjectHandler {
  14 +
  15 +
  16 + // mp 在执行添加的时候,这个方法会被执行
  17 + @Override
  18 + public void insertFill(MetaObject metaObject) {
  19 +
  20 + this.setFieldValByName("createDate",new Date(),metaObject);
  21 +
  22 + }
  23 +
  24 + // mp 在执行修改的时候,这个方法会执行
  25 + @Override
  26 + public void updateFill(MetaObject metaObject) {
  27 + this.setFieldValByName("updateDate",new Date(),metaObject);
  28 +
  29 + }
  30 +}
0 \ No newline at end of file 31 \ No newline at end of file
src/main/java/com/canrd/webmagic/config/SeleniumConfig.java
1 package com.canrd.webmagic.config; 1 package com.canrd.webmagic.config;
2 2
  3 +import com.canrd.webmagic.driver.ChromeBuildDriver;
  4 +import com.google.common.collect.ImmutableList;
  5 +import com.google.gson.JsonObject;
  6 +import com.sun.java.swing.plaf.windows.resources.windows;
3 import org.openqa.selenium.WebDriver; 7 import org.openqa.selenium.WebDriver;
4 import org.openqa.selenium.chrome.ChromeDriver; 8 import org.openqa.selenium.chrome.ChromeDriver;
5 import org.openqa.selenium.chrome.ChromeOptions; 9 import org.openqa.selenium.chrome.ChromeOptions;
  10 +import org.openqa.selenium.edge.EdgeDriver;
  11 +import org.openqa.selenium.edge.EdgeDriverService;
  12 +import org.openqa.selenium.edge.EdgeOptions;
  13 +import org.openqa.selenium.remote.DesiredCapabilities;
6 import org.springframework.context.annotation.Bean; 14 import org.springframework.context.annotation.Bean;
7 import org.springframework.context.annotation.Configuration; 15 import org.springframework.context.annotation.Configuration;
8 16
  17 +import java.io.File;
  18 +import java.io.IOException;
9 import java.util.Arrays; 19 import java.util.Arrays;
10 20
11 /** 21 /**
@@ -16,61 +26,45 @@ import java.util.Arrays; @@ -16,61 +26,45 @@ import java.util.Arrays;
16 */ 26 */
17 @Configuration 27 @Configuration
18 public class SeleniumConfig { 28 public class SeleniumConfig {
  29 + private static String currentDriver = "";
  30 +
  31 + // @Bean
  32 + public WebDriver webDriver() throws InterruptedException, IOException {
19 33
20 -// @Bean  
21 - public WebDriver webDriver() throws InterruptedException {  
22 // 初始化ChromeOptions 34 // 初始化ChromeOptions
23 - ChromeOptions options = new ChromeOptions();  
24 - // 添加代理,这里使用的代理是示例,需要替换为实际的代理服务器地址和端口  
25 -// options.addArguments("--proxy-server=http://proxy-server:port"); 35 + ChromeOptions chromeOptions = new ChromeBuildDriver().build("C:\\Program Files\\Google\\Chrome\\Application\\chromedriver.exe");
26 36
27 - // 禁用JavaScript,有时这能帮助绕过Cloudflare的检查  
28 - options.addArguments("--disable-javascript"); 37 + EdgeOptions edgeOptions = new EdgeOptions();
29 38
30 - // 禁用浏览器扩展,如果知道Cloudflare使用了特定的扩展,可以禁用它  
31 - options.addArguments("--disable-extensions"); 39 + //配置Edge
  40 + File edgeFile = new File("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedgedriver.exe");
32 41
33 - // 禁用本地缓存,确保每次访问都从服务器获取  
34 - options.addArguments("--disable-application-cache"); 42 + edgeOptions.setPageLoadStrategy("none");
  43 +// JsonObject jsonObject = edgeOptions.toJson();
35 44
36 - // 禁止策略化  
37 - options.addArguments("--disable-infobars");  
38 - // 解决DevToolsActivePort文件不存在的报错  
39 - options.addArguments("--no-sandbox");  
40 - // 指定浏览器分辨  
41 - options.addArguments("window-size=1920x3000");  
42 - // 谷歌文档提到需要加上这个属性来规避bug  
43 - options.addArguments("--disable-gpu");  
44 - // 隐身模式(无痕模式)  
45 - options.addArguments("--incognito");  
46 - // 最大化运行(全屏窗口),不设置,取元素会报错  
47 - options.addArguments("--start-maximized");  
48 - // 禁用浏览器正在被自动化程序控制的提示  
49 - options.addArguments("--disable-infobars");  
50 - // 隐藏滚动条, 应对一些特殊页面  
51 - options.addArguments("--hide-scrollbars");  
52 - // 不加载图片, 提升速度  
53 - options.addArguments("blink-settings=imagesEnabled=false");  
54 - // 浏览器不提供可视化页面. linux下如果系统不支持可视化不加这条会启动失败  
55 - options.addArguments("--headless");  
56 - //禁用 blink 特征  
57 - options.addArguments("disable-blink-features=AutomationControlled");  
58 - options.setExperimentalOption("excludeSwitches", Arrays.asList("enable-automation"));  
59 - options.setExperimentalOption("useAutomationExtension", false);  
60 - options.addArguments("--remote-allow-origins=*");  
61 45
62 String os_name = System.getProperty("os.name"); 46 String os_name = System.getProperty("os.name");
63 // 判断是否是windows系统 47 // 判断是否是windows系统
64 if (os_name.toLowerCase().startsWith("win")) { 48 if (os_name.toLowerCase().startsWith("win")) {
65 - // windows  
66 - options.setBinary("D:\\chrome\\chrome-headless-shell-win64\\chrome-headless-shell-win64\\chrome-headless-shell.exe");  
67 - System.setProperty("webdriver.chrome.driver", "D:\\chrome\\chromedriver-win64\\chromedriver-win64\\chromedriver.exe"); 49 +
  50 +// edgeOptions.setBinary("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedgedriver.exe");
  51 + currentDriver = "edge";
  52 + //windows
  53 + if (currentDriver.equals("") || currentDriver.equals("edge")) {
  54 + System.out.printf("chrome启动");
  55 + System.setProperty("webdriver.chrome.driver", "C:\\Program Files\\Google\\Chrome\\Application\\chromedriver.exe");
  56 + currentDriver = "chrome";
  57 + return new ChromeDriver(chromeOptions);
  58 + } else if (currentDriver.equals("chrome")) {
  59 + System.out.printf("edge启动");
  60 + System.setProperty("webdriver.edge.driver", "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedgedriver.exe");
  61 + currentDriver = "edge";
  62 + return new EdgeDriver(edgeOptions);
  63 + }
68 } else { 64 } else {
69 // linux 65 // linux
70 - options.setBinary("/home/canrd/webmagic/chrome/chrome-linux64/chrome");  
71 - System.setProperty("webdriver.chrome.driver", "/home/canrd/webmagic/chrome/chromedriver-linux64/chromedriver"); 66 + System.setProperty("webdriver.chrome.driver", "C:\\Program Files\\Google\\Chrome\\Application\\chromedriver.exe");
72 } 67 }
73 -  
74 - return new ChromeDriver(options); 68 + return null;
75 } 69 }
76 } 70 }
src/main/java/com/canrd/webmagic/controller/ChemicalController.java 0 → 100644
  1 +package com.canrd.webmagic.controller;
  2 +
  3 +
  4 +import io.swagger.annotations.Api;
  5 +import org.springframework.web.bind.annotation.RequestMapping;
  6 +import org.springframework.web.bind.annotation.RestController;
  7 +
  8 +@RestController
  9 +@RequestMapping("/nature/article")
  10 +@Api("Nature")
  11 +public class ChemicalController {
  12 +
  13 +}
src/main/java/com/canrd/webmagic/controller/NatureController.java
@@ -6,6 +6,10 @@ import com.canrd.webmagic.common.utils.StringUtils; @@ -6,6 +6,10 @@ import com.canrd.webmagic.common.utils.StringUtils;
6 import com.canrd.webmagic.processor.NatureSearchPageProcessor; 6 import com.canrd.webmagic.processor.NatureSearchPageProcessor;
7 import com.canrd.webmagic.processor.download.Downloader; 7 import com.canrd.webmagic.processor.download.Downloader;
8 import com.canrd.webmagic.processor.pipeline.ArticlePipeline; 8 import com.canrd.webmagic.processor.pipeline.ArticlePipeline;
  9 +import io.swagger.annotations.Api;
  10 +import io.swagger.annotations.ApiOperation;
  11 +import io.swagger.annotations.Api;
  12 +import io.swagger.annotations.ApiOperation;
9 import org.apache.logging.log4j.core.util.UuidUtil; 13 import org.apache.logging.log4j.core.util.UuidUtil;
10 import org.springframework.web.bind.annotation.GetMapping; 14 import org.springframework.web.bind.annotation.GetMapping;
11 import org.springframework.web.bind.annotation.RequestMapping; 15 import org.springframework.web.bind.annotation.RequestMapping;
@@ -23,6 +27,7 @@ import javax.annotation.Resource; @@ -23,6 +27,7 @@ import javax.annotation.Resource;
23 */ 27 */
24 @RestController 28 @RestController
25 @RequestMapping("/nature/article") 29 @RequestMapping("/nature/article")
  30 +@Api("Nature")
26 public class NatureController { 31 public class NatureController {
27 32
28 @Resource 33 @Resource
@@ -38,6 +43,7 @@ public class NatureController { @@ -38,6 +43,7 @@ public class NatureController {
38 * @return 43 * @return
39 */ 44 */
40 @GetMapping("/start") 45 @GetMapping("/start")
  46 + @ApiOperation("start")
41 public ServerResult start(@RequestParam(value = "indexSize") Integer indexSize) { 47 public ServerResult start(@RequestParam(value = "indexSize") Integer indexSize) {
42 for (int i = 1; i <= indexSize; i++) { 48 for (int i = 1; i <= indexSize; i++) {
43 Spider.create(natureSearchPageProcessor) 49 Spider.create(natureSearchPageProcessor)
@@ -51,7 +57,6 @@ public class NatureController { @@ -51,7 +57,6 @@ public class NatureController {
51 // 开启5个线程执行,并开始爬取 57 // 开启5个线程执行,并开始爬取
52 .thread(20).run(); 58 .thread(20).run();
53 } 59 }
54 -  
55 return ServerResult.success(); 60 return ServerResult.success();
56 } 61 }
57 62
@@ -61,6 +66,7 @@ public class NatureController { @@ -61,6 +66,7 @@ public class NatureController {
61 * @return 66 * @return
62 */ 67 */
63 @GetMapping("/search") 68 @GetMapping("/search")
  69 + @ApiOperation("search")
64 public ServerResult search(@RequestParam(value = "indexSize") Integer indexSize, 70 public ServerResult search(@RequestParam(value = "indexSize") Integer indexSize,
65 @RequestParam(value = "orderBy") String orderBy, 71 @RequestParam(value = "orderBy") String orderBy,
66 @RequestParam(value = "journal") String journal) { 72 @RequestParam(value = "journal") String journal) {
src/main/java/com/canrd/webmagic/controller/Science4JournalController.java
@@ -4,6 +4,8 @@ import com.canrd.webmagic.common.constant.ServerResult; @@ -4,6 +4,8 @@ import com.canrd.webmagic.common.constant.ServerResult;
4 import com.canrd.webmagic.common.utils.KeywordUtil; 4 import com.canrd.webmagic.common.utils.KeywordUtil;
5 import com.canrd.webmagic.processor.Science4JournalSearchPageProcessor; 5 import com.canrd.webmagic.processor.Science4JournalSearchPageProcessor;
6 import com.canrd.webmagic.processor.download.SeleniumDownloader; 6 import com.canrd.webmagic.processor.download.SeleniumDownloader;
  7 +import io.swagger.annotations.Api;
  8 +import io.swagger.annotations.ApiOperation;
7 import org.apache.logging.log4j.core.util.UuidUtil; 9 import org.apache.logging.log4j.core.util.UuidUtil;
8 import org.springframework.web.bind.annotation.GetMapping; 10 import org.springframework.web.bind.annotation.GetMapping;
9 import org.springframework.web.bind.annotation.RequestMapping; 11 import org.springframework.web.bind.annotation.RequestMapping;
@@ -21,6 +23,7 @@ import javax.annotation.Resource; @@ -21,6 +23,7 @@ import javax.annotation.Resource;
21 */ 23 */
22 @RestController 24 @RestController
23 @RequestMapping("/science/journal") 25 @RequestMapping("/science/journal")
  26 +@Api("science-journal")
24 public class Science4JournalController { 27 public class Science4JournalController {
25 28
26 @Resource 29 @Resource
@@ -33,6 +36,7 @@ public class Science4JournalController { @@ -33,6 +36,7 @@ public class Science4JournalController {
33 * @return 36 * @return
34 */ 37 */
35 @GetMapping("/start") 38 @GetMapping("/start")
  39 + @ApiOperation("start")
36 public ServerResult start(@RequestParam(value = "indexSize") Integer indexSize) { 40 public ServerResult start(@RequestParam(value = "indexSize") Integer indexSize) {
37 for (int i = 0; i <= indexSize; i++) { 41 for (int i = 0; i <= indexSize; i++) {
38 Spider.create(science4JournalSearchPageProcessor) 42 Spider.create(science4JournalSearchPageProcessor)
@@ -42,7 +46,6 @@ public class Science4JournalController { @@ -42,7 +46,6 @@ public class Science4JournalController {
42 .setDownloader(seleniumDownloader) 46 .setDownloader(seleniumDownloader)
43 .thread(5).run(); 47 .thread(5).run();
44 } 48 }
45 -  
46 return ServerResult.success(); 49 return ServerResult.success();
47 } 50 }
48 51
@@ -51,6 +54,7 @@ public class Science4JournalController { @@ -51,6 +54,7 @@ public class Science4JournalController {
51 * @return 54 * @return
52 */ 55 */
53 @GetMapping("/search") 56 @GetMapping("/search")
  57 + @ApiOperation("search")
54 public ServerResult search(@RequestParam(value = "indexSize") Integer indexSize) { 58 public ServerResult search(@RequestParam(value = "indexSize") Integer indexSize) {
55 for (int i = 0; i <= indexSize; i++) { 59 for (int i = 0; i <= indexSize; i++) {
56 for (String keyword : KeywordUtil.getKeyWordList()) { 60 for (String keyword : KeywordUtil.getKeyWordList()) {
src/main/java/com/canrd/webmagic/controller/Science4SpjController.java
@@ -5,6 +5,8 @@ import com.canrd.webmagic.common.utils.KeywordUtil; @@ -5,6 +5,8 @@ import com.canrd.webmagic.common.utils.KeywordUtil;
5 import com.canrd.webmagic.processor.Science4JournalSearchPageProcessor; 5 import com.canrd.webmagic.processor.Science4JournalSearchPageProcessor;
6 import com.canrd.webmagic.processor.Science4SpjSearchPageProcessor; 6 import com.canrd.webmagic.processor.Science4SpjSearchPageProcessor;
7 import com.canrd.webmagic.processor.download.SeleniumDownloader; 7 import com.canrd.webmagic.processor.download.SeleniumDownloader;
  8 +import io.swagger.annotations.Api;
  9 +import io.swagger.annotations.ApiOperation;
8 import org.apache.logging.log4j.core.util.UuidUtil; 10 import org.apache.logging.log4j.core.util.UuidUtil;
9 import org.springframework.web.bind.annotation.GetMapping; 11 import org.springframework.web.bind.annotation.GetMapping;
10 import org.springframework.web.bind.annotation.RequestMapping; 12 import org.springframework.web.bind.annotation.RequestMapping;
@@ -22,6 +24,7 @@ import javax.annotation.Resource; @@ -22,6 +24,7 @@ import javax.annotation.Resource;
22 */ 24 */
23 @RestController 25 @RestController
24 @RequestMapping("/science/spj") 26 @RequestMapping("/science/spj")
  27 +@Api("science-spj")
25 public class Science4SpjController { 28 public class Science4SpjController {
26 29
27 @Resource 30 @Resource
@@ -34,6 +37,7 @@ public class Science4SpjController { @@ -34,6 +37,7 @@ public class Science4SpjController {
34 * @return 37 * @return
35 */ 38 */
36 @GetMapping("/start") 39 @GetMapping("/start")
  40 + @ApiOperation("start")
37 public ServerResult start(@RequestParam(value = "indexSize") Integer indexSize) { 41 public ServerResult start(@RequestParam(value = "indexSize") Integer indexSize) {
38 for (int i = 0; i <= indexSize; i++) { 42 for (int i = 0; i <= indexSize; i++) {
39 Spider.create(science4SpjSearchPageProcessor) 43 Spider.create(science4SpjSearchPageProcessor)
@@ -52,6 +56,7 @@ public class Science4SpjController { @@ -52,6 +56,7 @@ public class Science4SpjController {
52 * @return 56 * @return
53 */ 57 */
54 @GetMapping("/search") 58 @GetMapping("/search")
  59 + @ApiOperation("search")
55 public ServerResult search(@RequestParam(value = "indexSize") Integer indexSize) { 60 public ServerResult search(@RequestParam(value = "indexSize") Integer indexSize) {
56 for (int i = 0; i <= indexSize; i++) { 61 for (int i = 0; i <= indexSize; i++) {
57 for (String keyword : KeywordUtil.getKeyWordList()) { 62 for (String keyword : KeywordUtil.getKeyWordList()) {
src/main/java/com/canrd/webmagic/controller/TestController.java
@@ -6,6 +6,8 @@ import com.canrd.webmagic.common.jsr303.OperateGroup; @@ -6,6 +6,8 @@ import com.canrd.webmagic.common.jsr303.OperateGroup;
6 import com.canrd.webmagic.domain.vo.TestQueryVO; 6 import com.canrd.webmagic.domain.vo.TestQueryVO;
7 import com.canrd.webmagic.domain.vo.TestVO; 7 import com.canrd.webmagic.domain.vo.TestVO;
8 import com.canrd.webmagic.service.TestService; 8 import com.canrd.webmagic.service.TestService;
  9 +import io.swagger.annotations.Api;
  10 +import io.swagger.annotations.ApiOperation;
9 import org.springframework.validation.annotation.Validated; 11 import org.springframework.validation.annotation.Validated;
10 import org.springframework.web.bind.annotation.PostMapping; 12 import org.springframework.web.bind.annotation.PostMapping;
11 import org.springframework.web.bind.annotation.RequestBody; 13 import org.springframework.web.bind.annotation.RequestBody;
@@ -22,6 +24,7 @@ import javax.annotation.Resource; @@ -22,6 +24,7 @@ import javax.annotation.Resource;
22 */ 24 */
23 @RestController 25 @RestController
24 @RequestMapping("/lift-hub/test") 26 @RequestMapping("/lift-hub/test")
  27 +@Api("lift-hub")
25 public class TestController { 28 public class TestController {
26 /** 29 /**
27 * 服务对象 30 * 服务对象
@@ -36,6 +39,7 @@ public class TestController { @@ -36,6 +39,7 @@ public class TestController {
36 * @return 查询结果 39 * @return 查询结果
37 */ 40 */
38 @PostMapping("/list") 41 @PostMapping("/list")
  42 + @ApiOperation("list")
39 public ServerResult list(@RequestBody @Validated({OperateGroup.List.class}) TestQueryVO testQueryVO) { 43 public ServerResult list(@RequestBody @Validated({OperateGroup.List.class}) TestQueryVO testQueryVO) {
40 return testService.list(testQueryVO); 44 return testService.list(testQueryVO);
41 } 45 }
@@ -47,6 +51,7 @@ public class TestController { @@ -47,6 +51,7 @@ public class TestController {
47 * @return 单条数据 51 * @return 单条数据
48 */ 52 */
49 @PostMapping("/query_by_id") 53 @PostMapping("/query_by_id")
  54 + @ApiOperation("query_by_id")
50 public ServerResult queryById(@RequestBody TestQueryVO testQueryVO) { 55 public ServerResult queryById(@RequestBody TestQueryVO testQueryVO) {
51 return testService.queryById(testQueryVO); 56 return testService.queryById(testQueryVO);
52 } 57 }
@@ -58,6 +63,7 @@ public class TestController { @@ -58,6 +63,7 @@ public class TestController {
58 * @return 新增结果 63 * @return 新增结果
59 */ 64 */
60 @PostMapping("/add") 65 @PostMapping("/add")
  66 + @ApiOperation("add")
61 public ServerResult add(@RequestBody TestVO testVO) { 67 public ServerResult add(@RequestBody TestVO testVO) {
62 return testService.add(testVO); 68 return testService.add(testVO);
63 } 69 }
@@ -69,6 +75,7 @@ public class TestController { @@ -69,6 +75,7 @@ public class TestController {
69 * @return 编辑结果 75 * @return 编辑结果
70 */ 76 */
71 @PostMapping("/edit") 77 @PostMapping("/edit")
  78 + @ApiOperation("edit")
72 public ServerResult edit(@RequestBody TestVO testVO) { 79 public ServerResult edit(@RequestBody TestVO testVO) {
73 return testService.edit(testVO); 80 return testService.edit(testVO);
74 } 81 }
@@ -80,6 +87,7 @@ public class TestController { @@ -80,6 +87,7 @@ public class TestController {
80 * @return 删除是否成功 87 * @return 删除是否成功
81 */ 88 */
82 @PostMapping("/delete_by_id") 89 @PostMapping("/delete_by_id")
  90 + @ApiOperation("delete_by_id")
83 public ServerResult deleteById(@RequestBody TestQueryVO testQueryVO) { 91 public ServerResult deleteById(@RequestBody TestQueryVO testQueryVO) {
84 return testService.deleteById(testQueryVO); 92 return testService.deleteById(testQueryVO);
85 } 93 }
src/main/java/com/canrd/webmagic/controller/UnivieController.java
@@ -3,6 +3,8 @@ package com.canrd.webmagic.controller; @@ -3,6 +3,8 @@ package com.canrd.webmagic.controller;
3 import com.canrd.webmagic.common.constant.ServerResult; 3 import com.canrd.webmagic.common.constant.ServerResult;
4 import com.canrd.webmagic.common.utils.KeywordUtil; 4 import com.canrd.webmagic.common.utils.KeywordUtil;
5 import com.canrd.webmagic.processor.UnivieSearchPageProcessor; 5 import com.canrd.webmagic.processor.UnivieSearchPageProcessor;
  6 +import io.swagger.annotations.Api;
  7 +import io.swagger.annotations.ApiOperation;
6 import org.apache.logging.log4j.core.util.UuidUtil; 8 import org.apache.logging.log4j.core.util.UuidUtil;
7 import org.springframework.web.bind.annotation.GetMapping; 9 import org.springframework.web.bind.annotation.GetMapping;
8 import org.springframework.web.bind.annotation.RequestMapping; 10 import org.springframework.web.bind.annotation.RequestMapping;
@@ -20,6 +22,7 @@ import javax.annotation.Resource; @@ -20,6 +22,7 @@ import javax.annotation.Resource;
20 */ 22 */
21 @RestController 23 @RestController
22 @RequestMapping("/univie/ac") 24 @RequestMapping("/univie/ac")
  25 +@Api("univie")
23 public class UnivieController { 26 public class UnivieController {
24 27
25 @Resource 28 @Resource
@@ -29,6 +32,7 @@ public class UnivieController { @@ -29,6 +32,7 @@ public class UnivieController {
29 * @return 32 * @return
30 */ 33 */
31 @GetMapping("/start") 34 @GetMapping("/start")
  35 + @ApiOperation("start")
32 public ServerResult start(@RequestParam(value = "indexSize") Integer indexSize) { 36 public ServerResult start(@RequestParam(value = "indexSize") Integer indexSize) {
33 for (int i = 0; i <= indexSize; i++) { 37 for (int i = 0; i <= indexSize; i++) {
34 Spider.create(univieSearchPageProcessor) 38 Spider.create(univieSearchPageProcessor)
@@ -46,6 +50,7 @@ public class UnivieController { @@ -46,6 +50,7 @@ public class UnivieController {
46 * @return 50 * @return
47 */ 51 */
48 @GetMapping("/search") 52 @GetMapping("/search")
  53 + @ApiOperation("search")
49 public ServerResult search(@RequestParam(value = "indexSize") Integer indexSize) { 54 public ServerResult search(@RequestParam(value = "indexSize") Integer indexSize) {
50 for (int i = 1; i <= indexSize; i++) { 55 for (int i = 1; i <= indexSize; i++) {
51 for (String keyword : KeywordUtil.getKeyWordList()) { 56 for (String keyword : KeywordUtil.getKeyWordList()) {
src/main/java/com/canrd/webmagic/driver/ChromeBuildDriver.java 0 → 100644
  1 +package com.canrd.webmagic.driver;
  2 +
  3 +import org.openqa.selenium.chrome.ChromeOptions;
  4 +
  5 +import java.util.Arrays;
  6 +
  7 +public class ChromeBuildDriver {
  8 + public ChromeOptions build(String DriverPath){
  9 + ChromeOptions options = new ChromeOptions();
  10 + // 添加代理,这里使用的代理是示例,需要替换为实际的代理服务器地址和端口
  11 +// options.addArguments("--proxy-server=http://proxy-server:port");
  12 +
  13 + // 禁用JavaScript,有时这能帮助绕过Cloudflare的检查
  14 + options.addArguments("--disable-javascript");
  15 +
  16 + // 禁用浏览器扩展,如果知道Cloudflare使用了特定的扩展,可以禁用它
  17 + options.addArguments("--disable-extensions");
  18 +
  19 + // 禁用本地缓存,确保每次访问都从服务器获取
  20 + options.addArguments("--disable-application-cache");
  21 +
  22 + // 禁止策略化
  23 + options.addArguments("--disable-infobars");
  24 + // 解决DevToolsActivePort文件不存在的报错
  25 + options.addArguments("--no-sandbox");
  26 + // 指定浏览器分辨
  27 + options.addArguments("window-size=1920x3000");
  28 + // 谷歌文档提到需要加上这个属性来规避bug
  29 + options.addArguments("--disable-gpu");
  30 + // 隐身模式(无痕模式)
  31 + options.addArguments("--incognito");
  32 + // 最大化运行(全屏窗口),不设置,取元素会报错
  33 + options.addArguments("--start-maximized");
  34 + // 禁用浏览器正在被自动化程序控制的提示
  35 + options.addArguments("--disable-infobars");
  36 + // 隐藏滚动条, 应对一些特殊页面
  37 + options.addArguments("--hide-scrollbars");
  38 + // 不加载图片, 提升速度
  39 + options.addArguments("blink-settings=imagesEnabled=false");
  40 + // 浏览器不提供可视化页面. linux下如果系统不支持可视化不加这条会启动失败
  41 + options.addArguments("--headless");
  42 + //禁用 blink 特征
  43 + options.addArguments("disable-blink-features=AutomationControlled");
  44 + options.setExperimentalOption("excludeSwitches", Arrays.asList("enable-automation"));
  45 + options.setExperimentalOption("useAutomationExtension", false);
  46 + options.addArguments("--remote-allow-origins=*");
  47 + options.setBinary(DriverPath);
  48 + return options;
  49 + }
  50 +}
src/main/java/com/canrd/webmagic/processor/ChemicalPagePcoessor.java 0 → 100644
  1 +package com.canrd.webmagic.processor;
  2 +
  3 +import us.codecraft.webmagic.Page;
  4 +import us.codecraft.webmagic.processor.PageProcessor;
  5 +
  6 +public class ChemicalPagePcoessor implements PageProcessor {
  7 +
  8 + @Override
  9 + public void process(Page page) {
  10 +
  11 + }
  12 +}
src/main/resources/application-test.yml
@@ -57,7 +57,7 @@ spring: @@ -57,7 +57,7 @@ spring:
57 testWhileIdle: true 57 testWhileIdle: true
58 testOnBorrow: true 58 testOnBorrow: true
59 testOnReturn: true 59 testOnReturn: true
60 - password: Canrd@2023 60 + password: 123456
61 time-between-eviction-runs-millis: 1000 61 time-between-eviction-runs-millis: 1000
62 url: jdbc:mysql://localhost:3306/webmagic?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true&useAffectedRows=true&autoReconnectForPools=true 62 url: jdbc:mysql://localhost:3306/webmagic?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true&useAffectedRows=true&autoReconnectForPools=true
63 username: root 63 username: root
@@ -108,7 +108,6 @@ spring: @@ -108,7 +108,6 @@ spring:
108 expose-session-attributes: false 108 expose-session-attributes: false
109 expose-spring-macro-helpers: false 109 expose-spring-macro-helpers: false
110 110
111 -  
112 logging: 111 logging:
113 config: classpath:log4j2-dev.xml 112 config: classpath:log4j2-dev.xml
114 113
@@ -149,8 +148,6 @@ outsys: @@ -149,8 +148,6 @@ outsys:
149 host: http://core.canrd.com 148 host: http://core.canrd.com
150 passwordRecoverKey: http://www.canrd.com/canrd/shop/member/passwordModify 149 passwordRecoverKey: http://www.canrd.com/canrd/shop/member/passwordModify
151 150
152 -  
153 -  
154 system: 151 system:
155 isLoginFailureLock: true 152 isLoginFailureLock: true
156 loginFailureLockTime: 5 153 loginFailureLockTime: 5
@@ -162,12 +159,11 @@ openai: @@ -162,12 +159,11 @@ openai:
162 # 文件存储路径 159 # 文件存储路径
163 file: 160 file:
164 path: /home/canrd/order-erp/files/ 161 path: /home/canrd/order-erp/files/
165 - host: http://39.108.227.113 162 +# host: http://39.108.227.113
166 avatar: /home/order-erp/avatar/ 163 avatar: /home/order-erp/avatar/
167 # 文件大小 /M 164 # 文件大小 /M
168 maxSize: 100 165 maxSize: 100
169 avatarMaxSize: 5 166 avatarMaxSize: 5
170 -  
171 # 阿里pss图片服务 167 # 阿里pss图片服务
172 oss: 168 oss:
173 endpoint: https://oss-cn-qingdao.aliyuncs.com 169 endpoint: https://oss-cn-qingdao.aliyuncs.com
@@ -178,9 +174,9 @@ oss: @@ -178,9 +174,9 @@ oss:
178 174
179 db: 175 db:
180 mysql: 176 mysql:
181 - ip: 39.108.227.113 177 + ip: 127.0.0.1
182 port: 3307 178 port: 3307
183 user: root 179 user: root
184 password: 123456 180 password: 123456
185 - databaseName: order-erp  
186 - savePath: /home/canrd/order-erp/files/backup/ 181 + databaseName: webmagic
  182 +# savePath: /home/canrd/order-erp/files/backup/
src/main/resources/application.yml
@@ -3,4 +3,4 @@ server: @@ -3,4 +3,4 @@ server:
3 3
4 spring: 4 spring:
5 profiles: 5 profiles:
6 - active: local  
7 \ No newline at end of file 6 \ No newline at end of file
  7 + active: test
8 \ No newline at end of file 8 \ No newline at end of file
src/test/java/com/canrd/webmagic/BaseTest.java
@@ -12,5 +12,4 @@ import org.springframework.transaction.annotation.Transactional; @@ -12,5 +12,4 @@ import org.springframework.transaction.annotation.Transactional;
12 @Transactional 12 @Transactional
13 public class BaseTest { 13 public class BaseTest {
14 14
15 -  
16 } 15 }
target/classes/application-local.yml 0 → 100644
  1 +mybatis-plus:
  2 + configuration:
  3 + cache-enabled: false
  4 + call-setters-on-nulls: true
  5 + jdbc-type-for-null: 'null'
  6 + map-underscore-to-camel-case: true
  7 + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  8 + global-config:
  9 + db-config:
  10 + capital-mode: false
  11 + field-strategy: NOT_NULL
  12 + id-type: AUTO
  13 + logic-delete-field: enable_flag
  14 + logic-delete-value: 20
  15 + logic-not-delete-value: 10
  16 + mapper-locations: classpath:/mapper/**.xml
  17 + type-aliases-package: com.order.erp.**.dto
  18 +#spring:
  19 +# datasource:
  20 +# dynamic:
  21 +# primary: overtime #设置默认的数据源或者数据源组,默认值即为master
  22 +# strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候会抛出异常,不启动则使用默认数据源.
  23 +# datasource:
  24 +# wms_warehouse:
  25 +# url: jdbc:mysql://127.0.0.1:3306/overtime?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true&useAffectedRows=true&autoReconnectForPools=true&rewriteBatchedStatements=true
  26 +# username: root
  27 +# password: root
  28 +# driver-class-name: com.mysql.cj.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
  29 +# druid:
  30 +# initial-size: 5
  31 +# max-active: 20
  32 +# max-evictable-idle-time-millis: 300000
  33 +# max-wait: 60000
  34 +# min-evictable-idle-time-millis: 300000
  35 +# min-idle: 5
  36 +# time-between-eviction-runs-millis: 60000
  37 +# type: com.alibaba.druid.pool.DruidDataSource
  38 +spring:
  39 + servlet:
  40 + multipart:
  41 + enabled: true
  42 + max-file-size: 100MB
  43 + max-request-size: 20MB
  44 + file-size-threshold: 20MB
  45 + datasource:
  46 + db-type: com.alibaba.druid.pool.DruidDataSource
  47 + driverClassName: com.mysql.cj.jdbc.Driver
  48 + initial-size: 5
  49 + max-active: 30
  50 + max-wait: 30000
  51 + min-idle: 5
  52 + #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
  53 + timeBetweenEvictionRunsMillis: 30000
  54 + #配置一个连接在池中最小生存的时间,单位是毫秒,30000=30s
  55 + minEvictableIdleTimeMillis: 30000
  56 + validationQuery: SELECT 'x'
  57 + testWhileIdle: true
  58 + testOnBorrow: true
  59 + testOnReturn: true
  60 + password: canrd@2024
  61 + time-between-eviction-runs-millis: 1000
  62 + url: jdbc:mysql://39.108.227.113:3307/webmagic?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true&useAffectedRows=true&autoReconnectForPools=true
  63 + username: root
  64 + redis:
  65 + database: 0
  66 + host: 39.108.227.113
  67 + lettuce:
  68 + pool:
  69 + max-active: 2000
  70 + max-idle: 10
  71 + max-wait: -1
  72 + min-idle: 3
  73 + time-between-eviction-runs: 100
  74 + password: ''
  75 + port: 6379
  76 + timeout: 2000
  77 + mail:
  78 + # 配置 SMTP 服务器地址
  79 + host: smtp.mxhichina.com
  80 + # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的
  81 + username: system@canrd.com
  82 + # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码
  83 + password: Kelude2015
  84 + # 邮件接收者
  85 + mailRecipient: #邮件接收者邮箱
  86 + # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议)
  87 + port: 587
  88 + # 默认的邮件编码为UTF-8
  89 + default-encoding: UTF-8
  90 + # 配置SSL 加密工厂
  91 + properties:
  92 + mail:
  93 + smtp:
  94 + socketFactoryClass: javax.net.ssl.SSLSocketFactory
  95 + #表示开启 DEBUG 模式,这样,邮件发送过程的日志会在控制台打印出来,方便排查错误
  96 + debug: true
  97 +
  98 + freemarker:
  99 + template-loader-path: classpath:/template/
  100 + suffix: .flt
  101 + enabled: true
  102 + cache: false
  103 + charset: UTF-8
  104 + content-type: text/html
  105 + allow-request-override: false
  106 + check-template-location: true
  107 + expose-request-attributes: false
  108 + expose-session-attributes: false
  109 + expose-spring-macro-helpers: false
  110 +
  111 +
  112 +logging:
  113 + config: classpath:log4j2-dev.xml
  114 +
  115 +#登录图形验证码有效时间/分钟
  116 +loginCode:
  117 + expiration: 2
  118 +
  119 +#密码加密传输,前端公钥加密,后端私钥解密
  120 +rsa:
  121 + private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==
  122 +
  123 +
  124 +#jwt
  125 +jwt:
  126 + header: Authorization
  127 + # 令牌前缀
  128 + token-start-with: Bearer
  129 + # 必须使用最少88位的Base64对该令牌进行编码
  130 + base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI=
  131 + # 令牌过期时间 此处单位/毫秒 ,默认2小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
  132 + token-validity-in-seconds: 720000000
  133 + # 在线用户key
  134 + online-key: online-token
  135 + # 验证码
  136 + code-key: code-key
  137 +
  138 +outsys:
  139 + sms:
  140 + regionId: cn-hangzhou
  141 + accessKeyId: LTAIZCPI7OaWud0m
  142 + secret: nvtGeScBwRztGeoj8WSp5OWalalgpK
  143 + domain: dysmsapi.aliyuncs.com
  144 + version: 2017-05-25
  145 + action: SendSms
  146 + signName: canrd
  147 + templateCode: SMS_173005236
  148 + email:
  149 + host: http://core.canrd.com
  150 + passwordRecoverKey: http://www.canrd.com/canrd/shop/member/passwordModify
  151 +
  152 +
  153 +
  154 +system:
  155 + isLoginFailureLock: true
  156 + loginFailureLockTime: 5
  157 + loginFailureLockCount: 3
  158 +
  159 +openai:
  160 + token: Bearer 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
  161 +
  162 +# 文件存储路径
  163 +file:
  164 + path: /home/canrd/order-erp/files/
  165 + host: http://39.108.227.113
  166 + avatar: /home/order-erp/avatar/
  167 + # 文件大小 /M
  168 + maxSize: 100
  169 + avatarMaxSize: 5
  170 +
  171 +# 阿里pss图片服务
  172 +oss:
  173 + endpoint: https://oss-cn-qingdao.aliyuncs.com
  174 + accessKeyId: LTAIZCPI7OaWud0m
  175 + accessKeySecret: nvtGeScBwRztGeoj8WSp5OWalalgpK
  176 + bucket: order-erp
  177 +
  178 +
  179 +db:
  180 + mysql:
  181 + ip: 39.108.227.113
  182 + port: 3307
  183 + user: root
  184 + password: 123456
  185 + databaseName: order-erp
  186 + savePath: /home/canrd/order-erp/files/backup/
target/classes/application-prod.yml 0 → 100644
  1 +mybatis-plus:
  2 + configuration:
  3 + cache-enabled: false
  4 + call-setters-on-nulls: true
  5 + jdbc-type-for-null: 'null'
  6 + map-underscore-to-camel-case: true
  7 + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  8 + global-config:
  9 + db-config:
  10 + capital-mode: false
  11 + field-strategy: NOT_NULL
  12 + id-type: AUTO
  13 + logic-delete-field: enable_flag
  14 + logic-delete-value: 20
  15 + logic-not-delete-value: 10
  16 + mapper-locations: classpath:/mapper/**.xml
  17 + type-aliases-package: com.order.erp.**.dto
  18 +#spring:
  19 +# datasource:
  20 +# dynamic:
  21 +# primary: overtime #设置默认的数据源或者数据源组,默认值即为master
  22 +# strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候会抛出异常,不启动则使用默认数据源.
  23 +# datasource:
  24 +# wms_warehouse:
  25 +# url: jdbc:mysql://127.0.0.1:3306/overtime?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true&useAffectedRows=true&autoReconnectForPools=true&rewriteBatchedStatements=true
  26 +# username: root
  27 +# password: root
  28 +# driver-class-name: com.mysql.cj.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
  29 +# druid:
  30 +# initial-size: 5
  31 +# max-active: 20
  32 +# max-evictable-idle-time-millis: 300000
  33 +# max-wait: 60000
  34 +# min-evictable-idle-time-millis: 300000
  35 +# min-idle: 5
  36 +# time-between-eviction-runs-millis: 60000
  37 +# type: com.alibaba.druid.pool.DruidDataSource
  38 +spring:
  39 + servlet:
  40 + multipart:
  41 + enabled: true
  42 + max-file-size: 100MB
  43 + max-request-size: 20MB
  44 + file-size-threshold: 20MB
  45 + datasource:
  46 + db-type: com.alibaba.druid.pool.DruidDataSource
  47 + driverClassName: com.mysql.cj.jdbc.Driver
  48 + initial-size: 5
  49 + max-active: 30
  50 + max-wait: 30000
  51 + min-idle: 5
  52 + #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
  53 + timeBetweenEvictionRunsMillis: 30000
  54 + #配置一个连接在池中最小生存的时间,单位是毫秒,30000=30s
  55 + minEvictableIdleTimeMillis: 30000
  56 + validationQuery: SELECT 'x'
  57 + testWhileIdle: true
  58 + testOnBorrow: true
  59 + testOnReturn: true
  60 + password: 123456
  61 + time-between-eviction-runs-millis: 1000
  62 + url: jdbc:mysql://172.17.0.1:3306/order-erp?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true&useAffectedRows=true&autoReconnectForPools=true
  63 + username: root
  64 + redis:
  65 + database: 0
  66 + host: 172.17.0.1
  67 + lettuce:
  68 + pool:
  69 + max-active: 2000
  70 + max-idle: 10
  71 + max-wait: -1
  72 + min-idle: 3
  73 + time-between-eviction-runs: 100
  74 + password: ''
  75 + port: 6379
  76 + timeout: 2000
  77 + mail:
  78 + # 配置 SMTP 服务器地址
  79 + host: xxx
  80 + # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的
  81 + username: xxxx
  82 + # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码
  83 + password: xxx
  84 + # 邮件接收者
  85 + mailRecipient: #邮件接收者邮箱
  86 + # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议)
  87 + port: 587
  88 + # 默认的邮件编码为UTF-8
  89 + default-encoding: UTF-8
  90 + # 配置SSL 加密工厂
  91 + properties:
  92 + mail:
  93 + smtp:
  94 + socketFactoryClass: javax.net.ssl.SSLSocketFactory
  95 + #表示开启 DEBUG 模式,这样,邮件发送过程的日志会在控制台打印出来,方便排查错误
  96 + debug: true
  97 +
  98 + freemarker:
  99 + template-loader-path: classpath:/template/
  100 + suffix: .flt
  101 + enabled: true
  102 + cache: false
  103 + charset: UTF-8
  104 + content-type: text/html
  105 + allow-request-override: false
  106 + check-template-location: true
  107 + expose-request-attributes: false
  108 + expose-session-attributes: false
  109 + expose-spring-macro-helpers: false
  110 +
  111 +
  112 +logging:
  113 + config: classpath:log4j2-prod.xml
  114 +
  115 +#登录图形验证码有效时间/分钟
  116 +loginCode:
  117 + expiration: 2
  118 +
  119 +#密码加密传输,前端公钥加密,后端私钥解密
  120 +rsa:
  121 + private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==
  122 +
  123 +
  124 +#jwt
  125 +jwt:
  126 + header: Authorization
  127 + # 令牌前缀
  128 + token-start-with: Bearer
  129 + # 必须使用最少88位的Base64对该令牌进行编码
  130 + base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI=
  131 + # 令牌过期时间 此处单位/毫秒 ,默认2小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
  132 + token-validity-in-seconds: 720000000
  133 + # 在线用户key
  134 + online-key: online-token
  135 + # 验证码
  136 + code-key: code-key
  137 +
  138 +outsys:
  139 + sms:
  140 + regionId: cn-hangzhou
  141 + accessKeyId: LTAIZCPI7OaWud0m
  142 + secret: nvtGeScBwRztGeoj8WSp5OWalalgpK
  143 + domain: dysmsapi.aliyuncs.com
  144 + version: 2017-05-25
  145 + action: SendSms
  146 + signName: canrd
  147 + templateCode: SMS_173005236
  148 + email:
  149 + host: xxxx
  150 + passwordRecoverKey: xxxxx
  151 +
  152 +
  153 +
  154 +system:
  155 + isLoginFailureLock: true
  156 + loginFailureLockTime: 5
  157 + loginFailureLockCount: 3
  158 +
  159 +openai:
  160 + token: Bearer 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
  161 +
  162 +# 文件存储路径
  163 +file:
  164 + path: /home/canrd/order-erp/files/
  165 + host: http://47.104.8.35
  166 + avatar: /home/order-erp/avatar/
  167 + # 文件大小 /M
  168 + maxSize: 100
  169 + avatarMaxSize: 5
  170 +
  171 +# 阿里pss图片服务
  172 +oss:
  173 + endpoint: https://oss-cn-qingdao.aliyuncs.com
  174 + accessKeyId: LTAI5t7u1gXR2vm82sd6CkVz
  175 + accessKeySecret: m4NzHZZsZiauKmRO8y7DihmcGNdQk4
  176 + bucket: alterego
  177 +
  178 +
  179 +db:
  180 + mysql:
  181 + ip: 172.17.0.1
  182 + port: 3306
  183 + user: root
  184 + password: 123456
  185 + databaseName: order-erp
  186 + savePath: /home/canrd/order-erp/files/backup/
target/classes/application-test.yml 0 → 100644
  1 +mybatis-plus:
  2 + configuration:
  3 + cache-enabled: false
  4 + call-setters-on-nulls: true
  5 + jdbc-type-for-null: 'null'
  6 + map-underscore-to-camel-case: true
  7 + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  8 + global-config:
  9 + db-config:
  10 + capital-mode: false
  11 + field-strategy: NOT_NULL
  12 + id-type: AUTO
  13 + logic-delete-field: enable_flag
  14 + logic-delete-value: 20
  15 + logic-not-delete-value: 10
  16 + mapper-locations: classpath:/mapper/**.xml
  17 + type-aliases-package: com.order.erp.**.dto
  18 +#spring:
  19 +# datasource:
  20 +# dynamic:
  21 +# primary: overtime #设置默认的数据源或者数据源组,默认值即为master
  22 +# strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候会抛出异常,不启动则使用默认数据源.
  23 +# datasource:
  24 +# wms_warehouse:
  25 +# url: jdbc:mysql://127.0.0.1:3306/overtime?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true&useAffectedRows=true&autoReconnectForPools=true&rewriteBatchedStatements=true
  26 +# username: root
  27 +# password: root
  28 +# driver-class-name: com.mysql.cj.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
  29 +# druid:
  30 +# initial-size: 5
  31 +# max-active: 20
  32 +# max-evictable-idle-time-millis: 300000
  33 +# max-wait: 60000
  34 +# min-evictable-idle-time-millis: 300000
  35 +# min-idle: 5
  36 +# time-between-eviction-runs-millis: 60000
  37 +# type: com.alibaba.druid.pool.DruidDataSource
  38 +spring:
  39 + servlet:
  40 + multipart:
  41 + enabled: true
  42 + max-file-size: 100MB
  43 + max-request-size: 20MB
  44 + file-size-threshold: 20MB
  45 + datasource:
  46 + db-type: com.alibaba.druid.pool.DruidDataSource
  47 + driverClassName: com.mysql.cj.jdbc.Driver
  48 + initial-size: 5
  49 + max-active: 30
  50 + max-wait: 30000
  51 + min-idle: 5
  52 + #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
  53 + timeBetweenEvictionRunsMillis: 30000
  54 + #配置一个连接在池中最小生存的时间,单位是毫秒,30000=30s
  55 + minEvictableIdleTimeMillis: 30000
  56 + validationQuery: SELECT 'x'
  57 + testWhileIdle: true
  58 + testOnBorrow: true
  59 + testOnReturn: true
  60 + password: 123456
  61 + time-between-eviction-runs-millis: 1000
  62 + url: jdbc:mysql://localhost:3306/webmagic?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&useSSL=false&autoReconnect=true&failOverReadOnly=false&maxReconnects=10&allowMultiQueries=true&useAffectedRows=true&autoReconnectForPools=true
  63 + username: root
  64 + redis:
  65 + database: 0
  66 + host: localhost
  67 + lettuce:
  68 + pool:
  69 + max-active: 2000
  70 + max-idle: 10
  71 + max-wait: -1
  72 + min-idle: 3
  73 + time-between-eviction-runs: 100
  74 + password: ''
  75 + port: 6379
  76 + timeout: 2000
  77 + mail:
  78 + # 配置 SMTP 服务器地址
  79 + host: smtp.mxhichina.com
  80 + # 发送者邮箱,已开通POP3/SMTP服务的邮箱,也就是你自己的
  81 + username: system@canrd.com
  82 + # 配置密码,注意不是真正的密码,而是刚刚申请到的授权码
  83 + password: Kelude2015
  84 + # 邮件接收者
  85 + mailRecipient: #邮件接收者邮箱
  86 + # 端口号465或587(QQ邮箱发送邮件仅支持587端口协议)
  87 + port: 587
  88 + # 默认的邮件编码为UTF-8
  89 + default-encoding: UTF-8
  90 + # 配置SSL 加密工厂
  91 + properties:
  92 + mail:
  93 + smtp:
  94 + socketFactoryClass: javax.net.ssl.SSLSocketFactory
  95 + #表示开启 DEBUG 模式,这样,邮件发送过程的日志会在控制台打印出来,方便排查错误
  96 + debug: true
  97 +
  98 + freemarker:
  99 + template-loader-path: classpath:/template/
  100 + suffix: .flt
  101 + enabled: true
  102 + cache: false
  103 + charset: UTF-8
  104 + content-type: text/html
  105 + allow-request-override: false
  106 + check-template-location: true
  107 + expose-request-attributes: false
  108 + expose-session-attributes: false
  109 + expose-spring-macro-helpers: false
  110 +
  111 +logging:
  112 + config: classpath:log4j2-dev.xml
  113 +
  114 +#登录图形验证码有效时间/分钟
  115 +loginCode:
  116 + expiration: 2
  117 +
  118 +#密码加密传输,前端公钥加密,后端私钥解密
  119 +rsa:
  120 + private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==
  121 +
  122 +
  123 +#jwt
  124 +jwt:
  125 + header: Authorization
  126 + # 令牌前缀
  127 + token-start-with: Bearer
  128 + # 必须使用最少88位的Base64对该令牌进行编码
  129 + base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI=
  130 + # 令牌过期时间 此处单位/毫秒 ,默认2小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
  131 + token-validity-in-seconds: 720000000
  132 + # 在线用户key
  133 + online-key: online-token
  134 + # 验证码
  135 + code-key: code-key
  136 +
  137 +outsys:
  138 + sms:
  139 + regionId: cn-hangzhou
  140 + accessKeyId: LTAIZCPI7OaWud0m
  141 + secret: nvtGeScBwRztGeoj8WSp5OWalalgpK
  142 + domain: dysmsapi.aliyuncs.com
  143 + version: 2017-05-25
  144 + action: SendSms
  145 + signName: canrd
  146 + templateCode: SMS_173005236
  147 + email:
  148 + host: http://core.canrd.com
  149 + passwordRecoverKey: http://www.canrd.com/canrd/shop/member/passwordModify
  150 +
  151 +system:
  152 + isLoginFailureLock: true
  153 + loginFailureLockTime: 5
  154 + loginFailureLockCount: 3
  155 +
  156 +openai:
  157 + token: Bearer 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
  158 +
  159 +# 文件存储路径
  160 +file:
  161 + path: /home/canrd/order-erp/files/
  162 +# host: http://39.108.227.113
  163 + avatar: /home/order-erp/avatar/
  164 + # 文件大小 /M
  165 + maxSize: 100
  166 + avatarMaxSize: 5
  167 +# 阿里pss图片服务
  168 +oss:
  169 + endpoint: https://oss-cn-qingdao.aliyuncs.com
  170 + accessKeyId: LTAIZCPI7OaWud0m
  171 + accessKeySecret: nvtGeScBwRztGeoj8WSp5OWalalgpK
  172 + bucket: order-erp
  173 +
  174 +
  175 +db:
  176 + mysql:
  177 + ip: 127.0.0.1
  178 + port: 3307
  179 + user: root
  180 + password: 123456
  181 + databaseName: webmagic
  182 +# savePath: /home/canrd/order-erp/files/backup/
target/classes/application.yml 0 → 100644
  1 +server:
  2 + port: 9000
  3 +
  4 +spring:
  5 + profiles:
  6 + active: test
0 \ No newline at end of file 7 \ No newline at end of file
target/classes/com/canrd/webmagic/Application.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/annotation/AnonymousAccess.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/constant/Constant.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/constant/ElAdminConstant$Url.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/constant/ElAdminConstant.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/constant/ServerResult.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/constant/ServerResultCode.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/directory/Path.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/exception/BadRequestException.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/exception/BusinessException.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/exception/BusinessExceptionHandlerAdvice.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/exception/EntityExistException.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/exception/EntityNotFoundException.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/exception/ErrorInfo.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/exception/handler/ApiError.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/exception/handler/GlobalExceptionHandler.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/jsr303/ListValueConstraintValidator.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/jsr303/OperateGroup$BatchQuery.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/jsr303/OperateGroup$Delete.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/jsr303/OperateGroup$Detail.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/jsr303/OperateGroup$Export.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/jsr303/OperateGroup$Format.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/jsr303/OperateGroup$Length.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/jsr303/OperateGroup$List.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/jsr303/OperateGroup$One.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/jsr303/OperateGroup$Page.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/jsr303/OperateGroup$Save.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/jsr303/OperateGroup$Trace.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/jsr303/OperateGroup$Update.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/jsr303/OperateGroup.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/jsr303/annotation/ListIntValue.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/DateUtil$Zone.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/DateUtil.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/DateUtils$Zone.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/DateUtils.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/EncryptUtils.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/FileUtil.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/JsonUtil$1.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/JsonUtil.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/KeywordUtil.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/LocalDateTimeUtil.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/PageUtils.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/RedisUtil.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/RedisUtils.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/RequestContextUtil.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/RequestHolder.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/RequestStringUtils.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/ServletUtils.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/SpringContextHolder.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/StringUtils.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/TemplateFormatUtils.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/ThrowableUtil.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/common/utils/TransactionHelper.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/config/AdminMetaObjectHandler.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/config/ConfigurerAdapter.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/config/Knife4jConfig.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/config/MybatisPlusConfig.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/config/RedisConfig.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/config/RestTemplateConfig.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/config/SeleniumConfig.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/config/WebConfig.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/controller/ChemicalController.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/controller/NatureController.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/controller/Science4JournalController.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/controller/Science4SpjController.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/controller/TestController.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/controller/UnivieController.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/domain/ArticleTypeEnum.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/domain/dto/ArticleDO$1.class 0 → 100644
No preview for this file type
target/classes/com/canrd/webmagic/domain/dto/ArticleDO$ArticleDOBuilder.class 0 → 100644
No preview for this file type