Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
C
communication
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
耿迪迪
communication
Commits
85a19eb0
Commit
85a19eb0
authored
Jul 02, 2021
by
耿迪迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
语音服务修改 gengdidi
parent
96c113d7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
207 additions
and
12 deletions
+207
-12
pom.xml
pom.xml
+120
-2
startup.sh
src/main/bin/startup.sh
+48
-0
stop.sh
src/main/bin/stop.sh
+34
-0
LogInterceptor.java
...hong/communication/common/interceptor/LogInterceptor.java
+0
-3
SmsController.java
...va/com/zehong/communication/controller/SmsController.java
+0
-1
application.yml
src/main/resources/application.yml
+1
-2
log4j.properties
src/main/resources/log4j.properties
+4
-4
No files found.
pom.xml
View file @
85a19eb0
...
@@ -109,15 +109,133 @@
...
@@ -109,15 +109,133 @@
<version>
5.4.1.Final
</version>
<version>
5.4.1.Final
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.aspectj
</groupId>
<artifactId>
aspectjweaver
</artifactId>
<version>
1.8.6
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
<finalName>
communication-${project.version}
</finalName>
<!--<plugins>-->
<!--<plugin>-->
<!--<groupId>org.springframework.boot</groupId>-->
<!--<artifactId>spring-boot-maven-plugin</artifactId>-->
<!--</plugin>-->
<!--</plugins>-->
<!--<finalName>lark.api-${project.version}</finalName>-->
<plugins>
<plugins>
<!--<plugin>-->
<!--<groupId>org.springframework.boot</groupId>-->
<!--<artifactId>spring-boot-maven-plugin</artifactId>-->
<!--</plugin>-->
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-jar-plugin
</artifactId>
<version>
2.4
</version>
<configuration>
<excludes>
<!--<exclude>*</exclude>-->
<!--<exclude>*.sh</exclude>-->
<!--<exclude>*.bat</exclude>-->
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-dependency-plugin
</artifactId>
<executions>
<execution>
<id>
copy
</id>
<phase>
package
</phase>
<goals>
<goal>
copy-dependencies
</goal>
</goals>
<configuration>
<outputDirectory>
${project.build.directory}/communication-${project.version}/lib
</outputDirectory>
<overWriteReleases>
false
</overWriteReleases>
<overWriteSnapshots>
false
</overWriteSnapshots>
<overWriteIfNewer>
true
</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<artifactId>
maven-resources-plugin
</artifactId>
<version>
2.6
</version>
<executions>
<execution>
<id>
copy-config
</id>
<phase>
package
</phase>
<goals>
<goal>
copy-resources
</goal>
</goals>
<configuration>
<encoding>
UTF-8
</encoding>
<outputDirectory>
${project.build.directory}/communication-${project.version}/conf
</outputDirectory>
<resources>
<resource>
<directory>
src/main/resources
</directory>
<includes>
<include>
**/*.yml
</include>
<include>
**/*.properties
</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>
copy-sh
</id>
<phase>
package
</phase>
<goals>
<goal>
copy-resources
</goal>
</goals>
<configuration>
<encoding>
UTF-8
</encoding>
<outputDirectory>
${project.build.directory}/communication-${project.version}/bin
</outputDirectory>
<resources>
<resource>
<directory>
src/main/bin
</directory>
<includes>
<include>
*.sh
</include>
<include>
*.bat
</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>
copy-dist-jar
</id>
<phase>
package
</phase>
<goals>
<goal>
copy-resources
</goal>
</goals>
<configuration>
<encoding>
UTF-8
</encoding>
<outputDirectory>
${project.build.directory}/communication-${project.version}/lib
</outputDirectory>
<resources>
<resource>
<directory>
target
</directory>
<includes>
<include>
*.jar
</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugin>
</plugins>
</plugins>
</build>
</build>
</project>
</project>
src/main/bin/startup.sh
0 → 100644
View file @
85a19eb0
#!/bin/bash
cd
`
dirname
$0
`
cd
..
DEPLOY_DIR
=
`
pwd
`
CONF_DIR
=
$DEPLOY_DIR
/conf
LOGS_DIR
=
$DEPLOY_DIR
/logs
APP_MAINCLASS
=
com.zehong.communication.CommunicationApplication
PIDS
=
`
ps
-ef
|
grep
-v
grep
|
grep
"
$CONF_DIR
"
|awk
'{print $2}'
`
if
[
-n
"
$PIDS
"
]
;
then
echo
"ERROR: already started!"
echo
"PID:
$PIDS
"
exit
1
fi
if
[
!
-d
$LOGS_DIR
]
;
then
mkdir
$LOGS_DIR
fi
STDOUT_FILE
=
$LOGS_DIR
/stdout.log
CLOG_FILE
=
$LOGS_DIR
/gc.logli
SYS_FILE
=
$LOGS_DIR
/communication.log
LIB_DIR
=
$DEPLOY_DIR
/lib
LIB_JARS
=
`
ls
$LIB_DIR
|grep .jar|awk
'{print "'
$LIB_DIR
'/"$0}'
| xargs |
sed
"s/ /:/g"
`
JAVA_OPTS
=
" -Djava.awt.headless=true"
JAVA_DEBUG_OPTS
=
""
if
[
"
$1
"
=
"debug"
]
;
then
JAVA_DEBUG_OPTS
=
" -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n "
fi
JAVA_JMX_OPTS
=
""
if
[
"
$1
"
=
"jmx"
]
;
then
JAVA_JMX_OPTS
=
" -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false "
fi
JAVA_MEM_OPTS
=
"-server -Xms2048M -Xmx2048M -Xmn1024M"
#JAVA_MEM_OPTS="-server -Xms5120M -Xmx5120M -Xmn1024M -Xnoclassgc -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+CMSParallelRemarkEnabled -XX:CMSInitiatingOccupancyFraction=80 -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+PrintClassHistogram -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC -Xloggc:$CLOG_FILE"
echo
-e
"Starting the CommunicationApplication ...
\c
"
export
LD_LIBRARY_PATH
=
$LD_LIBRARY_PATH
:
$DEPLOY_DIR
/libs/linux_64
nohup
java
-Dapp
.home
=
$DEPLOY_DIR
$JAVA_OPTS
$JAVA_MEM_OPTS
$JAVA_DEBUG_OPTS
$JAVA_JMX_OPTS
-classpath
$CONF_DIR
:
$LIB_JARS
$APP_MAINCLASS
>
$SYS_FILE
2>&1 &
sleep
1
echo
"started"
PIDS
=
`
ps
-ef
|
grep
java |
grep
"
$DEPLOY_DIR
"
|
awk
'{print $2}'
`
echo
"PID:
$PIDS
"
src/main/bin/stop.sh
0 → 100644
View file @
85a19eb0
#!/bin/bash
cd
`
dirname
$0
`
BIN_DIR
=
`
pwd
`
cd
..
DEPLOY_DIR
=
`
pwd
`
LOGS_DIR
=
$DEPLOY_DIR
/logs
if
[
!
-d
$LOGS_DIR
]
;
then
mkdir
$LOGS_DIR
fi
STDOUT_FILE
=
$LOGS_DIR
/stdout.log
PID
=
`
ps
-ef
|
grep
-v
grep
|
grep
"
$DEPLOY_DIR
/conf"
|
awk
'{print $2}'
`
echo
"PID:
$PID
"
if
[
-z
"
$PID
"
]
;
then
echo
"ERROR: The CommunicationApplication does not started!"
exit
1
fi
echo
-e
"Stopping the CommunicationApplication ...
\c
"
kill
$PID
>
$STDOUT_FILE
2>&1
COUNT
=
0
while
[
$COUNT
-lt
1
]
;
do
echo
-e
".
\c
"
sleep
1
COUNT
=
1
PID_EXIST
=
`
ps
-f
-p
$PID
|
grep
java
`
if
[
-n
"
$PID_EXIST
"
]
;
then
COUNT
=
0
fi
done
echo
"stopped"
echo
"PID:
$PID
"
src/main/java/com/zehong/communication/common/interceptor/LogInterceptor.java
View file @
85a19eb0
...
@@ -42,9 +42,6 @@ public class LogInterceptor {
...
@@ -42,9 +42,6 @@ public class LogInterceptor {
@Value
(
"${isWriteLocal}"
)
@Value
(
"${isWriteLocal}"
)
private
boolean
isWriteLocal
;
private
boolean
isWriteLocal
;
@Value
(
"${fileUrl}"
)
private
String
fileUrl
;
/**
/**
* 定义拦截器规则
* 定义拦截器规则
*/
*/
...
...
src/main/java/com/zehong/communication/controller/SmsController.java
View file @
85a19eb0
...
@@ -24,7 +24,6 @@ import javax.validation.Valid;
...
@@ -24,7 +24,6 @@ import javax.validation.Valid;
*/
*/
@RestController
@RestController
@RequestMapping
(
"/sms"
)
@RequestMapping
(
"/sms"
)
@PropertySource
(
value
=
"classpath:application.yml"
,
encoding
=
"UTF-8"
)
public
class
SmsController
{
public
class
SmsController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SmsController
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SmsController
.
class
);
...
...
src/main/resources/application.yml
View file @
85a19eb0
...
@@ -39,7 +39,7 @@ accessKeySecret: bprEWwn1M0xgglRQCQEMYSPiYctDk4
...
@@ -39,7 +39,7 @@ accessKeySecret: bprEWwn1M0xgglRQCQEMYSPiYctDk4
signName
:
泽宏云
signName
:
泽宏云
#阿里批量发送短信
#阿里批量发送短信
signNameJson
:
[
\"泽宏云\"
]
signNameJson
:
"
[
\"
泽宏云
\"
]"
#ip白名单
#ip白名单
iPWhite
:
192.168.2.23
iPWhite
:
192.168.2.23
...
@@ -49,7 +49,6 @@ secretKey: f225e66813e6d6a663daf919c1935dcb
...
@@ -49,7 +49,6 @@ secretKey: f225e66813e6d6a663daf919c1935dcb
#是否写入本地
#是否写入本地
isWriteLocal
:
true
isWriteLocal
:
true
fileUrl
:
E:\java\work\requireLog.text
logging
:
logging
:
# 设置logback.xml位置
# 设置logback.xml位置
...
...
src/main/resources/log4j.properties
View file @
85a19eb0
...
@@ -5,8 +5,8 @@ log4j.appender.Console.layout = org.apache.log4j.PatternLayout
...
@@ -5,8 +5,8 @@ log4j.appender.Console.layout = org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern
=
[%p] [%d{yyyy-MM-dd HH
\:
mm
\:
ss}][%c - %L]%m%n
log4j.appender.Console.layout.ConversionPattern
=
[%p] [%d{yyyy-MM-dd HH
\:
mm
\:
ss}][%c - %L]%m%n
log4j.appender.File
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.File
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.File.File
=
E:/java/work/info.log
#
log4j.appender.File.File = E:/java/work/info.log
#
log4j.appender.File.File = /data/java/communication/log/info
log4j.appender.File.File
=
/data/java/communication/log/info
log4j.appender.File.DatePattern
=
_yyyy-MM-dd'.log'
log4j.appender.File.DatePattern
=
_yyyy-MM-dd'.log'
log4j.appender.File.Append
=
true
log4j.appender.File.Append
=
true
log4j.appender.File.File.MaxFileSize
=
30MB
log4j.appender.File.File.MaxFileSize
=
30MB
...
@@ -18,8 +18,8 @@ log4j.appender.File.layout.ConversionPattern =[%p] [%d{yyyy-MM-dd HH\:mm\:ss}][%
...
@@ -18,8 +18,8 @@ log4j.appender.File.layout.ConversionPattern =[%p] [%d{yyyy-MM-dd HH\:mm\:ss}][%
log4j.logger.RequestLog
=
INFO,S
log4j.logger.RequestLog
=
INFO,S
log4j.additivity.RequestLog
=
false
log4j.additivity.RequestLog
=
false
log4j.appender.S
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.S
=
org.apache.log4j.DailyRollingFileAppender
log4j.appender.S.File
=
E:/java/work/log.log
#
log4j.appender.S.File =E:/java/work/log.log
#
log4j.appender.S.File = /data/java/communication/log/requestLog
log4j.appender.S.File
=
/data/java/communication/log/requestLog
log4j.appender.S.DatePattern
=
_yyyy-MM-dd'.log'
log4j.appender.S.DatePattern
=
_yyyy-MM-dd'.log'
log4j.appender.S.Append
=
true
log4j.appender.S.Append
=
true
log4j.appender.S.Threshold
=
info
log4j.appender.S.Threshold
=
info
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment