Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
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
haoban3.0
haoban-manage3.0
Commits
2768cb98
Commit
2768cb98
authored
Jun 17, 2025
by
王祖波
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-recommend2' into 'developer'
加载图片缓存统计 See merge request
!2990
parents
b4af00b3
3ac1b6a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
ImageCombined.java
...haoban/manage/service/context/combined/ImageCombined.java
+5
-4
ApolloUtils.java
.../java/com/gic/haoban/manage/service/util/ApolloUtils.java
+6
-2
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/context/combined/ImageCombined.java
View file @
2768cb98
...
...
@@ -114,7 +114,7 @@ public class ImageCombined {
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
BufferedImage
largeImage
=
loadImageWithCache
(
LARGE_IMAGE_URL
);
BufferedImage
largeImage
=
loadImageWithCache
(
LARGE_IMAGE_URL
,
""
);
BufferedImage
qrCodeImage
=
ImageIO
.
read
(
new
URL
(
QR_CODE_URL
));
int
showStyle
=
0
;
...
...
@@ -124,6 +124,7 @@ public class ImageCombined {
}
public
static
byte
[]
getCombinedImage
(
CombinedQDTO
combinedQDTO
)
throws
Exception
{
String
enterpriseId
=
combinedQDTO
.
getEnterpriseId
();
String
imageUrl
=
combinedQDTO
.
getImageUrl
();
String
qrCodeUrl
=
combinedQDTO
.
getQrCodeUrl
();
Integer
showStyle
=
combinedQDTO
.
getShowStyle
();
...
...
@@ -136,7 +137,7 @@ public class ImageCombined {
//压缩图片的参数
imageUrl
=
imageUrl
+
"?imageView2/2/w/1080/h/10800/format/jpg"
;
logger
.
info
(
"加载要合成的图片开始1"
);
BufferedImage
largeImage
=
loadImageWithCache
(
imageUrl
);
BufferedImage
largeImage
=
loadImageWithCache
(
imageUrl
,
enterpriseId
);
logger
.
info
(
"加载要合成的图片开始2"
);
BufferedImage
qrCodeImage
=
loadImageWithReader
(
qrCodeUrl
);
logger
.
info
(
"加载要合成的图片结束"
);
...
...
@@ -182,8 +183,8 @@ public class ImageCombined {
/**
* 从缓存中加载图像
*/
private
static
BufferedImage
loadImageWithCache
(
String
url
)
{
boolean
useCache
=
ApolloUtils
.
combinedCache
();
private
static
BufferedImage
loadImageWithCache
(
String
url
,
String
enterpriseId
)
{
boolean
useCache
=
ApolloUtils
.
combinedCache
(
enterpriseId
);
if
(!
useCache
)
{
logger
.
info
(
"非缓存加载图片:{}"
,
url
);
return
loadImageWithReader
(
url
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/util/ApolloUtils.java
View file @
2768cb98
...
...
@@ -69,13 +69,17 @@ public class ApolloUtils {
return
Integer
.
parseInt
(
combinedFontsType
);
}
public
static
boolean
combinedCache
()
{
public
static
boolean
combinedCache
(
String
enterpriseId
)
{
Config
config
=
ConfigService
.
getAppConfig
();
String
combinedCache
=
config
.
getProperty
(
"combinedCache"
,
""
);
if
(
StringUtils
.
isBlank
(
combinedCache
))
{
return
false
;
}
return
true
;
String
combinedCacheEid
=
config
.
getProperty
(
"combinedCacheEid"
,
""
);
if
(
StringUtils
.
isBlank
(
combinedCacheEid
))
{
return
true
;
}
return
combinedCacheEid
.
contains
(
enterpriseId
);
}
/**
...
...
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