Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-cloud-core
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xingmin
yd-cloud-core
Commits
69b161e2
Commit
69b161e2
authored
Apr 30, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
6d03b2ba
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
106 additions
and
1 deletions
+106
-1
yd-auth-core/src/main/java/com/yd/auth/core/dto/AuthUserDto.java
+5
-0
yd-auth-core/src/main/java/com/yd/auth/core/service/impl/AuthUserDetailsService.java
+1
-0
yd-common/src/main/java/com/yd/common/utils/ChineseTextConverter.java
+2
-1
yd-common/src/main/java/com/yd/common/utils/EnglishTextUtil.java
+44
-0
yd-common/src/main/java/com/yd/common/utils/UrlPathExtractor.java
+54
-0
No files found.
yd-auth-core/src/main/java/com/yd/auth/core/dto/AuthUserDto.java
View file @
69b161e2
...
@@ -34,6 +34,11 @@ public class AuthUserDto implements UserDetails {
...
@@ -34,6 +34,11 @@ public class AuthUserDto implements UserDetails {
private
String
username
;
private
String
username
;
/**
/**
* 真实姓名
*/
private
String
realName
;
/**
* 加密后的密码(实现UserDetails接口必需)
* 加密后的密码(实现UserDetails接口必需)
*/
*/
private
String
password
;
private
String
password
;
...
...
yd-auth-core/src/main/java/com/yd/auth/core/service/impl/AuthUserDetailsService.java
View file @
69b161e2
...
@@ -51,6 +51,7 @@ public class AuthUserDetailsService implements UserDetailsService {
...
@@ -51,6 +51,7 @@ public class AuthUserDetailsService implements UserDetailsService {
authUserDto
=
new
AuthUserDto
();
authUserDto
=
new
AuthUserDto
();
BeanUtils
.
copyProperties
(
response
,
authUserDto
);
BeanUtils
.
copyProperties
(
response
,
authUserDto
);
authUserDto
.
setUsername
(
response
.
getUserName
());
authUserDto
.
setUsername
(
response
.
getUserName
());
authUserDto
.
setRealName
(
response
.
getRealName
());
// 查询用户角色 TODO
// 查询用户角色 TODO
// authUserDto.setRoles(roles);
// authUserDto.setRoles(roles);
...
...
yd-common/src/main/java/com/yd/common/utils/ChineseTextConverter.java
View file @
69b161e2
...
@@ -54,6 +54,6 @@ public class ChineseTextConverter {
...
@@ -54,6 +54,6 @@ public class ChineseTextConverter {
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
traditionalToSimplified
(
"
鑫安逸儲蓄保險计划
"
));
System
.
out
.
println
(
traditionalToSimplified
(
"
JAVA IS FUN
"
));
}
}
}
}
\ No newline at end of file
yd-common/src/main/java/com/yd/common/utils/EnglishTextUtil.java
0 → 100644
View file @
69b161e2
package
com
.
yd
.
common
.
utils
;
import
org.apache.commons.lang3.StringUtils
;
import
java.util.Locale
;
/**
* 英文文本工具类
*/
public
final
class
EnglishTextUtil
{
// 私有构造器,防止实例化
private
EnglishTextUtil
()
{
throw
new
UnsupportedOperationException
(
"Utility class cannot be instantiated"
);
}
/**
* 将输入字符串中的英文字母转换为小写。
*
* @param text 待转换的字符串,可以为 null
* @return 转换后的小写字符串;如果输入为 null,则返回 null
*/
public
static
String
toLowerCase
(
String
text
)
{
if
(
text
==
null
)
{
return
null
;
}
// 使用英语区域设置进行转换,避免土耳其语等特殊语言环境下的错误
return
text
.
toLowerCase
(
Locale
.
ENGLISH
);
}
// 可选的空安全版本,将 null 转为空字符串
public
static
String
toLowerCaseSafe
(
String
text
)
{
return
StringUtils
.
isBlank
(
text
)
?
""
:
text
.
toLowerCase
(
Locale
.
ENGLISH
);
}
// 简单测试
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
toLowerCase
(
"扎根"
));
// hello world
System
.
out
.
println
(
toLowerCase
(
"JAVA IS FUN"
));
// java is fun
System
.
out
.
println
(
toLowerCase
(
null
));
// null
System
.
out
.
println
(
toLowerCaseSafe
(
null
));
// (空字符串)
}
}
\ No newline at end of file
yd-common/src/main/java/com/yd/common/utils/UrlPathExtractor.java
0 → 100644
View file @
69b161e2
package
com
.
yd
.
common
.
utils
;
import
java.net.URI
;
import
java.net.URISyntaxException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
public
class
UrlPathExtractor
{
/**
* 从分号分隔的 URL 中提取路径部分,并去掉开头的 "/"
*/
public
static
List
<
String
>
extractPaths
(
String
urlStr
)
{
if
(
urlStr
==
null
||
urlStr
.
isEmpty
())
{
return
new
ArrayList
<>();
}
return
Arrays
.
stream
(
urlStr
.
split
(
";"
))
.
map
(
String:
:
trim
)
.
filter
(
s
->
!
s
.
isEmpty
())
.
map
(
UrlPathExtractor:
:
getPath
)
.
collect
(
Collectors
.
toList
());
}
/**
* 从单个 URL 中提取路径,并去掉开头的 "/"
*/
private
static
String
getPath
(
String
url
)
{
try
{
URI
uri
=
new
URI
(
url
);
String
path
=
uri
.
getPath
();
// 例如 /pc/test/png/...
if
(
path
!=
null
&&
path
.
startsWith
(
"/"
))
{
path
=
path
.
substring
(
1
);
// 去掉开头斜杠
}
return
path
;
}
catch
(
URISyntaxException
e
)
{
// 解析失败时,直接返回原字符串(可按需处理)
return
url
.
startsWith
(
"/"
)
?
url
.
substring
(
1
)
:
url
;
}
}
// 测试
public
static
void
main
(
String
[]
args
)
{
String
input
=
"https://yd-ali-oss.oss-cn-shanghai-finance-1-pub.aliyuncs111.com/pc/test/png/2026/04/28/253339f4a88e4eaa8a0c78618df3cf07.png;"
+
"https://yd-ali-oss.oss-cn-shanghai-finance-1-pub.11aliyuncs222.com/pc/test/png/2026/04/27/aeca68e15d8d4301acc2d62ed2f31f4e.png"
;
List
<
String
>
paths
=
extractPaths
(
input
);
System
.
out
.
println
(
"["
+
String
.
join
(
", "
,
paths
)
+
"]"
);
}
}
\ No newline at end of file
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