Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-execute-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3c2a6874
authored
Jan 02, 2024
by
Hayreal
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/v2.0.1' into v2.0.1
2 parents
151d60c1
181ad4ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
platform-execute/src/main/java/cn/com/glsx/execute/modules/service/shorturl/ShortUrlService.java
platform-execute/src/main/java/cn/com/glsx/execute/modules/service/shorturl/ShortUrlService.java
View file @
3c2a687
...
@@ -177,7 +177,7 @@ public class ShortUrlService {
...
@@ -177,7 +177,7 @@ public class ShortUrlService {
boolean
flag
;
boolean
flag
;
int
count
=
0
;
int
count
=
0
;
do
{
do
{
if
(
count
++
>
0
)
builder
.
append
(
UUID
.
randomUUID
());
builder
.
append
(
UUID
.
randomUUID
());
code
=
getCompressCode
(
builder
.
toString
());
code
=
getCompressCode
(
builder
.
toString
());
shortUrl
=
UrlUtil
.
splicingUrl
(
domain
.
getProtocol
(),
domain
.
getDomainValue
(),
code
);
shortUrl
=
UrlUtil
.
splicingUrl
(
domain
.
getProtocol
(),
domain
.
getDomainValue
(),
code
);
urlMapDto
.
setCompressCode
(
code
);
urlMapDto
.
setCompressCode
(
code
);
...
@@ -185,7 +185,7 @@ public class ShortUrlService {
...
@@ -185,7 +185,7 @@ public class ShortUrlService {
urlMapDto
.
setShortUrlDigest
(
DigestUtils
.
sha1Hex
(
shortUrl
));
urlMapDto
.
setShortUrlDigest
(
DigestUtils
.
sha1Hex
(
shortUrl
));
flag
=
atomicSelectAndSaveUrlMap
(
urlMapDto
,
code
);
flag
=
atomicSelectAndSaveUrlMap
(
urlMapDto
,
code
);
}
while
(!
flag
);
}
while
(!
flag
);
if
(
count
>
5
)
log
.
warn
(
"{}该链接的短链压缩码生成已重复超过{}次"
,
longUrl
,
count
);
//
if (count > 5) log.warn("{}该链接的短链压缩码生成已重复超过{}次", longUrl, count);
// 返回短链
// 返回短链
log
.
info
(
"短链服务生成短链返回 response:{}"
,
shortUrl
);
log
.
info
(
"短链服务生成短链返回 response:{}"
,
shortUrl
);
return
shortUrl
;
return
shortUrl
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment