Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
b75a6a7b
o2oa
项目概览
ghsby
/
o2oa
落后 Fork 源项目 2880 个版本
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b75a6a7b
编写于
12月 12, 2022
作者:
NoSubject
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/develop' into develop
上级
05af0b09
26436a24
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
392 addition
and
482 deletion
+392
-482
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Query.java
...t/src/main/java/com/x/base/core/project/config/Query.java
+4
-0
o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/BaseTools.java
...rc/main/java/com/x/base/core/project/tools/BaseTools.java
+190
-189
o2server/x_console/src/main/java/com/x/server/console/Main.java
...er/x_console/src/main/java/com/x/server/console/Main.java
+4
-22
o2server/x_console/src/main/java/com/x/server/console/action/ActionConfig.java
...c/main/java/com/x/server/console/action/ActionConfig.java
+0
-78
o2server/x_console/src/main/java/com/x/server/console/action/ActionSetPassword.java
...n/java/com/x/server/console/action/ActionSetPassword.java
+32
-31
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/config/ActionChangePassword.java
...m/x/program/center/jaxrs/config/ActionChangePassword.java
+162
-162
未找到文件。
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Query.java
浏览文件 @
b75a6a7b
...
...
@@ -475,6 +475,10 @@ public class Query extends ConfigObject {
}
}
public
String
getHdfsDirectoryPath
()
{
return
this
.
adjustHdfsDirectoryPath
();
}
private
String
adjustHdfsDirectoryPath
()
{
return
StringUtils
.
startsWith
(
this
.
hdfsDirectoryPath
,
"/"
)
?
this
.
hdfsDirectoryPath
:
"/"
+
hdfsDirectoryPath
;
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/BaseTools.java
浏览文件 @
b75a6a7b
...
...
@@ -25,6 +25,7 @@ import java.util.Map.Entry;
import
java.util.Objects
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.Gson
;
...
...
@@ -36,31 +37,31 @@ import com.x.base.core.project.logger.Logger;
import
com.x.base.core.project.logger.LoggerFactory
;
public
class
BaseTools
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
BaseTools
.
class
);
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
BaseTools
.
class
);
public
static
String
getBasePath
()
throws
IOException
,
URISyntaxException
{
return
getBaseDirectory
().
toAbsolutePath
().
toString
();
}
public
static
String
getBasePath
()
throws
IOException
,
URISyntaxException
{
return
getBaseDirectory
().
toAbsolutePath
().
toString
();
}
/**
* 从Main.class所在的目录开始递归向上,找到version.o2所在目录,就是程序根目录.
*
* @return
* @throws IOException
* @throws URISyntaxException
*/
private
static
Path
getBaseDirectory
()
throws
IOException
,
URISyntaxException
{
Path
path
=
Paths
.
get
(
new
URI
(
"file://"
+
BaseTools
.
class
.
getProtectionDomain
().
getCodeSource
().
getLocation
().
getPath
()));
while
(
Files
.
exists
(
path
))
{
Path
versionFile
=
path
.
resolve
(
"version.o2"
);
if
(
Files
.
exists
(
versionFile
)
&&
Files
.
isRegularFile
(
versionFile
))
{
return
path
.
toAbsolutePath
();
}
path
=
path
.
getParent
();
}
throw
new
IOException
(
"can not define o2server base directory."
);
}
/**
* 从Main.class所在的目录开始递归向上,找到version.o2所在目录,就是程序根目录.
*
* @return
* @throws IOException
* @throws URISyntaxException
*/
private
static
Path
getBaseDirectory
()
throws
IOException
,
URISyntaxException
{
Path
path
=
Paths
.
get
(
new
URI
(
"file://"
+
BaseTools
.
class
.
getProtectionDomain
().
getCodeSource
().
getLocation
().
getPath
()));
while
(
Files
.
exists
(
path
))
{
Path
versionFile
=
path
.
resolve
(
"version.o2"
);
if
(
Files
.
exists
(
versionFile
)
&&
Files
.
isRegularFile
(
versionFile
))
{
return
path
.
toAbsolutePath
();
}
path
=
path
.
getParent
();
}
throw
new
IOException
(
"can not define o2server base directory."
);
}
// public static File getBaseDirectory() throws Exception {
// String path = BaseTools.class.getProtectionDomain().getCodeSource().getLocation().getPath();
...
...
@@ -78,192 +79,192 @@ public class BaseTools {
// throw new Exception("can not define o2server base directory.");
// }
public
static
<
T
>
T
readConfigObject
(
String
path
,
Class
<
T
>
cls
)
throws
Exception
{
String
base
=
BaseTools
.
getBasePath
();
File
file
=
new
File
(
base
,
path
);
if
((!
file
.
exists
())
||
file
.
isDirectory
())
{
return
null
;
}
String
json
=
FileUtils
.
readFileToString
(
file
,
DefaultCharset
.
charset
);
public
static
<
T
>
T
readConfigObject
(
String
path
,
Class
<
T
>
cls
)
throws
Exception
{
String
base
=
BaseTools
.
getBasePath
();
File
file
=
new
File
(
base
,
path
);
if
((!
file
.
exists
())
||
file
.
isDirectory
())
{
return
null
;
}
String
json
=
FileUtils
.
readFileToString
(
file
,
DefaultCharset
.
charset
);
Gson
gson
=
new
Gson
();
Gson
gson
=
new
Gson
();
JsonElement
jsonElement
=
gson
.
fromJson
(
json
,
JsonElement
.
class
);
if
((
null
!=
jsonElement
)
&&
jsonElement
.
isJsonObject
())
{
LinkedHashMap
<
Object
,
Object
>
map
=
new
LinkedHashMap
<>();
map
=
new
Gson
().
fromJson
(
jsonElement
,
map
.
getClass
());
removeComment
(
map
);
jsonElement
=
gson
.
toJsonTree
(
map
);
}
return
gson
.
fromJson
(
jsonElement
,
cls
);
}
JsonElement
jsonElement
=
gson
.
fromJson
(
json
,
JsonElement
.
class
);
if
((
null
!=
jsonElement
)
&&
jsonElement
.
isJsonObject
())
{
LinkedHashMap
<
Object
,
Object
>
map
=
new
LinkedHashMap
<>();
map
=
new
Gson
().
fromJson
(
jsonElement
,
map
.
getClass
());
removeComment
(
map
);
jsonElement
=
gson
.
toJsonTree
(
map
);
}
return
gson
.
fromJson
(
jsonElement
,
cls
);
}
private
static
void
removeComment
(
Map
<
Object
,
Object
>
map
)
{
List
<
Entry
<
Object
,
Object
>>
entries
=
new
ArrayList
<>();
for
(
Entry
<
Object
,
Object
>
entry
:
map
.
entrySet
())
{
if
(
StringUtils
.
startsWith
(
Objects
.
toString
(
entry
.
getKey
()),
"###"
))
{
entries
.
add
(
entry
);
continue
;
}
else
{
if
(
entry
.
getValue
()
instanceof
Map
)
{
removeComment
((
Map
<
Object
,
Object
>)
entry
.
getValue
());
}
}
}
for
(
Entry
<
Object
,
Object
>
entry
:
entries
)
{
map
.
remove
(
entry
.
getKey
());
}
}
private
static
void
removeComment
(
Map
<
Object
,
Object
>
map
)
{
List
<
Entry
<
Object
,
Object
>>
entries
=
new
ArrayList
<>();
for
(
Entry
<
Object
,
Object
>
entry
:
map
.
entrySet
())
{
if
(
StringUtils
.
startsWith
(
Objects
.
toString
(
entry
.
getKey
()),
"###"
))
{
entries
.
add
(
entry
);
continue
;
}
else
{
if
(
entry
.
getValue
()
instanceof
Map
)
{
removeComment
((
Map
<
Object
,
Object
>)
entry
.
getValue
());
}
}
}
for
(
Entry
<
Object
,
Object
>
entry
:
entries
)
{
map
.
remove
(
entry
.
getKey
());
}
}
public
static
<
T
>
T
readConfigObject
(
String
path
,
String
otherPath
,
Class
<
T
>
cls
)
throws
Exception
{
String
base
=
BaseTools
.
getBasePath
();
File
file
=
new
File
(
base
,
path
);
if
(
file
.
exists
()
&&
file
.
isFile
())
{
return
readConfigObject
(
path
,
cls
);
}
file
=
new
File
(
base
,
otherPath
);
if
(
file
.
exists
()
&&
file
.
isFile
())
{
return
readConfigObject
(
otherPath
,
cls
);
}
throw
new
Exception
(
"can not get file with path:"
+
path
+
", otherPath:"
+
otherPath
+
"."
);
}
public
static
<
T
>
T
readConfigObject
(
String
path
,
String
otherPath
,
Class
<
T
>
cls
)
throws
Exception
{
String
base
=
BaseTools
.
getBasePath
();
File
file
=
new
File
(
base
,
path
);
if
(
file
.
exists
()
&&
file
.
isFile
())
{
return
readConfigObject
(
path
,
cls
);
}
file
=
new
File
(
base
,
otherPath
);
if
(
file
.
exists
()
&&
file
.
isFile
())
{
return
readConfigObject
(
otherPath
,
cls
);
}
throw
new
Exception
(
"can not get file with path:"
+
path
+
", otherPath:"
+
otherPath
+
"."
);
}
public
static
void
writeObject
(
String
path
,
Object
obj
)
throws
Exception
{
String
base
=
BaseTools
.
getBasePath
();
File
file
=
new
File
(
base
,
path
);
String
json
=
(
new
Gson
()).
toJson
(
obj
);
FileUtils
.
writeStringToFile
(
file
,
json
,
DefaultCharset
.
charset
);
}
public
static
void
writeObject
(
String
path
,
Object
obj
)
throws
Exception
{
String
base
=
BaseTools
.
getBasePath
();
File
file
=
new
File
(
base
,
path
);
String
json
=
(
new
Gson
()).
toJson
(
obj
);
FileUtils
.
writeStringToFile
(
file
,
json
,
DefaultCharset
.
charset
);
}
public
static
String
readCfg
(
String
path
)
throws
Exception
{
String
base
=
BaseTools
.
getBasePath
();
File
file
=
new
File
(
base
,
path
);
if
((!
file
.
exists
())
||
file
.
isDirectory
())
{
return
null
;
}
String
str
=
FileUtils
.
readFileToString
(
file
,
DefaultCharset
.
charset
);
return
(
StringUtils
.
trim
(
str
));
}
public
static
String
readCfg
(
String
path
)
throws
Exception
{
String
base
=
BaseTools
.
getBasePath
();
File
file
=
new
File
(
base
,
path
);
if
((!
file
.
exists
())
||
file
.
isDirectory
())
{
return
null
;
}
String
str
=
FileUtils
.
readFileToString
(
file
,
DefaultCharset
.
charset
);
return
(
StringUtils
.
trim
(
str
));
}
public
static
String
readCfg
(
String
path
,
String
defaultValue
)
throws
Exception
{
String
str
=
readCfg
(
path
);
if
(
StringUtils
.
isEmpty
(
str
))
{
str
=
defaultValue
;
}
return
(
StringUtils
.
trim
(
str
));
}
public
static
String
readCfg
(
String
path
,
String
defaultValue
)
throws
Exception
{
String
str
=
readCfg
(
path
);
if
(
StringUtils
.
isEmpty
(
str
))
{
str
=
defaultValue
;
}
return
(
StringUtils
.
trim
(
str
));
}
public
static
void
writeCfg
(
String
path
,
String
value
)
throws
Exception
{
String
base
=
BaseTools
.
getBasePath
();
File
file
=
new
File
(
base
,
path
);
FileUtils
.
writeStringToFile
(
file
,
StringUtils
.
trim
(
value
),
DefaultCharset
.
charset
);
}
public
static
void
writeCfg
(
String
path
,
String
value
)
throws
Exception
{
String
base
=
BaseTools
.
getBasePath
();
File
file
=
new
File
(
base
,
path
);
FileUtils
.
writeStringToFile
(
file
,
StringUtils
.
trim
(
value
),
DefaultCharset
.
charset
);
}
public
static
byte
[]
readBytes
(
String
path
)
throws
IOException
,
URISyntaxException
{
String
base
=
BaseTools
.
getBasePath
();
File
file
=
new
File
(
base
,
path
);
if
((!
file
.
exists
())
||
file
.
isDirectory
())
{
throw
new
IOException
(
"can not get file with path:"
+
file
.
getAbsolutePath
());
}
return
FileUtils
.
readFileToByteArray
(
file
);
}
public
static
byte
[]
readBytes
(
String
path
)
throws
IOException
,
URISyntaxException
{
String
base
=
BaseTools
.
getBasePath
();
File
file
=
new
File
(
base
,
path
);
if
((!
file
.
exists
())
||
file
.
isDirectory
())
{
throw
new
IOException
(
"can not get file with path:"
+
file
.
getAbsolutePath
());
}
return
FileUtils
.
readFileToByteArray
(
file
);
}
public
static
String
readString
(
String
path
)
throws
IOException
,
URISyntaxException
{
String
base
=
BaseTools
.
getBasePath
();
File
file
=
new
File
(
base
,
path
);
if
((!
file
.
exists
())
||
file
.
isDirectory
())
{
return
null
;
}
return
FileUtils
.
readFileToString
(
file
,
DefaultCharset
.
charset
);
}
public
static
String
readString
(
String
path
)
throws
IOException
,
URISyntaxException
{
String
base
=
BaseTools
.
getBasePath
();
File
file
=
new
File
(
base
,
path
);
if
((!
file
.
exists
())
||
file
.
isDirectory
())
{
return
null
;
}
return
FileUtils
.
readFileToString
(
file
,
DefaultCharset
.
charset
);
}
public
static
boolean
executeSyncFile
(
String
syncFilePath
)
throws
Exception
{
public
static
boolean
executeSyncFile
(
String
syncFilePath
)
throws
Exception
{
boolean
Syncflag
=
false
;
Nodes
nodes
=
Config
.
nodes
();
// 同步config文件
if
(
Config
.
general
().
getConfigApiEnable
(
))
{
for
(
String
node
:
nodes
.
keySet
())
{
if
(
nodes
.
get
(
node
).
getApplication
().
getEnable
()
||
nodes
.
get
(
node
).
getCenter
().
getEnable
())
{
Syncflag
=
executeSyncFile
(
syncFilePath
,
node
,
nodes
.
get
(
node
).
nodeAgentPort
());
}
}
}
return
Syncflag
;
}
boolean
Syncflag
=
false
;
Nodes
nodes
=
Config
.
nodes
();
// 同步config文件
if
(
BooleanUtils
.
isTrue
(
Config
.
general
().
getConfigApiEnable
()
))
{
for
(
String
node
:
nodes
.
keySet
())
{
if
(
nodes
.
get
(
node
).
getApplication
().
getEnable
()
||
nodes
.
get
(
node
).
getCenter
().
getEnable
())
{
Syncflag
=
executeSyncFile
(
syncFilePath
,
node
,
nodes
.
get
(
node
).
nodeAgentPort
());
}
}
}
return
Syncflag
;
}
private
static
boolean
executeSyncFile
(
String
syncFilePath
,
String
nodeName
,
int
nodePort
)
{
boolean
syncFileFlag
=
false
;
File
syncFile
;
InputStream
fileInputStream
=
null
;
private
static
boolean
executeSyncFile
(
String
syncFilePath
,
String
nodeName
,
int
nodePort
)
{
boolean
syncFileFlag
=
false
;
File
syncFile
;
InputStream
fileInputStream
=
null
;
try
(
Socket
socket
=
new
Socket
(
nodeName
,
nodePort
))
{
try
(
Socket
socket
=
new
Socket
(
nodeName
,
nodePort
))
{
syncFile
=
new
File
(
Config
.
base
(),
syncFilePath
);
fileInputStream
=
new
FileInputStream
(
syncFile
);
syncFile
=
new
File
(
Config
.
base
(),
syncFilePath
);
fileInputStream
=
new
FileInputStream
(
syncFile
);
socket
.
setKeepAlive
(
true
);
socket
.
setSoTimeout
(
2000
);
DataOutputStream
dos
=
null
;
DataInputStream
dis
=
null
;
try
{
dos
=
new
DataOutputStream
(
socket
.
getOutputStream
());
dis
=
new
DataInputStream
(
socket
.
getInputStream
());
socket
.
setKeepAlive
(
true
);
socket
.
setSoTimeout
(
2000
);
DataOutputStream
dos
=
null
;
DataInputStream
dis
=
null
;
try
{
dos
=
new
DataOutputStream
(
socket
.
getOutputStream
());
dis
=
new
DataInputStream
(
socket
.
getInputStream
());
Map
<
String
,
Object
>
commandObject
=
new
HashMap
<>();
commandObject
.
put
(
"command"
,
"syncFile:"
+
syncFilePath
);
commandObject
.
put
(
"credential"
,
Crypto
.
rsaEncrypt
(
"o2@"
,
Config
.
publicKey
()));
dos
.
writeUTF
(
XGsonBuilder
.
toJson
(
commandObject
));
dos
.
flush
();
Map
<
String
,
Object
>
commandObject
=
new
HashMap
<>();
commandObject
.
put
(
"command"
,
"syncFile:"
+
syncFilePath
);
commandObject
.
put
(
"credential"
,
Crypto
.
rsaEncrypt
(
"o2@"
,
Config
.
publicKey
()));
dos
.
writeUTF
(
XGsonBuilder
.
toJson
(
commandObject
));
dos
.
flush
();
dos
.
writeUTF
(
syncFilePath
);
dos
.
flush
();
dos
.
writeUTF
(
syncFilePath
);
dos
.
flush
();
logger
.
info
(
"同步文件:"
+
syncFilePath
+
" starting..."
);
byte
[]
bytes
=
new
byte
[
1024
];
int
length
=
0
;
while
((
length
=
fileInputStream
.
read
(
bytes
,
0
,
bytes
.
length
))
!=
-
1
)
{
dos
.
write
(
bytes
,
0
,
length
);
dos
.
flush
();
}
logger
.
info
(
"同步文件:"
+
syncFilePath
+
"
end."
);
logger
.
info
(
"同步文件:"
+
syncFilePath
+
" starting..."
);
byte
[]
bytes
=
new
byte
[
1024
];
int
length
=
0
;
while
((
length
=
fileInputStream
.
read
(
bytes
,
0
,
bytes
.
length
))
!=
-
1
)
{
dos
.
write
(
bytes
,
0
,
length
);
dos
.
flush
();
}
logger
.
info
(
"同步文件:"
+
syncFilePath
+
"
end."
);
}
finally
{
dos
.
close
();
dis
.
close
();
socket
.
close
();
fileInputStream
.
close
();
}
}
finally
{
dos
.
close
();
dis
.
close
();
socket
.
close
();
fileInputStream
.
close
();
}
syncFileFlag
=
true
;
}
catch
(
Exception
ex
)
{
logger
.
error
(
ex
);
syncFileFlag
=
false
;
}
return
syncFileFlag
;
}
syncFileFlag
=
true
;
}
catch
(
Exception
ex
)
{
logger
.
error
(
ex
);
syncFileFlag
=
false
;
}
return
syncFileFlag
;
}
public
static
String
getIpAddress
()
{
try
{
Enumeration
<
NetworkInterface
>
allNetInterfaces
=
NetworkInterface
.
getNetworkInterfaces
();
InetAddress
ip
=
null
;
while
(
allNetInterfaces
.
hasMoreElements
())
{
NetworkInterface
netInterface
=
(
NetworkInterface
)
allNetInterfaces
.
nextElement
();
if
(
netInterface
.
isLoopback
()
||
netInterface
.
isVirtual
()
||
!
netInterface
.
isUp
())
{
continue
;
}
else
{
Enumeration
<
InetAddress
>
addresses
=
netInterface
.
getInetAddresses
();
while
(
addresses
.
hasMoreElements
())
{
ip
=
addresses
.
nextElement
();
if
(
ip
!=
null
&&
ip
instanceof
Inet4Address
)
{
return
ip
.
getHostAddress
();
}
}
}
}
}
catch
(
Exception
e
)
{
System
.
err
.
println
(
"IP地址获取失败"
+
e
.
toString
());
}
return
""
;
}
public
static
String
getIpAddress
()
{
try
{
Enumeration
<
NetworkInterface
>
allNetInterfaces
=
NetworkInterface
.
getNetworkInterfaces
();
InetAddress
ip
=
null
;
while
(
allNetInterfaces
.
hasMoreElements
())
{
NetworkInterface
netInterface
=
(
NetworkInterface
)
allNetInterfaces
.
nextElement
();
if
(
netInterface
.
isLoopback
()
||
netInterface
.
isVirtual
()
||
!
netInterface
.
isUp
())
{
continue
;
}
else
{
Enumeration
<
InetAddress
>
addresses
=
netInterface
.
getInetAddresses
();
while
(
addresses
.
hasMoreElements
())
{
ip
=
addresses
.
nextElement
();
if
(
ip
!=
null
&&
ip
instanceof
Inet4Address
)
{
return
ip
.
getHostAddress
();
}
}
}
}
}
catch
(
Exception
e
)
{
System
.
err
.
println
(
"IP地址获取失败"
+
e
.
toString
());
}
return
""
;
}
}
o2server/x_console/src/main/java/com/x/server/console/Main.java
浏览文件 @
b75a6a7b
...
...
@@ -32,7 +32,6 @@ import java.util.regex.Matcher;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.quartz.Scheduler
;
import
com.x.base.core.project.config.ApplicationServer
;
import
com.x.base.core.project.config.CenterServer
;
...
...
@@ -44,7 +43,6 @@ import com.x.base.core.project.gson.XGsonBuilder;
import
com.x.base.core.project.tools.Crypto
;
import
com.x.base.core.project.tools.DefaultCharset
;
import
com.x.base.core.project.tools.StringTools
;
import
com.x.server.console.action.ActionConfig
;
import
com.x.server.console.action.ActionControl
;
import
com.x.server.console.action.ActionSetPassword
;
import
com.x.server.console.action.ActionVersion
;
...
...
@@ -123,7 +121,7 @@ public class Main {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
init
();
if
(
null
==
Config
.
currentNode
())
{
throw
new
Exception
(
"无法找到当前节点,请检查config/node_{name}.json与local/node.cfg文件内容中的名称是否一致."
);
throw
new
IllegalState
Exception
(
"无法找到当前节点,请检查config/node_{name}.json与local/node.cfg文件内容中的名称是否一致."
);
}
swapCommandThread
.
start
();
consoleCommandThread
.
start
();
...
...
@@ -134,8 +132,8 @@ public class Main {
nodeAgent
.
start
();
}
SchedulerBuilder
schedulerBuilder
=
new
SchedulerBuilder
();
Scheduler
scheduler
=
schedulerBuilder
.
start
();
//
SchedulerBuilder schedulerBuilder = new SchedulerBuilder();
//
Scheduler scheduler = schedulerBuilder.start();
if
(
BooleanUtils
.
isTrue
(
Config
.
currentNode
().
autoStart
()))
{
startAll
();
...
...
@@ -217,11 +215,7 @@ public class Main {
matcher
=
CommandFactory
.
setPassword_pattern
.
matcher
(
cmd
);
if
(
matcher
.
find
())
{
setPassword
(
matcher
.
group
(
1
),
matcher
.
group
(
2
));
if
(
config
())
{
break
;
}
else
{
continue
;
}
continue
;
}
matcher
=
CommandFactory
.
control_pattern
.
matcher
(
cmd
);
...
...
@@ -242,9 +236,6 @@ public class Main {
}
System
.
out
.
println
(
"unknown command:"
+
cmd
);
}
// 关闭定时器
scheduler
.
shutdown
();
// SystemOutErrorSideCopyBuilder.stop();
}
private
static
void
version
()
{
...
...
@@ -255,15 +246,6 @@ public class Main {
}
}
private
static
boolean
config
()
{
try
{
return
new
ActionConfig
().
execute
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
true
;
}
private
static
void
startDataServer
()
{
try
{
if
(
BooleanUtils
.
isTrue
(
Servers
.
dataServerIsRunning
()))
{
...
...
o2server/x_console/src/main/java/com/x/server/console/action/ActionConfig.java
已删除
100644 → 0
浏览文件 @
05af0b09
package
com.x.server.console.action
;
import
java.io.File
;
import
java.io.InputStream
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
org.apache.commons.codec.binary.Base64
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.JsonElement
;
import
com.google.gson.JsonObject
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.http.HttpMediaType
;
import
com.x.base.core.project.tools.JarTools
;
public
class
ActionConfig
extends
ActionBase
{
public
boolean
execute
()
throws
Exception
{
if
(
StringUtils
.
equalsIgnoreCase
(
Config
.
node
(),
Config
.
resource_node_centersPirmaryNode
()))
{
byte
[]
bytes
=
this
.
getZip
();
this
.
unzip
(
bytes
);
System
.
out
.
println
(
"synchronize config success, should to restart server."
);
return
true
;
}
else
{
System
.
out
.
println
(
"config command only synchronize config from primary center."
);
return
false
;
}
}
@SuppressWarnings
(
"deprecation"
)
private
byte
[]
getZip
()
throws
Exception
{
String
address
=
Config
.
url_x_program_center_jaxrs
(
"config"
);
URL
url
=
new
URL
(
address
);
HttpURLConnection
connection
=
(
HttpURLConnection
)
url
.
openConnection
();
connection
.
setUseCaches
(
false
);
connection
.
setRequestProperty
(
"Content-Type"
,
HttpMediaType
.
APPLICATION_JSON_UTF_8
);
EffectivePerson
effectivePerson
=
EffectivePerson
.
cipher
(
Config
.
token
().
getCipher
(),
Config
.
person
().
getEncryptType
());
connection
.
setRequestProperty
(
Config
.
person
().
getTokenName
(),
effectivePerson
.
getToken
());
connection
.
setRequestMethod
(
"GET"
);
connection
.
setDoOutput
(
false
);
connection
.
setDoInput
(
true
);
connection
.
connect
();
String
json
=
null
;
try
(
InputStream
input
=
connection
.
getInputStream
())
{
json
=
IOUtils
.
toString
(
input
);
}
JsonElement
jsonElement
=
XGsonBuilder
.
instance
().
fromJson
(
json
,
JsonElement
.
class
);
if
(
jsonElement
.
isJsonObject
())
{
JsonObject
jsonObject
=
jsonElement
.
getAsJsonObject
();
if
(
jsonObject
.
has
(
"type"
))
{
if
(
StringUtils
.
equals
(
"success"
,
jsonObject
.
get
(
"type"
).
getAsString
()))
{
String
value
=
jsonObject
.
get
(
"data"
).
getAsString
();
byte
[]
bytes
=
Base64
.
decodeBase64
(
value
);
return
bytes
;
}
else
{
throw
new
Exception
(
"return type not success."
);
}
}
else
{
throw
new
Exception
(
"can not read return type."
);
}
}
else
{
throw
new
Exception
(
"return object is not jsonObject."
);
}
}
private
void
unzip
(
byte
[]
bytes
)
throws
Exception
{
File
dir
=
new
File
(
Config
.
base
(),
"config"
);
FileUtils
.
forceMkdir
(
dir
);
JarTools
.
unjar
(
bytes
,
""
,
dir
,
true
);
}
}
\ No newline at end of file
o2server/x_console/src/main/java/com/x/server/console/action/ActionSetPassword.java
浏览文件 @
b75a6a7b
...
...
@@ -14,40 +14,41 @@ import com.x.base.core.project.config.DataServer;
import
com.x.base.core.project.config.Token
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.server.console.server.Servers
;
public
class
ActionSetPassword
extends
ActionBase
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionSetPassword
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionSetPassword
.
class
);
public
boolean
execute
(
String
oldPassword
,
String
newPassword
)
throws
Exception
{
/** 如果初始密码没有修改就设置为初始密码 */
if
(
StringUtils
.
equals
(
Config
.
token
().
getPassword
(),
Token
.
initPassword
))
{
oldPassword
=
Token
.
initPassword
;
}
if
(!
StringUtils
.
equals
(
Config
.
token
().
getPassword
(),
oldPassword
))
{
logger
.
print
(
"old password not match."
);
return
false
;
}
this
.
changeInternalDataServerPassword
(
oldPassword
,
newPassword
);
Config
.
token
().
setPassword
(
newPassword
);
Config
.
token
().
save
();
logger
.
print
(
"The initial manager password has been modified."
);
return
true
;
}
public
boolean
execute
(
String
oldPassword
,
String
newPassword
)
throws
Exception
{
/** 如果初始密码没有修改就设置为初始密码 */
if
(
StringUtils
.
equals
(
Config
.
token
().
getPassword
(),
Token
.
initPassword
))
{
oldPassword
=
Token
.
initPassword
;
}
if
(!
StringUtils
.
equals
(
Config
.
token
().
getPassword
(),
oldPassword
))
{
LOGGER
.
print
(
"old password not match."
);
return
false
;
}
this
.
changeInternalDataServerPassword
(
oldPassword
,
newPassword
);
Config
.
token
().
setPassword
(
newPassword
);
Config
.
token
().
save
();
LOGGER
.
print
(
"The initial manager password has been modified."
);
return
true
;
}
private
void
changeInternalDataServerPassword
(
String
oldPassword
,
String
newPassword
)
throws
Exception
{
org
.
h2
.
Driver
.
load
();
for
(
Entry
<
String
,
DataServer
>
en
:
Config
.
nodes
().
dataServers
().
entrySet
())
{
DataServer
o
=
en
.
getValue
();
if
(
BooleanUtils
.
isTrue
(
o
.
getE
nable
()))
{
try
(
Connection
conn
=
DriverManager
.
getConnection
(
"jdbc:h2:tcp://"
+
en
.
getKey
()
+
":"
+
o
.
getTcpPort
()
+
"/X"
,
"sa"
,
oldPassword
))
{
RunScript
.
execute
(
conn
,
new
StringReader
(
"ALTER USER SA SET PASSWORD '"
+
newPassword
+
"'"
));
}
catch
(
Exception
e
)
{
throw
new
IllegalStateException
(
"Verify that the dataServer:"
+
en
.
getKey
()
+
" is started and that the dataServer password is updated synchronously."
,
e
);
}
}
}
}
private
void
changeInternalDataServerPassword
(
String
oldPassword
,
String
newPassword
)
throws
Exception
{
org
.
h2
.
Driver
.
load
();
for
(
Entry
<
String
,
DataServer
>
en
:
Config
.
nodes
().
dataServers
().
entrySet
())
{
DataServer
o
=
en
.
getValue
();
if
(
BooleanUtils
.
isTrue
(
o
.
getEnable
())
&&
(!
Config
.
externalDataSources
().
e
nable
()))
{
try
(
Connection
conn
=
DriverManager
.
getConnection
(
"jdbc:h2:tcp://"
+
en
.
getKey
()
+
":"
+
o
.
getTcpPort
()
+
"/X"
,
"sa"
,
oldPassword
))
{
RunScript
.
execute
(
conn
,
new
StringReader
(
"ALTER USER SA SET PASSWORD '"
+
newPassword
+
"'"
));
}
catch
(
Exception
e
)
{
throw
new
IllegalStateException
(
"Verify that the dataServer:"
+
en
.
getKey
()
+
" is started and that the dataServer password is updated synchronously."
,
e
);
}
}
}
}
}
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/config/ActionChangePassword.java
浏览文件 @
b75a6a7b
...
...
@@ -25,167 +25,167 @@ import io.swagger.v3.oas.annotations.media.Schema;
class
ActionChangePassword
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionChangePassword
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
LOGGER
.
debug
(
"execute:{}."
,
effectivePerson:
:
getDistinguishedName
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
if
(
BooleanUtils
.
isNotTrue
(
Config
.
general
().
getConfigApiEnable
()))
{
throw
new
ExceptionModifyConfig
();
}
check
(
wi
);
String
oldPassword
=
password
(
wi
.
getOldPassword
());
String
newPassword
=
password
(
wi
.
getNewPassword
());
checkPasswordComplexity
(
wi
.
getCredential
(),
newPassword
);
if
(
Config
.
ternaryManagement
().
isAuditManager
(
wi
.
getCredential
()))
{
changeAuditManagerPassword
(
effectivePerson
,
wi
.
getCredential
(),
oldPassword
,
newPassword
);
}
else
if
(
Config
.
ternaryManagement
().
isSecurityManager
(
wi
.
getCredential
()))
{
changeSecurityManager
(
effectivePerson
,
wi
.
getCredential
(),
oldPassword
,
newPassword
);
}
else
if
(
Config
.
ternaryManagement
().
isSystemManager
(
wi
.
getCredential
()))
{
changeSystemManager
(
effectivePerson
,
wi
.
getCredential
(),
oldPassword
,
newPassword
);
}
else
if
(
StringUtils
.
equals
(
wi
.
getCredential
(),
Config
.
token
().
getInitialManager
()))
{
changeInitialManager
(
effectivePerson
,
oldPassword
,
newPassword
);
}
else
{
throw
new
ExceptionInvalidCredential
();
}
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
return
result
;
}
private
void
changeAuditManagerPassword
(
EffectivePerson
effectivePerson
,
String
credential
,
String
oldPassword
,
String
newPassword
)
throws
Exception
{
if
(
BooleanUtils
.
isNotTrue
(
Config
.
ternaryManagement
().
verifyPassword
(
credential
,
oldPassword
)))
{
throw
new
ExceptionInvalidOldPassword
();
}
Config
.
ternaryManagement
().
setAuditManagerPassword
(
newPassword
);
Config
.
ternaryManagement
().
save
();
this
.
configFlush
(
effectivePerson
);
}
private
void
changeSecurityManager
(
EffectivePerson
effectivePerson
,
String
credential
,
String
oldPassword
,
String
newPassword
)
throws
Exception
{
if
(
BooleanUtils
.
isNotTrue
(
Config
.
ternaryManagement
().
verifyPassword
(
credential
,
oldPassword
)))
{
throw
new
ExceptionInvalidOldPassword
();
}
Config
.
ternaryManagement
().
setSecurityManagerPassword
(
newPassword
);
Config
.
ternaryManagement
().
save
();
this
.
configFlush
(
effectivePerson
);
}
private
void
changeSystemManager
(
EffectivePerson
effectivePerson
,
String
credential
,
String
oldPassword
,
String
newPassword
)
throws
Exception
{
if
(
BooleanUtils
.
isNotTrue
(
Config
.
ternaryManagement
().
verifyPassword
(
credential
,
oldPassword
)))
{
throw
new
ExceptionInvalidOldPassword
();
}
Config
.
ternaryManagement
().
setSystemManagerPassword
(
newPassword
);
Config
.
ternaryManagement
().
save
();
this
.
configFlush
(
effectivePerson
);
}
private
void
changeInitialManager
(
EffectivePerson
effectivePerson
,
String
oldPassword
,
String
newPassword
)
throws
Exception
{
if
(
BooleanUtils
.
isNotTrue
(
StringUtils
.
equals
(
Config
.
token
().
getPassword
(),
oldPassword
)))
{
throw
new
ExceptionInvalidOldPassword
();
}
this
.
changeInternalDataServerPassword
(
oldPassword
,
newPassword
);
Config
.
token
().
setPassword
(
newPassword
);
Config
.
token
().
save
();
this
.
configFlush
(
effectivePerson
);
}
private
void
changeInternalDataServerPassword
(
String
oldPassword
,
String
newPassword
)
throws
Exception
{
org
.
h2
.
Driver
.
load
();
for
(
Entry
<
String
,
DataServer
>
en
:
Config
.
nodes
().
dataServers
().
entrySet
())
{
DataServer
o
=
en
.
getValue
();
if
(
BooleanUtils
.
isTrue
(
o
.
getE
nable
()))
{
try
(
Connection
conn
=
DriverManager
.
getConnection
(
"jdbc:h2:tcp://"
+
en
.
getKey
()
+
":"
+
o
.
getTcpPort
()
+
"/X"
,
"sa"
,
oldPassword
))
{
RunScript
.
execute
(
conn
,
new
StringReader
(
"ALTER USER SA SET PASSWORD '"
+
newPassword
+
"'"
));
}
catch
(
Exception
e
)
{
throw
new
IllegalStateException
(
"Verify that the dataServer:"
+
en
.
getKey
()
+
" is started and that the dataServer password is updated synchronously."
,
e
);
}
}
}
}
private
void
check
(
Wi
wi
)
throws
ExceptionEmptyCredential
,
ExceptionEmptyOldPassword
,
ExceptionEmptyNewPassword
{
if
(
StringUtils
.
isEmpty
(
wi
.
getCredential
()))
{
throw
new
ExceptionEmptyCredential
();
}
if
(
StringUtils
.
isEmpty
(
wi
.
getOldPassword
()))
{
throw
new
ExceptionEmptyOldPassword
();
}
if
(
StringUtils
.
isEmpty
(
wi
.
getCredential
()))
{
throw
new
ExceptionEmptyNewPassword
();
}
}
private
void
checkPasswordComplexity
(
String
credential
,
String
newPassword
)
throws
Exception
{
if
(!
newPassword
.
matches
(
Config
.
person
().
getPasswordRegex
()))
{
throw
new
ExceptionInvalidPassword
(
credential
,
Config
.
person
().
getPasswordRegexHint
());
}
}
protected
String
password
(
String
text
)
throws
Exception
{
return
BooleanUtils
.
isTrue
(
Config
.
token
().
getRsaEnable
())
?
Crypto
.
rsaDecrypt
(
text
,
Config
.
privateKey
())
:
text
;
}
@Schema
(
name
=
"com.x.program.center.jaxrs.config.ActionChangePassword$Wo"
)
public
static
class
Wo
extends
WrapBoolean
{
private
static
final
long
serialVersionUID
=
-
6564786947838509994L
;
}
@Schema
(
name
=
"com.x.program.center.jaxrs.config.ActionChangePassword$Wi"
)
public
static
class
Wi
extends
GsonPropertyObject
{
private
static
final
long
serialVersionUID
=
-
8627814779546541124L
;
@FieldDescribe
(
"用户标识."
)
@Schema
(
description
=
"用户标识."
)
private
String
credential
;
@FieldDescribe
(
"原密码."
)
@Schema
(
description
=
"原密码."
)
private
String
oldPassword
;
@FieldDescribe
(
"新密码."
)
@Schema
(
description
=
"新密码."
)
private
String
newPassword
;
public
String
getCredential
()
{
return
credential
;
}
public
void
setCredential
(
String
credential
)
{
this
.
credential
=
credential
;
}
public
String
getOldPassword
()
{
return
oldPassword
;
}
public
void
setOldPassword
(
String
oldPassword
)
{
this
.
oldPassword
=
oldPassword
;
}
public
String
getNewPassword
()
{
return
newPassword
;
}
public
void
setNewPassword
(
String
newPassword
)
{
this
.
newPassword
=
newPassword
;
}
}
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionChangePassword
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
LOGGER
.
debug
(
"execute:{}."
,
effectivePerson:
:
getDistinguishedName
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
if
(
BooleanUtils
.
isNotTrue
(
Config
.
general
().
getConfigApiEnable
()))
{
throw
new
ExceptionModifyConfig
();
}
check
(
wi
);
String
oldPassword
=
password
(
wi
.
getOldPassword
());
String
newPassword
=
password
(
wi
.
getNewPassword
());
checkPasswordComplexity
(
wi
.
getCredential
(),
newPassword
);
if
(
Config
.
ternaryManagement
().
isAuditManager
(
wi
.
getCredential
()))
{
changeAuditManagerPassword
(
effectivePerson
,
wi
.
getCredential
(),
oldPassword
,
newPassword
);
}
else
if
(
Config
.
ternaryManagement
().
isSecurityManager
(
wi
.
getCredential
()))
{
changeSecurityManager
(
effectivePerson
,
wi
.
getCredential
(),
oldPassword
,
newPassword
);
}
else
if
(
Config
.
ternaryManagement
().
isSystemManager
(
wi
.
getCredential
()))
{
changeSystemManager
(
effectivePerson
,
wi
.
getCredential
(),
oldPassword
,
newPassword
);
}
else
if
(
StringUtils
.
equals
(
wi
.
getCredential
(),
Config
.
token
().
getInitialManager
()))
{
changeInitialManager
(
effectivePerson
,
oldPassword
,
newPassword
);
}
else
{
throw
new
ExceptionInvalidCredential
();
}
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
return
result
;
}
private
void
changeAuditManagerPassword
(
EffectivePerson
effectivePerson
,
String
credential
,
String
oldPassword
,
String
newPassword
)
throws
Exception
{
if
(
BooleanUtils
.
isNotTrue
(
Config
.
ternaryManagement
().
verifyPassword
(
credential
,
oldPassword
)))
{
throw
new
ExceptionInvalidOldPassword
();
}
Config
.
ternaryManagement
().
setAuditManagerPassword
(
newPassword
);
Config
.
ternaryManagement
().
save
();
this
.
configFlush
(
effectivePerson
);
}
private
void
changeSecurityManager
(
EffectivePerson
effectivePerson
,
String
credential
,
String
oldPassword
,
String
newPassword
)
throws
Exception
{
if
(
BooleanUtils
.
isNotTrue
(
Config
.
ternaryManagement
().
verifyPassword
(
credential
,
oldPassword
)))
{
throw
new
ExceptionInvalidOldPassword
();
}
Config
.
ternaryManagement
().
setSecurityManagerPassword
(
newPassword
);
Config
.
ternaryManagement
().
save
();
this
.
configFlush
(
effectivePerson
);
}
private
void
changeSystemManager
(
EffectivePerson
effectivePerson
,
String
credential
,
String
oldPassword
,
String
newPassword
)
throws
Exception
{
if
(
BooleanUtils
.
isNotTrue
(
Config
.
ternaryManagement
().
verifyPassword
(
credential
,
oldPassword
)))
{
throw
new
ExceptionInvalidOldPassword
();
}
Config
.
ternaryManagement
().
setSystemManagerPassword
(
newPassword
);
Config
.
ternaryManagement
().
save
();
this
.
configFlush
(
effectivePerson
);
}
private
void
changeInitialManager
(
EffectivePerson
effectivePerson
,
String
oldPassword
,
String
newPassword
)
throws
Exception
{
if
(
BooleanUtils
.
isNotTrue
(
StringUtils
.
equals
(
Config
.
token
().
getPassword
(),
oldPassword
)))
{
throw
new
ExceptionInvalidOldPassword
();
}
this
.
changeInternalDataServerPassword
(
oldPassword
,
newPassword
);
Config
.
token
().
setPassword
(
newPassword
);
Config
.
token
().
save
();
this
.
configFlush
(
effectivePerson
);
}
private
void
changeInternalDataServerPassword
(
String
oldPassword
,
String
newPassword
)
throws
Exception
{
org
.
h2
.
Driver
.
load
();
for
(
Entry
<
String
,
DataServer
>
en
:
Config
.
nodes
().
dataServers
().
entrySet
())
{
DataServer
o
=
en
.
getValue
();
if
(
BooleanUtils
.
isTrue
(
o
.
getEnable
())
&&
(!
Config
.
externalDataSources
().
e
nable
()))
{
try
(
Connection
conn
=
DriverManager
.
getConnection
(
"jdbc:h2:tcp://"
+
en
.
getKey
()
+
":"
+
o
.
getTcpPort
()
+
"/X"
,
"sa"
,
oldPassword
))
{
RunScript
.
execute
(
conn
,
new
StringReader
(
"ALTER USER SA SET PASSWORD '"
+
newPassword
+
"'"
));
}
catch
(
Exception
e
)
{
throw
new
IllegalStateException
(
"Verify that the dataServer:"
+
en
.
getKey
()
+
" is started and that the dataServer password is updated synchronously."
,
e
);
}
}
}
}
private
void
check
(
Wi
wi
)
throws
ExceptionEmptyCredential
,
ExceptionEmptyOldPassword
,
ExceptionEmptyNewPassword
{
if
(
StringUtils
.
isEmpty
(
wi
.
getCredential
()))
{
throw
new
ExceptionEmptyCredential
();
}
if
(
StringUtils
.
isEmpty
(
wi
.
getOldPassword
()))
{
throw
new
ExceptionEmptyOldPassword
();
}
if
(
StringUtils
.
isEmpty
(
wi
.
getCredential
()))
{
throw
new
ExceptionEmptyNewPassword
();
}
}
private
void
checkPasswordComplexity
(
String
credential
,
String
newPassword
)
throws
Exception
{
if
(!
newPassword
.
matches
(
Config
.
person
().
getPasswordRegex
()))
{
throw
new
ExceptionInvalidPassword
(
credential
,
Config
.
person
().
getPasswordRegexHint
());
}
}
protected
String
password
(
String
text
)
throws
Exception
{
return
BooleanUtils
.
isTrue
(
Config
.
token
().
getRsaEnable
())
?
Crypto
.
rsaDecrypt
(
text
,
Config
.
privateKey
())
:
text
;
}
@Schema
(
name
=
"com.x.program.center.jaxrs.config.ActionChangePassword$Wo"
)
public
static
class
Wo
extends
WrapBoolean
{
private
static
final
long
serialVersionUID
=
-
6564786947838509994L
;
}
@Schema
(
name
=
"com.x.program.center.jaxrs.config.ActionChangePassword$Wi"
)
public
static
class
Wi
extends
GsonPropertyObject
{
private
static
final
long
serialVersionUID
=
-
8627814779546541124L
;
@FieldDescribe
(
"用户标识."
)
@Schema
(
description
=
"用户标识."
)
private
String
credential
;
@FieldDescribe
(
"原密码."
)
@Schema
(
description
=
"原密码."
)
private
String
oldPassword
;
@FieldDescribe
(
"新密码."
)
@Schema
(
description
=
"新密码."
)
private
String
newPassword
;
public
String
getCredential
()
{
return
credential
;
}
public
void
setCredential
(
String
credential
)
{
this
.
credential
=
credential
;
}
public
String
getOldPassword
()
{
return
oldPassword
;
}
public
void
setOldPassword
(
String
oldPassword
)
{
this
.
oldPassword
=
oldPassword
;
}
public
String
getNewPassword
()
{
return
newPassword
;
}
public
void
setNewPassword
(
String
newPassword
)
{
this
.
newPassword
=
newPassword
;
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录