-
Notifications
You must be signed in to change notification settings - Fork 8
/
dubbo_handle.py
38 lines (29 loc) · 1.03 KB
/
dubbo_handle.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- coding: UTF-8 -*-
'''
@Project :dubbo_fastapi
@File :dubbo_handle.py
@IDE :PyCharm
@Author :junjie
@Date :2021/5/15 1:57 下午
'''
from dubborequests import Config
from config import ZK_CONFIG
import dubborequests
class DubboHandle(object):
Config.zookeeper_url_list = ZK_CONFIG
@staticmethod
def search(service_name, version=None):
service_info = dubborequests.search(service_name, version)
return service_info
@staticmethod
def list(service_name, method_name=None, version=None):
list_data = dubborequests.list(service_name, method_name, version)
return list_data
@staticmethod
def invoke(service_name, method_name, data, version=None):
res_data = dubborequests.zk_invoke(service_name, method_name, data, version)
return res_data['invoke_data']
@staticmethod
def telnet_list(ip, port, service_name, method_name=None):
list_data = dubborequests.telnet_list(ip, port, service_name, method_name)
return list_data