Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-new-platform
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
赵啸非
device-new-platform
Commits
229ddb9b
Commit
229ddb9b
authored
Nov 17, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加资源扫描接口
parent
ff2bb76f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
19 deletions
+5
-19
common-lib/pom.xml
common-lib/pom.xml
+0
-5
device-manager/src/main/java/com/mortals/xhx/base/system/resource/service/impl/ResourceServiceImpl.java
...ase/system/resource/service/impl/ResourceServiceImpl.java
+4
-4
device-manager/src/test/java/ScanTest.java
device-manager/src/test/java/ScanTest.java
+1
-10
No files found.
common-lib/pom.xml
View file @
229ddb9b
...
@@ -85,11 +85,6 @@
...
@@ -85,11 +85,6 @@
<artifactId>
javase
</artifactId>
<artifactId>
javase
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
io.swagger.core.v3
</groupId>
<artifactId>
swagger-annotations
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
junit
</groupId>
<groupId>
junit
</groupId>
...
...
device-manager/src/main/java/com/mortals/xhx/base/system/resource/service/impl/ResourceServiceImpl.java
View file @
229ddb9b
...
@@ -130,8 +130,8 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao, Re
...
@@ -130,8 +130,8 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao, Re
Arrays
.
stream
(
tempResource
.
getUrl
().
split
(
","
)).
forEach
(
i
->
{
Arrays
.
stream
(
tempResource
.
getUrl
().
split
(
","
)).
forEach
(
i
->
{
setUrl
.
add
(
i
);
setUrl
.
add
(
i
);
});
});
resourceEntity
.
setUrl
(
setUrl
.
stream
().
collect
(
Collectors
.
joining
(
","
)));
tempResource
.
setUrl
(
setUrl
.
stream
().
collect
(
Collectors
.
joining
(
","
)));
this
.
update
(
resourceEntity
,
context
);
this
.
update
(
tempResource
,
context
);
}
else
if
(
tempResourceList
.
size
()
>
1
)
{
}
else
if
(
tempResourceList
.
size
()
>
1
)
{
//找到多个同名的 资源配置
//找到多个同名的 资源配置
for
(
ResourceEntity
tempResource
:
tempResourceList
)
{
for
(
ResourceEntity
tempResource
:
tempResourceList
)
{
...
@@ -150,8 +150,8 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao, Re
...
@@ -150,8 +150,8 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao, Re
Arrays
.
stream
(
tempResource
.
getUrl
().
split
(
","
)).
forEach
(
i
->
{
Arrays
.
stream
(
tempResource
.
getUrl
().
split
(
","
)).
forEach
(
i
->
{
setUrl
.
add
(
i
);
setUrl
.
add
(
i
);
});
});
resourceEntity
.
setUrl
(
setUrl
.
stream
().
collect
(
Collectors
.
joining
(
","
)));
tempResource
.
setUrl
(
setUrl
.
stream
().
collect
(
Collectors
.
joining
(
","
)));
this
.
update
(
resourceEntity
,
context
);
this
.
update
(
tempResource
,
context
);
}
}
}
}
}
}
...
...
device-manager/src/test/java/ScanTest.java
View file @
229ddb9b
import
cn.hutool.core.util.RandomUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.xhx.base.system.resource.model.ResourceEntity
;
import
com.mortals.xhx.base.system.resource.model.ResourceEntity
;
import
com.mortals.xhx.module.site.web.SiteController
;
import
com.mortals.xhx.module.site.web.SiteController
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
@@ -63,14 +61,7 @@ public class ScanTest {
...
@@ -63,14 +61,7 @@ public class ScanTest {
}
}
if
(
ObjectUtils
.
isEmpty
(
result
))
{
if
(
ObjectUtils
.
isEmpty
(
result
))
{
boolean
tagExits
=
cls
.
isAnnotationPresent
(
Tag
.
class
);
if
(
tagExits
)
{
Tag
annotation
=
cls
.
getAnnotation
(
Tag
.
class
);
result
=
annotation
.
name
();
}
else
{
//自定义的controller 没有名称
result
=
"自定义api模块"
+
RandomUtil
.
randomInt
(
100
);
}
resourceViewEntity
.
setName
(
result
+
"-查看"
);
resourceViewEntity
.
setName
(
result
+
"-查看"
);
resourceEditEntity
.
setName
(
result
+
"-维护"
);
resourceEditEntity
.
setName
(
result
+
"-维护"
);
}
}
...
...
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