Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
long-tern-care-service
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hubin
long-tern-care-service
Commits
67c08597
Commit
67c08597
authored
Apr 22, 2021
by
zhangch
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://129.211.99.254:8088/hg-hubin/long-tern-care-service
parents
f1e1cf19
510bf591
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
65 additions
and
165 deletions
+65
-165
Dockerfile
Dockerfile
+18
-0
bootstrap.yml
apply/apply-service/src/main/resources/bootstrap.yml
+2
-2
bootstrap.yml
...sment/assessment-service/src/main/resources/bootstrap.yml
+2
-2
bootstrap.yml
auth-service/src/main/resources/bootstrap.yml
+2
-2
pom.xml
common/common-core/pom.xml
+1
-0
RequestUtils.java
...ore/src/main/java/com/hungraim/ltc/util/RequestUtils.java
+0
-149
pom.xml
common/common-mybatis/pom.xml
+5
-2
pom.xml
common/common-redis/pom.xml
+1
-0
bootstrap.yml
gateway-service/src/main/resources/bootstrap.yml
+2
-2
bootstrap.yml
governance/src/main/resources/bootstrap.yml
+2
-2
pom.xml
pom.xml
+1
-1
run.sh
run.sh
+10
-0
start.sh
start.sh
+15
-0
DOCKERFILE
system/system-admin-service/DOCKERFILE
+1
-1
bootstrap.yml
system/system-admin-service/src/main/resources/bootstrap.yml
+2
-2
pom.xml
system/system-api/pom.xml
+1
-0
No files found.
Dockerfile
0 → 100644
View file @
67c08597
#指定依赖的镜像
FROM
java:8
#springboot
VOLUME
/tmp
#容器使用端口
EXPOSE
8000
#添加jar包入容器
ADD
./apply/apply-service/target/apply-service-0.0.1.jar /apply.jar
ADD
./assessment/assessment-service/target/assessment-service-0.0.1.jar /assessment.jar
ADD
./auth-service/target/auth-0.0.1.jar /auth.jar
ADD
./gateway-service/target/gateway-0.0.1.jar /gateway.jar
ADD
./governance/target/governance-0.0.1.jar /governance.jar
ADD
./system/system-admin-service/target/system-admin-0.0.1.jar /system-admin.jar
ADD
start.sh /start.sh
RUN
chmod
+x /start.sh
ENTRYPOINT
["sh","-c","./start.sh"]
apply/apply-service/src/main/resources/bootstrap.yml
View file @
67c08597
...
...
@@ -10,9 +10,9 @@ spring:
nacos
:
discovery
:
server-addr
:
qw.hungraim.com:31158
namespace
:
87d6f6f1-6583-46ea-ad02-7e8125f03c9
0
namespace
:
0e0f834a-a665-4d27-ae04-9d53c2e0214
0
config
:
namespace
:
87d6f6f1-6583-46ea-ad02-7e8125f03c9
0
namespace
:
0e0f834a-a665-4d27-ae04-9d53c2e0214
0
server-addr
:
qw.hungraim.com:31158
file-extension
:
yaml
# 必须修改成yaml
extension-configs
:
...
...
assessment/assessment-service/src/main/resources/bootstrap.yml
View file @
67c08597
...
...
@@ -10,9 +10,9 @@ spring:
nacos
:
discovery
:
server-addr
:
qw.hungraim.com:31158
namespace
:
87d6f6f1-6583-46ea-ad02-7e8125f03c9
0
namespace
:
0e0f834a-a665-4d27-ae04-9d53c2e0214
0
config
:
namespace
:
87d6f6f1-6583-46ea-ad02-7e8125f03c9
0
namespace
:
0e0f834a-a665-4d27-ae04-9d53c2e0214
0
server-addr
:
qw.hungraim.com:31158
file-extension
:
yaml
# 必须修改成yaml
extension-configs
:
...
...
auth-service/src/main/resources/bootstrap.yml
View file @
67c08597
...
...
@@ -10,9 +10,9 @@ spring:
nacos
:
discovery
:
server-addr
:
qw.hungraim.com:31158
namespace
:
87d6f6f1-6583-46ea-ad02-7e8125f03c9
0
namespace
:
0e0f834a-a665-4d27-ae04-9d53c2e0214
0
config
:
namespace
:
87d6f6f1-6583-46ea-ad02-7e8125f03c9
0
namespace
:
0e0f834a-a665-4d27-ae04-9d53c2e0214
0
server-addr
:
qw.hungraim.com:31158
file-extension
:
yaml
# 必须修改成yaml
extension-configs
:
...
...
common/common-core/pom.xml
View file @
67c08597
...
...
@@ -9,6 +9,7 @@
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
common-core
</artifactId>
<packaging>
jar
</packaging>
<build>
<plugins>
<plugin>
...
...
common/common-core/src/main/java/com/hungraim/ltc/util/RequestUtils.java
deleted
100644 → 0
View file @
f1e1cf19
package
com
.
hungraim
.
ltc
.
util
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
com.hungraim.ltc.constant.AuthConstants
;
import
lombok.SneakyThrows
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.HttpGet
;
import
org.apache.http.client.methods.HttpHead
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.entity.StringEntity
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.util.EntityUtils
;
import
org.apache.logging.log4j.util.Strings
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
sun.misc.BASE64Decoder
;
import
javax.servlet.http.HttpServletRequest
;
import
java.nio.charset.StandardCharsets
;
import
java.util.Map
;
import
java.util.Objects
;
/**
* @author hubin
*/
@Slf4j
public
class
RequestUtils
{
public
static
HttpServletRequest
getRequest
()
{
return
((
ServletRequestAttributes
)
Objects
.
requireNonNull
(
RequestContextHolder
.
getRequestAttributes
())).
getRequest
();
}
public
static
JSONObject
getJwtPayload
()
{
String
jwtPayload
=
getRequest
().
getHeader
(
AuthConstants
.
JWT_PAYLOAD_KEY
);
return
JSONUtil
.
parseObj
(
jwtPayload
);
}
@SneakyThrows
public
static
String
getAuthClientId
()
{
String
clientId
;
HttpServletRequest
request
=
getRequest
();
// 从请求路径中获取
clientId
=
request
.
getParameter
(
AuthConstants
.
CLIENT_ID_KEY
);
if
(
StrUtil
.
isNotBlank
(
clientId
))
{
return
clientId
;
}
// 从请求头获取
String
basic
=
request
.
getHeader
(
AuthConstants
.
AUTHORIZATION_KEY
);
if
(
StrUtil
.
isNotBlank
(
basic
)
&&
basic
.
startsWith
(
AuthConstants
.
BASIC_PREFIX
))
{
basic
=
basic
.
replace
(
AuthConstants
.
BASIC_PREFIX
,
Strings
.
EMPTY
);
String
basicPlainText
=
new
String
(
new
BASE64Decoder
().
decodeBuffer
(
basic
),
StandardCharsets
.
UTF_8
);
//client:secret
clientId
=
basicPlainText
.
split
(
":"
)[
0
];
}
return
clientId
;
}
/**
* 发起http post请求
*
* @param url 请求地址
* @param entity 请求参数
* @return 返回信息,出错返回空
*/
@SneakyThrows
public
static
String
post
(
String
url
,
JSONObject
entity
,
Map
<
String
,
String
>
header
)
{
CloseableHttpClient
httpClient
=
HttpClients
.
createDefault
();
CloseableHttpResponse
response
=
null
;
try
{
HttpPost
httpPost
=
new
HttpPost
(
url
);
HttpHead
httpHead
=
new
HttpHead
();
//设置head
if
(
header
!=
null
)
{
header
.
forEach
(
httpHead:
:
setHeader
);
}
StringEntity
se
=
new
StringEntity
(
entity
.
toString
(),
"UTF-8"
);
se
.
setContentType
(
"application/json"
);
httpPost
.
setEntity
(
se
);
response
=
httpClient
.
execute
(
httpPost
);
HttpEntity
entity1
=
response
.
getEntity
();
String
resStr
=
null
;
if
(
entity1
!=
null
)
{
resStr
=
EntityUtils
.
toString
(
entity1
,
StandardCharsets
.
UTF_8
);
}
httpClient
.
close
();
response
.
close
();
return
resStr
;
}
catch
(
Exception
e
)
{
log
.
error
(
"POST请求:{},出现错误:{}"
,
url
,
e
.
getMessage
());
e
.
printStackTrace
();
}
finally
{
if
(
httpClient
!=
null
)
{
httpClient
.
close
();
}
if
(
response
!=
null
)
{
response
.
close
();
}
}
return
""
;
}
/**
* 发起http get请求
*
* @param url 请求地址
* @return 返回信息,出错返回空
*/
@SneakyThrows
public
static
String
get
(
String
url
)
{
CloseableHttpClient
httpClient
=
HttpClients
.
createDefault
();
CloseableHttpResponse
response
=
null
;
try
{
HttpGet
httpGet
=
new
HttpGet
(
url
);
response
=
httpClient
.
execute
(
httpGet
);
HttpEntity
entity1
=
response
.
getEntity
();
String
resStr
=
null
;
if
(
entity1
!=
null
)
{
resStr
=
EntityUtils
.
toString
(
entity1
,
StandardCharsets
.
UTF_8
);
}
httpClient
.
close
();
response
.
close
();
return
resStr
;
}
catch
(
Exception
e
)
{
log
.
error
(
"get请求:{},出现错误:{}"
,
url
,
e
.
getMessage
());
e
.
printStackTrace
();
}
finally
{
if
(
httpClient
!=
null
)
{
httpClient
.
close
();
}
if
(
response
!=
null
)
{
response
.
close
();
}
}
return
""
;
}
}
common/common-mybatis/pom.xml
View file @
67c08597
...
...
@@ -10,6 +10,7 @@
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
common-mybatis
</artifactId>
<packaging>
jar
</packaging>
<properties>
<maven.compiler.source>
8
</maven.compiler.source>
...
...
@@ -23,11 +24,13 @@
<artifactId>
mybatis-plus-boot-starter
</artifactId>
<version>
3.3.1
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.oracle.database.jdbc/ojdbc6 -->
<dependency>
<groupId>
com.oracle
</groupId>
<groupId>
com.oracle
.database.jdbc
</groupId>
<artifactId>
ojdbc6
</artifactId>
<version>
11.2.0.
3
</version>
<version>
11.2.0.
4
</version>
</dependency>
<!-- 引用Mybatis 和 Mysql驱动结束 -->
</dependencies>
...
...
common/common-redis/pom.xml
View file @
67c08597
...
...
@@ -10,6 +10,7 @@
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
common-redis
</artifactId>
<packaging>
jar
</packaging>
<properties>
<maven.compiler.source>
8
</maven.compiler.source>
...
...
gateway-service/src/main/resources/bootstrap.yml
View file @
67c08597
...
...
@@ -9,9 +9,9 @@ spring:
nacos
:
discovery
:
server-addr
:
qw.hungraim.com:31158
namespace
:
87d6f6f1-6583-46ea-ad02-7e8125f03c9
0
namespace
:
0e0f834a-a665-4d27-ae04-9d53c2e0214
0
config
:
namespace
:
87d6f6f1-6583-46ea-ad02-7e8125f03c9
0
namespace
:
0e0f834a-a665-4d27-ae04-9d53c2e0214
0
server-addr
:
qw.hungraim.com:31158
file-extension
:
yaml
# 必须修改成yaml
extension-configs
:
...
...
governance/src/main/resources/bootstrap.yml
View file @
67c08597
...
...
@@ -9,9 +9,9 @@ spring:
nacos
:
discovery
:
server-addr
:
qw.hungraim.com:31158
namespace
:
87d6f6f1-6583-46ea-ad02-7e8125f03c9
0
namespace
:
0e0f834a-a665-4d27-ae04-9d53c2e0214
0
config
:
namespace
:
87d6f6f1-6583-46ea-ad02-7e8125f03c9
0
namespace
:
0e0f834a-a665-4d27-ae04-9d53c2e0214
0
server-addr
:
qw.hungraim.com:31158
file-extension
:
yaml
# 必须修改成yaml
extension-configs
:
...
...
pom.xml
View file @
67c08597
...
...
@@ -9,6 +9,7 @@
<module>
system
</module>
<module>
apply
</module>
<module>
governance
</module>
<module>
assessment
</module>
</modules>
<parent>
<groupId>
org.springframework.boot
</groupId>
...
...
@@ -20,7 +21,6 @@
<groupId>
com.hungraim.ltc
</groupId>
<artifactId>
ltc
</artifactId>
<version>
0.0.1
</version>
<name>
spring-cloud-init
</name>
<description>
parent
</description>
<properties>
...
...
run.sh
0 → 100644
View file @
67c08597
#!/bin/bash
git pull
mvn
install
docker stop ltc-poc
docker rmi ltc:latest
docker build
-t
ltc
.
docker run
-d
--name
ltc-poc
-p
9999:8001
-m
2G ltc
start.sh
0 → 100644
View file @
67c08597
#!/bin/bash
mkdir
logs
nohup
java
-Xms50m
-Xmx200m
-jar
/auth.jar
>
./logs/auth.log &
nohup
java
-Xms50m
-Xmx200m
-jar
/system-admin.jar
>
./logs/admin.log &
nohup
java
-Xms50m
-Xmx200m
-jar
/gateway.jar
>
./logs/gateway.log &
nohup
java
-Xms50m
-Xmx200m
-jar
/apply.jar
>
./logs/apply.log &
nohup
java
-Xms50m
-Xmx200m
-jar
/governance.jar
>
./logs/govwenanc.log &
nohup
java
-Xms50m
-Xmx200m
-jar
/assessment.jar
>
./logs/assessment.log &
while
[[
true
]]
;
do
sleep
1
done
system/system-admin-service/DOCKERFILE
View file @
67c08597
#指定依赖的镜像
FROM
localhost:9999/library/
java:8
FROM
java:8
#springboot
VOLUME
/tmp
#容器使用端口
...
...
system/system-admin-service/src/main/resources/bootstrap.yml
View file @
67c08597
...
...
@@ -10,9 +10,9 @@ spring:
nacos
:
discovery
:
server-addr
:
qw.hungraim.com:31158
namespace
:
87d6f6f1-6583-46ea-ad02-7e8125f03c9
0
namespace
:
0e0f834a-a665-4d27-ae04-9d53c2e0214
0
config
:
namespace
:
87d6f6f1-6583-46ea-ad02-7e8125f03c9
0
namespace
:
0e0f834a-a665-4d27-ae04-9d53c2e0214
0
server-addr
:
qw.hungraim.com:31158
file-extension
:
yaml
# 必须修改成yaml
extension-configs
:
...
...
system/system-api/pom.xml
View file @
67c08597
...
...
@@ -9,6 +9,7 @@
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
system-api
</artifactId>
<packaging>
jar
</packaging>
<dependencies>
<dependency>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment