Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
incubator-dubbo-admin
提交
711a20e1
I
incubator-dubbo-admin
项目概览
爱吃血肠
/
incubator-dubbo-admin
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
incubator-dubbo-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
711a20e1
编写于
1月 17, 2019
作者:
N
nzomkxia
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
api to get all services and apps
上级
ec736b96
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
27 addition
and
16 deletion
+27
-16
dubbo-admin-backend/src/main/java/org/apache/dubbo/admin/controller/ServiceController.java
.../org/apache/dubbo/admin/controller/ServiceController.java
+14
-4
dubbo-admin-frontend/src/components/ServiceSearch.vue
dubbo-admin-frontend/src/components/ServiceSearch.vue
+13
-12
未找到文件。
dubbo-admin-backend/src/main/java/org/apache/dubbo/admin/controller/ServiceController.java
浏览文件 @
711a20e1
...
...
@@ -17,6 +17,7 @@
package
org.apache.dubbo.admin.controller
;
import
com.ctrip.framework.apollo.core.enums.Env
;
import
com.google.gson.Gson
;
import
org.apache.dubbo.admin.common.util.ConvertUtil
;
import
org.apache.dubbo.admin.model.domain.Consumer
;
...
...
@@ -26,7 +27,6 @@ import org.apache.dubbo.admin.model.dto.ServiceDetailDTO;
import
org.apache.dubbo.admin.service.ConsumerService
;
import
org.apache.dubbo.admin.service.ProviderService
;
import
org.apache.dubbo.admin.common.util.Constants
;
import
org.apache.dubbo.common.utils.StringUtils
;
import
org.apache.dubbo.metadata.definition.model.FullServiceDefinition
;
import
org.apache.dubbo.metadata.identifier.MetadataIdentifier
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -38,7 +38,7 @@ import java.util.regex.Pattern;
@RestController
@RequestMapping
(
"/api/{env}
/service
"
)
@RequestMapping
(
"/api/{env}"
)
public
class
ServiceController
{
private
final
ProviderService
providerService
;
...
...
@@ -50,7 +50,7 @@ public class ServiceController {
this
.
consumerService
=
consumerService
;
}
@RequestMapping
(
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/service"
,
method
=
RequestMethod
.
GET
)
public
Set
<
ServiceDTO
>
searchService
(
@RequestParam
String
pattern
,
@RequestParam
String
filter
,
@PathVariable
String
env
)
{
return
providerService
.
getServiceDTOS
(
pattern
,
filter
,
env
);
...
...
@@ -58,7 +58,7 @@ public class ServiceController {
@RequestMapping
(
value
=
"/{service}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/
service/
{service}"
,
method
=
RequestMethod
.
GET
)
public
ServiceDetailDTO
serviceDetail
(
@PathVariable
String
service
,
@PathVariable
String
env
)
{
service
=
service
.
replace
(
Constants
.
ANY_VALUE
,
Constants
.
PATH_SEPARATOR
);
List
<
Provider
>
providers
=
providerService
.
findByService
(
service
);
...
...
@@ -84,4 +84,14 @@ public class ServiceController {
}
return
serviceDetailDTO
;
}
@RequestMapping
(
value
=
"/services"
,
method
=
RequestMethod
.
GET
)
public
Set
<
String
>
allServices
(
@PathVariable
String
env
)
{
return
providerService
.
findServices
();
}
@RequestMapping
(
value
=
"/applications"
,
method
=
RequestMethod
.
GET
)
public
Set
<
String
>
allApplications
(
@PathVariable
String
env
)
{
return
providerService
.
findApplications
();
}
}
dubbo-admin-frontend/src/components/ServiceSearch.vue
浏览文件 @
711a20e1
...
...
@@ -312,18 +312,19 @@
pattern
=
'
service
'
this
.
search
(
this
.
filter
,
pattern
,
true
)
}
this
.
$axios
.
get
(
'
/service
'
,
{
params
:
{
pattern
:
'
service
'
,
filter
:
'
*
'
}
}).
then
(
response
=>
{
let
length
=
response
.
data
.
length
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
vm
.
serviceItem
.
push
(
response
.
data
[
i
].
service
)
vm
.
appItem
.
push
(
response
.
data
[
i
].
appName
)
}
})
this
.
$axios
.
get
(
'
/services
'
)
.
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
vm
.
serviceItem
=
response
.
data
}
})
this
.
$axios
.
get
(
'
/applications
'
)
.
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
vm
.
appItem
=
response
.
data
}
})
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录