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
b9436832
Commit
b9436832
authored
Apr 22, 2021
by
hubin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加一个简易自动脚本
parent
78baaeee
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
32 additions
and
165 deletions
+32
-165
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
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.
apply/apply-service/src/main/resources/bootstrap.yml
View file @
b9436832
...
...
@@ -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 @
b9436832
...
...
@@ -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 @
b9436832
...
...
@@ -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 @
b9436832
...
...
@@ -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 @
78baaeee
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 @
b9436832
...
...
@@ -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 @
b9436832
...
...
@@ -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 @
b9436832
...
...
@@ -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 @
b9436832
...
...
@@ -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 @
b9436832
...
...
@@ -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 @
b9436832
#!/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
system/system-admin-service/DOCKERFILE
View file @
b9436832
#指定依赖的镜像
FROM
localhost:9999/library/
java:8
FROM
java:8
#springboot
VOLUME
/tmp
#容器使用端口
...
...
system/system-admin-service/src/main/resources/bootstrap.yml
View file @
b9436832
...
...
@@ -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 @
b9436832
...
...
@@ -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