Browse Source

add route

qill 2 years ago
parent
commit
fc844a3e8b
1 changed files with 8 additions and 8 deletions
  1. 8 8
      app/run.py

+ 8 - 8
app/run.py

@@ -15,7 +15,7 @@ app.config.from_object('config')
 CORS(app, resources=r'/*')
 CORS(app, resources=r'/*')
 
 
 
 
-@app.route('/manage', methods=['POST'])
+@app.route('/jpt/manage', methods=['POST'])
 def manage():
 def manage():
     set_config = request.get_data()
     set_config = request.get_data()
     if set_config is None or set_config == "":
     if set_config is None or set_config == "":
@@ -30,7 +30,7 @@ def manage():
     return filename
     return filename
 
 
 
 
-@app.route('/managelist/item=<key_value>')
+@app.route('/jpt/managelist/item=<key_value>')
 def managelist(key_value):
 def managelist(key_value):
     files = os.listdir('./')
     files = os.listdir('./')
     res = []
     res = []
@@ -42,7 +42,7 @@ def managelist(key_value):
     dic['sourcelist'] = res
     dic['sourcelist'] = res
     return json.dumps(res)
     return json.dumps(res)
 
 
-@app.route('/show/hive/databases/item=<key_value>')
+@app.route('/jpt/show/hive/databases/item=<key_value>')
 def show_databases(key_value):
 def show_databases(key_value):
     #connection = hive.Connection(host="192.168.2.104", port=7001)
     #connection = hive.Connection(host="192.168.2.104", port=7001)
     manager, sourcename = tuple(key_value.split(';'))
     manager, sourcename = tuple(key_value.split(';'))
@@ -61,7 +61,7 @@ def show_databases(key_value):
     return json.dumps(res)
     return json.dumps(res)
 
 
 
 
-@app.route('/show/hive/tables/item=<key_value>')
+@app.route('/jpt/show/hive/tables/item=<key_value>')
 def show_tables(key_value):
 def show_tables(key_value):
     manager, sourcename ,database = tuple(key_value.split(';'))
     manager, sourcename ,database = tuple(key_value.split(';'))
     config = ConfigLoader(manager, sourcename).read_config()
     config = ConfigLoader(manager, sourcename).read_config()
@@ -76,7 +76,7 @@ def show_tables(key_value):
     return json.dumps(res)
     return json.dumps(res)
 
 
 
 
-@app.route('/show/hive/results/item=<key_value>')
+@app.route('/jpt/show/hive/results/item=<key_value>')
 def show_results(key_value):
 def show_results(key_value):
     manager, sourcename, database, table = tuple(key_value.split(';'))
     manager, sourcename, database, table = tuple(key_value.split(';'))
     config = ConfigLoader(manager, sourcename).read_config()
     config = ConfigLoader(manager, sourcename).read_config()
@@ -102,7 +102,7 @@ def show_results(key_value):
         return resp
         return resp
 
 
 
 
-@app.route('/show/mysql/databases/item=<key_value>')
+@app.route('/jpt/show/mysql/databases/item=<key_value>')
 def show_mysql_databases(key_value):
 def show_mysql_databases(key_value):
     manager, sourcename = tuple(key_value.split(';'))
     manager, sourcename = tuple(key_value.split(';'))
     config = ConfigLoader(manager, sourcename)
     config = ConfigLoader(manager, sourcename)
@@ -111,7 +111,7 @@ def show_mysql_databases(key_value):
     return mysqlcli.LinkMysql(query)
     return mysqlcli.LinkMysql(query)
 
 
 
 
-@app.route('/show/mysql/tables/item=<key_value>')
+@app.route('/jpt/show/mysql/tables/item=<key_value>')
 def show_mysql_tables(key_value):
 def show_mysql_tables(key_value):
     manager, sourcename, database = tuple(key_value.split(';'))
     manager, sourcename, database = tuple(key_value.split(';'))
     config = ConfigLoader(manager, sourcename)
     config = ConfigLoader(manager, sourcename)
@@ -120,7 +120,7 @@ def show_mysql_tables(key_value):
     return mysqlcli.LinkMysql(query, database=database)
     return mysqlcli.LinkMysql(query, database=database)
 
 
 
 
-@app.route('/show/mysql/results/item=<key_value>')
+@app.route('/jpt/show/mysql/results/item=<key_value>')
 def show_mysql_results(key_value):  # put application's code here
 def show_mysql_results(key_value):  # put application's code here
     manager, sourcename, database, table = tuple(key_value.split(';'))
     manager, sourcename, database, table = tuple(key_value.split(';'))
     config = ConfigLoader(manager, sourcename)
     config = ConfigLoader(manager, sourcename)