mirror of
https://github.com/chatopera/cosin.git
synced 2025-08-01 16:38:02 +08:00
后端基础设施完善
This commit is contained in:
parent
7c93ac0109
commit
64387b8a8e
@ -12,7 +12,7 @@ jobs:
|
|||||||
# Be sure to update the Docker image tag below to openjdk version of your application.
|
# Be sure to update the Docker image tag below to openjdk version of your application.
|
||||||
# A list of available CircleCI Docker Convenience Images are available here: https://circleci.com/developer/images/image/cimg/openjdk
|
# A list of available CircleCI Docker Convenience Images are available here: https://circleci.com/developer/images/image/cimg/openjdk
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/openjdk:17.0.7
|
- image: cimg/openjdk:21
|
||||||
# Add steps to the job
|
# Add steps to the job
|
||||||
# See: https://circleci.com/docs/configuration-reference/#steps
|
# See: https://circleci.com/docs/configuration-reference/#steps
|
||||||
steps:
|
steps:
|
||||||
@ -25,10 +25,7 @@ jobs:
|
|||||||
echo "$DOCKERHUB_USERPASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
|
echo "$DOCKERHUB_USERPASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
|
||||||
- run:
|
- run:
|
||||||
name: Build Contact Center Docker Image
|
name: Build Contact Center Docker Image
|
||||||
command: cd $CIRCLE_WORKING_DIRECTORY/contact-center && ./admin/build.sh
|
command: cd $CIRCLE_WORKING_DIRECTORY/cskefu-backend && ../scripts/deploy.sh
|
||||||
- run:
|
|
||||||
name: Push Contact Center Docker Image to DockerHub
|
|
||||||
command: cd $CIRCLE_WORKING_DIRECTORY/contact-center && ./admin/push.sh
|
|
||||||
|
|
||||||
# Invoke jobs via workflows
|
# Invoke jobs via workflows
|
||||||
# See: https://circleci.com/docs/configuration-reference/#workflows
|
# See: https://circleci.com/docs/configuration-reference/#workflows
|
||||||
|
3
.github/workflows/compile.yml
vendored
3
.github/workflows/compile.yml
vendored
@ -15,5 +15,4 @@ jobs:
|
|||||||
if [ ! -d .git ]; then git init; git config user.email "you@dummy.com"; git config user.name "dummy"; git add --all && git commit -q -m "Only fix mvn goals for github workflow"; fi
|
if [ ! -d .git ]; then git init; git config user.email "you@dummy.com"; git config user.name "dummy"; git add --all && git commit -q -m "Only fix mvn goals for github workflow"; fi
|
||||||
if [ -f ~/.cskefu.rc ]; then source ~/.cskefu.rc; else echo "Not found ~/.cskefu.rc; find info with https://github.com/cskefu/cskefu/issues/688"; exit 1; fi
|
if [ -f ~/.cskefu.rc ]; then source ~/.cskefu.rc; else echo "Not found ~/.cskefu.rc; find info with https://github.com/cskefu/cskefu/issues/688"; exit 1; fi
|
||||||
java -version && mvn -version
|
java -version && mvn -version
|
||||||
$GITHUB_WORKSPACE/public/plugins/scripts/install-all.sh
|
cd $GITHUB_WORKSPACE/cskefu-backend && ../public/scripts/compile.sh
|
||||||
cd $GITHUB_WORKSPACE/contact-center && ./admin/compile.sh
|
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -21,7 +21,6 @@ build.gradle
|
|||||||
.vscode/
|
.vscode/
|
||||||
nohup.out
|
nohup.out
|
||||||
docker-compose.dev.yml
|
docker-compose.dev.yml
|
||||||
docker-compose.custom.yml
|
|
||||||
private/
|
private/
|
||||||
smart-doc/
|
smart-doc/
|
||||||
target/
|
target/
|
@ -1,8 +0,0 @@
|
|||||||
app/target
|
|
||||||
!app/target/*.war.original
|
|
||||||
!app/target/*.war
|
|
||||||
!app/target/*.jar.original
|
|
||||||
!app/target/*.jar
|
|
||||||
logs/
|
|
||||||
tmp/
|
|
||||||
data/
|
|
23
contact-center/.gitignore
vendored
23
contact-center/.gitignore
vendored
@ -1,23 +0,0 @@
|
|||||||
*.swp
|
|
||||||
*.swo
|
|
||||||
*.sublime-*
|
|
||||||
*.pyc
|
|
||||||
jmeter.log
|
|
||||||
__pycache__
|
|
||||||
tmp/
|
|
||||||
node_modules/
|
|
||||||
sftp-config.json
|
|
||||||
.DS_Store
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
|
||||||
*.iws
|
|
||||||
*.idea
|
|
||||||
~$*.xls*
|
|
||||||
~$*.ppt*
|
|
||||||
~$*.doc*
|
|
||||||
admin/localrc
|
|
||||||
app/target/
|
|
||||||
app/.classpath
|
|
||||||
app/.project
|
|
||||||
app/.settings/
|
|
||||||
logPath_IS_UNDEFINED/
|
|
@ -1,30 +0,0 @@
|
|||||||
FROM chatopera/java:17
|
|
||||||
MAINTAINER Hai Liang Wang <hain@chatopera.com>
|
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
|
||||||
ARG VCS_REF
|
|
||||||
ARG APPLICATION_CUSTOMER_ENTITY
|
|
||||||
ARG APPLICATION_BUILD_DATESTR
|
|
||||||
|
|
||||||
ENV APPLICATION_CUSTOMER_ENTITY=$APPLICATION_CUSTOMER_ENTITY
|
|
||||||
ENV APPLICATION_BUILD_DATESTR=$APPLICATION_BUILD_DATESTR
|
|
||||||
|
|
||||||
LABEL org.label-schema.vcs-ref=$VCS_REF \
|
|
||||||
org.label-schema.vcs-url="https://www.cskefu.com"
|
|
||||||
|
|
||||||
# create dirs
|
|
||||||
RUN /bin/bash -c "mkdir -p /{data,logs}"
|
|
||||||
|
|
||||||
# build WAR
|
|
||||||
RUN mkdir -p /opt/cskefu
|
|
||||||
COPY ./app/target/contact-center.war /opt/cskefu/contact-center.war
|
|
||||||
COPY ./assets/mysql.setup.db.sh /opt/cskefu
|
|
||||||
COPY ./assets/mysql.upgrade.db.sh /opt/cskefu
|
|
||||||
COPY ./assets/utils.sh /opt/cskefu
|
|
||||||
COPY ./assets/docker-entrypoint.sh /opt/cskefu
|
|
||||||
RUN chmod +x /opt/cskefu/*.sh
|
|
||||||
RUN touch /root/.cskefu.pep
|
|
||||||
|
|
||||||
WORKDIR /opt/cskefu
|
|
||||||
EXPOSE 8030-8050
|
|
||||||
CMD ["./docker-entrypoint.sh"]
|
|
@ -1,7 +0,0 @@
|
|||||||
# Chatopera Contact Center
|
|
||||||
|
|
||||||
前三代呼叫中心均是以电话为主要的服务渠道。在 2000 年,伴随着互联网以及移动通信的发展与普及,将电子邮件、互联网、手机短信等渠道接入呼叫中心,成为第四代呼叫中心的标志。第四代呼叫中心也称为多媒体呼叫中心或联络中心(Contact Center)。它相对传统呼叫中心来说接入渠道丰富,同时引入了多渠道接入与多渠道统一排队等概念。
|
|
||||||
|
|
||||||
## 文档
|
|
||||||
|
|
||||||
<https://docs.chatopera.com/>
|
|
@ -1,40 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
###########################################
|
|
||||||
#
|
|
||||||
###########################################
|
|
||||||
|
|
||||||
# constants
|
|
||||||
baseDir=$(cd `dirname "$0"`;pwd)
|
|
||||||
appHome=$baseDir/..
|
|
||||||
registryPrefix=
|
|
||||||
imagename=cskefu/contact-center
|
|
||||||
|
|
||||||
# functions
|
|
||||||
|
|
||||||
# main
|
|
||||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
|
||||||
# build
|
|
||||||
cd $appHome
|
|
||||||
TIMESTAMP=`date "+%Y%m%d.%H%M%S"`
|
|
||||||
PACKAGE_VERSION=`git rev-parse --short HEAD`
|
|
||||||
APPLICATION_CUSTOMER_ENTITY=${APPLICATION_CUSTOMER_ENTITY:-"OpenSource Community"}
|
|
||||||
|
|
||||||
$baseDir/package.sh
|
|
||||||
|
|
||||||
if [ ! $? -eq 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
set -x
|
|
||||||
docker build --build-arg VCS_REF=$PACKAGE_VERSION \
|
|
||||||
--build-arg APPLICATION_BUILD_DATESTR=$TIMESTAMP \
|
|
||||||
--build-arg APPLICATION_CUSTOMER_ENTITY="$APPLICATION_CUSTOMER_ENTITY" \
|
|
||||||
--no-cache \
|
|
||||||
--force-rm=true --tag $registryPrefix$imagename:$PACKAGE_VERSION .
|
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
docker tag $registryPrefix$imagename:$PACKAGE_VERSION $registryPrefix$imagename:develop
|
|
||||||
else
|
|
||||||
echo "Build contact-center failure."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
@ -1,30 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
###########################################
|
|
||||||
# Create standalone SQL file to setup db
|
|
||||||
###########################################
|
|
||||||
|
|
||||||
# constants
|
|
||||||
baseDir=$(cd `dirname "$0"`;pwd)
|
|
||||||
cwdDir=$PWD
|
|
||||||
export PYTHONUNBUFFERED=1
|
|
||||||
export PATH=/opt/miniconda3/envs/venv-py3/bin:$PATH
|
|
||||||
export TS=$(date +%Y%m%d%H%M%S)
|
|
||||||
export DATE=`date "+%Y%m%d"`
|
|
||||||
export DATE_WITH_TIME=`date "+%Y%m%d-%H%M%S"` #add %3N as we want millisecond too
|
|
||||||
|
|
||||||
# functions
|
|
||||||
|
|
||||||
# main
|
|
||||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
|
||||||
|
|
||||||
cd $baseDir/..
|
|
||||||
|
|
||||||
if [ ! -e tmp ]; then
|
|
||||||
mkdir tmp
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat config/sql/001.mysql-create-db.sql > tmp/db-setup.sql
|
|
||||||
echo "" >> tmp/db-setup.sql
|
|
||||||
cat config/sql/002.mysql-create-schemas.sql >> tmp/db-setup.sql
|
|
||||||
|
|
||||||
echo "Setup Script created in" `pwd`/tmp/db-setup.sql
|
|
@ -1,50 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
###########################################
|
|
||||||
#
|
|
||||||
###########################################
|
|
||||||
|
|
||||||
# constants
|
|
||||||
baseDir=$(cd `dirname "$0"`;pwd)
|
|
||||||
REPO_ID_SNP=chatopera-snapshots
|
|
||||||
REPO_URL_SNP=https://nexus.chatopera.com/repository/maven-snapshots/
|
|
||||||
REPO_ID_REL=chatopera-releases
|
|
||||||
REPO_URL_REL=https://nexus.chatopera.com/repository/maven-releases/
|
|
||||||
|
|
||||||
# functions
|
|
||||||
|
|
||||||
# main
|
|
||||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
|
||||||
cd $baseDir/../app
|
|
||||||
mvn clean jar:jar
|
|
||||||
PACKAGE_VERSION=$(grep --max-count=1 '<version>' pom.xml | awk -F '>' '{ print $2 }' | awk -F '<' '{ print $1 }')
|
|
||||||
if [[ $PACKAGE_VERSION == *SNAPSHOT ]]; then
|
|
||||||
echo "Deploy as snapshot package ..."
|
|
||||||
mvn deploy:deploy-file \
|
|
||||||
-Dmaven.test.skip=true \
|
|
||||||
-Dfile=./target/contact-center.jar \
|
|
||||||
-DgroupId=com.cskefu.cc \
|
|
||||||
-DartifactId=cc-core \
|
|
||||||
-Dversion=$PACKAGE_VERSION \
|
|
||||||
-Dpackaging=jar \
|
|
||||||
-DgeneratePom=true \
|
|
||||||
-DrepositoryId=$REPO_ID_SNP \
|
|
||||||
-Durl=$REPO_URL_SNP
|
|
||||||
if [ ! $? -eq 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "Deploy as release package ..."
|
|
||||||
mvn deploy:deploy-file \
|
|
||||||
-Dmaven.test.skip=true \
|
|
||||||
-Dfile=./target/contact-center.jar \
|
|
||||||
-DgroupId=com.cskefu.cc \
|
|
||||||
-DartifactId=cc-core \
|
|
||||||
-Dversion=$PACKAGE_VERSION \
|
|
||||||
-Dpackaging=jar \
|
|
||||||
-DgeneratePom=true \
|
|
||||||
-DrepositoryId=$REPO_ID_REL \
|
|
||||||
-Durl=$REPO_URL_REL
|
|
||||||
if [ ! $? -eq 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
@ -1,15 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
###########################################
|
|
||||||
#
|
|
||||||
###########################################
|
|
||||||
|
|
||||||
# constants
|
|
||||||
baseDir=$(cd `dirname "$0"`;pwd)
|
|
||||||
# functions
|
|
||||||
|
|
||||||
# main
|
|
||||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
|
||||||
cd $baseDir/../app
|
|
||||||
source .env
|
|
||||||
mvn spring-boot:run
|
|
||||||
#java -jar target/contact-center.war
|
|
@ -1,13 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
###########################################
|
|
||||||
#
|
|
||||||
###########################################
|
|
||||||
|
|
||||||
# constants
|
|
||||||
baseDir=$(cd `dirname "$0"`;pwd)
|
|
||||||
# functions
|
|
||||||
|
|
||||||
# main
|
|
||||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
|
||||||
cd $baseDir/../app
|
|
||||||
mvn eclipse:eclipse
|
|
@ -1,13 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
###########################################
|
|
||||||
#
|
|
||||||
###########################################
|
|
||||||
|
|
||||||
# constants
|
|
||||||
baseDir=$(cd `dirname "$0"`;pwd)
|
|
||||||
# functions
|
|
||||||
|
|
||||||
# main
|
|
||||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
|
||||||
cd $baseDir/../app
|
|
||||||
mvn idea:idea
|
|
@ -1,47 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
###########################################
|
|
||||||
#
|
|
||||||
###########################################
|
|
||||||
|
|
||||||
# constants
|
|
||||||
baseDir=$(cd `dirname "$0"`;pwd)
|
|
||||||
SCRIPT_PATH=$0
|
|
||||||
ts=`date +"%Y-%m-%d_%H-%M-%S"`
|
|
||||||
buildDir=/tmp/cc-build-$ts
|
|
||||||
# functions
|
|
||||||
function print_usage(){
|
|
||||||
echo "Install contact-center plugin: $SCRIPT_PATH contact-center_jar_path plugin_path output_path"
|
|
||||||
}
|
|
||||||
|
|
||||||
# main
|
|
||||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
|
||||||
if [ "$#" -ne 4 ]; then
|
|
||||||
CONTACT_CENTER=$1
|
|
||||||
CC_PLUGIN=$2
|
|
||||||
OUTPUT_PATH=$3
|
|
||||||
if [ ! -f $1 ]; then
|
|
||||||
echo "contact center jar file not exist."
|
|
||||||
print_usage
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f $2 ]; then
|
|
||||||
echo "cc plugin jar file not exist."
|
|
||||||
print_usage
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
# create jar
|
|
||||||
rm -rf $buildDir
|
|
||||||
mkdir $buildDir
|
|
||||||
unzip $CONTACT_CENTER -d $buildDir
|
|
||||||
cp $CC_PLUGIN $buildDir/BOOT-INF/lib
|
|
||||||
cd $buildDir
|
|
||||||
jar -cvfM0 $3 .
|
|
||||||
echo "Created new jar file as" $OUTPUT_PATH "successfully."
|
|
||||||
echo "Build done, delete buildDir" $buildDir "in 3 seconds ..."
|
|
||||||
sleep 3
|
|
||||||
rm -rf $buildDir
|
|
||||||
else
|
|
||||||
print_usage
|
|
||||||
fi
|
|
@ -1,19 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
###########################################
|
|
||||||
#
|
|
||||||
###########################################
|
|
||||||
|
|
||||||
# constants
|
|
||||||
baseDir=$(cd `dirname "$0"`;pwd)
|
|
||||||
# functions
|
|
||||||
|
|
||||||
# main
|
|
||||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
|
||||||
cd $baseDir/../app
|
|
||||||
mvn -DskipTests clean package
|
|
||||||
# take too long time with dev002 for uploading artifact, skip this operation
|
|
||||||
# $baseDir/deploy.app.sh
|
|
||||||
|
|
||||||
if [ ! $? -eq 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
@ -1,13 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
###########################################
|
|
||||||
#
|
|
||||||
###########################################
|
|
||||||
|
|
||||||
# constants
|
|
||||||
baseDir=$(cd `dirname "$0"`;pwd)
|
|
||||||
# functions
|
|
||||||
|
|
||||||
# main
|
|
||||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
|
||||||
cd $baseDir/../root
|
|
||||||
mvn deploy
|
|
@ -1,52 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
###########################################
|
|
||||||
#
|
|
||||||
###########################################
|
|
||||||
|
|
||||||
# constants
|
|
||||||
baseDir=$(cd `dirname "$0"`;pwd)
|
|
||||||
appHome=$baseDir/..
|
|
||||||
registryPrefix=
|
|
||||||
imagename=cskefu/contact-center
|
|
||||||
PACKAGE_VERSION=
|
|
||||||
|
|
||||||
# functions
|
|
||||||
|
|
||||||
# main
|
|
||||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
|
||||||
cd $appHome/
|
|
||||||
|
|
||||||
if [ -d ../private ]; then
|
|
||||||
registryPrefix=dockerhub.qingcloud.com/
|
|
||||||
fi
|
|
||||||
|
|
||||||
TIMESTAMP=`date "+%Y%m%d.%H%M%S"`
|
|
||||||
PACKAGE_VERSION=`git rev-parse --short HEAD`
|
|
||||||
|
|
||||||
cd $baseDir
|
|
||||||
docker run -it --rm \
|
|
||||||
-p 9035:8035 \
|
|
||||||
-p 9036:8036 \
|
|
||||||
-v $PWD/data:/data \
|
|
||||||
-v $PWD/logs:/logs \
|
|
||||||
-e "JAVA_OPTS=-Xmx12288m -Xms2048m -XX:PermSize=256m -XX:MaxPermSize=1024m -Djava.net.preferIPv4Stack=true" \
|
|
||||||
-e SERVER_PORT=8035 \
|
|
||||||
-e SERVER_LOG_PATH=/logs \
|
|
||||||
-e SERVER_LOG_LEVEL=INFO \
|
|
||||||
-e WEB_UPLOAD_PATH=/data \
|
|
||||||
-e SPRING_FREEMARKER_CACHE=true \
|
|
||||||
-e SPRING_DATA_ELASTICSEARCH_PROPERTIES_PATH_DATA=/data \
|
|
||||||
-e SPRING_DATASOURCE_DRIVER_CLASS_NAME=com.mysql.jdbc.Driver \
|
|
||||||
-e "SPRING_DATASOURCE_URL=jdbc:mysql://mysql:8037/contactcenter?useUnicode=true&characterEncoding=UTF-8" \
|
|
||||||
-e SPRING_DATASOURCE_USERNAME=root \
|
|
||||||
-e SPRING_DATASOURCE_PASSWORD=123456 \
|
|
||||||
-e MANAGEMENT_SECURITY_ENABLED=false \
|
|
||||||
-e SPRING_REDIS_DATABASE=2 \
|
|
||||||
-e SPRING_REDIS_HOST=redis \
|
|
||||||
-e SPRING_REDIS_PORT=8041 \
|
|
||||||
-e CSKEFU_CALLOUT_WATCH_INTERVAL=60000 \
|
|
||||||
-e SPRING_DATA_ELASTICSEARCH_CLUSTER_NAME=elasticsearch \
|
|
||||||
-e SPRING_DATA_ELASTICSEARCH_CLUSTER_NODES=elasticsearch:8040 \
|
|
||||||
-e SPRING_DATA_ELASTICSEARCH_LOCAL=false \
|
|
||||||
-e SPRING_DATA_ELASTICSEARCH_REPOSITORIES_ENABLED=true \
|
|
||||||
$registryPrefix$imagename:$PACKAGE_VERSION
|
|
@ -1,14 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
###########################################
|
|
||||||
#
|
|
||||||
###########################################
|
|
||||||
|
|
||||||
# constants
|
|
||||||
baseDir=$(cd `dirname "$0"`;pwd)
|
|
||||||
# functions
|
|
||||||
|
|
||||||
# main
|
|
||||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
|
||||||
cd $baseDir/../app
|
|
||||||
set -x
|
|
||||||
mvn -Dtest=com.cskefu.cc.proto.ProtoTest#testProto test
|
|
@ -1,22 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
###########################################
|
|
||||||
# Contact Center Start
|
|
||||||
###########################################
|
|
||||||
|
|
||||||
# constants
|
|
||||||
baseDir=$(cd `dirname "$0"`;pwd)
|
|
||||||
|
|
||||||
# functions
|
|
||||||
|
|
||||||
# main
|
|
||||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
|
||||||
cd $baseDir
|
|
||||||
./mysql.setup.db.sh
|
|
||||||
./mysql.upgrade.db.sh
|
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
java -jar contact-center.war
|
|
||||||
else
|
|
||||||
echo "Fail to resolve mysql database instance."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
@ -1,23 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
###########################################
|
|
||||||
#
|
|
||||||
###########################################
|
|
||||||
|
|
||||||
# constants
|
|
||||||
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-amazon-corretto
|
|
||||||
export PATH=$PATH:$JAVA_HOME/bin
|
|
||||||
baseDir=$(cd `dirname "$0"`;pwd)
|
|
||||||
MVNNAME=maven.tgz
|
|
||||||
|
|
||||||
# functions
|
|
||||||
|
|
||||||
# main
|
|
||||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
|
||||||
cd /opt && wget -O $MVNNAME https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
|
|
||||||
tar xzf $MVNNAME
|
|
||||||
mv apache-maven-* maven
|
|
||||||
rm $MVNNAME
|
|
||||||
|
|
||||||
export MAVEN_HOME=/opt/maven
|
|
||||||
export PATH=$PATH:$MAVEN_HOME/bin
|
|
||||||
rm -rf $0
|
|
@ -1,86 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
###########################################
|
|
||||||
#
|
|
||||||
###########################################
|
|
||||||
|
|
||||||
# constants
|
|
||||||
baseDir=$(cd `dirname "$0"`;pwd)
|
|
||||||
source $baseDir/utils.sh
|
|
||||||
MYSQL_WRITEMODE_IP=`parse_host ${SPRING_DATASOURCE_URL}`
|
|
||||||
MYSQL_WRITEMODE_PORT=`parse_port ${SPRING_DATASOURCE_URL}`
|
|
||||||
CONTACT_CENTER_DB=`parse_dbname ${SPRING_DATASOURCE_URL}`
|
|
||||||
CONTACT_CENTER_WAR=/opt/cskefu/contact-center.war
|
|
||||||
MYSQL_SETUP_CREATE_DB=001.mysql-create-db.sql
|
|
||||||
MYSQL_SETUP_CREATE_SCHEMAS=002.mysql-create-schemas.sql
|
|
||||||
|
|
||||||
# functions
|
|
||||||
function import_db(){
|
|
||||||
if [ ! -f $1 ]; then exit 1; fi
|
|
||||||
println "run MySQL DB initialize script ..."
|
|
||||||
mysql -u ${SPRING_DATASOURCE_USERNAME} \
|
|
||||||
-h ${MYSQL_WRITEMODE_IP} \
|
|
||||||
-P ${MYSQL_WRITEMODE_PORT} -p${SPRING_DATASOURCE_PASSWORD} \
|
|
||||||
< $1
|
|
||||||
|
|
||||||
# verify status
|
|
||||||
if [ ! $? -eq 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function init_db(){
|
|
||||||
println "extract SQL script ..."
|
|
||||||
if [ -f $CONTACT_CENTER_WAR ]; then
|
|
||||||
cd /tmp
|
|
||||||
if [ -d ROOT ]; then
|
|
||||||
rm -rf ROOT
|
|
||||||
fi
|
|
||||||
|
|
||||||
unzip -q $CONTACT_CENTER_WAR -d ROOT
|
|
||||||
if [ -f /tmp/ROOT/$MYSQL_SETUP_CREATE_SCHEMAS ]; then
|
|
||||||
println "start to import database ..."
|
|
||||||
cat /tmp/ROOT/$MYSQL_SETUP_CREATE_DB > /tmp/ROOT/db_setup.sql
|
|
||||||
echo "" >> /tmp/ROOT/db_setup.sql
|
|
||||||
cat /tmp/ROOT/$MYSQL_SETUP_CREATE_SCHEMAS >> /tmp/ROOT/db_setup.sql
|
|
||||||
|
|
||||||
import_db /tmp/ROOT/db_setup.sql
|
|
||||||
# verify status
|
|
||||||
if [ ! $? -eq 0 ]; then
|
|
||||||
rm /tmp/ROOT/db_setup.sql
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
rm -rf /tmp/ROOT
|
|
||||||
else
|
|
||||||
println "SQL script not exist."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
println "War file not exist."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# main
|
|
||||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
|
||||||
println "[setup] connecting to $MYSQL_WRITEMODE_IP:$MYSQL_WRITEMODE_PORT/$CONTACT_CENTER_DB with $SPRING_DATASOURCE_USERNAME/****"
|
|
||||||
|
|
||||||
## wait for database connection ...
|
|
||||||
while ! mysqladmin --user=${SPRING_DATASOURCE_USERNAME} --password=${SPRING_DATASOURCE_PASSWORD} --host=${MYSQL_WRITEMODE_IP} --port=${MYSQL_WRITEMODE_PORT} ping --silent &> /dev/null ; do
|
|
||||||
echo "Waiting for database connection..."
|
|
||||||
sleep 2
|
|
||||||
done
|
|
||||||
|
|
||||||
# check if database exist, if not, create it.
|
|
||||||
mysqlshow -h ${MYSQL_WRITEMODE_IP} \
|
|
||||||
-P ${MYSQL_WRITEMODE_PORT} \
|
|
||||||
--user=${SPRING_DATASOURCE_USERNAME} \
|
|
||||||
--password=${SPRING_DATASOURCE_PASSWORD} \
|
|
||||||
${CONTACT_CENTER_DB} > /dev/null 2>&1 && exit 0;
|
|
||||||
|
|
||||||
# not exist
|
|
||||||
init_db
|
|
||||||
|
|
||||||
# verify status
|
|
||||||
if [ ! $? -eq 0 ]; then
|
|
||||||
println "DB status check failed."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
@ -1,81 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
###########################################
|
|
||||||
#
|
|
||||||
###########################################
|
|
||||||
|
|
||||||
# constants
|
|
||||||
baseDir=$(cd `dirname "$0"`;pwd)
|
|
||||||
source $baseDir/utils.sh
|
|
||||||
MYSQL_WRITEMODE_IP=`parse_host ${SPRING_DATASOURCE_URL}`
|
|
||||||
MYSQL_WRITEMODE_PORT=`parse_port ${SPRING_DATASOURCE_URL}`
|
|
||||||
CONTACT_CENTER_DB=`parse_dbname ${SPRING_DATASOURCE_URL}`
|
|
||||||
CONTACT_CENTER_WAR=/opt/cskefu/contact-center.war
|
|
||||||
APP_WAR_EXTRACTED=/tmp/ROOT
|
|
||||||
UPGRADE_DB_SCRIPT_DIR=$APP_WAR_EXTRACTED/upgrade
|
|
||||||
|
|
||||||
# functions
|
|
||||||
function upgrade_db(){
|
|
||||||
if [ ! -f $1 ]; then exit 1; fi
|
|
||||||
println "[upgrade] run MySQL DB upgrade script" $1 "..."
|
|
||||||
mysql -u ${SPRING_DATASOURCE_USERNAME} \
|
|
||||||
-h ${MYSQL_WRITEMODE_IP} \
|
|
||||||
-P ${MYSQL_WRITEMODE_PORT} -p${SPRING_DATASOURCE_PASSWORD} \
|
|
||||||
< $1
|
|
||||||
|
|
||||||
# verify status
|
|
||||||
if [ ! $? -eq 0 ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function extract_war(){
|
|
||||||
println "extract SQL script ..."
|
|
||||||
if [ -f $CONTACT_CENTER_WAR ]; then
|
|
||||||
cd /tmp
|
|
||||||
if [ -d $APP_WAR_EXTRACTED ]; then
|
|
||||||
rm -rf $APP_WAR_EXTRACTED
|
|
||||||
fi
|
|
||||||
|
|
||||||
unzip -q $CONTACT_CENTER_WAR -d ROOT
|
|
||||||
else
|
|
||||||
println "War file not exist."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# main
|
|
||||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
|
||||||
println "[upgrade] connecting to $MYSQL_WRITEMODE_IP:$MYSQL_WRITEMODE_PORT/$CONTACT_CENTER_DB with $SPRING_DATASOURCE_USERNAME/****"
|
|
||||||
## check upgrade footprint
|
|
||||||
if [ -f /opt/cskefu/upgrade.his ]; then
|
|
||||||
echo "[upgrade] upgrade has been done with previous start."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
## wait for database connection ...
|
|
||||||
while ! mysqladmin --user=${SPRING_DATASOURCE_USERNAME} --password=${SPRING_DATASOURCE_PASSWORD} --host=${MYSQL_WRITEMODE_IP} --port=${MYSQL_WRITEMODE_PORT} ping --silent &> /dev/null ; do
|
|
||||||
echo "Waiting for database connection..."
|
|
||||||
sleep 2
|
|
||||||
done
|
|
||||||
|
|
||||||
## check root dir
|
|
||||||
if [ ! -d $APP_WAR_EXTRACTED ]; then
|
|
||||||
extract_war
|
|
||||||
fi
|
|
||||||
|
|
||||||
## run scripts
|
|
||||||
if [ -d $UPGRADE_DB_SCRIPT_DIR ]; then
|
|
||||||
cd $UPGRADE_DB_SCRIPT_DIR
|
|
||||||
for x in `find . -name "*.sql"|sort`; do
|
|
||||||
echo "[run] " $x " ..."
|
|
||||||
upgrade_db $x
|
|
||||||
if [ ! $? -eq 0 ]; then
|
|
||||||
echo "Failed result with" $x
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
## touch upgrade footprint
|
|
||||||
if [ ! -f /opt/cskefu/upgrade.his ]; then
|
|
||||||
touch /opt/cskefu/upgrade.his
|
|
||||||
fi
|
|
@ -1,54 +0,0 @@
|
|||||||
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
|
|
||||||
# newer versions of the distribution.
|
|
||||||
deb http://archive.ubuntu.com/ubuntu/ bionic main restricted
|
|
||||||
# deb-src http://archive.ubuntu.com/ubuntu/ bionic main restricted
|
|
||||||
|
|
||||||
## Major bug fix updates produced after the final release of the
|
|
||||||
## distribution.
|
|
||||||
deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted
|
|
||||||
# deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted
|
|
||||||
|
|
||||||
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
|
|
||||||
## team. Also, please note that software in universe WILL NOT receive any
|
|
||||||
## review or updates from the Ubuntu security team.
|
|
||||||
deb http://archive.ubuntu.com/ubuntu/ bionic universe
|
|
||||||
# deb-src http://archive.ubuntu.com/ubuntu/ bionic universe
|
|
||||||
deb http://archive.ubuntu.com/ubuntu/ bionic-updates universe
|
|
||||||
# deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates universe
|
|
||||||
|
|
||||||
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
|
|
||||||
## team, and may not be under a free licence. Please satisfy yourself as to
|
|
||||||
## your rights to use the software. Also, please note that software in
|
|
||||||
## multiverse WILL NOT receive any review or updates from the Ubuntu
|
|
||||||
## security team.
|
|
||||||
deb http://archive.ubuntu.com/ubuntu/ bionic multiverse
|
|
||||||
# deb-src http://archive.ubuntu.com/ubuntu/ bionic multiverse
|
|
||||||
deb http://archive.ubuntu.com/ubuntu/ bionic-updates multiverse
|
|
||||||
# deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates multiverse
|
|
||||||
|
|
||||||
## N.B. software from this repository may not have been tested as
|
|
||||||
## extensively as that contained in the main release, although it includes
|
|
||||||
## newer versions of some applications which may provide useful features.
|
|
||||||
## Also, please note that software in backports WILL NOT receive any review
|
|
||||||
## or updates from the Ubuntu security team.
|
|
||||||
deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
|
|
||||||
# deb-src http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
|
|
||||||
|
|
||||||
## Uncomment the following two lines to add software from Canonical's
|
|
||||||
## 'partner' repository.
|
|
||||||
## This software is not part of Ubuntu, but is offered by Canonical and the
|
|
||||||
## respective vendors as a service to Ubuntu users.
|
|
||||||
# deb http://archive.canonical.com/ubuntu bionic partner
|
|
||||||
# deb-src http://archive.canonical.com/ubuntu bionic partner
|
|
||||||
|
|
||||||
deb http://security.ubuntu.com/ubuntu/ bionic-security main restricted
|
|
||||||
# deb-src http://security.ubuntu.com/ubuntu/ bionic-security main restricted
|
|
||||||
deb http://security.ubuntu.com/ubuntu/ bionic-security universe
|
|
||||||
# deb-src http://security.ubuntu.com/ubuntu/ bionic-security universe
|
|
||||||
deb http://security.ubuntu.com/ubuntu/ bionic-security multiverse
|
|
||||||
# deb-src http://security.ubuntu.com/ubuntu/ bionic-security multiverse
|
|
||||||
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
|
|
||||||
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
|
|
||||||
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
|
|
||||||
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
|
|
||||||
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
|
|
@ -1,27 +0,0 @@
|
|||||||
println() {
|
|
||||||
# timestamp=`date +%Y%m%d%H%M%S`
|
|
||||||
timestamp=$(date "+%Y-%m-%d %H:%M:%S")
|
|
||||||
echo $timestamp $@
|
|
||||||
}
|
|
||||||
|
|
||||||
# Following regex is based on https://tools.ietf.org/html/rfc3986#appendix-B with
|
|
||||||
# additional sub-expressions to split authority into userinfo, host and port
|
|
||||||
#
|
|
||||||
readonly JDBC_URI_REGEX='^jdbc:mysql:(//((([^:/?#]+)@)?([^:/?#]+)(:([0-9]+))?))?(/([^?#]*))(\?([^#]*))?(#(.*))?'
|
|
||||||
# ↑↑ ↑ ↑↑↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
||||||
# |2 scheme | ||6 userinfo 7 host | 9 port | 11 rpath | 13 query | 15 fragment
|
|
||||||
# 1 scheme: | |5 userinfo@ 8 :… 10 path 12 ?… 14 #…
|
|
||||||
# | 4 authority
|
|
||||||
# 3 //…
|
|
||||||
|
|
||||||
parse_host () {
|
|
||||||
[[ "$@" =~ $JDBC_URI_REGEX ]] && echo "${BASH_REMATCH[5]}"
|
|
||||||
}
|
|
||||||
|
|
||||||
parse_port () {
|
|
||||||
[[ "$@" =~ $JDBC_URI_REGEX ]] && echo "${BASH_REMATCH[7]}"
|
|
||||||
}
|
|
||||||
|
|
||||||
parse_dbname () {
|
|
||||||
[[ "$@" =~ $JDBC_URI_REGEX ]] && echo "${BASH_REMATCH[9]}"
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
FROM ubuntu:18.04
|
|
||||||
MAINTAINER Hai Liang Wang <hain@chatopera.com>
|
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
|
||||||
|
|
||||||
# COPY $PWD/assets/aliyun.sources.list /etc/apt/sources.list
|
|
||||||
# install amazon jdk corretto
|
|
||||||
COPY $PWD/assets/install-corretto-8.sh /opt
|
|
||||||
RUN chmod +x /opt/install-corretto-8.sh && /opt/install-corretto-8.sh
|
|
||||||
|
|
||||||
# install other lib and configure timezone
|
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get install --no-install-recommends -y tzdata iputils-ping mysql-client-5.7 zip unzip vim-tiny libfontconfig1 libfreetype6 && \
|
|
||||||
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
|
|
||||||
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure --frontend noninteractive tzdata && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Set the locale
|
|
||||||
ENV LANG C.UTF-8
|
|
||||||
ENV LANGUAGE en_US:en
|
|
||||||
ENV LC_ALL C.UTF-8
|
|
||||||
|
|
||||||
# set ENVs
|
|
||||||
ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-amazon-corretto
|
|
||||||
ENV PATH=$PATH:$JAVA_HOME/bin
|
|
@ -1,27 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
###########################################
|
|
||||||
#
|
|
||||||
###########################################
|
|
||||||
|
|
||||||
# constants
|
|
||||||
baseDir=$(cd `dirname "$0"`;pwd)
|
|
||||||
JDKNAME=java-1.8.0-amazon-corretto-jdk.deb
|
|
||||||
## fast download with internal addr
|
|
||||||
## replace JDKURL when builing outside chatopera machines, java-1.8.0-amazon-corretto-jdk_8.212.04-2_amd64.deb can be download from Amazon Official Site.
|
|
||||||
## https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html
|
|
||||||
JDKURL=http://192.168.2.217:30080/vendors/java/java-1.8.0-amazon-corretto-jdk_8.212.04-2_amd64.deb
|
|
||||||
|
|
||||||
# functions
|
|
||||||
|
|
||||||
# main
|
|
||||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
|
||||||
apt-get update && apt-get install -y --no-install-recommends publicsuffix ca-certificates wget java-common
|
|
||||||
cd /tmp
|
|
||||||
wget --no-check-certificate -O $JDKNAME $JDKURL
|
|
||||||
dpkg --install $JDKNAME
|
|
||||||
rm -rf $JDKNAME
|
|
||||||
java -version
|
|
||||||
|
|
||||||
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-amazon-corretto
|
|
||||||
export PATH=$PATH:$JAVA_HOME/bin
|
|
||||||
rm -rf $0
|
|
@ -1,33 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
###########################################
|
|
||||||
#
|
|
||||||
###########################################
|
|
||||||
|
|
||||||
# constants
|
|
||||||
baseDir=$(cd `dirname "$0"`;pwd)
|
|
||||||
appHome=$baseDir
|
|
||||||
# registryName=
|
|
||||||
imagename=chatopera/java-1.8.0-amazon-corretto-jdk
|
|
||||||
PACKAGE_VERSION=1.0.0
|
|
||||||
TIMESTAMP=`date "+%Y%m%d.%H%M%S"`
|
|
||||||
|
|
||||||
# functions
|
|
||||||
|
|
||||||
# main
|
|
||||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
|
||||||
# build
|
|
||||||
cd $appHome
|
|
||||||
|
|
||||||
docker build --build-arg \
|
|
||||||
--no-cache \
|
|
||||||
--force-rm=true --tag $imagename:$PACKAGE_VERSION .
|
|
||||||
|
|
||||||
set -x
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
docker tag $imagename:$PACKAGE_VERSION $imagename:develop
|
|
||||||
docker push $imagename:$PACKAGE_VERSION
|
|
||||||
docker push $imagename:develop
|
|
||||||
else
|
|
||||||
echo "Build contact-center failure."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
@ -1,127 +0,0 @@
|
|||||||
#优客服
|
|
||||||
优客服官方技术支持QQ群(555834343,目前项目已发布v3.8.0版本,加入QQ群可以了解最新进度和技术问题咨询。):
|
|
||||||
|
|
||||||
[](http://shang.qq.com/wpa/qunwpa?idkey=637134af30a27220211c843d801ada14700aca69ee8f4acf13f795fe38ea7b94)
|
|
||||||
|
|
||||||
优客服,是一个多渠道融合的客户支持服务平台,包含WebIM,微信,电话,邮件,短信等接入渠道、智能机器人
|
|
||||||
|
|
||||||
#访问地址
|
|
||||||
DEMO访问地址:[优客服(UCKeFu-WebIM)](http://uk.ukewo.cn/) , 访问账号:admin,密码:123456
|
|
||||||
|
|
||||||
#优客服组件结构
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
**1. WebIM在线客服**
|
|
||||||
优客服提供WebIM功能,在线坐席能够通过工作台操作界面,接收来自WebIM的咨询请求,优客服通过整合多个渠道来源,让坐席在同一个工作界面上处理来自PC端、移动端、微信端,微博等渠道的服务请求。
|
|
||||||
**2. 社交媒体**
|
|
||||||
接入微信和微博渠道,将社交媒体渠道的的咨询请求接入进入 优客服 坐席工作平台,让客服统一响应和受理
|
|
||||||
**3. 邮件、短信**
|
|
||||||
多种邮件处理方式,能够将邮箱的消息转为坐席的待处理任务,可以将待处理任务或邮件转为工单
|
|
||||||
|
|
||||||
|
|
||||||
项目组成:
|
|
||||||
|
|
||||||
**1. 前端:LayUI + Freemarker**
|
|
||||||
|
|
||||||
**1. 后端:Spring Boot**
|
|
||||||
|
|
||||||
**1. 数据库:MySQL+Elasticsearch**
|
|
||||||
|
|
||||||
项目运行方式:
|
|
||||||
|
|
||||||
### 1. 将代码拉取下来
|
|
||||||
|
|
||||||
### 1. 编译pom.xml文件,下载好jar包
|
|
||||||
本项目有四个依赖包,jave 和Mondrian,aliyun-java-sdk-core、aliyun-java-sdk-dysmsapi通过以下指令加入到本地Mavenue仓库:
|
|
||||||
|
|
||||||
|
|
||||||
1、mvn install:install-file -Dfile=src/main/resources/WEB-INF/lib/jave-1.0.2.jar -DgroupId=lt.jave -DartifactId=jave -Dversion=1.0.2 -Dpackaging=jar
|
|
||||||
|
|
||||||
2、mvn install:install-file -Dfile=src/main/resources/WEB-INF/lib/mondrian-3.7.0.jar -DgroupId=mondrian -DartifactId=mondrian -Dversion=3.7.0 -Dpackaging=jar
|
|
||||||
|
|
||||||
3、执行添加 阿里云jar
|
|
||||||
mvn install:install-file -Dfile=src/main/resources/WEB-INF/lib/aliyun-java-sdk-core-3.3.1.jar -DgroupId=com.aliyun -DartifactId=aliyun-java-sdk-core -Dversion=3.3.1 -Dpackaging=jar
|
|
||||||
|
|
||||||
4、阿里大鱼jar
|
|
||||||
mvn install:install-file -Dfile=src/main/resources/WEB-INF/lib/aliyun-java-sdk-dysmsapi-1.0.0.jar -DgroupId=com.aliyun -DartifactId=aliyun-java-sdk-dysmsapi -Dversion=1.0.0 -Dpackaging=jar
|
|
||||||
**确保两个依赖都安装成功**
|
|
||||||
|
|
||||||
### 1. 将项目按照maven格式配置好
|
|
||||||
### 1. 将ukefu.sql脚本在mysql数据库里运行,创建数据库和表
|
|
||||||
|
|
||||||
|
|
||||||
### 1. 配置项目中的application.properties文件中的数据库连接
|
|
||||||
|
|
||||||
### 2. 将生成的WAR文件部署到 Tomcat 即可。
|
|
||||||
|
|
||||||
|
|
||||||
运行一下查看效果吧!
|
|
||||||
|
|
||||||
|
|
||||||
**优客服将会分版本实现全部的功能,V1.0中将包含以下部分功能:**
|
|
||||||
**1、后台管理**
|
|
||||||
系统后台管理功能,包括系统用户管理,客服坐席管理,系统角色管理、组织机构管理,WebIM接入管理,接入设置
|
|
||||||
**2、WebIM在线客服**
|
|
||||||
访客管理、访客邀请、WebIM网站端多风格切换,访客用户唯一身份识别与跟踪,老用户识别,IP与地理位置识别转换,访客轨迹,访客停留记录,访客实时对话,通信消息,表情包,客户消息多媒体类型消息处理;坐席与用户统一路由排队(ACD),实时提示坐席当前客户正在输入的内容,坐席状态切换、坐席绩效管理
|
|
||||||
**3、联系人管理**
|
|
||||||
公共联系人,私有联系人,联系人贡献与分配
|
|
||||||
**4、联络记录**
|
|
||||||
坐席与客户之间的通信记录,包含WebIM对话,微信对话(V2.0功能)等
|
|
||||||
**5、常用语(FAQ)维护**
|
|
||||||
公共常用语维护(话术),坐席私有常用语维护
|
|
||||||
|
|
||||||
|
|
||||||
优客服全渠道客服系统产品介绍
|
|
||||||
优客服,是一个全渠道融合的客户支持服务平台,聚合8大客服渠道,帮助各种行业各种规模的企业建立完整客服体系。
|
|
||||||
通过将邮件、短信、电话语音、WebIM在线客服、微信、微博、H5页面、APP接口8个渠道来源的客户服务请求与对话汇聚在一个管理平台,用统一的方式来响应和支撑客户服务。
|
|
||||||
1、渠道融合,建立统一客服模式
|
|
||||||
|
|
||||||
• 语音
|
|
||||||
接入企业的呼叫中心,让客服在一个管理界面接听呼入的电话并可以方便快捷的呼出,通过工单记录和后续跟进客户
|
|
||||||
• WebIM在线客服
|
|
||||||
让您的客服在一个节目和各个渠道来源的用户对话,实时沟通,并能够为对话记录质检和创建业务请求方便后续跟进和处理
|
|
||||||
• 社交媒体
|
|
||||||
集成微信和微博渠道,将社交网络的服务请求集中到优客服,客服坐席统一响应和受理
|
|
||||||
• 邮件短信
|
|
||||||
将发至客服邮箱的邮件转为服务请求,通过任务受理和追踪,并能够通过发送邮件或短信快速回复客户客户
|
|
||||||
2、业务支撑,提供快速服务请求
|
|
||||||
|
|
||||||
• 简单易用的界面与交互
|
|
||||||
为客户和坐席人员提供友好的操作界面,方便通过标准方式进行高效沟通
|
|
||||||
• 跨部门协同解决客户问题
|
|
||||||
连接您的所有职能人员,从销售客服到技术支持
|
|
||||||
• 问题流转与变更全纪录
|
|
||||||
客户的所有交谈记录和问题工单处理事件都会完整记录,方便任何客服接手问题处理,有效解决客户问题
|
|
||||||
3、数据分析,深入了解客服业务状况
|
|
||||||
|
|
||||||
• 全渠道数据概况一目了然
|
|
||||||
了解所有渠道的客户服务状况、来源比例,了解响应时间与服务时间,按不同维度统计
|
|
||||||
• 优化客服坐席资源分配
|
|
||||||
按照不同的维度统计更细致的客户坐席服务变化趋势,查看每一天的坐席绩效
|
|
||||||
• 客群分类,建立客户全景式图
|
|
||||||
集成企业内部客户数据,分析客户价值,创建客户标签
|
|
||||||
|
|
||||||
**微信接入渠道演示微信公众号**
|
|
||||||

|
|
||||||
|
|
||||||
优客服部分产品组件截图
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||

|
|
@ -1,2 +1,3 @@
|
|||||||
*
|
data
|
||||||
|
logs
|
||||||
!.gitignore
|
!.gitignore
|
302
containerization/docker-compose.yml
Normal file
302
containerization/docker-compose.yml
Normal file
@ -0,0 +1,302 @@
|
|||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
cskefu-web-gateway:
|
||||||
|
image: cskefu/cskefu-web-gateway
|
||||||
|
# container_name: cskefu-web-gateway
|
||||||
|
restart: always
|
||||||
|
# ports:
|
||||||
|
# - "${CSKEFU_WEB_GATEWAY_PORT:-8080}:8080"
|
||||||
|
expose:
|
||||||
|
- 8080
|
||||||
|
volumes:
|
||||||
|
- ./cskefu/logs:/cskefu/logs
|
||||||
|
deploy:
|
||||||
|
replicas: 3
|
||||||
|
environment:
|
||||||
|
- "JAVA_OPTS=-Xmx${CSKEFU_JAVA_XMX:-512m} -Xms${CSKEFU_JAVA_XMS:-512m} -XX:PermSize=128m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -Dio.netty.tryReflectionSetAccessible=true --illegal-access=warn"
|
||||||
|
- LOGGING_LEVEL_ROOT=${LOGGING_LEVEL_ROOT:-INFO}
|
||||||
|
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/cskefu?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2B8
|
||||||
|
- SPRING_DATASOURCE_USERNAME=root
|
||||||
|
- SPRING_DATASOURCE_PASSWORD=${DB_PASSWD:-123456}
|
||||||
|
# - SPRING_DATASOURCE_HIKARI_MAXIMUM_POOL_SIZE=100
|
||||||
|
- SPRING_DATA_REDIS_HOST=redis
|
||||||
|
- SPRING_DATA_REDIS_PORT=6379
|
||||||
|
- SPRING_RABBITMQ_ADDRESSES=rabbitmq
|
||||||
|
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER_ADDR=nacos:8848
|
||||||
|
- CACHE_SETUP_STRATEGY=${CACHE_SETUP_STRATEGY:-create_by_force}
|
||||||
|
- BOT_THRESHOLD_FAQ_BEST_REPLY=${BOT_THRESHOLD_FAQ_BEST_REPLY:-0.9}
|
||||||
|
- BOT_THRESHOLD_FAQ_SUGG_REPLY=${BOT_THRESHOLD_FAQ_SUGG_REPLY:-0.1}
|
||||||
|
- TONGJI_BAIDU_SITEKEY=${TONGJI_BAIDU_SITEKEY:-placeholder}
|
||||||
|
- EXTRAS_LOGIN_BANNER=${NOTICE_LOGIN_BANNER:-off}
|
||||||
|
- EXTRAS_LOGIN_CHATBOX=${EXTRAS_LOGIN_CHATBOX:-off}
|
||||||
|
- EXTRAS_AUTH_SUPER_ADMIN_PASS=${EXTRAS_AUTH_SUPER_ADMIN_PASS:-}
|
||||||
|
- EXTRAS_LOG_REQUEST=${EXTRAS_LOG_REQUEST:-off}
|
||||||
|
depends_on:
|
||||||
|
- cskefu-auth-service
|
||||||
|
- cskefu-manager-service
|
||||||
|
|
||||||
|
cskefu-manager-service:
|
||||||
|
image: cskefu/cskefu-manager-service
|
||||||
|
# container_name: cskefu-manager-service
|
||||||
|
restart: always
|
||||||
|
# ports:
|
||||||
|
# - "${CSKEFU_MANAGER_SERVICE_PORT:-8081}:8081"
|
||||||
|
expose:
|
||||||
|
- 8081
|
||||||
|
volumes:
|
||||||
|
- ./cskefu/logs:/cskefu/logs
|
||||||
|
environment:
|
||||||
|
- "JAVA_OPTS=-Xmx${CSKEFU_JAVA_XMX:-512m} -Xms${CSKEFU_JAVA_XMS:-512m} -XX:PermSize=128m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -Dio.netty.tryReflectionSetAccessible=true --illegal-access=warn"
|
||||||
|
- LOGGING_LEVEL_ROOT=${LOGGING_LEVEL_ROOT:-INFO}
|
||||||
|
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/cskefu?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2B8
|
||||||
|
- SPRING_DATASOURCE_USERNAME=root
|
||||||
|
- SPRING_DATASOURCE_PASSWORD=${DB_PASSWD:-123456}
|
||||||
|
# - SPRING_DATASOURCE_HIKARI_MAXIMUM_POOL_SIZE=100
|
||||||
|
- SPRING_DATA_REDIS_HOST=redis
|
||||||
|
- SPRING_DATA_REDIS_PORT=6379
|
||||||
|
- SPRING_RABBITMQ_ADDRESSES=rabbitmq
|
||||||
|
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER_ADDR=nacos:8848
|
||||||
|
- CACHE_SETUP_STRATEGY=${CACHE_SETUP_STRATEGY:-create_by_force}
|
||||||
|
- BOT_THRESHOLD_FAQ_BEST_REPLY=${BOT_THRESHOLD_FAQ_BEST_REPLY:-0.9}
|
||||||
|
- BOT_THRESHOLD_FAQ_SUGG_REPLY=${BOT_THRESHOLD_FAQ_SUGG_REPLY:-0.1}
|
||||||
|
- TONGJI_BAIDU_SITEKEY=${TONGJI_BAIDU_SITEKEY:-placeholder}
|
||||||
|
- EXTRAS_LOGIN_BANNER=${NOTICE_LOGIN_BANNER:-off}
|
||||||
|
- EXTRAS_LOGIN_CHATBOX=${EXTRAS_LOGIN_CHATBOX:-off}
|
||||||
|
- EXTRAS_AUTH_SUPER_ADMIN_PASS=${EXTRAS_AUTH_SUPER_ADMIN_PASS:-}
|
||||||
|
- EXTRAS_LOG_REQUEST=${EXTRAS_LOG_REQUEST:-off}
|
||||||
|
depends_on:
|
||||||
|
- mysql
|
||||||
|
- redis
|
||||||
|
- nacos
|
||||||
|
- rabbitmq
|
||||||
|
|
||||||
|
cskefu-auth-service:
|
||||||
|
image: cskefu/cskefu-auth-service
|
||||||
|
# container_name: cskefu-auth-service
|
||||||
|
restart: always
|
||||||
|
# ports:
|
||||||
|
# - "${CSKEFU_AUTH_SERVICE_PORT:-8082}:8082"
|
||||||
|
expose:
|
||||||
|
- 8082
|
||||||
|
volumes:
|
||||||
|
- ./cskefu/logs:/cskefu/logs
|
||||||
|
environment:
|
||||||
|
- "JAVA_OPTS=-Xmx${CSKEFU_JAVA_XMX:-512m} -Xms${CSKEFU_JAVA_XMS:-512m} -XX:PermSize=128m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -Dio.netty.tryReflectionSetAccessible=true --illegal-access=warn"
|
||||||
|
- LOGGING_LEVEL_ROOT=${LOGGING_LEVEL_ROOT:-INFO}
|
||||||
|
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/cskefu?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2B8
|
||||||
|
- SPRING_DATASOURCE_USERNAME=root
|
||||||
|
- SPRING_DATASOURCE_PASSWORD=${DB_PASSWD:-123456}
|
||||||
|
# - SPRING_DATASOURCE_HIKARI_MAXIMUM_POOL_SIZE=100
|
||||||
|
- SPRING_DATA_REDIS_HOST=redis
|
||||||
|
- SPRING_DATA_REDIS_PORT=6379
|
||||||
|
- SPRING_RABBITMQ_ADDRESSES=rabbitmq
|
||||||
|
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER_ADDR=nacos:8848
|
||||||
|
- CACHE_SETUP_STRATEGY=${CACHE_SETUP_STRATEGY:-create_by_force}
|
||||||
|
- BOT_THRESHOLD_FAQ_BEST_REPLY=${BOT_THRESHOLD_FAQ_BEST_REPLY:-0.9}
|
||||||
|
- BOT_THRESHOLD_FAQ_SUGG_REPLY=${BOT_THRESHOLD_FAQ_SUGG_REPLY:-0.1}
|
||||||
|
- TONGJI_BAIDU_SITEKEY=${TONGJI_BAIDU_SITEKEY:-placeholder}
|
||||||
|
- EXTRAS_LOGIN_BANNER=${NOTICE_LOGIN_BANNER:-off}
|
||||||
|
- EXTRAS_LOGIN_CHATBOX=${EXTRAS_LOGIN_CHATBOX:-off}
|
||||||
|
- EXTRAS_AUTH_SUPER_ADMIN_PASS=${EXTRAS_AUTH_SUPER_ADMIN_PASS:-}
|
||||||
|
- EXTRAS_LOG_REQUEST=${EXTRAS_LOG_REQUEST:-off}
|
||||||
|
depends_on:
|
||||||
|
- mysql
|
||||||
|
- redis
|
||||||
|
- nacos
|
||||||
|
- rabbitmq
|
||||||
|
|
||||||
|
cskefu-plugin-service:
|
||||||
|
image: cskefu/cskefu-plugin-service
|
||||||
|
# container_name: cskefu-plugin-service
|
||||||
|
restart: always
|
||||||
|
# ports:
|
||||||
|
# - "${CSKEFU_PLUGIN_SERVICE_PORT:-8083}:8083"
|
||||||
|
expose:
|
||||||
|
- 8083
|
||||||
|
volumes:
|
||||||
|
- ./cskefu/logs:/cskefu/logs
|
||||||
|
environment:
|
||||||
|
- "JAVA_OPTS=-Xmx${CSKEFU_JAVA_XMX:-512m} -Xms${CSKEFU_JAVA_XMS:-512m} -XX:PermSize=128m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -Dio.netty.tryReflectionSetAccessible=true --illegal-access=warn"
|
||||||
|
- LOGGING_LEVEL_ROOT=${LOGGING_LEVEL_ROOT:-INFO}
|
||||||
|
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/cskefu?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2B8
|
||||||
|
- SPRING_DATASOURCE_USERNAME=root
|
||||||
|
- SPRING_DATASOURCE_PASSWORD=${DB_PASSWD:-123456}
|
||||||
|
# - SPRING_DATASOURCE_HIKARI_MAXIMUM_POOL_SIZE=100
|
||||||
|
- SPRING_DATA_REDIS_HOST=redis
|
||||||
|
- SPRING_DATA_REDIS_PORT=6379
|
||||||
|
- SPRING_RABBITMQ_ADDRESSES=rabbitmq
|
||||||
|
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER_ADDR=nacos:8848
|
||||||
|
- CACHE_SETUP_STRATEGY=${CACHE_SETUP_STRATEGY:-create_by_force}
|
||||||
|
- BOT_THRESHOLD_FAQ_BEST_REPLY=${BOT_THRESHOLD_FAQ_BEST_REPLY:-0.9}
|
||||||
|
- BOT_THRESHOLD_FAQ_SUGG_REPLY=${BOT_THRESHOLD_FAQ_SUGG_REPLY:-0.1}
|
||||||
|
- TONGJI_BAIDU_SITEKEY=${TONGJI_BAIDU_SITEKEY:-placeholder}
|
||||||
|
- EXTRAS_LOGIN_BANNER=${NOTICE_LOGIN_BANNER:-off}
|
||||||
|
- EXTRAS_LOGIN_CHATBOX=${EXTRAS_LOGIN_CHATBOX:-off}
|
||||||
|
- EXTRAS_AUTH_SUPER_ADMIN_PASS=${EXTRAS_AUTH_SUPER_ADMIN_PASS:-}
|
||||||
|
- EXTRAS_LOG_REQUEST=${EXTRAS_LOG_REQUEST:-off}
|
||||||
|
depends_on:
|
||||||
|
- mysql
|
||||||
|
- redis
|
||||||
|
- nacos
|
||||||
|
- rabbitmq
|
||||||
|
|
||||||
|
cskefu-channel-wechat-service:
|
||||||
|
image: cskefu/cskefu-channel-wechat-service
|
||||||
|
# container_name: cskefu-channel-wechat-service
|
||||||
|
restart: always
|
||||||
|
# ports:
|
||||||
|
# - "${CSKEFU_CHANNEL_WECHAT_SERVICE_PORT:-8084}:8084"
|
||||||
|
expose:
|
||||||
|
- 8084
|
||||||
|
volumes:
|
||||||
|
- ./cskefu/logs:/cskefu/logs
|
||||||
|
environment:
|
||||||
|
- "JAVA_OPTS=-Xmx${CSKEFU_JAVA_XMX:-512m} -Xms${CSKEFU_JAVA_XMS:-512m} -XX:PermSize=128m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -Dio.netty.tryReflectionSetAccessible=true --illegal-access=warn"
|
||||||
|
- LOGGING_LEVEL_ROOT=${LOGGING_LEVEL_ROOT:-INFO}
|
||||||
|
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/cskefu?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2B8
|
||||||
|
- SPRING_DATASOURCE_USERNAME=root
|
||||||
|
- SPRING_DATASOURCE_PASSWORD=${DB_PASSWD:-123456}
|
||||||
|
# - SPRING_DATASOURCE_HIKARI_MAXIMUM_POOL_SIZE=100
|
||||||
|
- SPRING_DATA_REDIS_HOST=redis
|
||||||
|
- SPRING_DATA_REDIS_PORT=6379
|
||||||
|
- SPRING_RABBITMQ_ADDRESSES=rabbitmq
|
||||||
|
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER_ADDR=nacos:8848
|
||||||
|
- CACHE_SETUP_STRATEGY=${CACHE_SETUP_STRATEGY:-create_by_force}
|
||||||
|
- BOT_THRESHOLD_FAQ_BEST_REPLY=${BOT_THRESHOLD_FAQ_BEST_REPLY:-0.9}
|
||||||
|
- BOT_THRESHOLD_FAQ_SUGG_REPLY=${BOT_THRESHOLD_FAQ_SUGG_REPLY:-0.1}
|
||||||
|
- TONGJI_BAIDU_SITEKEY=${TONGJI_BAIDU_SITEKEY:-placeholder}
|
||||||
|
- EXTRAS_LOGIN_BANNER=${NOTICE_LOGIN_BANNER:-off}
|
||||||
|
- EXTRAS_LOGIN_CHATBOX=${EXTRAS_LOGIN_CHATBOX:-off}
|
||||||
|
- EXTRAS_AUTH_SUPER_ADMIN_PASS=${EXTRAS_AUTH_SUPER_ADMIN_PASS:-}
|
||||||
|
- EXTRAS_LOG_REQUEST=${EXTRAS_LOG_REQUEST:-off}
|
||||||
|
depends_on:
|
||||||
|
- cskefu-auth-service
|
||||||
|
|
||||||
|
cskefu-websocket-service:
|
||||||
|
image: cskefu/cskefu-websocket-service
|
||||||
|
# container_name: cskefu-websocket-service
|
||||||
|
restart: always
|
||||||
|
# ports:
|
||||||
|
# - "${CSKEFU_WEBSOCKET_SERVICE_PORT:-10000}:10000"
|
||||||
|
expose:
|
||||||
|
- ${CSKEFU_WEBSOCKET_SERVICE_PORT:-10000}
|
||||||
|
volumes:
|
||||||
|
- ./cskefu/logs:/cskefu/logs
|
||||||
|
deploy:
|
||||||
|
replicas: 3
|
||||||
|
environment:
|
||||||
|
- "JAVA_OPTS=-Xmx${CSKEFU_JAVA_XMX:-512m} -Xms${CSKEFU_JAVA_XMS:-512m} -XX:PermSize=128m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -Dio.netty.tryReflectionSetAccessible=true --illegal-access=warn"
|
||||||
|
- LOGGING_LEVEL_ROOT=${LOGGING_LEVEL_ROOT:-INFO}
|
||||||
|
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/cskefu?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2B8
|
||||||
|
- SPRING_DATASOURCE_USERNAME=root
|
||||||
|
- SPRING_DATASOURCE_PASSWORD=${DB_PASSWD:-123456}
|
||||||
|
# - SPRING_DATASOURCE_HIKARI_MAXIMUM_POOL_SIZE=100
|
||||||
|
- SPRING_DATA_REDIS_HOST=redis
|
||||||
|
- SPRING_DATA_REDIS_PORT=6379
|
||||||
|
- SPRING_RABBITMQ_ADDRESSES=rabbitmq
|
||||||
|
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER_ADDR=nacos:8848
|
||||||
|
- CACHE_SETUP_STRATEGY=${CACHE_SETUP_STRATEGY:-create_by_force}
|
||||||
|
- BOT_THRESHOLD_FAQ_BEST_REPLY=${BOT_THRESHOLD_FAQ_BEST_REPLY:-0.9}
|
||||||
|
- BOT_THRESHOLD_FAQ_SUGG_REPLY=${BOT_THRESHOLD_FAQ_SUGG_REPLY:-0.1}
|
||||||
|
- TONGJI_BAIDU_SITEKEY=${TONGJI_BAIDU_SITEKEY:-placeholder}
|
||||||
|
- EXTRAS_LOGIN_BANNER=${NOTICE_LOGIN_BANNER:-off}
|
||||||
|
- EXTRAS_LOGIN_CHATBOX=${EXTRAS_LOGIN_CHATBOX:-off}
|
||||||
|
- EXTRAS_AUTH_SUPER_ADMIN_PASS=${EXTRAS_AUTH_SUPER_ADMIN_PASS:-}
|
||||||
|
- EXTRAS_LOG_REQUEST=${EXTRAS_LOG_REQUEST:-off}
|
||||||
|
depends_on:
|
||||||
|
- mysql
|
||||||
|
- redis
|
||||||
|
- nacos
|
||||||
|
- rabbitmq
|
||||||
|
|
||||||
|
mysql:
|
||||||
|
image: cskefu/mysql-8.1:nacos
|
||||||
|
container_name: mysql
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-123456}
|
||||||
|
- MYSQL_ROOT_PASSWORD=${MYSQL_PASSWORD:-123456}
|
||||||
|
ports:
|
||||||
|
- "${MYSQL_PORT:-3306}:3306"
|
||||||
|
expose:
|
||||||
|
- 3306
|
||||||
|
volumes:
|
||||||
|
- ./mysql/data:/var/lib/mysql
|
||||||
|
command: --max_allowed_packet=32505856
|
||||||
|
|
||||||
|
# https://hub.docker.com/r/nacos/nacos-server
|
||||||
|
nacos:
|
||||||
|
image: nacos/nacos-server:v2.2.3-slim
|
||||||
|
container_name: nacos
|
||||||
|
environment:
|
||||||
|
MODE: standalone
|
||||||
|
SPRING_DATASOURCE_PLATFORM: mysql
|
||||||
|
MYSQL_SERVICE_HOST: mysql
|
||||||
|
MYSQL_SERVICE_PORT: 3306
|
||||||
|
MYSQL_SERVICE_DB_NAME: nacos_config
|
||||||
|
MYSQL_SERVICE_USER: ${MYSQL_USER:-root}
|
||||||
|
MYSQL_SERVICE_PASSWORD: ${MYSQL_PASSWORD:-123456}
|
||||||
|
MYSQL_SERVICE_DB_PARAM: "characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&serverTimezone=UTC"
|
||||||
|
JVM_XMS: 256m
|
||||||
|
JVM_XMX: 512m
|
||||||
|
JVM_XMN: 256m
|
||||||
|
volumes:
|
||||||
|
- ./nacos/logs:/home/nacos/logs
|
||||||
|
ports:
|
||||||
|
- "${NACOS_PORT:-8848}:8848"
|
||||||
|
- "${NACOS_CLIENT_GRPC_PORT:-9848}:9848"
|
||||||
|
- "${NACOS_SERVER_GRPC_PORT:-9849}:9849"
|
||||||
|
expose:
|
||||||
|
- 8848
|
||||||
|
- 9848
|
||||||
|
- 9849
|
||||||
|
restart: always
|
||||||
|
depends_on:
|
||||||
|
- mysql
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis:7.2.1-alpine3.18
|
||||||
|
container_name: redis
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ./redis/data:/cskefu/redis
|
||||||
|
ports:
|
||||||
|
- "${REDIS_PORT:-6379}:6379"
|
||||||
|
expose:
|
||||||
|
- 6379
|
||||||
|
|
||||||
|
rabbitmq:
|
||||||
|
image: rabbitmq:3.12-management
|
||||||
|
container_name: rabbitmq
|
||||||
|
restart: always
|
||||||
|
hostname: rabbitmq
|
||||||
|
ports:
|
||||||
|
- "${RABBITMQ_CLIENT_PORT:-5672}:5672"
|
||||||
|
- "${RABBITMQ_HTTP_PORT:-15672}:15672"
|
||||||
|
expose:
|
||||||
|
- 5672
|
||||||
|
- 15672
|
||||||
|
volumes:
|
||||||
|
- ./rabbitmq/data:/var/lib/rabbitmq
|
||||||
|
- ./rabbitmq/hosts:/etc/hosts
|
||||||
|
environment:
|
||||||
|
- RABBITMQ_NODENAME=rabbitmq
|
||||||
|
- RABBITMQ_DEFAULT_VHOST='/'
|
||||||
|
- RABBITMQ_DEFAULT_USER=guest
|
||||||
|
- RABBITMQ_DEFAULT_PASS=guest
|
||||||
|
|
||||||
|
openresty:
|
||||||
|
image: openresty/openresty:1.21.4.2-0-alpine-apk
|
||||||
|
container_name: openresty
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "${NGINX_HTTP_PORT:-80}:80"
|
||||||
|
- "${NGINX_SSL_PORT:-443}:443"
|
||||||
|
volumes:
|
||||||
|
- ./openresty/logs:/usr/local/openresty/nginx/logs
|
||||||
|
- ./openresty/conf.d:/etc/nginx/conf.d
|
||||||
|
- ./openresty/certs:/certs
|
||||||
|
- ./openresty/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf
|
||||||
|
depends_on:
|
||||||
|
- cskefu-web-gateway
|
||||||
|
- cskefu-websocket-service
|
7
containerization/dockerfiles/mysql-8.1-nacos
Normal file
7
containerization/dockerfiles/mysql-8.1-nacos
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
FROM mysql:8.1
|
||||||
|
|
||||||
|
ADD nacos_mysql.sql /nacos/nacos_mysql.sql
|
||||||
|
|
||||||
|
CMD ["mysqld"]
|
||||||
|
|
||||||
|
CMD ["mysql -uroot -p$MYSQL_ROOT_PASSWORD nacos_config < /nacos/nacos_mysql.sql"]
|
208
containerization/dockerfiles/nacos_mysql.sql
Normal file
208
containerization/dockerfiles/nacos_mysql.sql
Normal file
@ -0,0 +1,208 @@
|
|||||||
|
create database if not exists nacos_config default charset utf8 collate utf8_unicode_ci;
|
||||||
|
use nacos_config;
|
||||||
|
|
||||||
|
/******************************************/
|
||||||
|
/* 数据库全名 = nacos_config */
|
||||||
|
/* 表名称 = config_info */
|
||||||
|
/******************************************/
|
||||||
|
CREATE TABLE `config_info` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||||
|
`data_id` varchar(255) NOT NULL COMMENT 'data_id',
|
||||||
|
`group_id` varchar(128) DEFAULT NULL,
|
||||||
|
`content` longtext NOT NULL COMMENT 'content',
|
||||||
|
`md5` varchar(32) DEFAULT NULL COMMENT 'md5',
|
||||||
|
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
|
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||||
|
`src_user` text COMMENT 'source user',
|
||||||
|
`src_ip` varchar(50) DEFAULT NULL COMMENT 'source ip',
|
||||||
|
`app_name` varchar(128) DEFAULT NULL,
|
||||||
|
`tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段',
|
||||||
|
`c_desc` varchar(256) DEFAULT NULL,
|
||||||
|
`c_use` varchar(64) DEFAULT NULL,
|
||||||
|
`effect` varchar(64) DEFAULT NULL,
|
||||||
|
`type` varchar(64) DEFAULT NULL,
|
||||||
|
`c_schema` text,
|
||||||
|
`encrypted_data_key` text NOT NULL COMMENT '秘钥',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_configinfo_datagrouptenant` (`data_id`,`group_id`,`tenant_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info';
|
||||||
|
|
||||||
|
/******************************************/
|
||||||
|
/* 数据库全名 = nacos_config */
|
||||||
|
/* 表名称 = config_info_aggr */
|
||||||
|
/******************************************/
|
||||||
|
CREATE TABLE `config_info_aggr` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||||
|
`data_id` varchar(255) NOT NULL COMMENT 'data_id',
|
||||||
|
`group_id` varchar(128) NOT NULL COMMENT 'group_id',
|
||||||
|
`datum_id` varchar(255) NOT NULL COMMENT 'datum_id',
|
||||||
|
`content` longtext NOT NULL COMMENT '内容',
|
||||||
|
`gmt_modified` datetime NOT NULL COMMENT '修改时间',
|
||||||
|
`app_name` varchar(128) DEFAULT NULL,
|
||||||
|
`tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_configinfoaggr_datagrouptenantdatum` (`data_id`,`group_id`,`tenant_id`,`datum_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='增加租户字段';
|
||||||
|
|
||||||
|
|
||||||
|
/******************************************/
|
||||||
|
/* 数据库全名 = nacos_config */
|
||||||
|
/* 表名称 = config_info_beta */
|
||||||
|
/******************************************/
|
||||||
|
CREATE TABLE `config_info_beta` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||||
|
`data_id` varchar(255) NOT NULL COMMENT 'data_id',
|
||||||
|
`group_id` varchar(128) NOT NULL COMMENT 'group_id',
|
||||||
|
`app_name` varchar(128) DEFAULT NULL COMMENT 'app_name',
|
||||||
|
`content` longtext NOT NULL COMMENT 'content',
|
||||||
|
`beta_ips` varchar(1024) DEFAULT NULL COMMENT 'betaIps',
|
||||||
|
`md5` varchar(32) DEFAULT NULL COMMENT 'md5',
|
||||||
|
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
|
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||||
|
`src_user` text COMMENT 'source user',
|
||||||
|
`src_ip` varchar(50) DEFAULT NULL COMMENT 'source ip',
|
||||||
|
`tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段',
|
||||||
|
`encrypted_data_key` text NOT NULL COMMENT '秘钥',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_configinfobeta_datagrouptenant` (`data_id`,`group_id`,`tenant_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info_beta';
|
||||||
|
|
||||||
|
/******************************************/
|
||||||
|
/* 数据库全名 = nacos_config */
|
||||||
|
/* 表名称 = config_info_tag */
|
||||||
|
/******************************************/
|
||||||
|
CREATE TABLE `config_info_tag` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||||
|
`data_id` varchar(255) NOT NULL COMMENT 'data_id',
|
||||||
|
`group_id` varchar(128) NOT NULL COMMENT 'group_id',
|
||||||
|
`tenant_id` varchar(128) DEFAULT '' COMMENT 'tenant_id',
|
||||||
|
`tag_id` varchar(128) NOT NULL COMMENT 'tag_id',
|
||||||
|
`app_name` varchar(128) DEFAULT NULL COMMENT 'app_name',
|
||||||
|
`content` longtext NOT NULL COMMENT 'content',
|
||||||
|
`md5` varchar(32) DEFAULT NULL COMMENT 'md5',
|
||||||
|
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
|
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||||
|
`src_user` text COMMENT 'source user',
|
||||||
|
`src_ip` varchar(50) DEFAULT NULL COMMENT 'source ip',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_configinfotag_datagrouptenanttag` (`data_id`,`group_id`,`tenant_id`,`tag_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info_tag';
|
||||||
|
|
||||||
|
/******************************************/
|
||||||
|
/* 数据库全名 = nacos_config */
|
||||||
|
/* 表名称 = config_tags_relation */
|
||||||
|
/******************************************/
|
||||||
|
CREATE TABLE `config_tags_relation` (
|
||||||
|
`id` bigint(20) NOT NULL COMMENT 'id',
|
||||||
|
`tag_name` varchar(128) NOT NULL COMMENT 'tag_name',
|
||||||
|
`tag_type` varchar(64) DEFAULT NULL COMMENT 'tag_type',
|
||||||
|
`data_id` varchar(255) NOT NULL COMMENT 'data_id',
|
||||||
|
`group_id` varchar(128) NOT NULL COMMENT 'group_id',
|
||||||
|
`tenant_id` varchar(128) DEFAULT '' COMMENT 'tenant_id',
|
||||||
|
`nid` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
|
PRIMARY KEY (`nid`),
|
||||||
|
UNIQUE KEY `uk_configtagrelation_configidtag` (`id`,`tag_name`,`tag_type`),
|
||||||
|
KEY `idx_tenant_id` (`tenant_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_tag_relation';
|
||||||
|
|
||||||
|
/******************************************/
|
||||||
|
/* 数据库全名 = nacos_config */
|
||||||
|
/* 表名称 = group_capacity */
|
||||||
|
/******************************************/
|
||||||
|
CREATE TABLE `group_capacity` (
|
||||||
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||||
|
`group_id` varchar(128) NOT NULL DEFAULT '' COMMENT 'Group ID,空字符表示整个集群',
|
||||||
|
`quota` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '配额,0表示使用默认值',
|
||||||
|
`usage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用量',
|
||||||
|
`max_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限,单位为字节,0表示使用默认值',
|
||||||
|
`max_aggr_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数,,0表示使用默认值',
|
||||||
|
`max_aggr_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值',
|
||||||
|
`max_history_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',
|
||||||
|
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
|
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_group_id` (`group_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='集群、各Group容量信息表';
|
||||||
|
|
||||||
|
/******************************************/
|
||||||
|
/* 数据库全名 = nacos_config */
|
||||||
|
/* 表名称 = his_config_info */
|
||||||
|
/******************************************/
|
||||||
|
CREATE TABLE `his_config_info` (
|
||||||
|
`id` bigint(20) unsigned NOT NULL,
|
||||||
|
`nid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`data_id` varchar(255) NOT NULL,
|
||||||
|
`group_id` varchar(128) NOT NULL,
|
||||||
|
`app_name` varchar(128) DEFAULT NULL COMMENT 'app_name',
|
||||||
|
`content` longtext NOT NULL,
|
||||||
|
`md5` varchar(32) DEFAULT NULL,
|
||||||
|
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
`src_user` text,
|
||||||
|
`src_ip` varchar(50) DEFAULT NULL,
|
||||||
|
`op_type` char(10) DEFAULT NULL,
|
||||||
|
`tenant_id` varchar(128) DEFAULT '' COMMENT '租户字段',
|
||||||
|
`encrypted_data_key` text NOT NULL COMMENT '秘钥',
|
||||||
|
PRIMARY KEY (`nid`),
|
||||||
|
KEY `idx_gmt_create` (`gmt_create`),
|
||||||
|
KEY `idx_gmt_modified` (`gmt_modified`),
|
||||||
|
KEY `idx_did` (`data_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='多租户改造';
|
||||||
|
|
||||||
|
|
||||||
|
/******************************************/
|
||||||
|
/* 数据库全名 = nacos_config */
|
||||||
|
/* 表名称 = tenant_capacity */
|
||||||
|
/******************************************/
|
||||||
|
CREATE TABLE `tenant_capacity` (
|
||||||
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
||||||
|
`tenant_id` varchar(128) NOT NULL DEFAULT '' COMMENT 'Tenant ID',
|
||||||
|
`quota` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '配额,0表示使用默认值',
|
||||||
|
`usage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用量',
|
||||||
|
`max_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限,单位为字节,0表示使用默认值',
|
||||||
|
`max_aggr_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数',
|
||||||
|
`max_aggr_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值',
|
||||||
|
`max_history_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',
|
||||||
|
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||||
|
`gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_tenant_id` (`tenant_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='租户容量信息表';
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE `tenant_info` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||||
|
`kp` varchar(128) NOT NULL COMMENT 'kp',
|
||||||
|
`tenant_id` varchar(128) default '' COMMENT 'tenant_id',
|
||||||
|
`tenant_name` varchar(128) default '' COMMENT 'tenant_name',
|
||||||
|
`tenant_desc` varchar(256) DEFAULT NULL COMMENT 'tenant_desc',
|
||||||
|
`create_source` varchar(32) DEFAULT NULL COMMENT 'create_source',
|
||||||
|
`gmt_create` bigint(20) NOT NULL COMMENT '创建时间',
|
||||||
|
`gmt_modified` bigint(20) NOT NULL COMMENT '修改时间',
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `uk_tenant_info_kptenantid` (`kp`,`tenant_id`),
|
||||||
|
KEY `idx_tenant_id` (`tenant_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='tenant_info';
|
||||||
|
|
||||||
|
CREATE TABLE `users` (
|
||||||
|
`username` varchar(50) NOT NULL PRIMARY KEY,
|
||||||
|
`password` varchar(500) NOT NULL,
|
||||||
|
`enabled` boolean NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE `roles` (
|
||||||
|
`username` varchar(50) NOT NULL,
|
||||||
|
`role` varchar(50) NOT NULL,
|
||||||
|
UNIQUE INDEX `idx_user_role` (`username` ASC, `role` ASC) USING BTREE
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE `permissions` (
|
||||||
|
`role` varchar(50) NOT NULL,
|
||||||
|
`resource` varchar(255) NOT NULL,
|
||||||
|
`action` varchar(8) NOT NULL,
|
||||||
|
UNIQUE INDEX `uk_role_permission` (`role`,`resource`,`action`) USING BTREE
|
||||||
|
);
|
||||||
|
|
||||||
|
INSERT INTO users (username, password, enabled) VALUES ('nacos', '$2a$10$EuWPZHzz32dJN7jexM34MOeYirDdFAZm2kuWj7VEOJhhZkDrxfvUu', TRUE);
|
||||||
|
|
||||||
|
INSERT INTO roles (username, role) VALUES ('nacos', 'ROLE_ADMIN');
|
15
containerization/dockerfiles/openjdk-21-debian-stretch-slim
Normal file
15
containerization/dockerfiles/openjdk-21-debian-stretch-slim
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
FROM openjdk:21 as openjdk-21
|
||||||
|
RUN jlink \
|
||||||
|
--add-modules ALL-MODULE-PATH \
|
||||||
|
--strip-debug \
|
||||||
|
--no-man-pages \
|
||||||
|
--no-header-files \
|
||||||
|
--compress=2 \
|
||||||
|
--output /java-21-openjdk
|
||||||
|
|
||||||
|
FROM debian:stretch-slim
|
||||||
|
|
||||||
|
COPY --from=openjdk-21 /java-21-openjdk /usr/local/java-21-openjdk
|
||||||
|
|
||||||
|
ENV JAVA_HOME=/usr/local/java-21-openjdk
|
||||||
|
ENV PATH=$PATH:/usr/local/java-21-openjdk/bin
|
3
containerization/mysql/.gitignore
vendored
Normal file
3
containerization/mysql/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
data
|
||||||
|
.gitignore
|
||||||
|
!.gitignore
|
@ -1,2 +1,3 @@
|
|||||||
*
|
data
|
||||||
|
logs
|
||||||
!.gitignore
|
!.gitignore
|
2
containerization/openresty/certs/.gitignore
vendored
Normal file
2
containerization/openresty/certs/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.gitignore
|
||||||
|
!.gitignore
|
171
containerization/openresty/conf.d/default.conf
Normal file
171
containerization/openresty/conf.d/default.conf
Normal file
@ -0,0 +1,171 @@
|
|||||||
|
http {
|
||||||
|
include /usr/local/openresty/nginx/conf/mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
|
||||||
|
log_format main '$server_name $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for" $ssl_protocol $ssl_cipher $upstream_addr $request_time $upstream_response_time';
|
||||||
|
# access_log logs/access.log main;
|
||||||
|
|
||||||
|
# log_format nginxlog_json escape=json '{ "timestamp": "$time_iso8601", ' '"remote_addr": "$remote_addr", ' '"body_bytes_sent": $body_bytes_sent, ' '"request_time": $request_time, ' '"response_status": $status, ' '"request": "$request", ' '"request_method": "$request_method", ' '"host": "$host",' '"upstream_addr": "$upstream_addr",' '"http_x_forwarded_for": "$http_x_forwarded_for",' '"http_referrer": "$http_referer", ' '"http_user_agent": "$http_user_agent", ' '"http_version": "$server_protocol", ' '"nginx_access": true }';
|
||||||
|
# access_log /dev/stdout nginxlog_json;
|
||||||
|
|
||||||
|
# See Move default writable paths to a dedicated directory (#119)
|
||||||
|
# https://github.com/openresty/docker-openresty/issues/119
|
||||||
|
client_body_temp_path /var/run/openresty/nginx-client-body;
|
||||||
|
proxy_temp_path /var/run/openresty/nginx-proxy;
|
||||||
|
fastcgi_temp_path /var/run/openresty/nginx-fastcgi;
|
||||||
|
uwsgi_temp_path /var/run/openresty/nginx-uwsgi;
|
||||||
|
scgi_temp_path /var/run/openresty/nginx-scgi;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
#tcp_nopush on;
|
||||||
|
|
||||||
|
#keepalive_timeout 0;
|
||||||
|
keepalive_timeout 65;
|
||||||
|
|
||||||
|
#gzip on;
|
||||||
|
|
||||||
|
init_by_lua_block {
|
||||||
|
instanceQueue = {}
|
||||||
|
cjson = require "cjson"
|
||||||
|
}
|
||||||
|
|
||||||
|
upstream cskefu_web_gateway {
|
||||||
|
server 0.0.0.1;
|
||||||
|
balancer_by_lua_block {
|
||||||
|
local balancer = require "ngx.balancer"
|
||||||
|
local instance = table.remove(instanceQueue, 1)
|
||||||
|
local ok, err = balancer.set_current_peer(instance["ip"], instance["port"])
|
||||||
|
if not ok then
|
||||||
|
ngx.log(ngx.ERR, "failed to set the current peer: ", err)
|
||||||
|
return ngx.exit(500)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
upstream cskefu_websocket_service {
|
||||||
|
server 0.0.0.1;
|
||||||
|
balancer_by_lua_block {
|
||||||
|
local balancer = require "ngx.balancer"
|
||||||
|
local instance = table.remove(instanceQueue, 1)
|
||||||
|
local ok, err = balancer.set_current_peer(instance["ip"], instance["port"])
|
||||||
|
if not ok then
|
||||||
|
ngx.log(ngx.ERR, "failed to set the current peer: ", err)
|
||||||
|
return ngx.exit(500)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
client_max_body_size 100M;
|
||||||
|
|
||||||
|
location /api/ {
|
||||||
|
access_by_lua_block {
|
||||||
|
local cjson = require "cjson"
|
||||||
|
local queueLength = table.getn(instanceQueue)
|
||||||
|
local mapper = {}
|
||||||
|
if queueLength > 0 then
|
||||||
|
for i = 1, queueLength do
|
||||||
|
local id = instanceQueue[i]["ip"]..":"..instanceQueue[i]["port"]
|
||||||
|
mapper[id] = i
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local result = ngx.location.capture("/nacos", {args='serviceName=cskefu-web-gateway'})
|
||||||
|
local hosts = cjson.decode(result.body)['hosts']
|
||||||
|
local hostsLength = table.getn(hosts)
|
||||||
|
local others = {}
|
||||||
|
instanceQueue = {}
|
||||||
|
for i = 1, hostsLength do
|
||||||
|
local id = hosts[i]["ip"]..":"..hosts[i]["port"]
|
||||||
|
if hosts[i]["healthy"] == true then
|
||||||
|
if mapper[id] then
|
||||||
|
instanceQueue[mapper[id]] = {
|
||||||
|
["ip"] = hosts[i]["ip"],
|
||||||
|
["port"] = hosts[i]["port"]
|
||||||
|
}
|
||||||
|
else
|
||||||
|
table.insert(others, {
|
||||||
|
["ip"] = hosts[i]["ip"],
|
||||||
|
["port"] = hosts[i]["port"]
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local othersLength = table.getn(others)
|
||||||
|
if othersLength > 0 then
|
||||||
|
for i = 1, othersLength do
|
||||||
|
table.insert(instanceQueue, {
|
||||||
|
["ip"] = others[i]["ip"],
|
||||||
|
["port"] = others[i]["port"]
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
# proxy_pass http://cskefu-web-gateway:8080/;
|
||||||
|
proxy_pass http://cskefu_web_gateway/;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /ws/ {
|
||||||
|
access_by_lua_block {
|
||||||
|
local cjson = require "cjson"
|
||||||
|
local queueLength = table.getn(instanceQueue)
|
||||||
|
local mapper = {}
|
||||||
|
if queueLength > 0 then
|
||||||
|
for i = 1, queueLength do
|
||||||
|
local id = instanceQueue[i]["ip"]..":"..instanceQueue[i]["port"]
|
||||||
|
mapper[id] = i
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local result = ngx.location.capture("/nacos", {args='serviceName=cskefu-websocket-service'})
|
||||||
|
local hosts = cjson.decode(result.body)['hosts']
|
||||||
|
local hostsLength = table.getn(hosts)
|
||||||
|
local others = {}
|
||||||
|
instanceQueue = {}
|
||||||
|
for i = 1, hostsLength do
|
||||||
|
local id = hosts[i]["ip"]..":"..hosts[i]["port"]
|
||||||
|
if hosts[i]["healthy"] == true then
|
||||||
|
if mapper[id] then
|
||||||
|
instanceQueue[mapper[id]] = {
|
||||||
|
["ip"] = hosts[i]["ip"],
|
||||||
|
["port"] = hosts[i]["port"]
|
||||||
|
}
|
||||||
|
else
|
||||||
|
table.insert(others, {
|
||||||
|
["ip"] = hosts[i]["ip"],
|
||||||
|
["port"] = hosts[i]["port"]
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local othersLength = table.getn(others)
|
||||||
|
if othersLength > 0 then
|
||||||
|
for i = 1, othersLength do
|
||||||
|
table.insert(instanceQueue, {
|
||||||
|
["ip"] = others[i]["ip"],
|
||||||
|
["port"] = others[i]["port"]
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "Upgrade";
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
# proxy_pass http://cskefu-websocket-service:10000/ws/;
|
||||||
|
proxy_pass http://cskefu_websocket_service;
|
||||||
|
}
|
||||||
|
|
||||||
|
location = /nacos {
|
||||||
|
internal;
|
||||||
|
proxy_pass http://nacos:8848/nacos/v1/ns/instance/list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Don't reveal OpenResty version to clients.
|
||||||
|
# server_tokens off;
|
||||||
|
}
|
2
containerization/openresty/logs/.gitignore
vendored
Normal file
2
containerization/openresty/logs/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.gitignore
|
||||||
|
!.gitignore
|
38
containerization/openresty/nginx.conf
Normal file
38
containerization/openresty/nginx.conf
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# nginx.conf -- docker-openresty
|
||||||
|
#
|
||||||
|
# This file is installed to:
|
||||||
|
# `/usr/local/openresty/nginx/conf/nginx.conf`
|
||||||
|
# and is the file loaded by nginx at startup,
|
||||||
|
# unless the user specifies otherwise.
|
||||||
|
#
|
||||||
|
# It tracks the upstream OpenResty's `nginx.conf`, but removes the `server`
|
||||||
|
# section and adds this directive:
|
||||||
|
# `include /etc/nginx/conf.d/*.conf;`
|
||||||
|
#
|
||||||
|
# The `docker-openresty` file `nginx.vh.default.conf` is copied to
|
||||||
|
# `/etc/nginx/conf.d/default.conf`. It contains the `server section
|
||||||
|
# of the upstream `nginx.conf`.
|
||||||
|
#
|
||||||
|
# See https://github.com/openresty/docker-openresty/blob/master/README.md#nginx-config-files
|
||||||
|
#
|
||||||
|
|
||||||
|
#user nobody;
|
||||||
|
#worker_processes 1;
|
||||||
|
|
||||||
|
# Enables the use of JIT for regular expressions to speed-up their processing.
|
||||||
|
pcre_jit on;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#error_log logs/error.log;
|
||||||
|
#error_log logs/error.log notice;
|
||||||
|
#error_log logs/error.log info;
|
||||||
|
|
||||||
|
#pid logs/nginx.pid;
|
||||||
|
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
include /etc/nginx/conf.d/*.conf;
|
@ -14,21 +14,20 @@ server {
|
|||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
proxy_pass http://contact-center:8035;
|
proxy_pass http://cskefu-web-gateway:8080;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /actuator {
|
location /actuator {
|
||||||
return 403 "403: Target API is blocked.";
|
return 403 "403: Target API is blocked.";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
location /socket.io {
|
location /socket.io {
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "Upgrade";
|
proxy_set_header Connection "Upgrade";
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_pass http://contact-center:8036;
|
proxy_pass http://cskefu-websocket-service:10000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,2 +1,3 @@
|
|||||||
*
|
data
|
||||||
|
logs
|
||||||
!.gitignore
|
!.gitignore
|
0
containerization/rabbitmq/hosts
Normal file
0
containerization/rabbitmq/hosts
Normal file
@ -1,2 +1,2 @@
|
|||||||
*
|
data
|
||||||
!.gitignore
|
!.gitignore
|
@ -4,26 +4,36 @@
|
|||||||
# and edit .env with COMPOSE_FILE=docker-compose.custom.yml, docker-compose.custom.yml
|
# and edit .env with COMPOSE_FILE=docker-compose.custom.yml, docker-compose.custom.yml
|
||||||
# is ignored with .gitignore
|
# is ignored with .gitignore
|
||||||
COMPOSE_FILE=docker-compose.yml
|
COMPOSE_FILE=docker-compose.yml
|
||||||
# To setup with nginx service
|
COMPOSE_PROJECT_NAME=cskefu-backend
|
||||||
#COMPOSE_FILE=docker-compose.yml:docker-nginx.yml
|
|
||||||
COMPOSE_PROJECT_NAME=cskefu
|
|
||||||
|
|
||||||
# OS Params
|
# OS Params
|
||||||
CC_IMAGE=cskefu/contact-center:develop
|
CSKEFU_JAVA_XMX=512m
|
||||||
CC_JAVA_XMX=12288m
|
CSKEFU_JAVA_XMS=512m
|
||||||
CC_JAVA_XMS=2048m
|
|
||||||
|
|
||||||
# Variables
|
LOGGING_LEVEL_ROOT=INFO
|
||||||
MYSQL_PORT=8037
|
|
||||||
REDIS_PORT=8041
|
#CSKEFU_WEB_GATEWAY_PORT:-8080
|
||||||
CC_WEB_PORT=8035
|
#CSKEFU_MANAGER_SERVICE_PORT:-8081
|
||||||
CC_SOCKET_PORT=8036
|
#CSKEFU_AUTH_SERVICE_PORT:-8082
|
||||||
ACTIVEMQ_PORT1=8051
|
#CSKEFU_PLUGIN_SERVICE_PORT:-8083
|
||||||
ACTIVEMQ_PORT2=8052
|
#CSKEFU_CHANNEL_WECHAT_SERVICE_PORT:-8084
|
||||||
ACTIVEMQ_PORT3=8053
|
CSKEFU_WEBSOCKET_SERVICE_PORT:10000
|
||||||
DB_PASSWD=123456
|
|
||||||
LOG_LEVEL=INFO
|
NGINX_HTTP_PORT=80
|
||||||
CACHE_SETUP_STRATEGY=create_by_force
|
NGINX_SSL_PORT=443
|
||||||
|
|
||||||
|
RABBITMQ_CLIENT_PORT=5683
|
||||||
|
RABBITMQ_HTTP_PORT=15683
|
||||||
|
|
||||||
|
REDIS_PORT=6379
|
||||||
|
|
||||||
|
NACOS_PORT=8848
|
||||||
|
NACOS_CLIENT_GRPC_PORT=9848
|
||||||
|
NACOS_SERVER_GRPC_PORT=9849
|
||||||
|
|
||||||
|
MYSQL_PORT=3306
|
||||||
|
MYSQL_USER=root
|
||||||
|
MYSQL_PASSWORD=123456
|
||||||
|
|
||||||
## chatbot
|
## chatbot
|
||||||
## https://docs.cskefu.com/docs/work-chatbot/
|
## https://docs.cskefu.com/docs/work-chatbot/
|
||||||
@ -33,4 +43,4 @@ BOT_THRESHOLD_FAQ_SUGG_REPLY=0.6
|
|||||||
TONGJI_BAIDU_SITEKEY=placeholder
|
TONGJI_BAIDU_SITEKEY=placeholder
|
||||||
EXTRAS_LOGIN_BANNER=""
|
EXTRAS_LOGIN_BANNER=""
|
||||||
EXTRAS_LOGIN_CHATBOX=
|
EXTRAS_LOGIN_CHATBOX=
|
||||||
EXTRAS_AUTH_SUPER_ADMIN_PASS=
|
EXTRAS_AUTH_SUPER_ADMIN_PASS=
|
12
containerization/scripts/build.sh
Normal file
12
containerization/scripts/build.sh
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
docker build -f openjdk-21-debian-stretch-slim -t openjdk-21:debian-stretch-slim .
|
||||||
|
docker build -f mysql-8.1-nacos -t mysql-8.1:nacos .
|
||||||
|
|
||||||
|
docker tag openjdk-21:debian-stretch-slim cskefu/openjdk-21:debian-stretch-slim
|
||||||
|
docker tag mysql-8.1:nacos cskefu/mysql-8.1:nacos
|
||||||
|
|
||||||
|
docker login
|
||||||
|
|
||||||
|
docker push cskefu/openjdk-21:debian-stretch-slim
|
||||||
|
docker push cskefu/mysql-8.1:nacos
|
@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
- Java21
|
- Java21
|
||||||
- Spring Boot 3
|
- Spring Boot 3
|
||||||
- Spring Cloud两种方案
|
- Spring Cloud两种方案,采纳的是方案一
|
||||||
- Spring Cloud Alibaba,docker-compose方案
|
- 方案一:Spring Cloud,docker-compose方案
|
||||||
- 注册中心 Nacos
|
- 注册中心 Nacos
|
||||||
- 声明式服务调用 OpenFeign/Square 待定
|
- 声明式服务调用 OpenFeign
|
||||||
- 负载均衡 Ribbon/LoadBanlancer 待定
|
- 负载均衡 Ribbon/LoadBanlancer 待定
|
||||||
- 配置中心 Nacos
|
- 配置中心 Nacos
|
||||||
- 服务容错 Sentinel
|
- 服务容错 Sentinel
|
||||||
- 链路追踪 Skywalking
|
- 链路追踪 Skywalking
|
||||||
- Spring Cloud Kubernetes,kubernetes方案
|
- 方案二:Spring Cloud Kubernetes,kubernetes方案
|
||||||
- 注册中心 Kubernetes注册中心
|
- 注册中心 Kubernetes注册中心
|
||||||
- 声明式服务调用 OpenFeign/Square 待定
|
- 声明式服务调用 OpenFeign/Square 待定
|
||||||
- 负载均衡 Kubernetes负载均衡/Ribbon/LoadBanlancer 待定
|
- 负载均衡 Kubernetes负载均衡/Ribbon/LoadBanlancer 待定
|
||||||
@ -19,10 +19,10 @@
|
|||||||
- 链路追踪 Skywalking
|
- 链路追踪 Skywalking
|
||||||
- Spring Security + Oauth2.0
|
- Spring Security + Oauth2.0
|
||||||
- MyBatis-Flex
|
- MyBatis-Flex
|
||||||
- Netty SocketIO
|
- Webflux、 Tomcat
|
||||||
- Jackson,不使用Fastjson
|
- Jackson,不使用Fastjson
|
||||||
- Redisson
|
- redisson
|
||||||
- Mysql 8.0
|
- mysql 8.0
|
||||||
- HikariCP,不使用Druid
|
- HikariCP,不使用Druid
|
||||||
- Smart-doc,不使用Swagger
|
- Smart-doc,不使用Swagger
|
||||||
- RabbitMQ
|
- RabbitMQ
|
||||||
@ -34,10 +34,11 @@
|
|||||||
```
|
```
|
||||||
cskefu-web-gateway: 8080
|
cskefu-web-gateway: 8080
|
||||||
cskefu-manager-service: 8081
|
cskefu-manager-service: 8081
|
||||||
cskefu-websocket-service: 8082
|
cskefu-auth-service: 8082
|
||||||
cskefu-auth-service: 8083
|
cskefu-plugin-service: 8083
|
||||||
cskefu-plugin-service: 8090
|
cskefu-channel-wechat-service: 8084
|
||||||
cskefu-channel-wechat-service: 10000
|
cskefu-websocket-service: 10000
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
# 模块及服务划分约定
|
# 模块及服务划分约定
|
||||||
@ -94,8 +95,6 @@ contact-backend
|
|||||||
└─cskefu-websocket-service 客户端的WebSocket直接和这个服务连接
|
└─cskefu-websocket-service 客户端的WebSocket直接和这个服务连接
|
||||||
```
|
```
|
||||||
|
|
||||||
TODO 纯WebSocket服务怎么注册到注册中心?
|
|
||||||
|
|
||||||
# 依赖、包、和类的约定
|
# 依赖、包、和类的约定
|
||||||
|
|
||||||
**统一的、简单的、一致的风格更有利于代码的维护,在依赖、包、和类的划分及命名上遵守以下约定。如不能请及时在开发者群反馈。**
|
**统一的、简单的、一致的风格更有利于代码的维护,在依赖、包、和类的划分及命名上遵守以下约定。如不能请及时在开发者群反馈。**
|
||||||
@ -112,24 +111,22 @@ TODO 纯WebSocket服务怎么注册到注册中心?
|
|||||||
因此,所有pom中请加入以下内容
|
因此,所有pom中请加入以下内容
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
```
|
```
|
||||||
|
|
||||||
如果包中有java代码,其对应的pom请加入以下内容
|
如果包中有java代码,其对应的pom请加入以下内容
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -150,7 +147,7 @@ src
|
|||||||
│ ├─CskefuXXXApplication.java 启动类
|
│ ├─CskefuXXXApplication.java 启动类
|
||||||
│ └─sys
|
│ └─sys
|
||||||
│ ├─SysUserController.java
|
│ ├─SysUserController.java
|
||||||
│ ├─SysUser.java 不需要和其他业务或其他业务公用的实体类,如果需要公用,请放到对应的-domain下
|
│ ├─SysUser.java 不需要和其他业务公用的实体类,如果需要公用,请放到对应的-domain下
|
||||||
│ ├─SysUserService.java
|
│ ├─SysUserService.java
|
||||||
│ ├─SysUserServiceImpl.java
|
│ ├─SysUserServiceImpl.java
|
||||||
│ ├─UserMapper.java
|
│ ├─UserMapper.java
|
||||||
@ -176,12 +173,12 @@ src
|
|||||||
|
|
||||||
- 按照包和类的组织中描述的方式命名,实体类不区分VO、BO、DO、POJO、DTO等,也不要使用这些后缀;
|
- 按照包和类的组织中描述的方式命名,实体类不区分VO、BO、DO、POJO、DTO等,也不要使用这些后缀;
|
||||||
- 枚举类统一以Enum结尾;
|
- 枚举类统一以Enum结尾;
|
||||||
- 除非必要,不需要定义异常类;
|
|
||||||
- 工具类以Utils结尾,提供private无参构造函数,并在构造函数中抛出异常,参考JacksonUtils,阻止类被实例化;
|
- 工具类以Utils结尾,提供private无参构造函数,并在构造函数中抛出异常,参考JacksonUtils,阻止类被实例化;
|
||||||
|
- 除非必要,不需要定义异常类;
|
||||||
|
|
||||||
# 数据库变更
|
# 数据库变更
|
||||||
|
|
||||||
涉及到表结构的变更,或必要的初始化数据,请及时同步到contact-backend/v9.mysql.sql中。
|
涉及到表结构的变更,或必要的初始化数据,请及时同步到contact-backend/v9.mysql.init.sql中。
|
||||||
|
|
||||||
# 其他
|
# 其他
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<artifactId>cskefu-assistant-base</artifactId>
|
<artifactId>cskefu-assistant-base</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-assistant-base</name>
|
<name>cskefu-assistant-base</name>
|
||||||
@ -11,7 +11,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -28,7 +28,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<artifactId>cskefu-assistant-mvc</artifactId>
|
<artifactId>cskefu-assistant-mvc</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-assistant-mvc</name>
|
<name>cskefu-assistant-mvc</name>
|
||||||
@ -11,18 +11,12 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-assistant-base</artifactId>
|
<artifactId>cskefu-assistant-base</artifactId>
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
|
||||||
<artifactId>jackson-databind</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>jakarta.servlet</groupId>
|
<groupId>jakarta.servlet</groupId>
|
||||||
@ -59,7 +53,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -2,6 +2,9 @@ package com.cskefu.mvc;
|
|||||||
|
|
||||||
import com.cskefu.base.JacksonUtils;
|
import com.cskefu.base.JacksonUtils;
|
||||||
import com.cskefu.base.Result;
|
import com.cskefu.base.Result;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.ConstraintViolation;
|
import jakarta.validation.ConstraintViolation;
|
||||||
@ -42,7 +45,11 @@ import java.util.stream.Collectors;
|
|||||||
@RestControllerAdvice
|
@RestControllerAdvice
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class GlobalResponseBodyHandler implements ResponseBodyAdvice {
|
public class GlobalResponseBodyHandler implements ResponseBodyAdvice {
|
||||||
|
private static ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
|
||||||
|
static {
|
||||||
|
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public boolean supports(MethodParameter returnType, Class converterType) {
|
public boolean supports(MethodParameter returnType, Class converterType) {
|
||||||
return true;
|
return true;
|
||||||
@ -53,6 +60,13 @@ public class GlobalResponseBodyHandler implements ResponseBodyAdvice {
|
|||||||
if (body instanceof Result) {
|
if (body instanceof Result) {
|
||||||
return body;
|
return body;
|
||||||
}
|
}
|
||||||
|
if (body instanceof String) {
|
||||||
|
try {
|
||||||
|
return this.objectMapper.writeValueAsString(Result.success(body));
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
return Result.success(body);
|
return Result.success(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,7 +77,6 @@ public class GlobalResponseBodyHandler implements ResponseBodyAdvice {
|
|||||||
|
|
||||||
@ExceptionHandler(BindException.class)
|
@ExceptionHandler(BindException.class)
|
||||||
public Result<?> handlerBindException(BindException e) {
|
public Result<?> handlerBindException(BindException e) {
|
||||||
|
|
||||||
List<String> collect = new ArrayList<>();
|
List<String> collect = new ArrayList<>();
|
||||||
if (e.getBindingResult().getFieldError() != null) {
|
if (e.getBindingResult().getFieldError() != null) {
|
||||||
List<FieldError> fieldErrors = e.getBindingResult().getFieldErrors();
|
List<FieldError> fieldErrors = e.getBindingResult().getFieldErrors();
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<artifactId>cskefu-assistant-module</artifactId>
|
<artifactId>cskefu-assistant-module</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-assistant-module</name>
|
<name>cskefu-assistant-module</name>
|
||||||
@ -11,7 +11,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modules>
|
<modules>
|
||||||
<module>cskefu-assistant-base</module>
|
<module>cskefu-assistant-base</module>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<artifactId>cskefu-auth-domain</artifactId>
|
<artifactId>cskefu-auth-domain</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-auth-domain</name>
|
<name>cskefu-auth-domain</name>
|
||||||
@ -11,14 +11,14 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -2,9 +2,8 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<groupId>com.cskefu</groupId>
|
|
||||||
<artifactId>cskefu-auth-service</artifactId>
|
<artifactId>cskefu-auth-service</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-auth-service</name>
|
<name>cskefu-auth-service</name>
|
||||||
@ -12,7 +11,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -32,8 +31,13 @@
|
|||||||
<artifactId>spring-boot-starter-validation</artifactId>
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
<artifactId>spring-cloud-kubernetes-discovery</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.mybatis-flex</groupId>
|
<groupId>com.mybatis-flex</groupId>
|
||||||
@ -47,11 +51,6 @@
|
|||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-assistant-mvc</artifactId>
|
<artifactId>cskefu-assistant-mvc</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>mysql</groupId>
|
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
|
||||||
<scope>runtime</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.jsonwebtoken</groupId>
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
<artifactId>jjwt-api</artifactId>
|
<artifactId>jjwt-api</artifactId>
|
||||||
@ -70,7 +69,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -86,6 +85,14 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-antrun-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.google.cloud.tools</groupId>
|
||||||
|
<artifactId>jib-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
@ -4,6 +4,7 @@ import com.cskefu.security.JwtAuthenticationFilter;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.security.core.userdetails.User;
|
import org.springframework.security.core.userdetails.User;
|
||||||
import org.springframework.security.core.userdetails.UserDetails;
|
import org.springframework.security.core.userdetails.UserDetails;
|
||||||
@ -14,7 +15,7 @@ import org.springframework.security.provisioning.InMemoryUserDetailsManager;
|
|||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
//@EnableDiscoveryClient
|
@EnableDiscoveryClient
|
||||||
public class CskefuAuthApplication {
|
public class CskefuAuthApplication {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
try {
|
try {
|
||||||
|
@ -1,12 +1,18 @@
|
|||||||
server.port=8083
|
|
||||||
spring.application.name=cskefu-auth-service
|
|
||||||
debug=true
|
debug=true
|
||||||
|
server.port=8082
|
||||||
|
spring.application.name=cskefu-auth-service
|
||||||
|
|
||||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||||
spring.datasource.url=jdbc:mysql://localhost:3307/cskefu?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2B8
|
spring.datasource.url=jdbc:mysql://localhost:3306/cskefu?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2B8
|
||||||
spring.datasource.username=root
|
spring.datasource.username=root
|
||||||
spring.datasource.password=123456
|
spring.datasource.password=123456
|
||||||
|
|
||||||
|
spring.cloud.nacos.discovery.server-addr=localhost:8848
|
||||||
|
|
||||||
spring.mvc.static-path-pattern=/smart-doc/**
|
spring.mvc.static-path-pattern=/smart-doc/**
|
||||||
spring.web.resources.static-locations=classpath:/smart-doc
|
spring.web.resources.static-locations=classpath:/smart-doc
|
||||||
|
|
||||||
cskefu.private-key=MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC8TSxdMp76dZS2L8DpvJOgHNJmeI8PM30CFSeVMCHV5dEjtixipsMsSQu0ariAtVfA5M/ma1wcqEpsDO9nVQRsmsJCKMIWOcR6yBQU9f0T7Hkmil4Ckf61C1R7wLrynOjCeUCneQ7R0+dg9K25CymclPnK4ym2GInmuUjdbyQQcX4QBuIbmuY10MG8nW9ovhFML85KoBk5yxV4zVwLGP4TFJVnBmiNO3XSKL2XsX7wFFO93O8jmAnzgpWj8khsZAYG4nijIz2BciS9uQFa/lUX6yD50ykjNklbhCBIMGaQ6rr1WjnwLHDZU9sLvcYMboKPJHWz1FttvxuKSLYbf7j/AgMBAAECggEAEH1rPSrwF47kdW/vibu+uDuat7Tz3w9RpM6lc/Mn6ctoA6PLqN5hvFpJPbhHoAqn1kSZ0EJNA4imIjNsluf8rMyAs1QbN+CnMpMC7zL7jrS1IO+ze+LwVnpyufbbm3nfCE85OKSC7IbAfhHvUYOHIvQI5Zn76FTamFHxh5klpCrY1h8gcVWdRxiK0Q8AQP7KD0QnkzgROhkRmdI01639VyTCTc6Rtv5puU6J6idJwTd3JAiJXZ2qcoAwhnkSHnVnP5ktFxl66eHGJKeol6bGcJIFQRGLVmh78x6MXoqkJ2M7DRntL38TLKT5KCYViGxUpO0gED/HQBhDALyNevJZQQKBgQDr+pZDtRIQ6mMZMswKTo2+zIFEUFES2sR/bunEW5snPR3krKdgzJoEg7WERkMviSlvW6K7a6VeJ9KKO/iE07lcRkN2NQZUkBDsrNRgoOwB17hHJqrMyZ1It+hZmPQTkeyJu/BCxDkIMwbQYXxIe8J/dVYjHJVXZgzPqEXKYqeViwKBgQDMRwr7ceW+9c/GzHd7p6849s3+MbT0kzyXDTdeJkQFSDPufYapTCan/MrdJmnIRz8pq2URZrO4kDDxxeWu2Vkekv9cxVFrQVFfvuq+4BFpQvYkRHk9PDzCmgFJD/wLG8gzNTH7UahaNb7m0tPB3D1g5Q6LzZCc1h3s2K6SLS7g3QKBgE41Bof6ArrIc39ubmEcF64caNsTI0t0ZZs2TxNcqNcgUj/vWKmkJYdJf2cPQkUG2Eynug8TZgMGf6iAp6Sd5tjGEKWkfSyZcoJ95QUBUDZsIA60qfak+xOWn9LR9lJmElazirUWAzDMeH2nUWFUYumLIbkRSA1nLOfFhRvGBnRxAoGBAJvDAAjCzGBTpt77QZA0SFOzPVc6J7TmICk9lp5fpzYv3AlaBbhJrKAjDbybccWZLfxkCGjAWwG8UNXKBFzStjWt+LGQc4jJAXd0aCKrUBtnR7BX1epvaBUqwRgo7BK8WGdThI0RssE2gh4XXAhSGysq/XB0inRMf/z9K/+iHECxAoGAFlcIZ4/xXhbObUPU05hZFoj+zN5obaOLefRJn4uqjD9/VSRnI2bBv7vXKoLX6BwFF/PWvg1hzGy3O9TQ4XYPOqNGcBFDOqwxmVVevzXgRInoiRNP3xZXcqswppEbqORGbRoPLQBqLnPx1GKwbo7Fp9O5ywARVZtf4STt3pRK8PY=
|
cskefu.private-key=MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC8TSxdMp76dZS2L8DpvJOgHNJmeI8PM30CFSeVMCHV5dEjtixipsMsSQu0ariAtVfA5M/ma1wcqEpsDO9nVQRsmsJCKMIWOcR6yBQU9f0T7Hkmil4Ckf61C1R7wLrynOjCeUCneQ7R0+dg9K25CymclPnK4ym2GInmuUjdbyQQcX4QBuIbmuY10MG8nW9ovhFML85KoBk5yxV4zVwLGP4TFJVnBmiNO3XSKL2XsX7wFFO93O8jmAnzgpWj8khsZAYG4nijIz2BciS9uQFa/lUX6yD50ykjNklbhCBIMGaQ6rr1WjnwLHDZU9sLvcYMboKPJHWz1FttvxuKSLYbf7j/AgMBAAECggEAEH1rPSrwF47kdW/vibu+uDuat7Tz3w9RpM6lc/Mn6ctoA6PLqN5hvFpJPbhHoAqn1kSZ0EJNA4imIjNsluf8rMyAs1QbN+CnMpMC7zL7jrS1IO+ze+LwVnpyufbbm3nfCE85OKSC7IbAfhHvUYOHIvQI5Zn76FTamFHxh5klpCrY1h8gcVWdRxiK0Q8AQP7KD0QnkzgROhkRmdI01639VyTCTc6Rtv5puU6J6idJwTd3JAiJXZ2qcoAwhnkSHnVnP5ktFxl66eHGJKeol6bGcJIFQRGLVmh78x6MXoqkJ2M7DRntL38TLKT5KCYViGxUpO0gED/HQBhDALyNevJZQQKBgQDr+pZDtRIQ6mMZMswKTo2+zIFEUFES2sR/bunEW5snPR3krKdgzJoEg7WERkMviSlvW6K7a6VeJ9KKO/iE07lcRkN2NQZUkBDsrNRgoOwB17hHJqrMyZ1It+hZmPQTkeyJu/BCxDkIMwbQYXxIe8J/dVYjHJVXZgzPqEXKYqeViwKBgQDMRwr7ceW+9c/GzHd7p6849s3+MbT0kzyXDTdeJkQFSDPufYapTCan/MrdJmnIRz8pq2URZrO4kDDxxeWu2Vkekv9cxVFrQVFfvuq+4BFpQvYkRHk9PDzCmgFJD/wLG8gzNTH7UahaNb7m0tPB3D1g5Q6LzZCc1h3s2K6SLS7g3QKBgE41Bof6ArrIc39ubmEcF64caNsTI0t0ZZs2TxNcqNcgUj/vWKmkJYdJf2cPQkUG2Eynug8TZgMGf6iAp6Sd5tjGEKWkfSyZcoJ95QUBUDZsIA60qfak+xOWn9LR9lJmElazirUWAzDMeH2nUWFUYumLIbkRSA1nLOfFhRvGBnRxAoGBAJvDAAjCzGBTpt77QZA0SFOzPVc6J7TmICk9lp5fpzYv3AlaBbhJrKAjDbybccWZLfxkCGjAWwG8UNXKBFzStjWt+LGQc4jJAXd0aCKrUBtnR7BX1epvaBUqwRgo7BK8WGdThI0RssE2gh4XXAhSGysq/XB0inRMf/z9K/+iHECxAoGAFlcIZ4/xXhbObUPU05hZFoj+zN5obaOLefRJn4uqjD9/VSRnI2bBv7vXKoLX6BwFF/PWvg1hzGy3O9TQ4XYPOqNGcBFDOqwxmVVevzXgRInoiRNP3xZXcqswppEbqORGbRoPLQBqLnPx1GKwbo7Fp9O5ywARVZtf4STt3pRK8PY=
|
||||||
cskefu.public-key=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvE0sXTKe+nWUti/A6byToBzSZniPDzN9AhUnlTAh1eXRI7YsYqbDLEkLtGq4gLVXwOTP5mtcHKhKbAzvZ1UEbJrCQijCFjnEesgUFPX9E+x5JopeApH+tQtUe8C68pzownlAp3kO0dPnYPStuQspnJT5yuMpthiJ5rlI3W8kEHF+EAbiG5rmNdDBvJ1vaL4RTC/OSqAZOcsVeM1cCxj+ExSVZwZojTt10ii9l7F+8BRTvdzvI5gJ84KVo/JIbGQGBuJ4oyM9gXIkvbkBWv5VF+sg+dMpIzZJW4QgSDBmkOq69Vo58Cxw2VPbC73GDG6CjyR1s9Rbbb8biki2G3+4/wIDAQAB
|
cskefu.public-key=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvE0sXTKe+nWUti/A6byToBzSZniPDzN9AhUnlTAh1eXRI7YsYqbDLEkLtGq4gLVXwOTP5mtcHKhKbAzvZ1UEbJrCQijCFjnEesgUFPX9E+x5JopeApH+tQtUe8C68pzownlAp3kO0dPnYPStuQspnJT5yuMpthiJ5rlI3W8kEHF+EAbiG5rmNdDBvJ1vaL4RTC/OSqAZOcsVeM1cCxj+ExSVZwZojTt10ii9l7F+8BRTvdzvI5gJ84KVo/JIbGQGBuJ4oyM9gXIkvbkBWv5VF+sg+dMpIzZJW4QgSDBmkOq69Vo58Cxw2VPbC73GDG6CjyR1s9Rbbb8biki2G3+4/wIDAQAB
|
||||||
cskefu.token.duration=3600
|
cskefu.token.duration=3600
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<artifactId>cskefu-auth</artifactId>
|
<artifactId>cskefu-auth</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-auth</name>
|
<name>cskefu-auth</name>
|
||||||
@ -11,7 +11,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modules>
|
<modules>
|
||||||
<module>cskefu-auth-domain</module>
|
<module>cskefu-auth-domain</module>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<artifactId>cskefu-channel-wechat-domain</artifactId>
|
<artifactId>cskefu-channel-wechat-domain</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-channel-wechat-domain</name>
|
<name>cskefu-channel-wechat-domain</name>
|
||||||
@ -11,7 +11,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
@ -20,7 +20,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<artifactId>cskefu-channel-wechat-service</artifactId>
|
<artifactId>cskefu-channel-wechat-service</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-channel-wechat-service</name>
|
<name>cskefu-channel-wechat-service</name>
|
||||||
@ -11,13 +11,26 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.mybatis-flex</groupId>
|
<groupId>com.mybatis-flex</groupId>
|
||||||
<artifactId>mybatis-flex-spring-boot-starter</artifactId>
|
<artifactId>mybatis-flex-spring-boot-starter</artifactId>
|
||||||
@ -38,6 +51,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
<artifactId>httpclient</artifactId>
|
<artifactId>httpclient</artifactId>
|
||||||
|
<!--TODO lecjy-->
|
||||||
<version>4.5.14</version>
|
<version>4.5.14</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
@ -46,7 +60,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -62,6 +76,14 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-antrun-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.google.cloud.tools</groupId>
|
||||||
|
<artifactId>jib-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
@ -3,10 +3,10 @@ package com.cskefu;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||||
|
|
||||||
@Slf4j
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
//@EnableDiscoveryClient
|
@EnableDiscoveryClient
|
||||||
public class CskefuWechatChannelApplication {
|
public class CskefuWechatChannelApplication {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
try {
|
try {
|
||||||
|
@ -121,7 +121,7 @@ public class WechatCallbackChatbot {
|
|||||||
return "200";
|
return "200";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void test(String[] args) throws Exception {
|
||||||
String replyMsg = "中文<xml><ToUserName><![CDATA[oia2TjjewbmiOUlr6X-1crbLOvLw]]></ToUserName><FromUserName><![CDATA[gh_7f083739789a]]></FromUserName><CreateTime>1407743423</CreateTime><MsgType><![CDATA[video]]></MsgType><Video><MediaId><![CDATA[eYJ1MbwPRJtOvIEabaxHs7TX2D-HV71s79GUxqdUkjm6Gs2Ed1KF3ulAOA9H1xG0]]></MediaId><Title><![CDATA[testCallBackReplyVideo]]></Title><Description><![CDATA[testCallBackReplyVideo]]></Description></Video></xml>";
|
String replyMsg = "中文<xml><ToUserName><![CDATA[oia2TjjewbmiOUlr6X-1crbLOvLw]]></ToUserName><FromUserName><![CDATA[gh_7f083739789a]]></FromUserName><CreateTime>1407743423</CreateTime><MsgType><![CDATA[video]]></MsgType><Video><MediaId><![CDATA[eYJ1MbwPRJtOvIEabaxHs7TX2D-HV71s79GUxqdUkjm6Gs2Ed1KF3ulAOA9H1xG0]]></MediaId><Title><![CDATA[testCallBackReplyVideo]]></Title><Description><![CDATA[testCallBackReplyVideo]]></Description></Video></xml>";
|
||||||
|
|
||||||
val nonce = "";
|
val nonce = "";
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
server.port=8090
|
|
||||||
spring.application.name=cskefu-channel-wechat-service
|
|
||||||
debug=true
|
debug=true
|
||||||
|
server.port=8084
|
||||||
|
spring.application.name=cskefu-channel-wechat-service
|
||||||
|
|
||||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||||
spring.datasource.url=jdbc:mysql://localhost:3307/cskefu?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2B8
|
spring.datasource.url=jdbc:mysql://localhost:3306/cskefu?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2B8
|
||||||
spring.datasource.username=root
|
spring.datasource.username=root
|
||||||
spring.datasource.password=123456
|
spring.datasource.password=123456
|
||||||
|
|
||||||
|
spring.cloud.nacos.discovery.server-addr=localhost:8848
|
||||||
|
|
||||||
spring.mvc.static-path-pattern=/smart-doc/**
|
spring.mvc.static-path-pattern=/smart-doc/**
|
||||||
spring.web.resources.static-locations=classpath:/smart-doc
|
spring.web.resources.static-locations=classpath:/smart-doc
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<artifactId>cskefu-channel</artifactId>
|
<artifactId>cskefu-channel</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-channel</name>
|
<name>cskefu-channel</name>
|
||||||
@ -11,7 +11,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modules>
|
<modules>
|
||||||
<module>cskefu-channel-wechat-service</module>
|
<module>cskefu-channel-wechat-service</module>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<artifactId>cskefu-web-gateway</artifactId>
|
<artifactId>cskefu-web-gateway</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-web-gateway</name>
|
<name>cskefu-web-gateway</name>
|
||||||
@ -11,7 +11,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -19,12 +19,12 @@
|
|||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.mybatis-flex</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
<artifactId>mybatis-flex-spring-boot-starter</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mybatis.spring.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
@ -36,7 +36,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -52,6 +52,14 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-antrun-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.google.cloud.tools</groupId>
|
||||||
|
<artifactId>jib-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
@ -2,10 +2,16 @@ package com.cskefu;
|
|||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.net.InetAddress;
|
||||||
|
import java.net.UnknownHostException;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
|
@EnableDiscoveryClient
|
||||||
|
@RestController
|
||||||
public class CskefuWebGatewayApplication {
|
public class CskefuWebGatewayApplication {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
try {
|
try {
|
||||||
@ -14,4 +20,10 @@ public class CskefuWebGatewayApplication {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping({"", "/"})
|
||||||
|
public String index() throws UnknownHostException {
|
||||||
|
InetAddress localHost = InetAddress.getLocalHost();
|
||||||
|
return localHost.getHostAddress();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
|
debug=true
|
||||||
server.port=8080
|
server.port=8080
|
||||||
spring.application.name=cskefu-web-gateway
|
spring.application.name=cskefu-web-gateway
|
||||||
debug=true
|
|
||||||
|
spring.datasource.password=123456
|
||||||
|
|
||||||
|
spring.cloud.nacos.discovery.server-addr=localhost:8848
|
||||||
|
|
||||||
spring.mvc.static-path-pattern=/smart-doc/**
|
spring.mvc.static-path-pattern=/smart-doc/**
|
||||||
spring.web.resources.static-locations=classpath:/smart-doc
|
spring.web.resources.static-locations=classpath:/smart-doc
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<artifactId>cskefu-gateway</artifactId>
|
<artifactId>cskefu-gateway</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-gateway</name>
|
<name>cskefu-gateway</name>
|
||||||
@ -11,7 +11,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modules>
|
<modules>
|
||||||
<module>cskefu-web-gateway</module>
|
<module>cskefu-web-gateway</module>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<artifactId>cskefu-manager-domain</artifactId>
|
<artifactId>cskefu-manager-domain</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-manager-domain</name>
|
<name>cskefu-manager-domain</name>
|
||||||
@ -11,14 +11,14 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<artifactId>cskefu-manager-service</artifactId>
|
<artifactId>cskefu-manager-service</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-manager-service</name>
|
<name>cskefu-manager-service</name>
|
||||||
@ -11,7 +11,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<relativePath/>
|
<relativePath/>
|
||||||
</parent>
|
</parent>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@ -19,6 +19,19 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.mybatis-flex</groupId>
|
<groupId>com.mybatis-flex</groupId>
|
||||||
<artifactId>mybatis-flex-spring-boot-starter</artifactId>
|
<artifactId>mybatis-flex-spring-boot-starter</artifactId>
|
||||||
@ -37,7 +50,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -53,6 +66,14 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-antrun-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.google.cloud.tools</groupId>
|
||||||
|
<artifactId>jib-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
@ -2,9 +2,10 @@ package com.cskefu;
|
|||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
//@EnableDiscoveryClient
|
@EnableDiscoveryClient
|
||||||
public class CskefuManagerApplication {
|
public class CskefuManagerApplication {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
try {
|
try {
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
|
debug=true
|
||||||
server.port=8081
|
server.port=8081
|
||||||
spring.application.name=cskefu-manager-service
|
spring.application.name=cskefu-manager-service
|
||||||
debug=true
|
|
||||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||||
spring.datasource.url=jdbc:mysql://localhost:3307/cskefu?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2B8
|
spring.datasource.url=jdbc:mysql://localhost:3306/cskefu?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2B8
|
||||||
spring.datasource.username=root
|
spring.datasource.username=root
|
||||||
spring.datasource.password=123456
|
spring.datasource.password=123456
|
||||||
|
|
||||||
|
spring.cloud.nacos.discovery.server-addr=localhost:8848
|
||||||
|
|
||||||
spring.mvc.static-path-pattern=/smart-doc/**
|
spring.mvc.static-path-pattern=/smart-doc/**
|
||||||
spring.web.resources.static-locations=classpath:/smart-doc
|
spring.web.resources.static-locations=classpath:/smart-doc
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<artifactId>cskefu-manager</artifactId>
|
<artifactId>cskefu-manager</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-manager</name>
|
<name>cskefu-manager</name>
|
||||||
@ -11,7 +11,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modules>
|
<modules>
|
||||||
<module>cskefu-manager-service</module>
|
<module>cskefu-manager-service</module>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<artifactId>cskefu-plugin-domain</artifactId>
|
<artifactId>cskefu-plugin-domain</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-plugin-domain</name>
|
<name>cskefu-plugin-domain</name>
|
||||||
@ -11,14 +11,14 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<artifactId>cskefu-plugin-service</artifactId>
|
<artifactId>cskefu-plugin-service</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-plugin-service</name>
|
<name>cskefu-plugin-service</name>
|
||||||
@ -11,7 +11,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<relativePath/>
|
<relativePath/>
|
||||||
</parent>
|
</parent>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@ -19,6 +19,19 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.mybatis-flex</groupId>
|
<groupId>com.mybatis-flex</groupId>
|
||||||
<artifactId>mybatis-flex-spring-boot-starter</artifactId>
|
<artifactId>mybatis-flex-spring-boot-starter</artifactId>
|
||||||
@ -37,7 +50,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -53,6 +66,14 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-antrun-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.google.cloud.tools</groupId>
|
||||||
|
<artifactId>jib-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
@ -2,9 +2,10 @@ package com.cskefu;
|
|||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
//@EnableDiscoveryClient
|
@EnableDiscoveryClient
|
||||||
public class CskefuPluginApplication {
|
public class CskefuPluginApplication {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
try {
|
try {
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
server.port=8090
|
|
||||||
spring.application.name=cskefu-plugin-service
|
|
||||||
debug=true
|
debug=true
|
||||||
|
server.port=8083
|
||||||
|
spring.application.name=cskefu-plugin-service
|
||||||
|
|
||||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||||
spring.datasource.url=jdbc:mysql://localhost:3307/cskefu?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2B8
|
spring.datasource.url=jdbc:mysql://localhost:3306/cskefu?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2B8
|
||||||
spring.datasource.username=root
|
spring.datasource.username=root
|
||||||
spring.datasource.password=123456
|
spring.datasource.password=123456
|
||||||
|
|
||||||
|
spring.cloud.nacos.discovery.server-addr=localhost:8848
|
||||||
|
|
||||||
spring.mvc.static-path-pattern=/smart-doc/**
|
spring.mvc.static-path-pattern=/smart-doc/**
|
||||||
spring.web.resources.static-locations=classpath:/smart-doc
|
spring.web.resources.static-locations=classpath:/smart-doc
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<artifactId>cskefu-plugin</artifactId>
|
<artifactId>cskefu-plugin</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-plugin</name>
|
<name>cskefu-plugin</name>
|
||||||
@ -11,7 +11,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modules>
|
<modules>
|
||||||
<module>cskefu-plugin-service</module>
|
<module>cskefu-plugin-service</module>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<artifactId>cskefu-websocket-domain</artifactId>
|
<artifactId>cskefu-websocket-domain</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-websocket-domain</name>
|
<name>cskefu-websocket-domain</name>
|
||||||
@ -11,14 +11,14 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<artifactId>cskefu-websocket-service</artifactId>
|
<artifactId>cskefu-websocket-service</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-websocket-service</name>
|
<name>cskefu-websocket-service</name>
|
||||||
@ -11,32 +11,24 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-autoconfigure</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.mybatis-flex</groupId>
|
|
||||||
<artifactId>mybatis-flex-spring-boot-starter</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.mybatis.spring.boot</groupId>
|
|
||||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>ch.qos.logback</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>logback-classic</artifactId>
|
<artifactId>spring-boot-starter-webflux</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.corundumstudio.socketio</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
<artifactId>netty-socketio</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-amqp</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
@ -44,7 +36,14 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
||||||
|
<version>2022.0.0.0</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -56,6 +55,14 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-antrun-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.google.cloud.tools</groupId>
|
||||||
|
<artifactId>jib-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
package com.cskefu;
|
package com.cskefu;
|
||||||
|
|
||||||
import com.corundumstudio.socketio.SocketIOServer;
|
import com.cskefu.handler.WebSocketMappingHandlerMapping;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.DisposableBean;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.boot.CommandLineRunner;
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.web.reactive.HandlerMapping;
|
||||||
|
import org.springframework.web.reactive.socket.server.support.WebSocketHandlerAdapter;
|
||||||
|
|
||||||
@Slf4j
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
//@EnableDiscoveryClient
|
@EnableDiscoveryClient
|
||||||
public class WebsocketApplication {
|
public class WebsocketApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
@ -21,24 +20,14 @@ public class WebsocketApplication {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Component
|
@Bean
|
||||||
@Slf4j
|
public HandlerMapping webSocketMapping() {
|
||||||
class SocketIOServerRunner implements CommandLineRunner, DisposableBean {
|
return new WebSocketMappingHandlerMapping();
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SocketIOServer socketIOServer;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run(String... args) throws Exception {
|
|
||||||
socketIOServer.start();
|
|
||||||
log.warn("SocketIOServer启动成功");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Bean
|
||||||
public void destroy() throws Exception {
|
public WebSocketHandlerAdapter handlerAdapter() {
|
||||||
socketIOServer.stop();
|
return new WebSocketHandlerAdapter();
|
||||||
log.warn("SocketIOServer关闭成功");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.cskefu.annotations;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target(ElementType.TYPE)
|
||||||
|
public @interface WebSocketMapping {
|
||||||
|
String value() default "";
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.cskefu.handler;
|
||||||
|
|
||||||
|
import com.cskefu.annotations.WebSocketMapping;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.reactive.socket.HandshakeInfo;
|
||||||
|
import org.springframework.web.reactive.socket.WebSocketHandler;
|
||||||
|
import org.springframework.web.reactive.socket.WebSocketSession;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
@WebSocketMapping("/ws/message")
|
||||||
|
public class MessageHandler implements WebSocketHandler {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<Void> handle(WebSocketSession session) {
|
||||||
|
HandshakeInfo handshakeInfo = session.getHandshakeInfo();
|
||||||
|
return session.send(session.receive().map(msg -> session.textMessage("服务端:-> " + msg.getPayloadAsText())));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.cskefu.handler;
|
||||||
|
|
||||||
|
import com.cskefu.annotations.WebSocketMapping;
|
||||||
|
import org.springframework.beans.BeansException;
|
||||||
|
import org.springframework.core.Ordered;
|
||||||
|
import org.springframework.core.annotation.AnnotationUtils;
|
||||||
|
import org.springframework.web.reactive.handler.SimpleUrlHandlerMapping;
|
||||||
|
import org.springframework.web.reactive.socket.WebSocketHandler;
|
||||||
|
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public class WebSocketMappingHandlerMapping extends SimpleUrlHandlerMapping {
|
||||||
|
|
||||||
|
private Map<String, WebSocketHandler> handlerMap = new LinkedHashMap<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initApplicationContext() throws BeansException {
|
||||||
|
Map<String, Object> beanMap = obtainApplicationContext().getBeansWithAnnotation(WebSocketMapping.class);
|
||||||
|
beanMap.values().forEach(bean -> {
|
||||||
|
if (!(bean instanceof WebSocketHandler)) {
|
||||||
|
throw new RuntimeException(String.format("Controller [%s] doesn't implement WebSocketHandler interface.", bean.getClass().getName()));
|
||||||
|
}
|
||||||
|
WebSocketMapping annotation = AnnotationUtils.getAnnotation(bean.getClass(), WebSocketMapping.class);
|
||||||
|
//webSocketMapping 映射到管理中
|
||||||
|
handlerMap.put(Objects.requireNonNull(annotation).value(), (WebSocketHandler) bean);
|
||||||
|
});
|
||||||
|
super.setOrder(Ordered.HIGHEST_PRECEDENCE);
|
||||||
|
super.setUrlMap(handlerMap);
|
||||||
|
super.initApplicationContext();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.cskefu.handler;
|
||||||
|
|
||||||
|
import com.cskefu.annotations.WebSocketMapping;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.reactive.socket.HandshakeInfo;
|
||||||
|
import org.springframework.web.reactive.socket.WebSocketHandler;
|
||||||
|
import org.springframework.web.reactive.socket.WebSocketSession;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
import java.net.InetAddress;
|
||||||
|
import java.net.UnknownHostException;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
@WebSocketMapping("/ws/")
|
||||||
|
public class WelcomeHandler implements WebSocketHandler {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<Void> handle(WebSocketSession session) {
|
||||||
|
try {
|
||||||
|
InetAddress localHost = InetAddress.getLocalHost();
|
||||||
|
HandshakeInfo handshakeInfo = session.getHandshakeInfo();
|
||||||
|
return session.send(session.receive().map(msg -> session.textMessage("cskefu-websocket-service: " + localHost.getHostAddress())));
|
||||||
|
} catch (UnknownHostException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException("出错了!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,100 +0,0 @@
|
|||||||
package com.cskefu.websocket;
|
|
||||||
|
|
||||||
import com.corundumstudio.socketio.AuthorizationListener;
|
|
||||||
import com.corundumstudio.socketio.HandshakeData;
|
|
||||||
import com.corundumstudio.socketio.SocketConfig;
|
|
||||||
import com.corundumstudio.socketio.SocketIOServer;
|
|
||||||
import com.corundumstudio.socketio.annotation.SpringAnnotationScanner;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
@Slf4j
|
|
||||||
public class SocketIOConfiguration {
|
|
||||||
|
|
||||||
@Value("${cskefu.socketio.port:8082}")
|
|
||||||
private Integer port;
|
|
||||||
|
|
||||||
@Value("${cskefu.socketio.bossCount:1}")
|
|
||||||
private int bossCount;
|
|
||||||
|
|
||||||
@Value("${cskefu.socketio.workCount:0}")
|
|
||||||
private int workCount;
|
|
||||||
|
|
||||||
@Value("${cskefu.socketio.upgradeTimeout:1000}")
|
|
||||||
private int upgradeTimeout;
|
|
||||||
|
|
||||||
@Value("${cskefu.socketio.pingTimeout:3000}")
|
|
||||||
private int pingTimeout;
|
|
||||||
|
|
||||||
@Value("${cskefu.socketio.pingInterval:3000}")
|
|
||||||
private int pingInterval;
|
|
||||||
|
|
||||||
@Value("#{'${cskefu.socketio.namespaces:}'.split(',')}")
|
|
||||||
private String[] namespaces;
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public SocketIOServer socketIOServer() {
|
|
||||||
SocketConfig socketConfig = new SocketConfig();
|
|
||||||
socketConfig.setTcpNoDelay(true);
|
|
||||||
socketConfig.setSoLinger(0);
|
|
||||||
socketConfig.setReuseAddress(true);
|
|
||||||
|
|
||||||
com.corundumstudio.socketio.Configuration config = new com.corundumstudio.socketio.Configuration();
|
|
||||||
config.setSocketConfig(socketConfig);
|
|
||||||
config.setPort(port);
|
|
||||||
config.setBossThreads(bossCount);
|
|
||||||
int threads = Runtime.getRuntime().availableProcessors();
|
|
||||||
if (workCount < 1) {
|
|
||||||
config.setWorkerThreads(threads);
|
|
||||||
} else {
|
|
||||||
if (workCount < threads) {
|
|
||||||
log.warn("worker threads to low");
|
|
||||||
}
|
|
||||||
config.setWorkerThreads(workCount);
|
|
||||||
}
|
|
||||||
config.setWorkerThreads(Runtime.getRuntime().availableProcessors());
|
|
||||||
config.setAllowCustomRequests(false);
|
|
||||||
config.setUpgradeTimeout(upgradeTimeout);
|
|
||||||
config.setPingTimeout(pingTimeout);
|
|
||||||
config.setPingInterval(pingInterval);
|
|
||||||
|
|
||||||
final SocketIOServer server = new SocketIOServer(config);
|
|
||||||
|
|
||||||
Optional.ofNullable(namespaces).ifPresent(namespace -> Arrays.stream(namespace).forEach(server::addNamespace));
|
|
||||||
|
|
||||||
config.setAuthorizationListener(new AuthorizationListener() {
|
|
||||||
@Override
|
|
||||||
public boolean isAuthorized(HandshakeData data) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
server.addConnectListener(client -> {
|
|
||||||
log.info("SessionId: {}", client.getSessionId());
|
|
||||||
log.info("RemoteAddress: {}", client.getRemoteAddress());
|
|
||||||
log.info("Transport: {}", client.getTransport());
|
|
||||||
});
|
|
||||||
|
|
||||||
server.addDisconnectListener(client -> {
|
|
||||||
log.info("断开连接:{} ", client.getSessionId());
|
|
||||||
client.disconnect();
|
|
||||||
});
|
|
||||||
|
|
||||||
server.addEventListener("text", Object.class, (client, data, ackSender) -> {
|
|
||||||
client.getHandshakeData();
|
|
||||||
log.info("客户端:{} 发来消息 {}", client, data);
|
|
||||||
});
|
|
||||||
return server;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public SpringAnnotationScanner springAnnotationScanner() {
|
|
||||||
return new SpringAnnotationScanner(socketIOServer());
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,9 +1,17 @@
|
|||||||
spring.application.name=cskefu-websocket-service
|
|
||||||
debug=true
|
debug=true
|
||||||
|
server.port=10000
|
||||||
|
spring.application.name=cskefu-websocket-service
|
||||||
|
|
||||||
spring.mvc.static-path-pattern=/smart-doc/**
|
spring.mvc.static-path-pattern=/smart-doc/**
|
||||||
spring.web.resources.static-locations=classpath:/smart-doc
|
spring.web.resources.static-locations=classpath:/smart-doc
|
||||||
spring.cloud.kubernetes.discovery.enabled=true
|
|
||||||
cskefu.socketio.port=8082
|
spring.cloud.nacos.discovery.server-addr=localhost:8848
|
||||||
cskefu.socketio.upgradeTimeout=1000
|
|
||||||
cskefu.socketio.pingTimeout=3000
|
spring.rabbitmq.username=guest
|
||||||
cskefu.socketio.pingInterval=3000
|
spring.rabbitmq.password=guest
|
||||||
|
spring.rabbitmq.addresses=127.0.0.1
|
||||||
|
spring.rabbitmq.port=5672
|
||||||
|
spring.rabbitmq.publisher-confirm-type=correlated
|
||||||
|
spring.rabbitmq.publisher-returns=true
|
||||||
|
spring.rabbitmq.listener.simple.acknowledge-mode=manual
|
||||||
|
spring.rabbitmq.listener.simple.prefetch=1
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<artifactId>cskefu-websocket</artifactId>
|
<artifactId>cskefu-websocket</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-websocket</name>
|
<name>cskefu-websocket</name>
|
||||||
@ -11,7 +11,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modules>
|
<modules>
|
||||||
<module>cskefu-websocket-domain</module>
|
<module>cskefu-websocket-domain</module>
|
||||||
|
16
cskefu-backend/git.properties
Normal file
16
cskefu-backend/git.properties
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# git.properties
|
||||||
|
git.tags=PLACEHOLDER
|
||||||
|
git.branch=PLACEHOLDER
|
||||||
|
git.dirty=PLACEHOLDER
|
||||||
|
git.commit.id=PLACEHOLDER
|
||||||
|
git.commit.id.abbrev=PLACEHOLDER
|
||||||
|
git.commit.id.describe=PLACEHOLDER
|
||||||
|
git.commit.id.describe-short=PLACEHOLDER
|
||||||
|
git.commit.user.name=PLACEHOLDER
|
||||||
|
git.commit.user.email=PLACEHOLDER
|
||||||
|
git.commit.time=PLACEHOLDER
|
||||||
|
git.build.user.name=PLACEHOLDER
|
||||||
|
git.build.user.email=PLACEHOLDER
|
||||||
|
git.build.time=PLACEHOLDER
|
||||||
|
git.build.host=PLACEHOLDER
|
||||||
|
git.build.version=PLACEHOLDER
|
174
cskefu-backend/logback-spring.xml
Normal file
174
cskefu-backend/logback-spring.xml
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration>
|
||||||
|
<property name="max_history" value="30"/>
|
||||||
|
<property name="max_file_size" value="50MB"/>
|
||||||
|
<property name="charset" value="UTF-8"/>
|
||||||
|
<property name="queueSize" value="256"/>
|
||||||
|
<property name="log_path" value="/cskefu/logs"/>
|
||||||
|
|
||||||
|
<define name="hostname" class="ch.qos.logback.core.property.CanonicalHostNamePropertyDefiner"/>
|
||||||
|
|
||||||
|
<springProperty scope="context" name="app_name" source="spring.application.name" defaultValue="log-%d{yyyy-MM-dd_HH:mm:ss.SSS}"/>
|
||||||
|
<conversionRule conversionWord="color" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
|
||||||
|
<conversionRule conversionWord="whitespace" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
||||||
|
<conversionRule conversionWord="extended_whitespace" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
||||||
|
|
||||||
|
<property name="console_log_pattern" value="%boldMagenta(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %boldYellow(${LOG-LEVEL-PATTERN:-%5p}) %boldCyan(${PID:- }){magenta} %boldGreen(---){faint} %boldGreen([%15.15t]){faint} %boldCyan(%-40.40logger{50}){cyan} %boldYellow(:){faint} %m%n${LOG-EXCEPTION-CONVERSION-WORD:-%extended_whitespace}"/>
|
||||||
|
<property name="file_log_pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n"/>
|
||||||
|
|
||||||
|
<appender name="console_appender" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||||
|
<level>debug</level>
|
||||||
|
</filter>
|
||||||
|
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||||
|
<pattern>${console_log_pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="debug_file_appender" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log_path}/${app_name}-${hostname}-debug.log</file>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||||
|
<charset>${charset}</charset>
|
||||||
|
</encoder>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log_path}/%d{yyyy-MM-dd}/${app_name}-${hostname}-debug.%i.log</fileNamePattern>
|
||||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||||
|
<maxFileSize>${max_file_size}</maxFileSize>
|
||||||
|
</timeBasedFileNamingAndTriggeringPolicy>
|
||||||
|
<maxHistory>${max_history}</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<level>debug</level>
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="info_file_appender" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log_path}/${app_name}-${hostname}-info.log</file>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${file_log_pattern}</pattern>
|
||||||
|
<charset>${charset}</charset>
|
||||||
|
</encoder>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log_path}/%d{yyyy-MM-dd}/${app_name}-${hostname}-info.%i.log</fileNamePattern>
|
||||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||||
|
<maxFileSize>${max_file_size}</maxFileSize>
|
||||||
|
</timeBasedFileNamingAndTriggeringPolicy>
|
||||||
|
<maxHistory>${max_history}</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<level>info</level>
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="warn_file_appender" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log_path}/${app_name}-${hostname}-warn.log</file>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${file_log_pattern}</pattern>
|
||||||
|
<charset>${charset}</charset>
|
||||||
|
</encoder>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log_path}/%d{yyyy-MM-dd}/${app_name}-${hostname}-warn.%i.log</fileNamePattern>
|
||||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||||
|
<maxFileSize>${max_file_size}</maxFileSize>
|
||||||
|
</timeBasedFileNamingAndTriggeringPolicy>
|
||||||
|
<maxHistory>${max_history}</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<level>warn</level>
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="error_file_appender" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log_path}/${app_name}-${hostname}-error.log</file>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${file_log_pattern}</pattern>
|
||||||
|
<charset>${charset}</charset>
|
||||||
|
</encoder>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log_path}/%d{yyyy-MM-dd}/${app_name}-${hostname}-error.%i.log</fileNamePattern>
|
||||||
|
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||||
|
<maxFileSize>${max_file_size}</maxFileSize>
|
||||||
|
</timeBasedFileNamingAndTriggeringPolicy>
|
||||||
|
<maxHistory>${max_history}</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<level>ERROR</level>
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="async_log_debug" class="ch.qos.logback.classic.AsyncAppender">
|
||||||
|
<discardingThreshold>0</discardingThreshold>
|
||||||
|
<queueSize>${queueSize}</queueSize>
|
||||||
|
<appender-ref ref="debug_file_appender"/>
|
||||||
|
</appender>
|
||||||
|
<appender name="async_log_info" class="ch.qos.logback.classic.AsyncAppender">
|
||||||
|
<discardingThreshold>0</discardingThreshold>
|
||||||
|
<queueSize>${queueSize}</queueSize>
|
||||||
|
<appender-ref ref="info_file_appender"/>
|
||||||
|
</appender>
|
||||||
|
<appender name="async_log_warn" class="ch.qos.logback.classic.AsyncAppender">
|
||||||
|
<discardingThreshold>0</discardingThreshold>
|
||||||
|
<queueSize>${queueSize}</queueSize>
|
||||||
|
<appender-ref ref="warn_file_appender"/>
|
||||||
|
</appender>
|
||||||
|
<appender name="async_log_error" class="ch.qos.logback.classic.AsyncAppender">
|
||||||
|
<discardingThreshold>0</discardingThreshold>
|
||||||
|
<queueSize>${queueSize}</queueSize>
|
||||||
|
<appender-ref ref="error_file_appender"/>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<logger name="com.cskefu" level="DEBUG">
|
||||||
|
<appender-ref ref="debug_file_appender"/>
|
||||||
|
<appender-ref ref="console_appender"/>
|
||||||
|
</logger>
|
||||||
|
<!--
|
||||||
|
<springProfile name="dev">
|
||||||
|
<root level="INFO">
|
||||||
|
<appender-ref ref="console_appender"/>
|
||||||
|
<appender-ref ref="async_log_debug"/>
|
||||||
|
<appender-ref ref="async_log_info"/>
|
||||||
|
<appender-ref ref="async_log_warn"/>
|
||||||
|
<appender-ref ref="async_log_error"/>
|
||||||
|
</root>
|
||||||
|
</springProfile>
|
||||||
|
<springProfile name="test">
|
||||||
|
<root level="INFO">
|
||||||
|
<appender-ref ref="console_appender"/>
|
||||||
|
<appender-ref ref="async_log_debug"/>
|
||||||
|
<appender-ref ref="async_log_info"/>
|
||||||
|
<appender-ref ref="async_log_warn"/>
|
||||||
|
<appender-ref ref="async_log_error"/>
|
||||||
|
</root>
|
||||||
|
</springProfile>
|
||||||
|
<springProfile name="pre">
|
||||||
|
<root level="INFO">
|
||||||
|
<appender-ref ref="async_log_debug"/>
|
||||||
|
<appender-ref ref="async_log_info"/>
|
||||||
|
<appender-ref ref="async_log_warn"/>
|
||||||
|
<appender-ref ref="async_log_error"/>
|
||||||
|
</root>
|
||||||
|
</springProfile>
|
||||||
|
<springProfile name="pro">
|
||||||
|
<root level="INFO">
|
||||||
|
<appender-ref ref="async_log_debug"/>
|
||||||
|
<appender-ref ref="async_log_info"/>
|
||||||
|
<appender-ref ref="async_log_warn"/>
|
||||||
|
<appender-ref ref="async_log_error"/>
|
||||||
|
</root>
|
||||||
|
</springProfile> -->
|
||||||
|
<root level="DEBUG">
|
||||||
|
<appender-ref ref="async_log_debug"/>
|
||||||
|
<appender-ref ref="async_log_info"/>
|
||||||
|
<appender-ref ref="async_log_warn"/>
|
||||||
|
<appender-ref ref="async_log_error"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
@ -4,7 +4,7 @@
|
|||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<groupId>com.cskefu</groupId>
|
<groupId>com.cskefu</groupId>
|
||||||
<artifactId>cskefu-backend</artifactId>
|
<artifactId>cskefu-backend</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<name>cskefu-backend</name>
|
<name>cskefu-backend</name>
|
||||||
@ -34,11 +34,11 @@
|
|||||||
<argLine>-Dfile.encoding=UTF-8</argLine>
|
<argLine>-Dfile.encoding=UTF-8</argLine>
|
||||||
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
|
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
|
||||||
|
|
||||||
<maven.compiler.source>21</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
<maven.compiler.target>21</maven.compiler.target>
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
<java.version>21</java.version>
|
<java.version>17</java.version>
|
||||||
|
|
||||||
<cskefu.assistant.version>1.0.0</cskefu.assistant.version>
|
<cskefu.assistant.version>1.0.0-SNAPSHOT</cskefu.assistant.version>
|
||||||
|
|
||||||
<jjwt.version>0.11.5</jjwt.version>
|
<jjwt.version>0.11.5</jjwt.version>
|
||||||
<mybatis.flex.version>1.6.6</mybatis.flex.version>
|
<mybatis.flex.version>1.6.6</mybatis.flex.version>
|
||||||
@ -47,6 +47,7 @@
|
|||||||
<lombok.version>1.18.30</lombok.version>
|
<lombok.version>1.18.30</lombok.version>
|
||||||
<spring.boot.version>3.1.3</spring.boot.version>
|
<spring.boot.version>3.1.3</spring.boot.version>
|
||||||
<spring.cloud.version>2022.0.4</spring.cloud.version>
|
<spring.cloud.version>2022.0.4</spring.cloud.version>
|
||||||
|
<spring.cloud.alibaba.version>2022.0.0.0</spring.cloud.alibaba.version>
|
||||||
<jakarta.servlet.version>6.0.0</jakarta.servlet.version>
|
<jakarta.servlet.version>6.0.0</jakarta.servlet.version>
|
||||||
<jakarta.validation.version>3.0.2</jakarta.validation.version>
|
<jakarta.validation.version>3.0.2</jakarta.validation.version>
|
||||||
<netty.socketio.version>2.0.3</netty.socketio.version>
|
<netty.socketio.version>2.0.3</netty.socketio.version>
|
||||||
@ -56,6 +57,12 @@
|
|||||||
<bean.searcher.version>3.8.2</bean.searcher.version>
|
<bean.searcher.version>3.8.2</bean.searcher.version>
|
||||||
<redisson.starter.version>3.23.5</redisson.starter.version>
|
<redisson.starter.version>3.23.5</redisson.starter.version>
|
||||||
<smart.doc.version>2.6.4</smart.doc.version>
|
<smart.doc.version>2.6.4</smart.doc.version>
|
||||||
|
<git.commit.plugin.version>6.0.0</git.commit.plugin.version>
|
||||||
|
<jib.maven.plugin.version>3.4.0</jib.maven.plugin.version>
|
||||||
|
<springboot.maven.plugin.version>3.1.4</springboot.maven.plugin.version>
|
||||||
|
|
||||||
|
<docker.image.prefix>cskefu</docker.image.prefix>
|
||||||
|
<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
|
||||||
</properties>
|
</properties>
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
@ -86,6 +93,13 @@
|
|||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
||||||
|
<version>${spring.cloud.alibaba.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
@ -177,11 +191,35 @@
|
|||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
<build>
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>io.github.git-commit-id</groupId>
|
||||||
|
<artifactId>git-commit-id-maven-plugin</artifactId>
|
||||||
|
<version>${git.commit.plugin.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>get-the-git-infos</id>
|
||||||
|
<phase>initialize</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>revision</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<dotGitDirectory>../.git</dotGitDirectory>
|
||||||
|
<verbose>false</verbose>
|
||||||
|
<dateFormat>yyyy-MM-dd HH:mm:ss</dateFormat>
|
||||||
|
<generateGitPropertiesFile>true</generateGitPropertiesFile>
|
||||||
|
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
<pluginManagement>
|
<pluginManagement>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<version>${springboot.maven.plugin.version}</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<goals>
|
<goals>
|
||||||
@ -207,9 +245,54 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.google.cloud.tools</groupId>
|
||||||
|
<artifactId>jib-maven-plugin</artifactId>
|
||||||
|
<version>${jib.maven.plugin.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>build-image</id>
|
||||||
|
<phase>deploy</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>build</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<from>
|
||||||
|
<image>${docker.image.prefix}/openjdk-21:debian-stretch-slim</image>
|
||||||
|
</from>
|
||||||
|
<to>
|
||||||
|
<image>${docker.image.prefix}/${project.artifactId}:latest</image>
|
||||||
|
<tags>
|
||||||
|
<tag>v9-${git.commit.id.abbrev}</tag>
|
||||||
|
<tag>${maven.build.timestamp}-${git.commit.id.abbrev}</tag>
|
||||||
|
</tags>
|
||||||
|
</to>
|
||||||
|
<allowInsecureRegistries>true</allowInsecureRegistries>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-antrun-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>run</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<tasks>
|
||||||
|
<copy file="../../logback-spring.xml" tofile="${project.build.outputDirectory}/logback-spring.xml"/>
|
||||||
|
</tasks>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</pluginManagement>
|
</pluginManagement>
|
||||||
</build>
|
</build>
|
||||||
|
<!--
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
<id>chatopera-releases</id>
|
<id>chatopera-releases</id>
|
||||||
@ -222,4 +305,5 @@
|
|||||||
<url>https://nexus.chatopera.com/repository/maven-snapshots/</url>
|
<url>https://nexus.chatopera.com/repository/maven-snapshots/</url>
|
||||||
</snapshotRepository>
|
</snapshotRepository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
|
-->
|
||||||
</project>
|
</project>
|
||||||
|
2
cskefu-backend/v9.mysql.init.sql
Normal file
2
cskefu-backend/v9.mysql.init.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
create database if not exists cskefu default charset utf8mb4 collate utf8mb4_unicode_ci;
|
||||||
|
use cskefu;
|
@ -1,4 +0,0 @@
|
|||||||
create
|
|
||||||
database if not exists cskefu default charset utf8mb4 collate utf8mb4_unicode_ci;
|
|
||||||
use
|
|
||||||
cskefu;
|
|
2
database/redis/.gitignore
vendored
2
database/redis/.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
@ -1,18 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
###########################################
|
|
||||||
#
|
|
||||||
###########################################
|
|
||||||
|
|
||||||
# constants
|
|
||||||
baseDir=$(cd `dirname "$0"`;pwd)
|
|
||||||
# functions
|
|
||||||
|
|
||||||
# main
|
|
||||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
|
||||||
cd $baseDir/../..
|
|
||||||
if [ -f docker-compose.yml ]; then
|
|
||||||
docker-compose up redis
|
|
||||||
else
|
|
||||||
echo "Invalid docker compose."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
@ -1,18 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
###########################################
|
|
||||||
#
|
|
||||||
###########################################
|
|
||||||
|
|
||||||
# constants
|
|
||||||
baseDir=$(cd `dirname "$0"`;pwd)
|
|
||||||
# functions
|
|
||||||
|
|
||||||
# main
|
|
||||||
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
|
|
||||||
cd $baseDir/../..
|
|
||||||
if [ -f docker-compose.yml ]; then
|
|
||||||
docker-compose down redis
|
|
||||||
else
|
|
||||||
echo "Invalid docker compose."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
3
database/redis/data/.gitignore
vendored
3
database/redis/data/.gitignore
vendored
@ -1,3 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
||||||
|
|
@ -1,93 +0,0 @@
|
|||||||
version: "3"
|
|
||||||
services:
|
|
||||||
contact-center:
|
|
||||||
image: ${CC_IMAGE:-cskefu/contact-center:develop}
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- "${CC_WEB_PORT:-8035}:8035"
|
|
||||||
- "${CC_SOCKET_PORT:-8036}:8036"
|
|
||||||
volumes:
|
|
||||||
- ./contact-center/data:/data
|
|
||||||
- ./contact-center/logs:/logs
|
|
||||||
environment:
|
|
||||||
- "JAVA_OPTS=-Xmx${CC_JAVA_XMX:-12288m} -Xms${CC_JAVA_XMS:-2048m} -XX:PermSize=256m -XX:MaxPermSize=1024m -Djava.net.preferIPv4Stack=true --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -Dio.netty.tryReflectionSetAccessible=true --illegal-access=warn"
|
|
||||||
- SERVER_PORT=8035
|
|
||||||
- SERVER_LOG_PATH=/logs
|
|
||||||
- SERVER_LOG_LEVEL=${LOG_LEVEL:-WARN}
|
|
||||||
- WEB_UPLOAD_PATH=/data
|
|
||||||
- UK_IM_SERVER_PORT=8036
|
|
||||||
- UK_IM_SERVER_HOST=localhost
|
|
||||||
- UK_IM_SERVER_THREADS=10
|
|
||||||
# 春松客服配置 HTTPs / HTTPs for CSKeFu
|
|
||||||
# In detail
|
|
||||||
# 1) https://chatopera.blog.csdn.net/article/details/105820829
|
|
||||||
# 2) https://github.com/cskefu/cskefu/issues/414#issuecomment-1437767407
|
|
||||||
# In short
|
|
||||||
# 1) Setup Load Balancing / Reverse Proxy
|
|
||||||
# 2) Modify CS_IM_SERVER_SSL_PORT
|
|
||||||
# set CS_IM_SERVER_SSL_PORT=443
|
|
||||||
- CS_IM_SERVER_SSL_PORT=${CC_SOCKET_PORT:-8036}
|
|
||||||
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/cosinee?useUnicode=true&characterEncoding=UTF-8
|
|
||||||
- SPRING_DATASOURCE_USERNAME=root
|
|
||||||
- SPRING_DATASOURCE_PASSWORD=${DB_PASSWD:-123456}
|
|
||||||
- SPRING_DATA_REDIS_HOST=redis
|
|
||||||
- SPRING_DATA_REDIS_PORT=6379
|
|
||||||
- SPRING_DATA_REDIS_PASSWORD=${DB_PASSWD:-123456}
|
|
||||||
- SPRING_ACTIVEMQ_BROKER_URL=tcp://activemq:61616
|
|
||||||
- CSKEFU_MODULE_CALLOUT=false
|
|
||||||
- CSKEFU_MODULE_CONTACTS=true
|
|
||||||
- CSKEFU_MODULE_CHATBOT=true
|
|
||||||
- CACHE_SETUP_STRATEGY=${CACHE_SETUP_STRATEGY:-create_by_force}
|
|
||||||
- SKYPE_CHANNEL_CRM=${SKYPE_CHANNEL_CRM:-placeholder}
|
|
||||||
- BOT_THRESHOLD_FAQ_BEST_REPLY=${BOT_THRESHOLD_FAQ_BEST_REPLY:-0.9}
|
|
||||||
- BOT_THRESHOLD_FAQ_SUGG_REPLY=${BOT_THRESHOLD_FAQ_SUGG_REPLY:-0.1}
|
|
||||||
- CSKEFU_SETTINGS_WEBIM_VISITOR_SEPARATE=true
|
|
||||||
- TONGJI_BAIDU_SITEKEY=${TONGJI_BAIDU_SITEKEY:-placeholder}
|
|
||||||
- EXTRAS_LOGIN_BANNER=${NOTICE_LOGIN_BANNER:-off}
|
|
||||||
- EXTRAS_LOGIN_CHATBOX=${EXTRAS_LOGIN_CHATBOX:-off}
|
|
||||||
- EXTRAS_AUTH_SUPER_ADMIN_PASS=${EXTRAS_AUTH_SUPER_ADMIN_PASS:-}
|
|
||||||
- EXTRAS_LOG_REQUEST=${EXTRAS_LOG_REQUEST:-off}
|
|
||||||
depends_on:
|
|
||||||
- mysql
|
|
||||||
- redis
|
|
||||||
- activemq
|
|
||||||
|
|
||||||
activemq:
|
|
||||||
image: cskefu/activemq:5.14.3
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
- ACTIVEMQ_ADMIN_LOGIN=admin
|
|
||||||
- ACTIVEMQ_ADMIN_PASSWORD=${DB_PASSWD:-123456}
|
|
||||||
- ACTIVEMQ_ENABLED_SCHEDULER=true
|
|
||||||
- ACTIVEMQ_MIN_MEMORY=1024
|
|
||||||
- ACTIVEMQ_MAX_MEMORY=4096
|
|
||||||
volumes:
|
|
||||||
- ./database/activemq/data:/data
|
|
||||||
- ./database/activemq/logs:/var/log/activemq
|
|
||||||
ports:
|
|
||||||
- "${ACTIVEMQ_PORT1:-8051}:8161"
|
|
||||||
- "${ACTIVEMQ_PORT2:-8052}:61616"
|
|
||||||
- "${ACTIVEMQ_PORT3:-8053}:61613"
|
|
||||||
|
|
||||||
mysql:
|
|
||||||
image: cskefu/mysql:5.7
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
- MYSQL_ROOT_PASSWORD=${DB_PASSWD:-123456}
|
|
||||||
- MYSQL_USER=admin
|
|
||||||
- MYSQL_PASSWORD=${DB_PASSWD:-123456}
|
|
||||||
ports:
|
|
||||||
- "${MYSQL_PORT:-8037}:3306"
|
|
||||||
volumes:
|
|
||||||
- ./database/mysql/data:/var/lib/mysql
|
|
||||||
command: --max_allowed_packet=32505856
|
|
||||||
|
|
||||||
redis:
|
|
||||||
image: cskefu/redis:5.0.5
|
|
||||||
environment:
|
|
||||||
- REDIS_PASSWORD=${DB_PASSWD:-123456}
|
|
||||||
restart: always
|
|
||||||
volumes:
|
|
||||||
- ./database/redis/data:/data
|
|
||||||
ports:
|
|
||||||
- "${REDIS_PORT:-8041}:6379"
|
|
@ -1,14 +0,0 @@
|
|||||||
version: "3"
|
|
||||||
services:
|
|
||||||
nginx:
|
|
||||||
image: nginx
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- 80:80
|
|
||||||
- 443:443
|
|
||||||
volumes:
|
|
||||||
- ./nginx/logs:/var/log/nginx
|
|
||||||
- ./nginx/conf.d:/etc/nginx/conf.d
|
|
||||||
- ./nginx/certs:/certs
|
|
||||||
depends_on:
|
|
||||||
- contact-center
|
|
2
nginx/certs/.gitignore
vendored
2
nginx/certs/.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
@ -1,21 +0,0 @@
|
|||||||
server {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
client_max_body_size 100M;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
proxy_pass http://contact-center:8035;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /socket.io { proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "Upgrade";
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_pass http://contact-center:8036;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
2
nginx/logs/.gitignore
vendored
2
nginx/logs/.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
@ -1,44 +0,0 @@
|
|||||||
# 春松客服插件
|
|
||||||
|
|
||||||
本文件夹包含春松客服的开源的插件,每个插件授权参考各子目录。
|
|
||||||
|
|
||||||
## 规范
|
|
||||||
|
|
||||||
目前,春松客服插件安装是在命令行终端内完成:使用 Bash Shell 命令,链接插件源码到春松客服源码,然后编译打包 WAR 后得到插件功能。
|
|
||||||
|
|
||||||
> 提示:Windows 上使用 Git Bash 获得 Bash Shell, [https://git-scm.com/downloads](https://git-scm.com/downloads)。
|
|
||||||
|
|
||||||
不同的插件均遵循以下的规范。
|
|
||||||
|
|
||||||
### 插件安装
|
|
||||||
|
|
||||||
执行命令:
|
|
||||||
|
|
||||||
```
|
|
||||||
cd plugins/PLUGIN
|
|
||||||
./scripts/install.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
其中,`PLUGIN` 是插件的名字。
|
|
||||||
|
|
||||||
### 卸载插件
|
|
||||||
|
|
||||||
执行命令:
|
|
||||||
|
|
||||||
```
|
|
||||||
cd plugins/PLUGIN
|
|
||||||
./scripts/uninstall.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
## 应用打包
|
|
||||||
|
|
||||||
安装插件后,插件开发过程同[春松客服开发环境搭建](https://docs.cskefu.com/docs/osc/engineering)。
|
|
||||||
|
|
||||||
如果需要部署到系统测试、生产环境等,首先打包为 WAR 应用,方式如下:
|
|
||||||
|
|
||||||
```
|
|
||||||
cd contact-center
|
|
||||||
./admin/package.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
春松客服的发布形式为 Docker 镜像,如果在更改源码后,也可以使用春松客服的 Docker 镜像构建脚本发布,参考[构建脚本](https://github.com/cskefu/cskefu/blob/osc/contact-center/admin/build.sh)。
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user