wanyao 4 gadi atpakaļ
vecāks
revīzija
ce63c6ded0

+ 332 - 346
ebc-sea-platform/pom.xml

@ -1,347 +1,333 @@
1
<project xmlns="http://maven.apache.org/POM/4.0.0"
2
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4
	<modelVersion>4.0.0</modelVersion>
5
6
	<parent>
7
		<groupId>com.ai.ipu.server</groupId>
8
		<artifactId>ipu-rest-libs</artifactId>
9
		<version>3.1-SNAPSHOT</version>
10
	</parent>
11
12
	<artifactId>ebc-sea-platform</artifactId>
13
	<packaging>jar</packaging>
14
	<name>restful脚手架服务</name>
15
16
17
18
	<properties>
19
		<start-class>com.ai.ipu.server.EbcSeaPlatformStart</start-class>
20
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
21
		<mongo.java.driver>3.11.2</mongo.java.driver>
22
		<ipu>3.1-SNAPSHOT</ipu>
23
		<jdk>1.8</jdk>
24
		<junit>4.12</junit>
25
		<spring-session.version>1.3.2.RELEASE</spring-session.version>
26
		<nacos.version>0.1.1</nacos.version>
27
		<poi.version>3.14</poi.version>
28
		<swagger.version>2.6.1</swagger.version>
29
	</properties>
30
31
32
	<repositories>
33
		<!-- 阿里私服 -->
34
		<repository>
35
			<id>ali</id>
36
			<url>http://maven.aliyun.com/nexus/content/groups/public</url>
37
			<releases>
38
				<enabled>true</enabled>
39
			</releases>
40
			<snapshots>
41
				<enabled>true</enabled>
42
				<updatePolicy>always</updatePolicy>
43
				<checksumPolicy>fail</checksumPolicy>
44
			</snapshots>
45
		</repository>
46
		<!-- IPU仓库 -->
47
		<repository>
48
			<id>ipu</id>
49
			<name>ipu repository</name>
50
			<url>http://114.215.100.48:9090/nexus/content/groups/public/</url>
51
			<releases>
52
				<enabled>true</enabled>
53
			</releases>
54
			<snapshots>
55
				<enabled>true</enabled>
56
				<updatePolicy>always</updatePolicy>
57
			</snapshots>
58
		</repository>
59
		<!-- Uspa仓库 -->
60
		<repository>
61
			<id>maven-public</id>
62
			<name>maven-public</name>
63
			<url>http://10.1.252.197:8081/repository/maven-public/</url>
64
			<releases>
65
				<enabled>true</enabled>
66
			</releases>
67
			<snapshots>
68
				<enabled>true</enabled>
69
				<updatePolicy>always</updatePolicy>
70
			</snapshots>
71
		</repository>
72
	</repositories>
73
74
75
	<dependencies>
76
		<dependency>
77
			<groupId>com.ai.ipu</groupId>
78
			<artifactId>ipu-sql-mgmt</artifactId>
79
			<version>${ipu}</version>
80
			<!-- 屏蔽以后Idea可能启动报错 -->
81
<!--			<scope>provided</scope>-->
82
		</dependency>
83
		<dependency>
84
			<groupId>com.ai.ipu.server</groupId>
85
			<artifactId>ipu-restful</artifactId>
86
		</dependency>
87
88
89
		<!--uspa start-->
90
		<dependency>
91
			<groupId>org.springframework</groupId>
92
			<artifactId>spring-orm</artifactId>
93
			<version>4.1.9.RELEASE</version>
94
		</dependency>
95
96
		<!-- apache start -->
97
		<dependency>
98
			<groupId>commons-configuration</groupId>
99
			<artifactId>commons-configuration</artifactId>
100
			<version>1.10</version>
101
		</dependency>
102
103
		<dependency>
104
			<groupId>commons-fileupload</groupId>
105
			<artifactId>commons-fileupload</artifactId>
106
			<version>1.3.2</version>
107
		</dependency>
108
109
		<dependency>
110
			<groupId>oro</groupId>
111
			<artifactId>oro</artifactId>
112
			<version>2.0.8</version>
113
		</dependency>
114
115
		<dependency>
116
			<groupId>commons-net</groupId>
117
			<artifactId>commons-net</artifactId>
118
			<version>3.6</version>
119
		</dependency>
120
121
122
		<!-- apache end -->
123
124
		<dependency>
125
			<groupId>org.hibernate</groupId>
126
			<artifactId>hibernate-core</artifactId>
127
			<version>4.2.5.Final</version>
128
		</dependency>
129
130
		<!-- swagger start -->
131
		<dependency>
132
			<groupId>io.springfox</groupId>
133
			<artifactId>springfox-swagger2</artifactId>
134
			<version>${swagger.version}</version>
135
		</dependency>
136
137
		<dependency>
138
			<groupId>io.springfox</groupId>
139
			<artifactId>springfox-swagger-ui</artifactId>
140
			<version>${swagger.version}</version>
141
		</dependency>
142
		<!-- swagger end -->
143
144
		<dependency>
145
			<groupId>com.thoughtworks.xstream</groupId>
146
			<artifactId>xstream</artifactId>
147
			<version>1.4.10</version>
148
		</dependency>
149
150
		<!--	poi start  -->
151
152
		<dependency>
153
			<groupId>org.apache.poi</groupId>
154
			<artifactId>poi-ooxml</artifactId>
155
			<version>${poi.version}</version>
156
		</dependency>
157
		<dependency>
158
			<groupId>org.apache.poi</groupId>
159
			<artifactId>poi-ooxml-schemas</artifactId>
160
			<version>${poi.version}</version>
161
		</dependency>
162
		<dependency>
163
			<groupId>org.apache.poi</groupId>
164
			<artifactId>poi-scratchpad</artifactId>
165
			<version>${poi.version}</version>
166
		</dependency>
167
		<dependency>
168
			<groupId>org.apache.poi</groupId>
169
			<artifactId>poi-excelant</artifactId>
170
			<version>${poi.version}</version>
171
		</dependency>
172
173
		<dependency>
174
			<groupId>org.apache.poi</groupId>
175
			<artifactId>poi-contrib</artifactId>
176
			<version>3.6</version>
177
		</dependency>
178
179
180
181
182
183
184
		<dependency>
185
			<groupId>commons-digester</groupId>
186
			<artifactId>commons-digester</artifactId>
187
			<version>2.1</version>
188
		</dependency>
189
		<!-- poi end -->
190
191
		<dependency>
192
			<groupId>commons-httpclient</groupId>
193
			<artifactId>commons-httpclient</artifactId>
194
			<version>3.1</version>
195
		</dependency>
196
		<dependency>
197
			<groupId>org.projectlombok</groupId>
198
			<artifactId>lombok</artifactId>
199
			<version>1.16.10</version>
200
			<scope>provided</scope>
201
		</dependency>
202
	</dependencies>
203
204
	<!--<build>
205
		<plugins>
206
			<plugin>
207
				<groupId>org.springframework.boot</groupId>
208
				<artifactId>spring-boot-maven-plugin</artifactId>
209
				<configuration>
210
					<fork>true</fork>
211
				</configuration>
212
			</plugin>
213
		</plugins>
214
	</build>-->
215
216
	<build>
217
		<plugins>
218
			<plugin>
219
				<artifactId>maven-compiler-plugin</artifactId>
220
				<configuration>
221
					<source>${compiler-version}</source>
222
					<target>${compiler-version}</target>
223
					<encoding>${encoding}</encoding>
224
					<!-- 通过此方法添加本地jar -->
225
					<compilerArguments>
226
						<!--suppress UnresolvedMavenProperty -->
227
						<bootclasspath>${JAVA_HOME}/jre/lib/rt.jar</bootclasspath>
228
						<extdirs>${project.basedir}/libs</extdirs>
229
					</compilerArguments>
230
				</configuration>
231
			</plugin>
232
			<plugin>
233
				<groupId>org.apache.maven.plugins</groupId>
234
				<artifactId>maven-surefire-plugin</artifactId>
235
				<configuration>
236
					<skip>true</skip>
237
				</configuration>
238
			</plugin>
239
			<!-- ==========应用包和依赖包分离的打包方法================ -->
240
			<plugin>
241
				<groupId>org.apache.maven.plugins</groupId>
242
				<artifactId>maven-resources-plugin</artifactId>
243
				<executions>
244
					<execution>
245
						<id>copy-resources</id>
246
						<phase>compile</phase>
247
						<goals>
248
							<goal>copy-resources</goal>
249
						</goals>
250
						<configuration>
251
							<encoding>${encoding}</encoding>
252
							<resources>
253
								<resource>
254
									<directory>${project.build.directory}/classes</directory>
255
									<includes>
256
										<include>**/*.properties</include>
257
										<include>**/*.xml</include>
258
										<include>**/*.yaml</include>
259
										<include>**/*.yml</include>
260
										<include>**/*.txt</include>
261
									</includes>
262
								</resource>
263
							</resources>
264
							<!-- 表示把配置文件拷到和jar包同一个路径下 -->
265
							<outputDirectory>
266
								${project.build.directory}/config
267
							</outputDirectory>
268
						</configuration>
269
					</execution>
270
				</executions>
271
			</plugin>
272
			<!-- 复制依赖包 -->
273
			<plugin>
274
				<groupId>org.apache.maven.plugins</groupId>
275
				<artifactId>maven-dependency-plugin</artifactId>
276
				<executions>
277
					<execution>
278
						<id>copy-dependencies</id>
279
						<phase>package</phase>
280
						<goals>
281
							<goal>copy-dependencies</goal>
282
						</goals>
283
						<configuration>
284
							<outputDirectory>${project.build.directory}/lib</outputDirectory>
285
						</configuration>
286
					</execution>
287
				</executions>
288
			</plugin>
289
			<plugin>
290
				<groupId>org.apache.maven.plugins</groupId>
291
				<artifactId>maven-jar-plugin</artifactId>
292
				<configuration>
293
					<archive>
294
						<!--生成的jar中,不要包含pom.xml和pom.properties这两个文件-->
295
						<addMavenDescriptor>false</addMavenDescriptor>
296
						<manifest>
297
							<!--是否要把第三方jar放到manifest的classpath中-->
298
							<addClasspath>true</addClasspath>
299
							<!--生成的manifest中classpath的前缀,lib存放第三方jar-->
300
							<classpathPrefix>lib/</classpathPrefix>
301
							<!--应用的main class-->
302
							<mainClass>${start-class}</mainClass>
303
							<!-- 去掉jar后的时间戳 -->
304
							<useUniqueVersions>false</useUniqueVersions>
305
						</manifest>
306
						<!-- 自定义的MANIFEST.MF参数 -->
307
						<manifestEntries>
308
							<!-- 增加classpath目录config -->
309
							<Class-Path>./config/</Class-Path>
310
						</manifestEntries>
311
					</archive>
312
					<!--过滤掉不希望包含在jar中的文件-->
313
					<excludes>
314
						<exclude>**/*.properties</exclude>
315
						<exclude>**/*.xml</exclude>
316
						<exclude>**/*.yaml</exclude>
317
						<exclude>**/*.yml</exclude>
318
						<exclude>**/*.txt</exclude>
319
					</excludes>
320
				</configuration>
321
			</plugin>
322
323
			<plugin>
324
				<groupId>org.apache.maven.plugins</groupId>
325
				<artifactId>maven-assembly-plugin</artifactId>
326
				<version>2.4</version>
327
				<!-- The configuration of the plugin -->
328
				<configuration>
329
					<!-- Specifies the configuration file of the assembly plugin -->
330
					<descriptors>
331
						<descriptor>src/main/assembly-package.xml</descriptor>
332
					</descriptors>
333
				</configuration>
334
				<executions>
335
					<execution>
336
						<id>make-assembly</id>
337
						<phase>package</phase>
338
						<goals>
339
							<goal>single</goal>
340
						</goals>
341
					</execution>
342
				</executions>
343
			</plugin>
344
		</plugins>
345
		<finalName>${project.artifactId}</finalName>
346
	</build>
1
<project xmlns="http://maven.apache.org/POM/4.0.0"
2
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4
	<modelVersion>4.0.0</modelVersion>
5

6
	<parent>
7
		<groupId>com.ai.ipu.server</groupId>
8
		<artifactId>ipu-rest-libs</artifactId>
9
		<version>3.1-SNAPSHOT</version>
10
	</parent>
11

12
	<artifactId>ebc-sea-platform</artifactId>
13
	<packaging>jar</packaging>
14
	<name>ebc海上定位与救援</name>
15

16
	<properties>
17
		<start-class>com.ai.ipu.server.EbcSeaPlatformStart</start-class>
18
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
19
		<mongo.java.driver>3.11.2</mongo.java.driver>
20
		<ipu>3.1-SNAPSHOT</ipu>
21
		<jdk>1.8</jdk>
22
		<junit>4.12</junit>
23
		<spring-session.version>1.3.2.RELEASE</spring-session.version>
24
		<nacos.version>0.1.1</nacos.version>
25
		<poi.version>3.14</poi.version>
26
		<swagger.version>2.6.1</swagger.version>
27
	</properties>
28

29
	<repositories>
30
		<!-- 阿里私服 -->
31
		<repository>
32
			<id>ali</id>
33
			<url>http://maven.aliyun.com/nexus/content/groups/public</url>
34
			<releases>
35
				<enabled>true</enabled>
36
			</releases>
37
			<snapshots>
38
				<enabled>true</enabled>
39
				<updatePolicy>always</updatePolicy>
40
				<checksumPolicy>fail</checksumPolicy>
41
			</snapshots>
42
		</repository>
43
		<!-- IPU仓库 -->
44
		<repository>
45
			<id>ipu</id>
46
			<name>ipu repository</name>
47
			<url>http://114.215.100.48:9090/nexus/content/groups/public/</url>
48
			<releases>
49
				<enabled>true</enabled>
50
			</releases>
51
			<snapshots>
52
				<enabled>true</enabled>
53
				<updatePolicy>always</updatePolicy>
54
			</snapshots>
55
		</repository>
56
		<!-- Uspa仓库 -->
57
		<repository>
58
			<id>maven-public</id>
59
			<name>maven-public</name>
60
			<url>http://10.1.252.197:8081/repository/maven-public/</url>
61
			<releases>
62
				<enabled>true</enabled>
63
			</releases>
64
			<snapshots>
65
				<enabled>true</enabled>
66
				<updatePolicy>always</updatePolicy>
67
			</snapshots>
68
		</repository>
69
	</repositories>
70

71
	<dependencies>
72
		<dependency>
73
			<groupId>com.ai.ipu</groupId>
74
			<artifactId>ipu-sql-mgmt</artifactId>
75
			<version>${ipu}</version>
76
			<!-- 屏蔽以后Idea可能启动报错 -->
77
<!--			<scope>provided</scope>-->
78
		</dependency>
79
		<dependency>
80
			<groupId>com.ai.ipu.server</groupId>
81
			<artifactId>ipu-restful</artifactId>
82
		</dependency>
83
		<!--uspa start-->
84
		<dependency>
85
			<groupId>org.springframework</groupId>
86
			<artifactId>spring-orm</artifactId>
87
			<version>4.1.9.RELEASE</version>
88
		</dependency>
89
		<!-- apache start -->
90
		<dependency>
91
			<groupId>commons-configuration</groupId>
92
			<artifactId>commons-configuration</artifactId>
93
			<version>1.10</version>
94
		</dependency>
95
		<dependency>
96
			<groupId>commons-fileupload</groupId>
97
			<artifactId>commons-fileupload</artifactId>
98
			<version>1.3.2</version>
99
		</dependency>
100
		<dependency>
101
			<groupId>oro</groupId>
102
			<artifactId>oro</artifactId>
103
			<version>2.0.8</version>
104
		</dependency>
105
		<dependency>
106
			<groupId>commons-net</groupId>
107
			<artifactId>commons-net</artifactId>
108
			<version>3.6</version>
109
		</dependency>
110
		<!-- apache end -->
111
		<dependency>
112
			<groupId>org.hibernate</groupId>
113
			<artifactId>hibernate-core</artifactId>
114
			<version>4.2.5.Final</version>
115
		</dependency>
116
		<!-- swagger start -->
117
		<dependency>
118
			<groupId>io.springfox</groupId>
119
			<artifactId>springfox-swagger2</artifactId>
120
			<version>${swagger.version}</version>
121
		</dependency>
122
		<dependency>
123
			<groupId>io.springfox</groupId>
124
			<artifactId>springfox-swagger-ui</artifactId>
125
			<version>${swagger.version}</version>
126
		</dependency>
127
		<!-- swagger end -->
128
		<dependency>
129
			<groupId>com.thoughtworks.xstream</groupId>
130
			<artifactId>xstream</artifactId>
131
			<version>1.4.10</version>
132
		</dependency>
133
		<!--	poi start  -->
134
		<dependency>
135
			<groupId>org.apache.poi</groupId>
136
			<artifactId>poi-ooxml</artifactId>
137
			<version>${poi.version}</version>
138
		</dependency>
139
		<dependency>
140
			<groupId>org.apache.poi</groupId>
141
			<artifactId>poi-ooxml-schemas</artifactId>
142
			<version>${poi.version}</version>
143
		</dependency>
144
		<dependency>
145
			<groupId>org.apache.poi</groupId>
146
			<artifactId>poi-scratchpad</artifactId>
147
			<version>${poi.version}</version>
148
		</dependency>
149
		<dependency>
150
			<groupId>org.apache.poi</groupId>
151
			<artifactId>poi-excelant</artifactId>
152
			<version>${poi.version}</version>
153
		</dependency>
154
		<dependency>
155
			<groupId>org.apache.poi</groupId>
156
			<artifactId>poi-contrib</artifactId>
157
			<version>3.6</version>
158
		</dependency>
159
		<dependency>
160
			<groupId>commons-digester</groupId>
161
			<artifactId>commons-digester</artifactId>
162
			<version>2.1</version>
163
		</dependency>
164
		<!-- poi end -->
165
		<dependency>
166
			<groupId>commons-httpclient</groupId>
167
			<artifactId>commons-httpclient</artifactId>
168
			<version>3.1</version>
169
		</dependency>
170
		<dependency>
171
			<groupId>org.projectlombok</groupId>
172
			<artifactId>lombok</artifactId>
173
			<version>1.16.10</version>
174
			<scope>provided</scope>
175
		</dependency>
176
		<!--  IPU 镜屏 -->
177
		<dependency>
178
			<groupId>com.ai.ipu.server</groupId>
179
			<artifactId>iot-stomp-server</artifactId>
180
			<version>${ipu}</version>
181
			<exclusions>
182
				<exclusion>
183
					<groupId>org.apache.logging.log4j</groupId>
184
					<artifactId>log4j-slf4j-impl</artifactId>
185
				</exclusion>
186
			</exclusions>
187
		</dependency>
188
	</dependencies>
189

190
	<!--<build>
191
		<plugins>
192
			<plugin>
193
				<groupId>org.springframework.boot</groupId>
194
				<artifactId>spring-boot-maven-plugin</artifactId>
195
				<configuration>
196
					<fork>true</fork>
197
				</configuration>
198
			</plugin>
199
		</plugins>
200
	</build>-->
201

202
	<build>
203
		<plugins>
204
			<plugin>
205
				<artifactId>maven-compiler-plugin</artifactId>
206
				<configuration>
207
					<source>${compiler-version}</source>
208
					<target>${compiler-version}</target>
209
					<encoding>${encoding}</encoding>
210
					<!-- 通过此方法添加本地jar -->
211
					<compilerArguments>
212
						<!--suppress UnresolvedMavenProperty -->
213
						<bootclasspath>${JAVA_HOME}/jre/lib/rt.jar</bootclasspath>
214
						<extdirs>${project.basedir}/libs</extdirs>
215
					</compilerArguments>
216
				</configuration>
217
			</plugin>
218
			<plugin>
219
				<groupId>org.apache.maven.plugins</groupId>
220
				<artifactId>maven-surefire-plugin</artifactId>
221
				<configuration>
222
					<skip>true</skip>
223
				</configuration>
224
			</plugin>
225
			<!-- ==========应用包和依赖包分离的打包方法================ -->
226
			<plugin>
227
				<groupId>org.apache.maven.plugins</groupId>
228
				<artifactId>maven-resources-plugin</artifactId>
229
				<executions>
230
					<execution>
231
						<id>copy-resources</id>
232
						<phase>compile</phase>
233
						<goals>
234
							<goal>copy-resources</goal>
235
						</goals>
236
						<configuration>
237
							<encoding>${encoding}</encoding>
238
							<resources>
239
								<resource>
240
									<directory>${project.build.directory}/classes</directory>
241
									<includes>
242
										<include>**/*.properties</include>
243
										<include>**/*.xml</include>
244
										<include>**/*.yaml</include>
245
										<include>**/*.yml</include>
246
										<include>**/*.txt</include>
247
									</includes>
248
								</resource>
249
							</resources>
250
							<!-- 表示把配置文件拷到和jar包同一个路径下 -->
251
							<outputDirectory>
252
								${project.build.directory}/config
253
							</outputDirectory>
254
						</configuration>
255
					</execution>
256
				</executions>
257
			</plugin>
258
			<!-- 复制依赖包 -->
259
			<plugin>
260
				<groupId>org.apache.maven.plugins</groupId>
261
				<artifactId>maven-dependency-plugin</artifactId>
262
				<executions>
263
					<execution>
264
						<id>copy-dependencies</id>
265
						<phase>package</phase>
266
						<goals>
267
							<goal>copy-dependencies</goal>
268
						</goals>
269
						<configuration>
270
							<outputDirectory>${project.build.directory}/lib</outputDirectory>
271
						</configuration>
272
					</execution>
273
				</executions>
274
			</plugin>
275
			<plugin>
276
				<groupId>org.apache.maven.plugins</groupId>
277
				<artifactId>maven-jar-plugin</artifactId>
278
				<configuration>
279
					<archive>
280
						<!--生成的jar中,不要包含pom.xml和pom.properties这两个文件-->
281
						<addMavenDescriptor>false</addMavenDescriptor>
282
						<manifest>
283
							<!--是否要把第三方jar放到manifest的classpath中-->
284
							<addClasspath>true</addClasspath>
285
							<!--生成的manifest中classpath的前缀,lib存放第三方jar-->
286
							<classpathPrefix>lib/</classpathPrefix>
287
							<!--应用的main class-->
288
							<mainClass>${start-class}</mainClass>
289
							<!-- 去掉jar后的时间戳 -->
290
							<useUniqueVersions>false</useUniqueVersions>
291
						</manifest>
292
						<!-- 自定义的MANIFEST.MF参数 -->
293
						<manifestEntries>
294
							<!-- 增加classpath目录config -->
295
							<Class-Path>./config/</Class-Path>
296
						</manifestEntries>
297
					</archive>
298
					<!--过滤掉不希望包含在jar中的文件-->
299
					<excludes>
300
						<exclude>**/*.properties</exclude>
301
						<exclude>**/*.xml</exclude>
302
						<exclude>**/*.yaml</exclude>
303
						<exclude>**/*.yml</exclude>
304
						<exclude>**/*.txt</exclude>
305
					</excludes>
306
				</configuration>
307
			</plugin>
308

309
			<plugin>
310
				<groupId>org.apache.maven.plugins</groupId>
311
				<artifactId>maven-assembly-plugin</artifactId>
312
				<version>2.4</version>
313
				<!-- The configuration of the plugin -->
314
				<configuration>
315
					<!-- Specifies the configuration file of the assembly plugin -->
316
					<descriptors>
317
						<descriptor>src/main/assembly-package.xml</descriptor>
318
					</descriptors>
319
				</configuration>
320
				<executions>
321
					<execution>
322
						<id>make-assembly</id>
323
						<phase>package</phase>
324
						<goals>
325
							<goal>single</goal>
326
						</goals>
327
					</execution>
328
				</executions>
329
			</plugin>
330
		</plugins>
331
		<finalName>${project.artifactId}</finalName>
332
	</build>
347 333
</project>

+ 42 - 26
ebc-sea-platform/src/main/java/com/ai/ipu/server/EbcSeaPlatformStart.java

@ -1,26 +1,42 @@
1
package com.ai.ipu.server;
2
3
import com.ai.ipu.basic.util.IpuBaseException;
4
import com.ai.ipu.restful.boot.IpuRestApplication;
5
6
/**
7
 * @author huangbo@asiainfo.com
8
 * @team IPU
9
 * @date 2019年11月21日下午3:11:12
10
 * @desc SpringBoot应用启动类
11
 */
12
public class EbcSeaPlatformStart {
13
	private final static String EXCEPTION_MESSAGES_CONFIG = "exception_messages";
14
15
	public static void main(String[] args) {
16
		/*注册异常信息编码配置*/
17
	    //热部署会多次加载,因此需要捕获并忽略异常
18
		try{
19
			IpuBaseException.registerCode(EXCEPTION_MESSAGES_CONFIG);
20
		}catch(Exception e) {}
21
		/*启动*/
22
	    IpuRestApplication.start(args);
23
	}
24
25
26
}
1
package com.ai.ipu.server;
2

3
import org.slf4j.Logger;
4
import org.slf4j.LoggerFactory;
5
import com.ai.ipu.basic.reflect.ReflectUtil;
6
import com.ai.ipu.basic.util.IpuBaseException;
7
import com.ai.ipu.restful.boot.IpuRestApplication;
8
import com.ai.ipu.server.connect.ConnectServerStart;
9
import com.ai.ipu.server.connect.util.ConnectServerManager;
10
import com.ai.ipu.server.stomp.WebSocketStompServer;
11

12
/**
13
 * @author huangbo@asiainfo.com
14
 * @team IPU
15
 * @date 2019年11月21日下午3:11:12
16
 * @desc SpringBoot应用启动类
17
 */
18
public class EbcSeaPlatformStart {
19
	
20
	private final static String EXCEPTION_MESSAGES_CONFIG = "exception_messages";
21
	private static final Logger logger = LoggerFactory.getLogger(EbcSeaPlatformStart.class);
22

23
	public static void main(String[] args) {
24
		/*注册异常信息编码配置*/
25
	    //热部署会多次加载,因此需要捕获并忽略异常
26
		try{
27
			IpuBaseException.registerCode(EXCEPTION_MESSAGES_CONFIG);
28
			//注册镜屏服务
29
			ConnectServerManager.registerServer("websocket.port", new WebSocketStompServer("/stomp"));
30
			//镜屏服务启动
31
			ConnectServerStart.start(args, false);
32
		}catch(Exception e) {
33
			logger.error("启动失败:" + e.getMessage());
34
			try {
35
				ReflectUtil.invokeStaticMethod(System.class, "exit", new Object[] { 0 });
36
			} catch (Exception e1) {}
37
		}
38
		/*启动*/
39
	    IpuRestApplication.start(args);
40
	}
41
	
42
}

+ 13 - 0
ebc-sea-platform/src/main/resources/push-action.xml

@ -0,0 +1,13 @@
1
<?xml version="1.0" encoding="UTF-8"?>
2
<actions>
3
	<!-- 查询服务当前连接数 -->
4
	<action name="ChannelStatus" 
5
	    class="com.ai.ipu.server.stomp.action.ChannelStatusAction" />
6
	<action name="StatsForChannel" 
7
	    class="com.ai.ipu.server.stomp.action.StatisticsForChannelAction" />
8
	<!-- 服务统计接口 -->
9
	<action name="StatsForServer" 
10
	    class="com.ai.ipu.server.connect.action.impl.StatisticsForServerAction" />
11
	<action name="StatsForClient" 
12
	    class="com.ai.ipu.server.connect.action.impl.StatisticsForClientAction" />
13
</actions>