Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
dc9e59ae
Commit
dc9e59ae
authored
Apr 03, 2026
by
fangxinjiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/MVP1.7.21' into MVP1.7.21
parents
265622fd
945047cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
HttpDaprUtil.java
...ifu/cloud/plus/v1/yifu/common/dapr/util/HttpDaprUtil.java
+9
-8
No files found.
yifu-common/yifu-common-dapr/src/main/java/com/yifu/cloud/plus/v1/yifu/common/dapr/util/HttpDaprUtil.java
View file @
dc9e59ae
...
@@ -17,8 +17,8 @@ import java.net.URI;
...
@@ -17,8 +17,8 @@ import java.net.URI;
@Log4j2
@Log4j2
public
class
HttpDaprUtil
{
public
class
HttpDaprUtil
{
private
static
RestTemplate
restTemplate
;
private
static
RestTemplate
restTemplate
;
private
static
HttpHeaders
headers
;
//private static HttpHeaders headers
private
static
StringBuffer
stringBuffer
;
//private static StringBuffer stringBuffer
/**
/**
* @param appUrl
* @param appUrl
...
@@ -39,7 +39,7 @@ public class HttpDaprUtil {
...
@@ -39,7 +39,7 @@ public class HttpDaprUtil {
// 实例化 RestTemplate
// 实例化 RestTemplate
initResTemplate
();
initResTemplate
();
// 初始化请求URL
// 初始化请求URL
initUrl
(
appUrl
,
appId
,
method
,
param
);
StringBuilder
stringBuffer
=
initUrl
(
appUrl
,
appId
,
method
,
param
);
ResponseEntity
<
T
>
res
;
ResponseEntity
<
T
>
res
;
try
{
try
{
res
=
restTemplate
.
getForEntity
(
stringBuffer
.
toString
(),
cs
);
res
=
restTemplate
.
getForEntity
(
stringBuffer
.
toString
(),
cs
);
...
@@ -73,7 +73,7 @@ public class HttpDaprUtil {
...
@@ -73,7 +73,7 @@ public class HttpDaprUtil {
// 实例化 RestTemplate
// 实例化 RestTemplate
initResTemplate
();
initResTemplate
();
// 初始化请求URL
// 初始化请求URL
initUrl
(
appUrl
,
appId
,
method
,
param
);
StringBuilder
stringBuffer
=
initUrl
(
appUrl
,
appId
,
method
,
param
);
ResponseEntity
<
T
>
res
;
ResponseEntity
<
T
>
res
;
HttpHeaders
headers
=
new
HttpHeaders
();
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
add
(
SecurityConstants
.
FROM
,
from
);
headers
.
add
(
SecurityConstants
.
FROM
,
from
);
...
@@ -101,7 +101,7 @@ public class HttpDaprUtil {
...
@@ -101,7 +101,7 @@ public class HttpDaprUtil {
// 实例化 RestTemplate
// 实例化 RestTemplate
initResTemplate
();
initResTemplate
();
// 初始化请求URL
// 初始化请求URL
initUrl
(
appUrl
,
appId
,
method
,
""
);
StringBuilder
stringBuffer
=
initUrl
(
appUrl
,
appId
,
method
,
""
);
ResponseEntity
<
T
>
res
;
ResponseEntity
<
T
>
res
;
HttpHeaders
headers
=
new
HttpHeaders
();
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
add
(
SecurityConstants
.
FROM
,
from
);
headers
.
add
(
SecurityConstants
.
FROM
,
from
);
...
@@ -136,13 +136,14 @@ public class HttpDaprUtil {
...
@@ -136,13 +136,14 @@ public class HttpDaprUtil {
* @author fxj
* @author fxj
* @date 2022/5/23 18:11
* @date 2022/5/23 18:11
*/
*/
private
static
void
initUrl
(
String
appUrl
,
String
appId
,
String
method
,
String
param
)
{
private
static
StringBuilder
initUrl
(
String
appUrl
,
String
appId
,
String
method
,
String
param
)
{
stringBuffer
=
new
StringBuff
er
();
StringBuilder
stringBuffer
=
new
StringBuild
er
();
stringBuffer
.
append
(
appUrl
);
stringBuffer
.
append
(
appUrl
);
stringBuffer
.
append
(
appId
);
stringBuffer
.
append
(
appId
);
stringBuffer
.
append
(
"/method"
);
stringBuffer
.
append
(
"/method"
);
stringBuffer
.
append
(
method
);
stringBuffer
.
append
(
method
);
stringBuffer
.
append
(
param
);
stringBuffer
.
append
(
param
);
return
stringBuffer
;
}
}
public
static
<
T
>
R
<
T
>
invokeMethodGetR
(
String
appUrl
,
public
static
<
T
>
R
<
T
>
invokeMethodGetR
(
String
appUrl
,
...
@@ -152,7 +153,7 @@ public class HttpDaprUtil {
...
@@ -152,7 +153,7 @@ public class HttpDaprUtil {
// 实例化 RestTemplate
// 实例化 RestTemplate
initResTemplate
();
initResTemplate
();
// 初始化请求URL
// 初始化请求URL
initUrl
(
appUrl
,
appId
,
method
,
param
);
StringBuilder
stringBuffer
=
initUrl
(
appUrl
,
appId
,
method
,
param
);
ResponseEntity
<
R
>
res
;
ResponseEntity
<
R
>
res
;
try
{
try
{
res
=
restTemplate
.
getForEntity
(
stringBuffer
.
toString
(),
R
.
class
);
res
=
restTemplate
.
getForEntity
(
stringBuffer
.
toString
(),
R
.
class
);
...
...
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