Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setup-manager
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
setup-manager
Commits
405a430e
Commit
405a430e
authored
Nov 11, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加产品资源枚举类
parent
4431edb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
setup-project-manager/src/main/java/com/mortals/xhx/daemon/task/CheckProjectStatusTaskImpl.java
...m/mortals/xhx/daemon/task/CheckProjectStatusTaskImpl.java
+17
-4
No files found.
setup-project-manager/src/main/java/com/mortals/xhx/daemon/task/CheckProjectStatusTaskImpl.java
View file @
405a430e
...
...
@@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
java.io.File
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -49,13 +50,13 @@ public class CheckProjectStatusTaskImpl implements ITaskExcuteService {
NacosResponse
nacosResponse
=
JSON
.
parseObject
(
resp
,
new
TypeReference
<
NacosResponse
>()
{
});
int
count
=
nacosResponse
.
getCount
();
if
(
count
>
0
)
{
if
(
count
>
0
)
{
ListItem
item
=
nacosResponse
.
getList
().
get
(
0
);
String
serviceName
=
item
.
getServiceName
();
boolean
healthy
=
item
.
isHealthy
();
if
(
healthy
)
{
if
(
healthy
)
{
setupProjectEntity
.
setProjectStatus
(
ProjectStatusEnum
.
运行
.
getValue
());
}
else
{
}
else
{
setupProjectEntity
.
setProjectStatus
(
ProjectStatusEnum
.
停止
.
getValue
());
}
setupProjectEntity
.
setUpdateTime
(
new
Date
());
...
...
@@ -65,7 +66,19 @@ public class CheckProjectStatusTaskImpl implements ITaskExcuteService {
log
.
info
(
"服务实例详细查询url:{},返回:{},naocsResponse:{}"
,
serverUrl
,
resp
,
JSON
.
toJSONString
(
nacosResponse
));
}
else
if
(
ProjectTypeEnum
.
前端
.
getValue
()
==
setupProjectEntity
.
getProjectType
())
{
//todo
//todo 前端 判断路径文件是否存在 如果存在 则代表运行
String
projectPath
=
setupProjectEntity
.
getProjectPath
();
String
projectCode
=
setupProjectEntity
.
getProjectCode
();
String
destPath
=
projectPath
+
File
.
separator
+
projectCode
+
File
.
separator
+
"dist"
+
File
.
separator
+
"index.html"
;
File
uiFile
=
new
File
(
destPath
);
if
(
uiFile
.
exists
())
{
setupProjectEntity
.
setProjectStatus
(
ProjectStatusEnum
.
运行
.
getValue
());
setupProjectEntity
.
setUpdateTime
(
new
Date
());
setupProjectService
.
update
(
setupProjectEntity
);
}
log
.
info
(
"前端资源路径:{},是否存在:{}"
,
destPath
,
uiFile
.
exists
());
}
else
{
}
}
...
...
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