diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 7909b96..d5f0503 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -2,13 +2,19 @@ + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml index 7ffa493..0b713f8 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -3,8 +3,16 @@ + + + + + + + + diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..ee9f695 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,68 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 325840e..131a039 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -5,10 +5,19 @@ + - + diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 43d5b7f..4d1db4a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,12 +4,70 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -33,29 +91,124 @@ - { + "keyToString": { + "ApiPost:METDOD_SEND_RECORD:el-data-source-server": "{\"/test\":[{\"url\":\"http://localhost:8886/test\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"url\\\": \\\"jdbc:mysql://localhost:3306/\\\",\\n \\\"user\\\": \\\"root\\\",\\n \\\"passWard\\\": \\\"lzz@123\\\"\\n}\",\"responseBody\":\"{\\n \\\"code\\\": 200,\\n \\\"msg\\\": \\\"操作成功\\\",\\n \\\"data\\\": \\\"无法连接到MySQL数据库!\\\"\\n}\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":16.0,\"minute\":7.0,\"second\":1.0,\"nano\":8.935848E8}}},{\"url\":\"http://localhost:8886/test\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"url\\\": \\\"jdbc:mysql://localhost:3306/health\\\",\\n \\\"user\\\": \\\"root\\\",\\n \\\"passWard\\\": \\\"lzz@123\\\"\\n}\",\"responseBody\":\"{\\n \\\"code\\\": 200,\\n \\\"msg\\\": \\\"操作成功\\\",\\n \\\"data\\\": \\\"无法连接到MySQL数据库!\\\"\\n}\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":16.0,\"minute\":7.0,\"second\":17.0,\"nano\":1.862118E8}}},{\"url\":\"http://localhost:8886/test\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"url\\\": \\\"jdbc:mysql://182.254.221.163:3306\\\",\\n \\\"user\\\": \\\"root\\\",\\n \\\"passWard\\\": \\\"lzz@123\\\"\\n}\",\"responseBody\":\"{\\n \\\"code\\\": 200,\\n \\\"msg\\\": \\\"操作成功\\\",\\n \\\"data\\\": \\\"成功连接到MySQL数据库!\\\"\\n}\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":16.0,\"minute\":9.0,\"second\":16.0,\"nano\":9.248973E8}}},{\"url\":\"http://localhost:8886/test\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"url\\\": \\\"jdbc:mysql://182.254.221.163:3306\\\",\\n \\\"user\\\": \\\"root\\\",\\n \\\"passWard\\\": \\\"lzz@123\\\"\\n}\",\"responseBody\":\"{\\n \\\"code\\\": 200,\\n \\\"msg\\\": \\\"操作成功\\\",\\n \\\"data\\\": \\\"成功连接到MySQL数据库!\\\"\\n}\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":16.0,\"minute\":9.0,\"second\":22.0,\"nano\":1.626433E8}}},{\"url\":\"http://localhost:8886/test\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"url\\\": \\\"jdbc:mysql://182.254.221.163:3306/health\\\",\\n \\\"user\\\": \\\"root\\\",\\n \\\"passWard\\\": \\\"lzz@123\\\"\\n}\",\"responseBody\":\"{\\n \\\"code\\\": 200,\\n \\\"msg\\\": \\\"操作成功\\\",\\n \\\"data\\\": \\\"成功连接到MySQL数据库!\\\"\\n}\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":16.0,\"minute\":9.0,\"second\":28.0,\"nano\":6.040624E8}}},{\"url\":\"http://localhost:8886/test\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"url\\\": \\\"jdbc:mysql://182.254.221.163:3306/health\\\",\\n \\\"user\\\": \\\"root\\\",\\n \\\"passWard\\\": \\\"lzz@123\\\"\\n}\",\"responseBody\":\"{\\n \\\"code\\\": 200,\\n \\\"msg\\\": \\\"操作成功\\\",\\n \\\"data\\\": \\\"数据连接成功\\\"\\n}\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":16.0,\"minute\":15.0,\"second\":59.0,\"nano\":5.084082E8}}}],\"/test-database-connection\":[{\"url\":\"http://localhost:8886/test-database-connection\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"com.mysql.cj.jdbc.Driver\\\",\\n \\\"url\\\": \\\"jdbc:mysql://182.254.221.163:health?serverTimezone\\u003dUTC\\\",\\n \\\"username\\\": \\\"root\\\",\\n \\\"password\\\": \\\"lzz@123\\\"\\n}\",\"responseBody\":\"error\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":19.0,\"minute\":28.0,\"second\":7.0,\"nano\":2.000408E8}}},{\"url\":\"http://localhost:8886/test-database-connection\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"com.mysql.cj.jdbc.Driver\\\",\\n \\\"url\\\": \\\"jdbc:mysql://182.254.221.163/health?serverTimezone\\u003dUTC\\\",\\n \\\"username\\\": \\\"root\\\",\\n \\\"password\\\": \\\"lzz@123\\\"\\n}\",\"responseBody\":\"ok\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":19.0,\"minute\":29.0,\"second\":0.0,\"nano\":4.296155E8}}},{\"url\":\"http://localhost:8886/test-database-connection\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"com.mysql.cj.jdbc.Driver\\\",\\n \\\"url\\\": \\\"jdbc:mysql://43.142.12.243/health?serverTimezone\\u003dUTC\\\",\\n \\\"username\\\": \\\"root\\\",\\n \\\"password\\\": \\\"lzz@123\\\"\\n}\",\"responseBody\":\"error\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":19.0,\"minute\":33.0,\"second\":49.0,\"nano\":1.179387E8}}},{\"url\":\"http://localhost:8886/test-database-connection\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"com.mysql.cj.jdbc.Driver\\\",\\n \\\"url\\\": \\\"jdbc:mysql://43.142.12.243/etl?serverTimezone\\u003dUTC\\\",\\n \\\"username\\\": \\\"root\\\",\\n \\\"password\\\": \\\"lzz@123\\\"\\n}\",\"responseBody\":\"error\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":19.0,\"minute\":34.0,\"second\":59.0,\"nano\":4.527054E8}}},{\"url\":\"http://localhost:8886/test-database-connection\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"com.mysql.cj.jdbc.Driver\\\",\\n \\\"url\\\": \\\"jdbc:mysql://43.142.12.243/etl?serverTimezone\\u003dUTC\\\",\\n \\\"username\\\": \\\"root\\\",\\n \\\"password\\\": \\\"ytt@123\\\"\\n}\",\"responseBody\":\"ok\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":19.0,\"minute\":35.0,\"second\":17.0,\"nano\":4.192197E8}}}],\"/findDatabaseTable\":[{\"url\":\"http://localhost:8886/findDatabaseTable\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"com.mysql.cj.jdbc.Driver\\\",\\n \\\"url\\\": \\\"jdbc:mysql://43.142.12.243\\\",\\n \\\"username\\\": \\\"root\\\",\\n \\\"password\\\": \\\"ytt@123\\\"\\n}\",\"responseBody\":\"{\\n \\\"code\\\": 200,\\n \\\"msg\\\": \\\"操作成功\\\",\\n \\\"data\\\": [\\n \\\"information_schema\\\",\\n \\\"access\\\",\\n \\\"bbyb_examination\\\",\\n \\\"buy_car\\\",\\n \\\"demo-seata\\\",\\n \\\"ele-admin-api\\\",\\n \\\"etl\\\",\\n \\\"follow-up\\\",\\n \\\"goods\\\",\\n \\\"mall\\\",\\n \\\"mall-cloud\\\",\\n \\\"mall-config\\\",\\n \\\"mall-seata\\\",\\n \\\"mall_product\\\",\\n \\\"month6\\\",\\n \\\"mysql\\\",\\n \\\"performance_schema\\\",\\n \\\"plm_material\\\",\\n \\\"product\\\",\\n \\\"producth\\\",\\n \\\"rule\\\",\\n \\\"ry-cloud\\\",\\n \\\"ry-config\\\",\\n \\\"seata\\\",\\n \\\"sky_db\\\",\\n \\\"sys\\\",\\n \\\"xxl_job\\\",\\n \\\"yuekao\\\",\\n \\\"zhou1\\\",\\n \\\"zhou2\\\",\\n \\\"zhou3\\\"\\n ]\\n}\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":20.0,\"minute\":36.0,\"second\":48.0,\"nano\":5.312185E8}}},{\"url\":\"http://localhost:8886/findDatabaseTable\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"\\\",\\n \\\"url\\\": \\\"\\\",\\n \\\"username\\\": \\\"\\\",\\n \\\"password\\\": \\\"\\\"\\n}\",\"responseBody\":\"There was an error accessing to URL: http://localhost:8886/findDatabaseTable\\n\\n数据库密码不能为空, 驱动类不能为空, 数据库连接地址不能为空, 数据库用户名不能为空\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":20.0,\"minute\":56.0,\"second\":25.0,\"nano\":3.12132E7}}},{\"url\":\"http://localhost:8886/findDatabaseTable\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"com.mysql.cj.jdbc.Driver\\\",\\n \\\"url\\\": \\\"jdbc:mysql://182.254.221.163:3306/\\\",\\n \\\"username\\\": \\\"root\\\",\\n \\\"password\\\": \\\"lzz@123\\\"\\n}\",\"responseBody\":\"{\\n \\\"code\\\": 200,\\n \\\"msg\\\": \\\"操作成功\\\",\\n \\\"data\\\": [\\n \\\"information_schema\\\",\\n \\\"etl\\\",\\n \\\"health\\\",\\n \\\"mall\\\",\\n \\\"mall-cloud\\\",\\n \\\"mall-product\\\",\\n \\\"mall-search\\\",\\n \\\"mall-seata\\\",\\n \\\"mysql\\\",\\n \\\"nacos_config\\\",\\n \\\"performance_schema\\\",\\n \\\"plm_material\\\",\\n \\\"product\\\",\\n \\\"ry-cloud\\\",\\n \\\"seata\\\",\\n \\\"skywalking\\\",\\n \\\"sys\\\",\\n \\\"xxl_job\\\",\\n \\\"yuekao\\\"\\n ]\\n}\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":20.0,\"minute\":57.0,\"second\":43.0,\"nano\":4.081869E8}}},{\"url\":\"http://localhost:8886/findDatabaseTable\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"com.mysql.cj.jdbc.Driver\\\",\\n \\\"url\\\": \\\"jdbc:mysql://182.254.221.163:3306/health\\\",\\n \\\"username\\\": \\\"root\\\",\\n \\\"password\\\": \\\"lzz@123\\\"\\n}\",\"responseBody\":\"{\\n \\\"code\\\": 200,\\n \\\"msg\\\": \\\"操作成功\\\",\\n \\\"data\\\": [\\n \\\"information_schema\\\",\\n \\\"etl\\\",\\n \\\"health\\\",\\n \\\"mall\\\",\\n \\\"mall-cloud\\\",\\n \\\"mall-product\\\",\\n \\\"mall-search\\\",\\n \\\"mall-seata\\\",\\n \\\"mysql\\\",\\n \\\"nacos_config\\\",\\n \\\"performance_schema\\\",\\n \\\"plm_material\\\",\\n \\\"product\\\",\\n \\\"ry-cloud\\\",\\n \\\"seata\\\",\\n \\\"skywalking\\\",\\n \\\"sys\\\",\\n \\\"xxl_job\\\",\\n \\\"yuekao\\\"\\n ]\\n}\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":20.0,\"minute\":58.0,\"second\":20.0,\"nano\":6.477346E8}}},{\"url\":\"http://localhost:8886/findDatabaseTable\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"com.mysql.cj.jdbc.Driver\\\",\\n \\\"url\\\": \\\"jdbc:mysql://182.254.221.163:3306\\\",\\n \\\"username\\\": \\\"root\\\",\\n \\\"password\\\": \\\"lzz@123\\\"\\n}\",\"responseBody\":\"{\\n \\\"code\\\": 200,\\n \\\"msg\\\": \\\"操作成功\\\",\\n \\\"data\\\": [\\n \\\"information_schema\\\",\\n \\\"etl\\\",\\n \\\"health\\\",\\n \\\"mall\\\",\\n \\\"mall-cloud\\\",\\n \\\"mall-product\\\",\\n \\\"mall-search\\\",\\n \\\"mall-seata\\\",\\n \\\"mysql\\\",\\n \\\"nacos_config\\\",\\n \\\"performance_schema\\\",\\n \\\"plm_material\\\",\\n \\\"product\\\",\\n \\\"ry-cloud\\\",\\n \\\"seata\\\",\\n \\\"skywalking\\\",\\n \\\"sys\\\",\\n \\\"xxl_job\\\",\\n \\\"yuekao\\\"\\n ]\\n}\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":20.0,\"minute\":58.0,\"second\":35.0,\"nano\":6.607178E8}}},{\"url\":\"http://localhost:8886/findDatabaseTable\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"com.mysql.cj.jdbc.Driver\\\",\\n \\\"url\\\": \\\"jdbc:mysql://182.254.221.163:3306/\\\",\\n \\\"username\\\": \\\"root\\\",\\n \\\"password\\\": \\\"lzz@123\\\",\\n \\\"tableName\\\":\\\"health\\\"\\n}\",\"responseBody\":\"{\\n \\\"code\\\": 200,\\n \\\"msg\\\": \\\"操作成功\\\",\\n \\\"data\\\": [\\n \\\"ef_completed_questionnaire_answer\\\",\\n \\\"ef_followup_plan\\\",\\n \\\"ef_followup_plan_setting\\\",\\n \\\"ef_followup_task\\\",\\n \\\"ef_followup_task_item\\\",\\n \\\"ef_followup_task_item_setting\\\",\\n \\\"ef_followup_task_setting\\\",\\n \\\"ef_questionnaire\\\",\\n \\\"ef_questionnaire_option\\\",\\n \\\"ef_questionnaire_question\\\",\\n \\\"ef_questionnaire_section\\\",\\n \\\"ef_questionnaire_template\\\",\\n \\\"t_brank\\\",\\n \\\"t_community\\\",\\n \\\"t_community_explain\\\",\\n \\\"t_community_search\\\",\\n \\\"t_consult\\\",\\n \\\"t_consult_chat\\\",\\n \\\"t_department_disease\\\",\\n \\\"t_dictionary\\\",\\n \\\"t_disease\\\",\\n \\\"t_drug\\\",\\n \\\"t_drug_type\\\",\\n \\\"t_evaluate\\\",\\n \\\"t_explain_praise\\\",\\n \\\"t_file\\\",\\n \\\"t_file_sharding\\\",\\n \\\"t_gift\\\",\\n \\\"t_hb_log\\\",\\n \\\"t_historical_consultation\\\",\\n \\\"t_menu\\\",\\n \\\"t_orders\\\",\\n \\\"t_role\\\",\\n \\\"t_role_menu\\\",\\n \\\"t_system_news\\\",\\n \\\"t_user\\\",\\n \\\"t_user_auto_reply\\\",\\n \\\"t_user_collect\\\",\\n \\\"t_user_department\\\",\\n \\\"t_user_gift\\\",\\n \\\"t_user_hospital\\\",\\n \\\"t_user_job\\\",\\n \\\"t_user_role\\\",\\n \\\"t_video\\\",\\n \\\"t_video_comments\\\",\\n \\\"t_wallet_brank\\\",\\n \\\"t_wallet_info\\\",\\n \\\"t_withdraw_log\\\"\\n ]\\n}\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":21.0,\"minute\":34.0,\"second\":36.0,\"nano\":7.434797E8}}}],\"/test-database-mysql\":[{\"url\":\"http://localhost:8886/test-database-mysql\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"\\\",\\n \\\"url\\\": \\\"\\\",\\n \\\"username\\\": \\\"\\\",\\n \\\"password\\\": \\\"\\\"\\n}\",\"responseBody\":\"{\\n \\\"code\\\": 500,\\n \\\"msg\\\": \\\"操作异常\\\",\\n \\\"data\\\": null\\n}\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":20.0,\"minute\":39.0,\"second\":5.0,\"nano\":6.72859E7}}},{\"url\":\"http://localhost:8886/test-database-mysql\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"\\\",\\n \\\"url\\\": \\\"\\\",\\n \\\"username\\\": \\\"\\\",\\n \\\"password\\\": \\\"\\\"\\n}\",\"responseBody\":\"{\\n \\\"code\\\": 500,\\n \\\"msg\\\": \\\"操作异常\\\",\\n \\\"data\\\": null\\n}\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":20.0,\"minute\":43.0,\"second\":49.0,\"nano\":4.508657E8}}},{\"url\":\"http://localhost:8886/test-database-mysql\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"\\\",\\n \\\"url\\\": \\\"\\\",\\n \\\"username\\\": \\\"\\\",\\n \\\"password\\\": \\\"\\\"\\n}\",\"responseBody\":\"{\\n \\\"code\\\": 500,\\n \\\"msg\\\": \\\"操作异常\\\",\\n \\\"data\\\": null\\n}\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":20.0,\"minute\":44.0,\"second\":21.0,\"nano\":7.852463E8}}},{\"url\":\"http://localhost:8886/test-database-mysql\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"\\\",\\n \\\"url\\\": \\\"\\\",\\n \\\"username\\\": \\\"\\\",\\n \\\"password\\\": \\\"\\\"\\n}\",\"responseBody\":\"There was an error accessing to URL: http://localhost:8886/test-database-mysql\\n\\n\\u003chtml\\u003e\\u003cbody\\u003e\\u003ch1\\u003eWhitelabel Error Page\\u003c/h1\\u003e\\u003cp\\u003eThis application has no explicit mapping for /error, so you are seeing this as a fallback.\\u003c/p\\u003e\\u003cdiv id\\u003d\\u0027created\\u0027\\u003eFri Jun 21 20:49:12 CST 2024\\u003c/div\\u003e\\u003cdiv\\u003eThere was an unexpected error (type\\u003dBad Request, status\\u003d400).\\u003c/div\\u003e\\u003c/body\\u003e\\u003c/html\\u003e\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":20.0,\"minute\":49.0,\"second\":12.0,\"nano\":8.879368E8}}},{\"url\":\"http://localhost:8886/test-database-mysql\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"\\\",\\n \\\"url\\\": \\\"\\\",\\n \\\"username\\\": \\\"\\\",\\n \\\"password\\\": \\\"\\\"\\n}\",\"responseBody\":\"There was an error accessing to URL: http://localhost:8886/test-database-mysql\\n\\n\\u003chtml\\u003e\\u003cbody\\u003e\\u003ch1\\u003eWhitelabel Error Page\\u003c/h1\\u003e\\u003cp\\u003eThis application has no explicit mapping for /error, so you are seeing this as a fallback.\\u003c/p\\u003e\\u003cdiv id\\u003d\\u0027created\\u0027\\u003eFri Jun 21 20:49:28 CST 2024\\u003c/div\\u003e\\u003cdiv\\u003eThere was an unexpected error (type\\u003dBad Request, status\\u003d400).\\u003c/div\\u003e\\u003c/body\\u003e\\u003c/html\\u003e\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":20.0,\"minute\":49.0,\"second\":28.0,\"nano\":8.304501E8}}},{\"url\":\"http://localhost:8886/test-database-mysql\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"\\\",\\n \\\"url\\\": \\\"\\\",\\n \\\"username\\\": \\\"\\\",\\n \\\"password\\\": \\\"\\\"\\n}\",\"responseBody\":\"There was an error accessing to URL: http://localhost:8886/test-database-mysql\\n\\n\\u003chtml\\u003e\\u003cbody\\u003e\\u003ch1\\u003eWhitelabel Error Page\\u003c/h1\\u003e\\u003cp\\u003eThis application has no explicit mapping for /error, so you are seeing this as a fallback.\\u003c/p\\u003e\\u003cdiv id\\u003d\\u0027created\\u0027\\u003eFri Jun 21 20:49:59 CST 2024\\u003c/div\\u003e\\u003cdiv\\u003eThere was an unexpected error (type\\u003dBad Request, status\\u003d400).\\u003c/div\\u003e\\u003c/body\\u003e\\u003c/html\\u003e\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":20.0,\"minute\":49.0,\"second\":59.0,\"nano\":9.699223E8}}},{\"url\":\"http://localhost:8886/test-database-mysql\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"\\\",\\n \\\"url\\\": \\\"\\\",\\n \\\"username\\\": \\\"\\\",\\n \\\"password\\\": \\\"\\\"\\n}\",\"responseBody\":\"There was an error accessing to URL: http://localhost:8886/test-database-mysql\\n\\n\\u003chtml\\u003e\\u003cbody\\u003e\\u003ch1\\u003eWhitelabel Error Page\\u003c/h1\\u003e\\u003cp\\u003eThis application has no explicit mapping for /error, so you are seeing this as a fallback.\\u003c/p\\u003e\\u003cdiv id\\u003d\\u0027created\\u0027\\u003eFri Jun 21 20:53:52 CST 2024\\u003c/div\\u003e\\u003cdiv\\u003eThere was an unexpected error (type\\u003dBad Request, status\\u003d400).\\u003c/div\\u003e\\u003c/body\\u003e\\u003c/html\\u003e\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":20.0,\"minute\":53.0,\"second\":52.0,\"nano\":4.422725E8}}},{\"url\":\"http://localhost:8886/test-database-mysql\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"\\\",\\n \\\"url\\\": \\\"\\\",\\n \\\"username\\\": \\\"\\\",\\n \\\"password\\\": \\\"\\\"\\n}\",\"responseBody\":\"There was an error accessing to URL: http://localhost:8886/test-database-mysql\\n\\n驱动类不能为空, 数据库用户名不能为空, 数据库密码不能为空, 数据库连接地址不能为空\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":20.0,\"minute\":55.0,\"second\":0.0,\"nano\":4.917924E8}}},{\"url\":\"http://localhost:8886/test-database-mysql\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"\\\",\\n \\\"url\\\": \\\"\\\",\\n \\\"username\\\": \\\"\\\",\\n \\\"password\\\": \\\"\\\"\\n}\",\"responseBody\":\"There was an error accessing to URL: http://localhost:8886/test-database-mysql\\n\\n数据库密码不能为空, 数据库用户名不能为空, 数据库连接地址不能为空, 驱动类不能为空\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":20.0,\"minute\":56.0,\"second\":20.0,\"nano\":7.39437E7}}},{\"url\":\"http://localhost:8886/test-database-mysql\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"com.mysql.cj.jdbc.Driver\\\",\\n \\\"url\\\": \\\"jdbc:mysql://182.254.221.163:3306/\\\",\\n \\\"username\\\": \\\"root\\\",\\n \\\"password\\\": \\\"lzz@123\\\"\\n}\",\"responseBody\":\"{\\n \\\"code\\\": 200,\\n \\\"msg\\\": \\\"操作成功\\\",\\n \\\"data\\\": null\\n}\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":20.0,\"minute\":57.0,\"second\":9.0,\"nano\":3.471744E8}}},{\"url\":\"http://localhost:8886/test-database-mysql\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"com.mysql.cj.jdbc.Driver\\\",\\n \\\"url\\\": \\\"jdbc:mysql://182.254.221.163:3306/\\\",\\n \\\"username\\\": \\\"root\\\",\\n \\\"password\\\": \\\"lzz@123\\\"\\n}\",\"responseBody\":\"{\\n \\\"code\\\": 200,\\n \\\"msg\\\": \\\"操作成功\\\",\\n \\\"data\\\": null\\n}\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":20.0,\"minute\":57.0,\"second\":15.0,\"nano\":9.596244E8}}},{\"url\":\"http://localhost:8886/test-database-mysql\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"com.mysql.cj.jdbc.Driver\\\",\\n \\\"url\\\": \\\"jdbc:mysql://182.254.221.163:3306/\\\",\\n \\\"username\\\": \\\"root\\\",\\n \\\"password\\\": \\\"lzz@123\\\",\\n \\\"tableName\\\":\\\"health\\\"\\n}\",\"responseBody\":\"{\\n \\\"code\\\": 200,\\n \\\"msg\\\": \\\"操作成功\\\",\\n \\\"data\\\": \\\"连接成功\\\"\\n}\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":21.0},\"time\":{\"hour\":21.0,\"minute\":34.0,\"second\":26.0,\"nano\":1.512348E8}}}],\"/testDatabaseMysql\":[{\"url\":\"http://localhost:8886/testDatabaseMysql\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"\\\",\\n \\\"url\\\": \\\"\\\",\\n \\\"username\\\": \\\"\\\",\\n \\\"password\\\": \\\"\\\",\\n \\\"tableName\\\": \\\"\\\",\\n \\\"warehouseName\\\": \\\"\\\"\\n}\",\"responseBody\":\"There was an error accessing to URL: http://localhost:8886/testDatabaseMysql\\n\\n\\u003chtml\\u003e\\u003cbody\\u003e\\u003ch1\\u003eWhitelabel Error Page\\u003c/h1\\u003e\\u003cp\\u003eThis application has no explicit mapping for /error, so you are seeing this as a fallback.\\u003c/p\\u003e\\u003cdiv id\\u003d\\u0027created\\u0027\\u003eSat Jun 22 12:34:07 CST 2024\\u003c/div\\u003e\\u003cdiv\\u003eThere was an unexpected error (type\\u003dBad Request, status\\u003d400).\\u003c/div\\u003e\\u003c/body\\u003e\\u003c/html\\u003e\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":22.0},\"time\":{\"hour\":12.0,\"minute\":34.0,\"second\":7.0,\"nano\":9.278628E8}}},{\"url\":\"http://localhost:8886/testDatabaseMysql\",\"header\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1.0,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"\\\",\\n \\\"url\\\": \\\"\\\",\\n \\\"username\\\": \\\"\\\",\\n \\\"password\\\": \\\"\\\",\\n \\\"tableName\\\": \\\"\\\",\\n \\\"warehouseName\\\": \\\"\\\"\\n}\",\"responseBody\":\"There was an error accessing to URL: http://localhost:8886/testDatabaseMysql\\n\\n驱动类不能为空, 数据库连接地址不能为空, 数据库用户名不能为空, 数据库密码不能为空\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024.0,\"month\":6.0,\"day\":22.0},\"time\":{\"hour\":12.0,\"minute\":35.0,\"second\":17.0,\"nano\":7.667724E8}}},{\"url\":\"http://localhost:8886/testDatabaseMysql\",\"header\":[{\"is_checked\":1,\"type\":\"Text\",\"value\":\"\"}],\"query\":[{\"is_checked\":1,\"type\":\"Text\",\"value\":\"\"}],\"rest\":[{\"is_checked\":1,\"type\":\"Text\",\"value\":\"\"}],\"requestBody\":\"{\\n \\\"driverClassName\\\": \\\"\\\",\\n \\\"url\\\": \\\"\\\",\\n \\\"username\\\": \\\"\\\",\\n \\\"password\\\": \\\"\\\",\\n \\\"tableName\\\": \\\"\\\",\\n \\\"warehouseName\\\": \\\"\\\"\\n}\",\"responseBody\":\"There was an error accessing to URL: http://localhost:8886/testDatabaseMysql\\n\\n\\u003chtml\\u003e\\u003cbody\\u003e\\u003ch1\\u003eWhitelabel Error Page\\u003c/h1\\u003e\\u003cp\\u003eThis application has no explicit mapping for /error, so you are seeing this as a fallback.\\u003c/p\\u003e\\u003cdiv id\\u003d\\u0027created\\u0027\\u003eSat Jun 22 12:39:36 CST 2024\\u003c/div\\u003e\\u003cdiv\\u003eThere was an unexpected error (type\\u003dInternal Server Error, status\\u003d500).\\u003c/div\\u003e\\u003c/body\\u003e\\u003c/html\\u003e\",\"selectedItem\":\"POST\",\"time\":{\"date\":{\"year\":2024,\"month\":6,\"day\":22},\"time\":{\"hour\":12,\"minute\":39,\"second\":36,\"nano\":447723500}}}]}", + "RequestMappingsPanelOrder0": "0", + "RequestMappingsPanelOrder1": "1", + "RequestMappingsPanelWidth0": "75", + "RequestMappingsPanelWidth1": "75", + "RunOnceActivity.OpenProjectViewOnStart": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "SHARE_PROJECT_CONFIGURATION_FILES": "true", + "WebServerToolWindowFactoryState": "false", + "git-widget-placeholder": "main", + "jdk.selected.JAVA_MODULE": "1.8", + "last_opened_file_path": "D:/workspace/etl-ui", + "node.js.detected.package.eslint": "true", + "node.js.detected.package.tslint": "true", + "node.js.selected.package.eslint": "(autodetect)", + "node.js.selected.package.tslint": "(autodetect)", + "nodejs_package_manager_path": "npm", + "project.structure.last.edited": "模块", + "project.structure.proportion": "0.17", + "project.structure.side.proportion": "0.29885057", + "settings.editor.selected.configurable": "configurable.group.build", + "spring.configuration.checksum": "21940204b7449cbc44619bf9f15c4b27", + "vue.rearranger.settings.migration": "true" } -}]]> - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + @@ -81,7 +238,22 @@ + + + + + + + + + @@ -98,4 +270,8 @@ + + + \ No newline at end of file diff --git a/etl-common/pom.xml b/etl-common/pom.xml index 412ed7b..8653e6f 100644 --- a/etl-common/pom.xml +++ b/etl-common/pom.xml @@ -9,13 +9,54 @@ etl-common etl-common + 1.8 UTF-8 UTF-8 2.6.13 + + + com.bwie + etl-cloud + 1.0-SNAPSHOT + + + org.springframework.boot + spring-boot-starter-validation + + + org.redisson + redisson-spring-boot-starter + 3.21.1 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-test + + + org.springframework.boot + spring-boot-starter-data-redis + + + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + com.github.xiaoymin + knife4j-openapi2-spring-boot-starter + 4.4.0 + net.sourceforge.tess4j tess4j @@ -32,6 +73,10 @@ knife4j-openapi2-spring-boot-starter 4.4.0 + + org.springframework.boot + spring-boot-starter-web + org.springframework.boot spring-boot-starter-test @@ -98,40 +143,6 @@ import - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - 1.8 - 1.8 - UTF-8 - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot.version} - - com.health.cloud.common.HealthCloudCommonApplication - true - - - - repackage - - repackage - - - - - - - - diff --git a/etl-common/src/main/resources/META-INF/spring.factories b/etl-common/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..d562b5f --- /dev/null +++ b/etl-common/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +#org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +# com.health.common.handle.ExceptHandle diff --git a/etl-common/target/classes/META-INF/spring.factories b/etl-common/target/classes/META-INF/spring.factories new file mode 100644 index 0000000..d562b5f --- /dev/null +++ b/etl-common/target/classes/META-INF/spring.factories @@ -0,0 +1,2 @@ +#org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +# com.health.common.handle.ExceptHandle diff --git a/etl-common/target/etl-common-1.0-SNAPSHOT.jar b/etl-common/target/etl-common-1.0-SNAPSHOT.jar new file mode 100644 index 0000000..eca0a6c Binary files /dev/null and b/etl-common/target/etl-common-1.0-SNAPSHOT.jar differ diff --git a/etl-common/target/maven-archiver/pom.properties b/etl-common/target/maven-archiver/pom.properties index 72f02fc..9905eb9 100644 --- a/etl-common/target/maven-archiver/pom.properties +++ b/etl-common/target/maven-archiver/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven -#Tue Jun 18 19:06:20 CST 2024 -version=1.0-SNAPSHOT +#Fri Jun 21 17:06:57 CST 2024 groupId=com.bwie artifactId=etl-common +version=1.0-SNAPSHOT diff --git a/etl-common/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/etl-common/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..55b2628 --- /dev/null +++ b/etl-common/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,19 @@ +com\etl\common\constants\Constants.class +com\etl\common\result\PageResult.class +com\etl\common\constants\JwtConstants.class +com\etl\common\Entity.class +com\etl\common\handler\ExceptionHandlers.class +com\etl\common\util\JwtUtils.class +com\etl\common\util\RequestUtil.class +com\etl\common\exception\ServiceException.class +com\etl\common\result\ResultBody.class +com\etl\common\config\Swagger.class +com\etl\common\exception\AllException.class +com\etl\common\util\RestTemplateUtil.class +com\etl\common\result\Result.class +com\etl\common\config\Swagger$1.class +com\etl\common\BaseEntity.class +com\etl\common\exception\GlobalException.class +com\etl\common\util\RestTemplateConfig.class +com\etl\common\constants\TokenConstants.class +com\etl\common\util\StringUtils.class diff --git a/etl-common/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/etl-common/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..1597a51 --- /dev/null +++ b/etl-common/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,18 @@ +D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\config\Swagger.java +D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\exception\AllException.java +D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\result\Result.java +D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\util\RestTemplateConfig.java +D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\constants\Constants.java +D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\result\PageResult.java +D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\constants\TokenConstants.java +D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\util\RequestUtil.java +D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\util\StringUtils.java +D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\util\RestTemplateUtil.java +D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\constants\JwtConstants.java +D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\util\JwtUtils.java +D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\BaseEntity.java +D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\exception\GlobalException.java +D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\handler\ExceptionHandlers.java +D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\Entity.java +D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\exception\ServiceException.java +D:\workspace\etl-cloud\etl-common\src\main\java\com\etl\common\result\ResultBody.java diff --git a/etl-data-source/el-data-source-common/pom.xml b/etl-data-source/el-data-source-common/pom.xml new file mode 100644 index 0000000..fa054e0 --- /dev/null +++ b/etl-data-source/el-data-source-common/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + com.bwie + etl-data-source + 1.0-SNAPSHOT + + el-data-source-common + el-data-source-common + + 1.8 + UTF-8 + UTF-8 + 2.6.13 + + + + com.bwie + etl-common + 1.0-SNAPSHOT + + + + diff --git a/etl-data-source/el-data-source-common/src/main/java/com/etl/data/source/common/pojo/DatabaseConfig.java b/etl-data-source/el-data-source-common/src/main/java/com/etl/data/source/common/pojo/DatabaseConfig.java new file mode 100644 index 0000000..27c41a3 --- /dev/null +++ b/etl-data-source/el-data-source-common/src/main/java/com/etl/data/source/common/pojo/DatabaseConfig.java @@ -0,0 +1,36 @@ +package com.etl.data.source.common.pojo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +@Data +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "数据库配置") +public class DatabaseConfig { + @NotBlank(message = "驱动类不能为空") + @ApiModelProperty(value = "驱动类") + private String driverClassName; + @NotBlank(message = "数据库连接地址不能为空") + @ApiModelProperty(value = "数据库连接地址") + private String url; + @NotBlank(message = "数据库用户名不能为空") + @ApiModelProperty(value = "数据库用户名") + private String username; + @NotBlank(message = "数据库密码不能为空") + @ApiModelProperty(value = "数据库密码") + private String password; + @ApiModelProperty(value = "数据库表名") + private String tableName; + @ApiModelProperty(value = "数据库库名") + private String warehouseName; + +} + diff --git a/etl-data-source/el-data-source-common/src/main/java/com/etl/data/source/common/pojo/DatabaseRedis.java b/etl-data-source/el-data-source-common/src/main/java/com/etl/data/source/common/pojo/DatabaseRedis.java new file mode 100644 index 0000000..bf67072 --- /dev/null +++ b/etl-data-source/el-data-source-common/src/main/java/com/etl/data/source/common/pojo/DatabaseRedis.java @@ -0,0 +1,25 @@ +package com.etl.data.source.common.pojo; + +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; + +/** + * @ClassName DatabaseRedis + * @Description 描述 + * @Author ZeZhang.Liu + * @Date 2024/6/24 8:35 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "redis数据库配置") +public class DatabaseRedis { + @NotBlank(message = "redis连接地址不能为空") + private String url; + @NotBlank(message = "redis端口号不能为空") + private String port; +} diff --git a/etl-data-source/el-data-source-common/src/main/java/com/etl/data/source/common/pojo/constants/MysqlConstants.java b/etl-data-source/el-data-source-common/src/main/java/com/etl/data/source/common/pojo/constants/MysqlConstants.java new file mode 100644 index 0000000..a0fc707 --- /dev/null +++ b/etl-data-source/el-data-source-common/src/main/java/com/etl/data/source/common/pojo/constants/MysqlConstants.java @@ -0,0 +1,13 @@ +package com.etl.data.source.common.pojo.constants; + +/** + * @ClassName MysqlConstants + * @Description 描述 + * @Author ZeZhang.Liu + * @Date 2024/6/21 20:34 + */ +public class MysqlConstants { + public static final String MYSQL_USER = "user"; + + public static final String MYSQL_PASSWORD = "password"; +} diff --git a/etl-data-source/el-data-source-common/src/main/java/com/etl/data/source/common/pojo/req/ConnectMysqlReq.java b/etl-data-source/el-data-source-common/src/main/java/com/etl/data/source/common/pojo/req/ConnectMysqlReq.java new file mode 100644 index 0000000..f23dac1 --- /dev/null +++ b/etl-data-source/el-data-source-common/src/main/java/com/etl/data/source/common/pojo/req/ConnectMysqlReq.java @@ -0,0 +1,22 @@ +package com.etl.data.source.common.pojo.req; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @ClassName ConnectMysqlReq + * @Description 描述 + * @Author ZeZhang.Liu + * @Date 2024/6/21 15:32 + */ +@Data +@ApiModel(value = "连接mysql请求参数") +public class ConnectMysqlReq { + @ApiModelProperty(value = "数据库连接地址") + private String url; + @ApiModelProperty(value = "数据库用户名") + private String user; + @ApiModelProperty(value = "数据库密码") + private String passWard; +} diff --git a/etl-data-source/el-data-source-common/src/main/java/com/etl/data/source/common/pojo/resq/ColumnInfo.java b/etl-data-source/el-data-source-common/src/main/java/com/etl/data/source/common/pojo/resq/ColumnInfo.java new file mode 100644 index 0000000..e2cba26 --- /dev/null +++ b/etl-data-source/el-data-source-common/src/main/java/com/etl/data/source/common/pojo/resq/ColumnInfo.java @@ -0,0 +1,27 @@ +package com.etl.data.source.common.pojo.resq; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "字段信息") +public class ColumnInfo { + @ApiModelProperty(value = "字段名") + private String columnName; + @ApiModelProperty(value = "字段类型") + private String dataType; + @ApiModelProperty(value = "字段长度") + private Integer characterMaximumLength; // 注意这里可能是null + @ApiModelProperty(value = "字段键类型") + private String columnKey; // 主键、唯一键等 + @ApiModelProperty(value = "是否为空") + private String isNullable; // YES 或 NO + @ApiModelProperty(value = "字段注释") + private String columnComment; // 列注释 + +} diff --git a/etl-data-source/el-data-source-common/target/classes/com/etl/data/source/common/pojo/DatabaseConfig.class b/etl-data-source/el-data-source-common/target/classes/com/etl/data/source/common/pojo/DatabaseConfig.class new file mode 100644 index 0000000..350a6fd Binary files /dev/null and b/etl-data-source/el-data-source-common/target/classes/com/etl/data/source/common/pojo/DatabaseConfig.class differ diff --git a/etl-data-source/el-data-source-common/target/classes/com/etl/data/source/common/pojo/DatabaseRedis.class b/etl-data-source/el-data-source-common/target/classes/com/etl/data/source/common/pojo/DatabaseRedis.class new file mode 100644 index 0000000..8e1ce0b Binary files /dev/null and b/etl-data-source/el-data-source-common/target/classes/com/etl/data/source/common/pojo/DatabaseRedis.class differ diff --git a/etl-data-source/el-data-source-common/target/classes/com/etl/data/source/common/pojo/constants/MysqlConstants.class b/etl-data-source/el-data-source-common/target/classes/com/etl/data/source/common/pojo/constants/MysqlConstants.class new file mode 100644 index 0000000..6b6430a Binary files /dev/null and b/etl-data-source/el-data-source-common/target/classes/com/etl/data/source/common/pojo/constants/MysqlConstants.class differ diff --git a/etl-data-source/el-data-source-common/target/classes/com/etl/data/source/common/pojo/req/ConnectMysqlReq.class b/etl-data-source/el-data-source-common/target/classes/com/etl/data/source/common/pojo/req/ConnectMysqlReq.class new file mode 100644 index 0000000..e00c164 Binary files /dev/null and b/etl-data-source/el-data-source-common/target/classes/com/etl/data/source/common/pojo/req/ConnectMysqlReq.class differ diff --git a/etl-data-source/el-data-source-common/target/classes/com/etl/data/source/common/pojo/resq/ColumnInfo.class b/etl-data-source/el-data-source-common/target/classes/com/etl/data/source/common/pojo/resq/ColumnInfo.class new file mode 100644 index 0000000..3471ed5 Binary files /dev/null and b/etl-data-source/el-data-source-common/target/classes/com/etl/data/source/common/pojo/resq/ColumnInfo.class differ diff --git a/etl-data-source/el-data-source-server/pom.xml b/etl-data-source/el-data-source-server/pom.xml new file mode 100644 index 0000000..df6f5e3 --- /dev/null +++ b/etl-data-source/el-data-source-server/pom.xml @@ -0,0 +1,115 @@ + + + 4.0.0 + + com.bwie + etl-data-source + 1.0-SNAPSHOT + + el-data-source-server + el-data-source-server + + 1.8 + UTF-8 + UTF-8 + 2.6.13 + + + + com.bwie + el-data-source-common + 1.0-SNAPSHOT + + + org.springframework.cloud + spring-cloud-starter-bootstrap + 3.1.3 + + + org.springframework.boot + spring-boot-configuration-processor + true + + + org.springframework + spring-jdbc + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + redis.clients + jedis + 3.7.0 + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + org.springframework.boot + spring-boot-starter-web + + + com.mysql + mysql-connector-j + runtime + + + org.springframework.boot + spring-boot-starter + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + UTF-8 + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + com.etl.data.source.server.ElDataSourceServerApplication + true + + + + repackage + + repackage + + + + + + + + diff --git a/etl-data-source/el-data-source-server/src/main/java/com/etl/data/source/server/ElDataSourceServerApplication.java b/etl-data-source/el-data-source-server/src/main/java/com/etl/data/source/server/ElDataSourceServerApplication.java new file mode 100644 index 0000000..8d13b2f --- /dev/null +++ b/etl-data-source/el-data-source-server/src/main/java/com/etl/data/source/server/ElDataSourceServerApplication.java @@ -0,0 +1,19 @@ +package com.etl.data.source.server; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class ElDataSourceServerApplication { + + public static void main(String[] args) { + SpringApplication.run(ElDataSourceServerApplication.class, args); + System.out.println(" __ __ _ _ _ _"); + System.out.println(" ___ _ __ ___/ _|__ / /_ | | | | | | ___| |__"); + System.out.println(" / _ \\ '__/ _ \\ _/ _ \\ | '_ \\ | |_| | | |/ _ \\ '_ \\"); + System.out.println("| (_) | | | __/ | || __/| |_) || _ | | | __/ | | |"); + System.out.println(" \\___/|_| \\___|_| \\___| |_.__/ |_| |_| |_| \\___|_| |_|"); + System.out.println(" 数据源业务启动成功!"); + } + +} diff --git a/etl-data-source/el-data-source-server/src/main/java/com/etl/data/source/server/GlobalExceptionHandler.java b/etl-data-source/el-data-source-server/src/main/java/com/etl/data/source/server/GlobalExceptionHandler.java new file mode 100644 index 0000000..00e5e69 --- /dev/null +++ b/etl-data-source/el-data-source-server/src/main/java/com/etl/data/source/server/GlobalExceptionHandler.java @@ -0,0 +1,42 @@ +package com.etl.data.source.server; + +import com.etl.common.result.Result; +import lombok.extern.log4j.Log4j2; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.FieldError; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; + +import java.util.List; +import java.util.stream.Collectors; + +@ControllerAdvice +@Log4j2 +public class GlobalExceptionHandler { + + @ExceptionHandler(MethodArgumentNotValidException.class) + public ResponseEntity> handleValidationExceptions(MethodArgumentNotValidException ex) { + List fieldErrors = ex.getBindingResult().getFieldErrors(); + + String errorMessage = fieldErrors.stream() + .map(FieldError::getDefaultMessage) + .collect(Collectors.joining(", ")); + + log.error(errorMessage); + + // 使用Result封装错误信息 + Result result = Result.error(errorMessage); + return new ResponseEntity<>(result, HttpStatus.BAD_REQUEST); + } + + @ExceptionHandler(Exception.class) + public ResponseEntity> handleException(Exception ex) { + log.error("General exception", ex); // 最好打印堆栈信息以便排查问题 + + // 使用Result封装错误信息 + Result result = Result.error(ex.getMessage()); + return new ResponseEntity<>(result, HttpStatus.INTERNAL_SERVER_ERROR); + } +} diff --git a/etl-data-source/el-data-source-server/src/main/java/com/etl/data/source/server/config/Swagger.java b/etl-data-source/el-data-source-server/src/main/java/com/etl/data/source/server/config/Swagger.java new file mode 100644 index 0000000..708f9a6 --- /dev/null +++ b/etl-data-source/el-data-source-server/src/main/java/com/etl/data/source/server/config/Swagger.java @@ -0,0 +1,101 @@ +package com.etl.data.source.server.config; + +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.config.BeanPostProcessor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.util.ReflectionUtils; +import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider; +import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; + +import java.lang.reflect.Field; +import java.util.List; +import java.util.stream.Collectors; + +@Configuration +@EnableSwagger2WebMvc +@Slf4j +public class Swagger { + + @Bean(value = "defaultApi") + public Docket defaultApi() { + Docket docket = new Docket(DocumentationType.SWAGGER_2) + .apiInfo(apiInfo()) + //分组名称 + .groupName("2.X版本") + .select() + //这里指定Controller扫描包路径 +// .apis(RequestHandlerSelectors.basePackage("com.github.xiaoymin.knife4j.controller")) + //这里指定扫描有ApiOperation注解的类 + .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) + //所有路径 + .paths(PathSelectors.any()) + //不包含^/inner/.*的路径 + //.paths(input -> !input.matches("^/inner/.*")) + .build(); + return docket; + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("七组RESTful APIs") + .description("构建RESTful APIs") + .termsOfServiceUrl("https://blog.csdn.net/weixin_43453386") + .contact(new Contact("刘泽璋", + "https://blog.csdn.net/weixin_43453386", + "xxx@163.com")) + .version("1.0") + .build(); + } + /** + * 解决SpringBoot和Swagger2冲突 + * + * @return + */ + @Bean + public static BeanPostProcessor springfoxHandlerProviderBeanPostProcessor() { + return new BeanPostProcessor() { + + @Override + public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { + if (bean instanceof WebMvcRequestHandlerProvider) { + customizeSpringfoxHandlerMappings(getHandlerMappings(bean)); + } + return bean; + } + + private void customizeSpringfoxHandlerMappings(List mappings) { + List copy = mappings.stream() + .filter(mapping -> mapping.getPatternParser() == null) + .collect(Collectors.toList()); + mappings.clear(); + mappings.addAll(copy); + } + + @SuppressWarnings("unchecked") + private List getHandlerMappings(Object bean) { + try { + Field field = ReflectionUtils.findField(bean.getClass(), "handlerMappings"); + field.setAccessible(true); + return (List) field.get(bean); + } catch (IllegalArgumentException | IllegalAccessException e) { + log.warn("修改WebMvcRequestHandlerProvider的属性:handlerMappings出错,可能导致swagger不可用", e); + throw new IllegalStateException(e); + } + } + }; + } +} + + + diff --git a/etl-data-source/el-data-source-server/src/main/java/com/etl/data/source/server/controller/DatabaseController.java b/etl-data-source/el-data-source-server/src/main/java/com/etl/data/source/server/controller/DatabaseController.java new file mode 100644 index 0000000..4ebc8f6 --- /dev/null +++ b/etl-data-source/el-data-source-server/src/main/java/com/etl/data/source/server/controller/DatabaseController.java @@ -0,0 +1,75 @@ +package com.etl.data.source.server.controller; + +import com.etl.common.result.Result; +import com.etl.data.source.common.pojo.DatabaseConfig; +import com.etl.data.source.common.pojo.DatabaseRedis; +import com.etl.data.source.common.pojo.resq.ColumnInfo; +import com.etl.data.source.server.service.DatabaseService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import redis.clients.jedis.Jedis; + +import javax.validation.Valid; +import java.util.List; + + +// 声明为一个 Spring Boot 控制器 +@RestController +@Api(tags = "数据源") +@Slf4j +public class DatabaseController { + @Autowired + private DatabaseService databaseService; + + @PostMapping("/testDatabaseRedis") + public Result testDatabaseRedis(@Valid @RequestBody DatabaseRedis databaseRedis) { + try (Jedis jedis = new Jedis(databaseRedis.getUrl(), Integer.parseInt(databaseRedis.getPort()))) { + // 测试连接,例如设置一个键并获取它 + String testKey = "testKey"; + String testValue = "testValue"; + jedis.set(testKey, testValue); + String result = jedis.get(testKey); + + // 假设Result是一个泛型类,用于封装响应结果 + return Result.success(result); + } catch (Exception e) { + // 处理异常,例如记录日志或返回错误结果 + log.info("Redis test failed: " + e.getMessage()); + return Result.error("连接失败"); + } + } + // POST请求映射到/test-database-connection路径 + @PostMapping("/testDatabaseMysql") + @ApiOperation(value = "测试数据库连接") + public Result testDatabaseConnection(@Valid @RequestBody DatabaseConfig config) { + String string = databaseService.testDatabaseConnection(config); + if (string.equals("ok")) { + return Result.success("连接成功"); + } else { + return Result.error("连接失败"); + } + } + @PostMapping("/findDatabaseTable") + @ApiOperation(value = "查询数据库表") + public Result> findDatabaseTable(@Valid @RequestBody DatabaseConfig config){ + return Result.success(databaseService.findDatabaseTable(config)); + } + @PostMapping("/findDatabaseTableName") + @ApiOperation("查询指定数据库的所有表名") + public Result> findDatabaseTableName(@Valid @RequestBody DatabaseConfig config){ + return Result.success(databaseService.findDatabaseTables(config)); + } + @PostMapping("/findDatabaseTableField") + @ApiOperation("查询指定数据库的指定表的所有字段") + public Result> findDatabaseTableField(@Valid @RequestBody DatabaseConfig config){ + return Result.success(databaseService.findDatabaseTableField(config)); + } + + +} diff --git a/etl-data-source/el-data-source-server/src/main/java/com/etl/data/source/server/service/DatabaseService.java b/etl-data-source/el-data-source-server/src/main/java/com/etl/data/source/server/service/DatabaseService.java new file mode 100644 index 0000000..f58747f --- /dev/null +++ b/etl-data-source/el-data-source-server/src/main/java/com/etl/data/source/server/service/DatabaseService.java @@ -0,0 +1,22 @@ +package com.etl.data.source.server.service; + +import com.etl.data.source.common.pojo.DatabaseConfig; +import com.etl.data.source.common.pojo.resq.ColumnInfo; + +import java.util.List; + +/** + * @ClassName DatabaseService + * @Description 描述 + * @Author ZeZhang.Liu + * @Date 2024/6/21 20:16 + */ +public interface DatabaseService { + String testDatabaseConnection(DatabaseConfig config); + + List findDatabaseTable(DatabaseConfig config); + + List findDatabaseTables(DatabaseConfig config); + + List findDatabaseTableField(DatabaseConfig config); +} diff --git a/etl-data-source/el-data-source-server/src/main/java/com/etl/data/source/server/service/impl/DatabaseServiceImpl.java b/etl-data-source/el-data-source-server/src/main/java/com/etl/data/source/server/service/impl/DatabaseServiceImpl.java new file mode 100644 index 0000000..c2a3c4f --- /dev/null +++ b/etl-data-source/el-data-source-server/src/main/java/com/etl/data/source/server/service/impl/DatabaseServiceImpl.java @@ -0,0 +1,174 @@ +package com.etl.data.source.server.service.impl; + +import com.etl.common.util.StringUtils; +import com.etl.data.source.common.pojo.DatabaseConfig; +import com.etl.data.source.common.pojo.constants.MysqlConstants; +import com.etl.data.source.common.pojo.resq.ColumnInfo; +import com.etl.data.source.server.service.DatabaseService; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.datasource.DriverManagerDataSource; +import org.springframework.stereotype.Service; + +import javax.sql.DataSource; +import java.sql.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +/** + * @ClassName DatabaseServiceImpl + * @Description 描述 + * @Author ZeZhang.Liu + * @Date 2024/6/21 20:16 + */ +@Service +public class DatabaseServiceImpl implements DatabaseService { + @Override + public String testDatabaseConnection(DatabaseConfig config) { + try { + // 创建数据源 + DataSource dataSource = createDataSource(config); + // 使用JdbcTemplate执行SQL语句 + JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); + jdbcTemplate.execute("SELECT 1"); + // 如果连接成功,返回"ok" + return "ok"; + } catch (Exception e) { + // 如果发生异常,打印异常信息并返回"error" + e.printStackTrace(); + return "error"; + } + } + + @Override + public List findDatabaseTable(DatabaseConfig config) { + List tableNames = new ArrayList<>(); + try (Connection connection = getConnection(config)) { + try (Statement statement = connection.createStatement()) { + // 查询所有数据库名 + try (ResultSet resultSet = statement.executeQuery("SHOW DATABASES;")) { + while (resultSet.next()) { + tableNames.add(resultSet.getString(1)); + } + } + } + } catch (ClassNotFoundException | SQLException e) { + e.printStackTrace(); + } + return tableNames; + } + + @Override + public List findDatabaseTables(DatabaseConfig config) { + if(StringUtils.isNull(config.getWarehouseName())){ + throw new RuntimeException("请选择数据库"); + } + List tableNames = new ArrayList<>(); + try (Connection connection = getConnection(config)) { + try (Statement statement = connection.createStatement()) { + // 查询指定数据库的所有表名 + try (ResultSet resultSet = statement.executeQuery( + "SHOW TABLES FROM " + config.getWarehouseName() + ";")) { + while (resultSet.next()) { + tableNames.add(resultSet.getString(1)); + } + } + } + } catch (ClassNotFoundException | SQLException e) { + e.printStackTrace(); + } + return tableNames; + } + + @Override + public List findDatabaseTableField(DatabaseConfig config) { + if(StringUtils.isNull(config.getWarehouseName())){ + throw new RuntimeException("请选择数据库"); + } + if(StringUtils.isNull(config.getTableName())){ + throw new RuntimeException("请选择表"); + } + List columnInfos = new ArrayList<>(); + Connection connection = null; + PreparedStatement preparedStatement = null; + ResultSet resultSet = null; + + try { + // 加载并注册JDBC驱动 + Class.forName(config.getDriverClassName()); + + // 建立数据库连接 + connection = DriverManager.getConnection(config.getUrl(), config.getUsername(), config.getPassword()); + + // 创建PreparedStatement以避免SQL注入 + String sql = "SELECT " + + "COLUMN_NAME, " + + "DATA_TYPE, " + + "CHARACTER_MAXIMUM_LENGTH, " + + "COLUMN_KEY, " + + "IS_NULLABLE, " + + "COLUMN_COMMENT " + + "FROM INFORMATION_SCHEMA.COLUMNS " + + "WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ?"; + + preparedStatement = connection.prepareStatement(sql); + preparedStatement.setString(1, config.getWarehouseName()); + preparedStatement.setString(2, config.getTableName()); + + // 执行查询 + resultSet = preparedStatement.executeQuery(); + + // 遍历结果集 + while (resultSet.next()) { + ColumnInfo columnInfo = new ColumnInfo(); + columnInfo.setColumnName(resultSet.getString("COLUMN_NAME")); + columnInfo.setDataType(resultSet.getString("DATA_TYPE")); + columnInfo.setCharacterMaximumLength(resultSet.getInt("CHARACTER_MAXIMUM_LENGTH")); // 注意可能为null + columnInfo.setColumnKey(resultSet.getString("COLUMN_KEY")); + columnInfo.setIsNullable(resultSet.getString("IS_NULLABLE")); + columnInfo.setColumnComment(resultSet.getString("COLUMN_COMMENT")); + + columnInfos.add(columnInfo); + } + + } catch (ClassNotFoundException | SQLException e) { + // 处理异常 + e.printStackTrace(); + } finally { + // 关闭资源 + try { + if (resultSet != null) resultSet.close(); + if (preparedStatement != null) preparedStatement.close(); + if (connection != null) connection.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + return columnInfos; + } + + + private static Connection getConnection(DatabaseConfig config) throws ClassNotFoundException, SQLException { + // 加载MySQL驱动 + Class.forName(config.getDriverClassName()); + // 设置数据库连接信息 + String url = config.getUrl(); + Properties properties = new Properties(); + properties.setProperty(MysqlConstants.MYSQL_USER, config.getUsername()); + properties.setProperty(MysqlConstants.MYSQL_PASSWORD, config.getPassword()); + // 获取数据库连接 + return DriverManager.getConnection(url, properties); + } + + private DataSource createDataSource(DatabaseConfig config) { + // 使用DriverManagerDataSource创建数据源 + DriverManagerDataSource dataSource = new DriverManagerDataSource(); + // 设置数据源的驱动类名、URL、用户名和密码 + dataSource.setDriverClassName(config.getDriverClassName()); + dataSource.setUrl(config.getUrl()); + dataSource.setUsername(config.getUsername()); + dataSource.setPassword(config.getPassword()); + return dataSource; + } +} diff --git a/etl-data-source/el-data-source-server/src/main/resources/bootstrap.yml b/etl-data-source/el-data-source-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..86f79de --- /dev/null +++ b/etl-data-source/el-data-source-server/src/main/resources/bootstrap.yml @@ -0,0 +1,27 @@ +# Tomcat +server: + port: 8886 +# Spring +spring: + application: + # 应用名称 + name: etl-data-source-service + profiles: + # 环境配置 + active: dev + main: + # 允许使用循环引用 + allow-circular-references: true + # 允许定义相同的bean对象 去覆盖原有的 + allow-bean-definition-overriding: true + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 182.254.221.163:8848 + config: + # 配置中心地址 + server-addr: 182.254.221.163:8848 + # 配置文件格式 + file-extension: yml + diff --git a/etl-data-source/el-data-source-server/src/test/java/com/etl/data/source/server/ElDataSourceServerApplicationTests.java b/etl-data-source/el-data-source-server/src/test/java/com/etl/data/source/server/ElDataSourceServerApplicationTests.java new file mode 100644 index 0000000..00fb8a7 --- /dev/null +++ b/etl-data-source/el-data-source-server/src/test/java/com/etl/data/source/server/ElDataSourceServerApplicationTests.java @@ -0,0 +1,39 @@ +package com.etl.data.source.server; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; +import java.sql.*; +import java.util.*; + +@SpringBootTest +class ElDataSourceServerApplicationTests { + @Test + void contextLoads() { +// List list = Arrays.asList("a", "b", "c"); +// list.forEach(item -> System.out.println("Lambda方式遍历元素: "+item)); + //创建一个未排序的列表 + List list = Arrays.asList("b", "a", "c","aa"); + //使用传统方式进行排序 +// Collections.sort(list, new Comparator() { +// @Override +// public int compare(String o1, String o2) { +// return o1.compareTo(o2); +// } +// }); +// +// System.out.println("传统方式排序结果:"+list); +// list.sort((s1,s2) -> s1.compareTo(s2)); +// System.out.println("Lambda方式排序结果:"+list); + //创建一个新的列表来存储过滤后的结果 +// ArrayList filteredLis = new ArrayList<>(); +// //使用传统方式过滤 +// for (String item : list) { +// if(item.startsWith("a")){ +// filteredLis.add(item); +// } +// } +// //打印过滤后的列表 +// System.out.println("传统过滤结果:"+filteredLis); + } + +} diff --git a/etl-data-source/el-data-source-server/target/classes/bootstrap.yml b/etl-data-source/el-data-source-server/target/classes/bootstrap.yml new file mode 100644 index 0000000..86f79de --- /dev/null +++ b/etl-data-source/el-data-source-server/target/classes/bootstrap.yml @@ -0,0 +1,27 @@ +# Tomcat +server: + port: 8886 +# Spring +spring: + application: + # 应用名称 + name: etl-data-source-service + profiles: + # 环境配置 + active: dev + main: + # 允许使用循环引用 + allow-circular-references: true + # 允许定义相同的bean对象 去覆盖原有的 + allow-bean-definition-overriding: true + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 182.254.221.163:8848 + config: + # 配置中心地址 + server-addr: 182.254.221.163:8848 + # 配置文件格式 + file-extension: yml + diff --git a/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/ElDataSourceServerApplication.class b/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/ElDataSourceServerApplication.class new file mode 100644 index 0000000..d16812d Binary files /dev/null and b/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/ElDataSourceServerApplication.class differ diff --git a/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/GlobalExceptionHandler.class b/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/GlobalExceptionHandler.class new file mode 100644 index 0000000..0d421a7 Binary files /dev/null and b/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/GlobalExceptionHandler.class differ diff --git a/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/config/Swagger$1.class b/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/config/Swagger$1.class new file mode 100644 index 0000000..95db43b Binary files /dev/null and b/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/config/Swagger$1.class differ diff --git a/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/config/Swagger.class b/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/config/Swagger.class new file mode 100644 index 0000000..a18a893 Binary files /dev/null and b/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/config/Swagger.class differ diff --git a/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/controller/DatabaseController.class b/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/controller/DatabaseController.class new file mode 100644 index 0000000..2004636 Binary files /dev/null and b/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/controller/DatabaseController.class differ diff --git a/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/service/DatabaseService.class b/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/service/DatabaseService.class new file mode 100644 index 0000000..837743a Binary files /dev/null and b/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/service/DatabaseService.class differ diff --git a/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/service/impl/DatabaseServiceImpl.class b/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/service/impl/DatabaseServiceImpl.class new file mode 100644 index 0000000..eb22ae2 Binary files /dev/null and b/etl-data-source/el-data-source-server/target/classes/com/etl/data/source/server/service/impl/DatabaseServiceImpl.class differ diff --git a/etl-data-source/el-data-source-server/target/el-data-source-server-1.0-SNAPSHOT.jar b/etl-data-source/el-data-source-server/target/el-data-source-server-1.0-SNAPSHOT.jar new file mode 100644 index 0000000..04077e8 Binary files /dev/null and b/etl-data-source/el-data-source-server/target/el-data-source-server-1.0-SNAPSHOT.jar differ diff --git a/etl-data-source/el-data-source-server/target/maven-archiver/pom.properties b/etl-data-source/el-data-source-server/target/maven-archiver/pom.properties new file mode 100644 index 0000000..935ab4d --- /dev/null +++ b/etl-data-source/el-data-source-server/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Jun 21 15:04:44 CST 2024 +groupId=com.bwie +artifactId=el-data-source-server +version=1.0-SNAPSHOT diff --git a/etl-data-source/el-data-source-server/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/etl-data-source/el-data-source-server/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..8fc62ec --- /dev/null +++ b/etl-data-source/el-data-source-server/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1 @@ +com\etl\data\source\server\ElDataSourceServerApplication.class diff --git a/etl-data-source/el-data-source-server/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/etl-data-source/el-data-source-server/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..050180e --- /dev/null +++ b/etl-data-source/el-data-source-server/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1 @@ +D:\workspace\etl-cloud\etl-data-source\el-data-source-server\src\main\java\com\etl\data\source\server\ElDataSourceServerApplication.java diff --git a/etl-data-source/el-data-source-server/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/etl-data-source/el-data-source-server/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst new file mode 100644 index 0000000..f7ea04e --- /dev/null +++ b/etl-data-source/el-data-source-server/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst @@ -0,0 +1 @@ +com\etl\data\source\server\ElDataSourceServerApplicationTests.class diff --git a/etl-data-source/el-data-source-server/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/etl-data-source/el-data-source-server/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..688572d --- /dev/null +++ b/etl-data-source/el-data-source-server/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst @@ -0,0 +1 @@ +D:\workspace\etl-cloud\etl-data-source\el-data-source-server\src\test\java\com\etl\data\source\server\ElDataSourceServerApplicationTests.java diff --git a/etl-data-source/el-data-source-server/target/test-classes/com/etl/data/source/server/ElDataSourceServerApplicationTests.class b/etl-data-source/el-data-source-server/target/test-classes/com/etl/data/source/server/ElDataSourceServerApplicationTests.class new file mode 100644 index 0000000..1729aef Binary files /dev/null and b/etl-data-source/el-data-source-server/target/test-classes/com/etl/data/source/server/ElDataSourceServerApplicationTests.class differ diff --git a/etl-data-source/pom.xml b/etl-data-source/pom.xml new file mode 100644 index 0000000..1fa721f --- /dev/null +++ b/etl-data-source/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + com.bwie + etl-cloud + 1.0-SNAPSHOT + + etl-data-source + etl-data-source + pom + + el-data-source-server + el-data-source-common + + diff --git a/etl-gateway/pom.xml b/etl-gateway/pom.xml index d0fa0ed..5c9f651 100644 --- a/etl-gateway/pom.xml +++ b/etl-gateway/pom.xml @@ -62,11 +62,6 @@ spring-cloud-starter-gateway 3.1.3 - - org.springframework.boot - spring-boot-starter-test - test - diff --git a/etl-gateway/src/main/resources/bootstrap.yml b/etl-gateway/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..6aa11fb --- /dev/null +++ b/etl-gateway/src/main/resources/bootstrap.yml @@ -0,0 +1,31 @@ +# Tomcat +server: + port: 18080 +# Spring +spring: + application: + # 应用名称 + name: etl-gateway + profiles: + # 环境配置 + active: dev + main: + # 允许使用循环引用 + allow-circular-references: true + # 允许定义相同的bean对象 去覆盖原有的 + allow-bean-definition-overriding: true + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 182.254.221.163:8848 + namespace: 10a15e4b-3457-44dc-9378-cc25849f1872 + config: + # 配置中心地址 + server-addr: 182.254.221.163:8848 + namespace: 10a15e4b-3457-44dc-9378-cc25849f1872 + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} diff --git a/pom.xml b/pom.xml index ce08678..d383cbe 100644 --- a/pom.xml +++ b/pom.xml @@ -11,6 +11,7 @@ etl-common etl-gateway + etl-data-source