Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
byit-myth-job
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
liyuan
byit-myth-job
Commits
97a45972
Commit
97a45972
authored
Sep 11, 2020
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加版本号解析工具方法
parent
f80c036e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+1
-1
JobVersionGenUtil.java
...-core/src/main/java/com/byit/utils/JobVersionGenUtil.java
+20
-2
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
97a45972
...
@@ -181,7 +181,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
...
@@ -181,7 +181,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
//当版本号不存在
//当版本号不存在
if
(
StringUtils
.
isBlank
(
versionName
)){
if
(
StringUtils
.
isBlank
(
versionName
)){
String
version
=
oldFlow
.
getVersionName
();
String
version
=
oldFlow
.
getVersionName
();
Integer
versionTag
=
Integer
.
valueOf
(
version
.
split
(
"\\."
)[
1
]
);
Integer
versionTag
=
JobVersionGenUtil
.
parsingVersionName
(
version
);
flow
.
setVersionName
(
JobVersionGenUtil
.
generateVersionName
(
versionTag
));
flow
.
setVersionName
(
JobVersionGenUtil
.
generateVersionName
(
versionTag
));
}
else
{
}
else
{
...
...
byit-myth-core/myth-dto-core/src/main/java/com/byit/utils/JobVersionGenUtil.java
View file @
97a45972
package
com
.
byit
.
utils
;
package
com
.
byit
.
utils
;
import
org.springframework.util.StringUtils
;
/**
/**
* 版本号生成策略
* 版本号生成策略
*
*
...
@@ -7,14 +9,30 @@ package com.byit.utils;
...
@@ -7,14 +9,30 @@ package com.byit.utils;
*/
*/
public
class
JobVersionGenUtil
{
public
class
JobVersionGenUtil
{
public
static
final
String
VERSION_NAME_PRE
=
"V.%s"
;
private
static
final
String
VERSION_NAME_PRE
=
"V.%s"
;
private
static
final
String
SEGMENTATION
=
"\\."
;
/**
/**
* 调度版本生成策略
* 调度版本生成策略
*
* @param versionIndex 版本索号
* @param versionIndex 版本索号
* @return 对应的版本名称
* @return 对应的版本名称
*/
*/
public
static
String
generateVersionName
(
Integer
versionIndex
){
public
static
String
generateVersionName
(
Integer
versionIndex
)
{
return
String
.
format
(
VERSION_NAME_PRE
,
versionIndex
);
return
String
.
format
(
VERSION_NAME_PRE
,
versionIndex
);
}
}
/**
* 解析版本号为版本索引
*
* @param versionName 版本名称
* @return 对应的版本索引
*/
public
static
Integer
parsingVersionName
(
String
versionName
)
{
if
(
StringUtils
.
isEmpty
(
versionName
))
{
return
0
;
}
return
Integer
.
valueOf
(
versionName
.
split
(
SEGMENTATION
)[
1
]);
}
}
}
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