Closed hklhai closed 5 years ago
增加参数: GET http://127.0.0.1:8090/show/tableList?dbid=1 GET http://127.0.0.1:8090/show/tableList?dbid=2
GET http://127.0.0.1:8090/show/tableList
Return: [ "ACT_EVT_LOG", "ACT_GE_BYTEARRAY", "ACT_GE_PROPERTY", "ACT_HI_ACTINST", "ACT_HI_ATTACHMENT", "ACT_HI_COMMENT", "ACT_HI_DETAIL", "ACT_HI_IDENTITYLINK", "ACT_HI_PROCINST", "ACT_HI_TASKINST", "ACT_HI_VARINST", "ACT_ID_GROUP", "ACT_ID_INFO", "ACT_ID_MEMBERSHIP", "ACT_ID_USER", "ACT_PROCDEF_INFO", "ACT_RE_DEPLOYMENT", "ACT_RE_MODEL", "ACT_RE_PROCDEF", "ACT_RU_EVENT_SUBSCR", "ACT_RU_EXECUTION", "ACT_RU_IDENTITYLINK", "ACT_RU_JOB", "ACT_RU_TASK", "ACT_RU_VARIABLE", "baidu_info", "crawler_douban_score", "crawler_problem", "crawler_url", "crawler_url_book", "crawler_url_book_2", "crawler_url_literature", "crawler_url_soap", "crawler_url_variety", "crawler_variety", "pub_map", "task", "tb_product", "tb_status", "tb_user", "test_user", "v_baidu_crawler", "v_douban_crawler_book", "v_douban_crawler_film", "v_douban_crawler_soap" ]
增加参数 GET http://127.0.0.1:8090/show/columnList?tablename=LINE_SOURCE&dbid=2 GET http://127.0.0.1:8090/show/columnList?tablename=pie_source&dbid=1
GET http://127.0.0.1:8090/show/columnList?tablename=task
Return: [ { "field": "taskid", "type": "bigint(20)" }, { "field": "task_name", "type": "varchar(255)" }, { "field": "create_time", "type": "datetime" }, { "field": "start_time", "type": "datetime" }, { "field": "finish_time", "type": "datetime" }, { "field": "task_type", "type": "varchar(25)" }, { "field": "task_status", "type": "varchar(25)" }, { "field": "task_param", "type": "text" }, { "field": "task_desc", "type": "varchar(255)" }, { "field": "task_exception", "type": "varchar(500)" } ]
POST http://127.0.0.1:8090/show/visualizeAdd { "visualize": { "type": "pie", "visualizename": "BNOP-pie_2", "sourcetablename" : "ab_line_1" }, "columnList": [ { "field": "showkey", "type": "varchar(20)" }, { "field": "showvalue", "type": "double(10,2)" }, { "field": "showvalue1", "type": "double(10,2)" }, { "field": "showvalue2", "type": "double(10,2)" }, { "field": "showvalue3", "type": "double(10,2)" }, { "field": "showvalue4", "type": "double(10,2)" } ] }
oracle查询表列
select * from user_tab_cols where table_name='TEST';
SELECT T1.TABLE_NAME, T1.COLUMN_NAME, T1.NULLABLE, T1.DATA_TYPE || '(' || T1.DATA_LENGTH || ')', T2.COMMENTS FROM USER_TAB_COLS T1, USER_COL_COMMENTS T2 WHERE T1.TABLE_NAME = T2.TABLE_NAME AND T1.COLUMN_NAME = T2.COLUMN_NAME AND T1.TABLE_NAME = 'LINE_SOURCE';
更改版:
SELECT T1.COLUMN_NAME as field, decode(T1.DATA_TYPE, 'VARCHAR2', T1.DATA_TYPE || '(' || T1.DATA_LENGTH || ')', 'NUMBER', decode(T1.DATA_SCALE, 0, T1.DATA_TYPE || '(' || T1.DATA_PRECISION || ')', T1.DATA_TYPE || '(' || T1.DATA_PRECISION || ',' || T1.DATA_SCALE || ')')) as type FROM USER_TAB_COLS T1 where T1.TABLE_NAME = 'LINE_SOURCE';
@aym19900825
POST http://127.0.0.1:8090/show/databaseAdd { "ip": "spark4", "port": "3306", "database": "sourcedb", "user": "root", "password": "mysql", "datasourcename": "配饰数据库1", "dbtype": "mysql" }
@aym19900825
PUT http://127.0.0.1:8090/show/databaseUpdate { "dbid": 3, "ip": "spark4", "port": "3306", "database": "sourcedb", "user": "root", "password": "mysql", "datasourcename": "配饰数据库-update", "dbtype": "oracle" }
@aym19900825
GET http://127.0.0.1:8090/show/validateDatabase?dbid=1 { "code": 1, "message": "Connection successful!", "modelList": null }
选择数据库
只显示数据库名称database即可 GET http://127.0.0.1:8090/show/databaseList
Return:
[ { "dbid": 1, "ip": "spark4", "port": "3306", "database": "market_analysis", "user": "root", "password": "mysql", "drivername": "com.mysql.jdbc.Driver", "valid": 1, "datasourcename": null } ]
@aym19900825
DELETE http://spark2:8090/show/database/4
RETURN: { "code": 1, "message": "Delete Success!", "modelList": null }
选择数据库
只显示数据库名称database即可 GET http://spark2:8090/show/databaseList
Return:
[ { "dbid": 1, "ip": "spark4", "port": "3306", "database": "market_analysis", "user": "root", "password": "mysql", "drivername": "com.mysql.jdbc.Driver", "valid": 1, "datasourcename": null } ]
@aym19900825 以上数据库列表接口不变; 新建视图时,调用接口需要增加参数,返回测试成功的数据库链接
http://spark2:8090/show/databaseList?valid=1
增加valid参数为1