Commit 2c0d4073b670f38cef348adc70698e678c267f92
Committed by
Gitee
!1458 spring ai from 1.0.1 to 1.1.0
Merge pull request !1458 from 芋道源码/feature/ai
Showing
11 changed files
with
179 additions
and
66 deletions
sql/postgresql/ruoyi-vue-pro.sql
| ... | ... | @@ -33,7 +33,7 @@ INSERT INTO dual VALUES (1); |
| 33 | 33 | DROP TABLE IF EXISTS infra_api_access_log; |
| 34 | 34 | CREATE TABLE infra_api_access_log |
| 35 | 35 | ( |
| 36 | - id int8 NOT NULL, | |
| 36 | + id int8 NOT NULL DEFAULT NEXTVAL('infra_api_access_log_seq'), | |
| 37 | 37 | trace_id varchar(64) NOT NULL DEFAULT '', |
| 38 | 38 | user_id int8 NOT NULL DEFAULT 0, |
| 39 | 39 | user_type int2 NOT NULL DEFAULT 0, |
| ... | ... | @@ -102,7 +102,7 @@ CREATE SEQUENCE infra_api_access_log_seq |
| 102 | 102 | DROP TABLE IF EXISTS infra_api_error_log; |
| 103 | 103 | CREATE TABLE infra_api_error_log |
| 104 | 104 | ( |
| 105 | - id int8 NOT NULL, | |
| 105 | + id int8 NOT NULL DEFAULT NEXTVAL('infra_api_error_log_seq'), | |
| 106 | 106 | trace_id varchar(64) NOT NULL, |
| 107 | 107 | user_id int8 NOT NULL DEFAULT 0, |
| 108 | 108 | user_type int2 NOT NULL DEFAULT 0, |
| ... | ... | @@ -175,7 +175,7 @@ CREATE SEQUENCE infra_api_error_log_seq |
| 175 | 175 | DROP TABLE IF EXISTS infra_codegen_column; |
| 176 | 176 | CREATE TABLE infra_codegen_column |
| 177 | 177 | ( |
| 178 | - id int8 NOT NULL, | |
| 178 | + id int8 NOT NULL default nextval('infra_codegen_column_seq'), | |
| 179 | 179 | table_id int8 NOT NULL, |
| 180 | 180 | column_name varchar(200) NOT NULL, |
| 181 | 181 | data_type varchar(100) NOT NULL, |
| ... | ... | @@ -238,7 +238,7 @@ CREATE SEQUENCE infra_codegen_column_seq |
| 238 | 238 | DROP TABLE IF EXISTS infra_codegen_table; |
| 239 | 239 | CREATE TABLE infra_codegen_table |
| 240 | 240 | ( |
| 241 | - id int8 NOT NULL, | |
| 241 | + id int8 NOT NULL default nextval('infra_codegen_table_seq'), | |
| 242 | 242 | data_source_config_id int8 NOT NULL, |
| 243 | 243 | scene int2 NOT NULL DEFAULT 1, |
| 244 | 244 | table_name varchar(200) NOT NULL DEFAULT '', |
| ... | ... | @@ -303,7 +303,7 @@ CREATE SEQUENCE infra_codegen_table_seq |
| 303 | 303 | DROP TABLE IF EXISTS infra_config; |
| 304 | 304 | CREATE TABLE infra_config |
| 305 | 305 | ( |
| 306 | - id int8 NOT NULL, | |
| 306 | + id int8 NOT NULL default nextval('infra_config_seq'), | |
| 307 | 307 | category varchar(50) NOT NULL, |
| 308 | 308 | type int2 NOT NULL, |
| 309 | 309 | name varchar(100) NOT NULL DEFAULT '', |
| ... | ... | @@ -362,7 +362,7 @@ CREATE SEQUENCE infra_config_seq |
| 362 | 362 | DROP TABLE IF EXISTS infra_data_source_config; |
| 363 | 363 | CREATE TABLE infra_data_source_config |
| 364 | 364 | ( |
| 365 | - id int8 NOT NULL, | |
| 365 | + id int8 NOT NULL default nextval('infra_data_source_config_seq'), | |
| 366 | 366 | name varchar(100) NOT NULL DEFAULT '', |
| 367 | 367 | url varchar(1024) NOT NULL, |
| 368 | 368 | username varchar(255) NOT NULL, |
| ... | ... | @@ -399,7 +399,7 @@ CREATE SEQUENCE infra_data_source_config_seq |
| 399 | 399 | DROP TABLE IF EXISTS infra_file; |
| 400 | 400 | CREATE TABLE infra_file |
| 401 | 401 | ( |
| 402 | - id int8 NOT NULL, | |
| 402 | + id int8 NOT NULL default nextval('infra_file_seq'), | |
| 403 | 403 | config_id int8 NULL DEFAULT NULL, |
| 404 | 404 | name varchar(256) NULL DEFAULT NULL, |
| 405 | 405 | path varchar(512) NOT NULL, |
| ... | ... | @@ -440,7 +440,7 @@ CREATE SEQUENCE infra_file_seq |
| 440 | 440 | DROP TABLE IF EXISTS infra_file_config; |
| 441 | 441 | CREATE TABLE infra_file_config |
| 442 | 442 | ( |
| 443 | - id int8 NOT NULL, | |
| 443 | + id int8 NOT NULL default nextval('infra_file_config_seq'), | |
| 444 | 444 | name varchar(63) NOT NULL, |
| 445 | 445 | storage int2 NOT NULL, |
| 446 | 446 | remark varchar(255) NULL DEFAULT NULL, |
| ... | ... | @@ -496,7 +496,7 @@ CREATE SEQUENCE infra_file_config_seq |
| 496 | 496 | DROP TABLE IF EXISTS infra_file_content; |
| 497 | 497 | CREATE TABLE infra_file_content |
| 498 | 498 | ( |
| 499 | - id int8 NOT NULL, | |
| 499 | + id int8 NOT NULL default nextval('infra_file_content_seq'), | |
| 500 | 500 | config_id int8 NOT NULL, |
| 501 | 501 | path varchar(512) NOT NULL, |
| 502 | 502 | content bytea NOT NULL, |
| ... | ... | @@ -531,7 +531,7 @@ CREATE SEQUENCE infra_file_content_seq |
| 531 | 531 | DROP TABLE IF EXISTS infra_job; |
| 532 | 532 | CREATE TABLE infra_job |
| 533 | 533 | ( |
| 534 | - id int8 NOT NULL, | |
| 534 | + id int8 NOT NULL default nextval('infra_job_seq'), | |
| 535 | 535 | name varchar(32) NOT NULL, |
| 536 | 536 | status int2 NOT NULL, |
| 537 | 537 | handler_name varchar(64) NOT NULL, |
| ... | ... | @@ -597,7 +597,7 @@ CREATE SEQUENCE infra_job_seq |
| 597 | 597 | DROP TABLE IF EXISTS infra_job_log; |
| 598 | 598 | CREATE TABLE infra_job_log |
| 599 | 599 | ( |
| 600 | - id int8 NOT NULL, | |
| 600 | + id int8 NOT NULL default nextval('infra_job_log_seq'), | |
| 601 | 601 | job_id int8 NOT NULL, |
| 602 | 602 | handler_name varchar(64) NOT NULL, |
| 603 | 603 | handler_param varchar(255) NULL DEFAULT NULL, |
| ... | ... | @@ -644,7 +644,7 @@ CREATE SEQUENCE infra_job_log_seq |
| 644 | 644 | DROP TABLE IF EXISTS system_dept; |
| 645 | 645 | CREATE TABLE system_dept |
| 646 | 646 | ( |
| 647 | - id int8 NOT NULL, | |
| 647 | + id int8 NOT NULL default nextval('system_dept_seq'), | |
| 648 | 648 | name varchar(30) NOT NULL DEFAULT '', |
| 649 | 649 | parent_id int8 NOT NULL DEFAULT 0, |
| 650 | 650 | sort int4 NOT NULL DEFAULT 0, |
| ... | ... | @@ -711,7 +711,7 @@ CREATE SEQUENCE system_dept_seq |
| 711 | 711 | DROP TABLE IF EXISTS system_dict_data; |
| 712 | 712 | CREATE TABLE system_dict_data |
| 713 | 713 | ( |
| 714 | - id int8 NOT NULL, | |
| 714 | + id int8 NOT NULL default nextval('system_dict_data_seq'), | |
| 715 | 715 | sort int4 NOT NULL DEFAULT 0, |
| 716 | 716 | label varchar(100) NOT NULL DEFAULT '', |
| 717 | 717 | value varchar(100) NOT NULL DEFAULT '', |
| ... | ... | @@ -1367,7 +1367,7 @@ CREATE SEQUENCE system_dict_data_seq |
| 1367 | 1367 | DROP TABLE IF EXISTS system_dict_type; |
| 1368 | 1368 | CREATE TABLE system_dict_type |
| 1369 | 1369 | ( |
| 1370 | - id int8 NOT NULL, | |
| 1370 | + id int8 NOT NULL default nextval('system_dict_type_seq'), | |
| 1371 | 1371 | name varchar(100) NOT NULL DEFAULT '', |
| 1372 | 1372 | type varchar(100) NOT NULL DEFAULT '', |
| 1373 | 1373 | status int2 NOT NULL DEFAULT 0, |
| ... | ... | @@ -1521,7 +1521,7 @@ CREATE SEQUENCE system_dict_type_seq |
| 1521 | 1521 | DROP TABLE IF EXISTS system_login_log; |
| 1522 | 1522 | CREATE TABLE system_login_log |
| 1523 | 1523 | ( |
| 1524 | - id int8 NOT NULL, | |
| 1524 | + id int8 NOT NULL default nextval('system_login_log_seq'), | |
| 1525 | 1525 | log_type int8 NOT NULL, |
| 1526 | 1526 | trace_id varchar(64) NOT NULL DEFAULT '', |
| 1527 | 1527 | user_id int8 NOT NULL DEFAULT 0, |
| ... | ... | @@ -1568,7 +1568,7 @@ CREATE SEQUENCE system_login_log_seq |
| 1568 | 1568 | DROP TABLE IF EXISTS system_mail_account; |
| 1569 | 1569 | CREATE TABLE system_mail_account |
| 1570 | 1570 | ( |
| 1571 | - id int8 NOT NULL, | |
| 1571 | + id int8 NOT NULL default nextval('system_mail_account_seq'), | |
| 1572 | 1572 | mail varchar(255) NOT NULL, |
| 1573 | 1573 | username varchar(255) NOT NULL, |
| 1574 | 1574 | password varchar(255) NOT NULL, |
| ... | ... | @@ -1623,7 +1623,7 @@ CREATE SEQUENCE system_mail_account_seq |
| 1623 | 1623 | DROP TABLE IF EXISTS system_mail_log; |
| 1624 | 1624 | CREATE TABLE system_mail_log |
| 1625 | 1625 | ( |
| 1626 | - id int8 NOT NULL, | |
| 1626 | + id int8 NOT NULL default nextval('system_mail_log_seq'), | |
| 1627 | 1627 | user_id int8 NULL DEFAULT NULL, |
| 1628 | 1628 | user_type int2 NULL DEFAULT NULL, |
| 1629 | 1629 | to_mail varchar(255) NOT NULL, |
| ... | ... | @@ -1682,7 +1682,7 @@ CREATE SEQUENCE system_mail_log_seq |
| 1682 | 1682 | DROP TABLE IF EXISTS system_mail_template; |
| 1683 | 1683 | CREATE TABLE system_mail_template |
| 1684 | 1684 | ( |
| 1685 | - id int8 NOT NULL, | |
| 1685 | + id int8 NOT NULL default nextval('system_mail_template_seq'), | |
| 1686 | 1686 | name varchar(63) NOT NULL, |
| 1687 | 1687 | code varchar(63) NOT NULL, |
| 1688 | 1688 | account_id int8 NOT NULL, |
| ... | ... | @@ -1740,7 +1740,7 @@ CREATE SEQUENCE system_mail_template_seq |
| 1740 | 1740 | DROP TABLE IF EXISTS system_menu; |
| 1741 | 1741 | CREATE TABLE system_menu |
| 1742 | 1742 | ( |
| 1743 | - id int8 NOT NULL, | |
| 1743 | + id int8 NOT NULL default nextval('system_menu_seq'), | |
| 1744 | 1744 | name varchar(50) NOT NULL, |
| 1745 | 1745 | permission varchar(100) NOT NULL DEFAULT '', |
| 1746 | 1746 | type int2 NOT NULL, |
| ... | ... | @@ -2714,7 +2714,7 @@ CREATE SEQUENCE system_menu_seq |
| 2714 | 2714 | DROP TABLE IF EXISTS system_notice; |
| 2715 | 2715 | CREATE TABLE system_notice |
| 2716 | 2716 | ( |
| 2717 | - id int8 NOT NULL, | |
| 2717 | + id int8 NOT NULL default nextval('system_notice_seq'), | |
| 2718 | 2718 | title varchar(50) NOT NULL, |
| 2719 | 2719 | content text NOT NULL, |
| 2720 | 2720 | type int2 NOT NULL, |
| ... | ... | @@ -2764,7 +2764,7 @@ CREATE SEQUENCE system_notice_seq |
| 2764 | 2764 | DROP TABLE IF EXISTS system_notify_message; |
| 2765 | 2765 | CREATE TABLE system_notify_message |
| 2766 | 2766 | ( |
| 2767 | - id int8 NOT NULL, | |
| 2767 | + id int8 NOT NULL default nextval('system_notify_message_seq'), | |
| 2768 | 2768 | user_id int8 NOT NULL, |
| 2769 | 2769 | user_type int2 NOT NULL, |
| 2770 | 2770 | template_id int8 NOT NULL, |
| ... | ... | @@ -2832,7 +2832,7 @@ CREATE SEQUENCE system_notify_message_seq |
| 2832 | 2832 | DROP TABLE IF EXISTS system_notify_template; |
| 2833 | 2833 | CREATE TABLE system_notify_template |
| 2834 | 2834 | ( |
| 2835 | - id int8 NOT NULL, | |
| 2835 | + id int8 NOT NULL default nextval('system_notify_template_seq'), | |
| 2836 | 2836 | name varchar(63) NOT NULL, |
| 2837 | 2837 | code varchar(64) NOT NULL, |
| 2838 | 2838 | nickname varchar(255) NOT NULL, |
| ... | ... | @@ -2877,7 +2877,7 @@ CREATE SEQUENCE system_notify_template_seq |
| 2877 | 2877 | DROP TABLE IF EXISTS system_oauth2_access_token; |
| 2878 | 2878 | CREATE TABLE system_oauth2_access_token |
| 2879 | 2879 | ( |
| 2880 | - id int8 NOT NULL, | |
| 2880 | + id int8 NOT NULL default nextval('system_oauth2_access_token_seq'), | |
| 2881 | 2881 | user_id int8 NOT NULL, |
| 2882 | 2882 | user_type int2 NOT NULL, |
| 2883 | 2883 | user_info varchar(512) NOT NULL, |
| ... | ... | @@ -2927,7 +2927,7 @@ CREATE SEQUENCE system_oauth2_access_token_seq |
| 2927 | 2927 | DROP TABLE IF EXISTS system_oauth2_approve; |
| 2928 | 2928 | CREATE TABLE system_oauth2_approve |
| 2929 | 2929 | ( |
| 2930 | - id int8 NOT NULL, | |
| 2930 | + id int8 NOT NULL default nextval('system_oauth2_approve_seq'), | |
| 2931 | 2931 | user_id int8 NOT NULL, |
| 2932 | 2932 | user_type int2 NOT NULL, |
| 2933 | 2933 | client_id varchar(255) NOT NULL, |
| ... | ... | @@ -2970,7 +2970,7 @@ CREATE SEQUENCE system_oauth2_approve_seq |
| 2970 | 2970 | DROP TABLE IF EXISTS system_oauth2_client; |
| 2971 | 2971 | CREATE TABLE system_oauth2_client |
| 2972 | 2972 | ( |
| 2973 | - id int8 NOT NULL, | |
| 2973 | + id int8 NOT NULL default nextval('system_oauth2_client_seq'), | |
| 2974 | 2974 | client_id varchar(255) NOT NULL, |
| 2975 | 2975 | secret varchar(255) NOT NULL, |
| 2976 | 2976 | name varchar(255) NOT NULL, |
| ... | ... | @@ -3041,7 +3041,7 @@ CREATE SEQUENCE system_oauth2_client_seq |
| 3041 | 3041 | DROP TABLE IF EXISTS system_oauth2_code; |
| 3042 | 3042 | CREATE TABLE system_oauth2_code |
| 3043 | 3043 | ( |
| 3044 | - id int8 NOT NULL, | |
| 3044 | + id int8 NOT NULL default nextval('system_oauth2_code_seq'), | |
| 3045 | 3045 | user_id int8 NOT NULL, |
| 3046 | 3046 | user_type int2 NOT NULL, |
| 3047 | 3047 | code varchar(32) NOT NULL, |
| ... | ... | @@ -3088,7 +3088,7 @@ CREATE SEQUENCE system_oauth2_code_seq |
| 3088 | 3088 | DROP TABLE IF EXISTS system_oauth2_refresh_token; |
| 3089 | 3089 | CREATE TABLE system_oauth2_refresh_token |
| 3090 | 3090 | ( |
| 3091 | - id int8 NOT NULL, | |
| 3091 | + id int8 NOT NULL default nextval('system_oauth2_refresh_token_seq'), | |
| 3092 | 3092 | user_id int8 NOT NULL, |
| 3093 | 3093 | refresh_token varchar(32) NOT NULL, |
| 3094 | 3094 | user_type int2 NOT NULL, |
| ... | ... | @@ -3131,7 +3131,7 @@ CREATE SEQUENCE system_oauth2_refresh_token_seq |
| 3131 | 3131 | DROP TABLE IF EXISTS system_operate_log; |
| 3132 | 3132 | CREATE TABLE system_operate_log |
| 3133 | 3133 | ( |
| 3134 | - id int8 NOT NULL, | |
| 3134 | + id int8 NOT NULL default nextval('system_operate_log_seq'), | |
| 3135 | 3135 | trace_id varchar(64) NOT NULL DEFAULT '', |
| 3136 | 3136 | user_id int8 NOT NULL, |
| 3137 | 3137 | user_type int2 NOT NULL DEFAULT 0, |
| ... | ... | @@ -3188,7 +3188,7 @@ CREATE SEQUENCE system_operate_log_seq |
| 3188 | 3188 | DROP TABLE IF EXISTS system_post; |
| 3189 | 3189 | CREATE TABLE system_post |
| 3190 | 3190 | ( |
| 3191 | - id int8 NOT NULL, | |
| 3191 | + id int8 NOT NULL default nextval('system_post_seq'), | |
| 3192 | 3192 | code varchar(64) NOT NULL, |
| 3193 | 3193 | name varchar(50) NOT NULL, |
| 3194 | 3194 | sort int4 NOT NULL, |
| ... | ... | @@ -3241,7 +3241,7 @@ CREATE SEQUENCE system_post_seq |
| 3241 | 3241 | DROP TABLE IF EXISTS system_role; |
| 3242 | 3242 | CREATE TABLE system_role |
| 3243 | 3243 | ( |
| 3244 | - id int8 NOT NULL, | |
| 3244 | + id int8 NOT NULL default nextval('system_role_seq'), | |
| 3245 | 3245 | name varchar(30) NOT NULL, |
| 3246 | 3246 | code varchar(100) NOT NULL, |
| 3247 | 3247 | sort int4 NOT NULL, |
| ... | ... | @@ -3304,7 +3304,7 @@ CREATE SEQUENCE system_role_seq |
| 3304 | 3304 | DROP TABLE IF EXISTS system_role_menu; |
| 3305 | 3305 | CREATE TABLE system_role_menu |
| 3306 | 3306 | ( |
| 3307 | - id int8 NOT NULL, | |
| 3307 | + id int8 NOT NULL default nextval('system_role_menu_seq'), | |
| 3308 | 3308 | role_id int8 NOT NULL, |
| 3309 | 3309 | menu_id int8 NOT NULL, |
| 3310 | 3310 | creator varchar(64) NULL DEFAULT '', |
| ... | ... | @@ -4210,7 +4210,7 @@ CREATE SEQUENCE system_role_menu_seq |
| 4210 | 4210 | DROP TABLE IF EXISTS system_sms_channel; |
| 4211 | 4211 | CREATE TABLE system_sms_channel |
| 4212 | 4212 | ( |
| 4213 | - id int8 NOT NULL, | |
| 4213 | + id int8 NOT NULL default nextval('system_sms_channel_seq'), | |
| 4214 | 4214 | signature varchar(12) NOT NULL, |
| 4215 | 4215 | code varchar(63) NOT NULL, |
| 4216 | 4216 | status int2 NOT NULL, |
| ... | ... | @@ -4264,7 +4264,7 @@ CREATE SEQUENCE system_sms_channel_seq |
| 4264 | 4264 | DROP TABLE IF EXISTS system_sms_code; |
| 4265 | 4265 | CREATE TABLE system_sms_code |
| 4266 | 4266 | ( |
| 4267 | - id int8 NOT NULL, | |
| 4267 | + id int8 NOT NULL default nextval('system_sms_code_seq'), | |
| 4268 | 4268 | mobile varchar(11) NOT NULL, |
| 4269 | 4269 | code varchar(6) NOT NULL, |
| 4270 | 4270 | create_ip varchar(15) NOT NULL, |
| ... | ... | @@ -4313,7 +4313,7 @@ CREATE SEQUENCE system_sms_code_seq |
| 4313 | 4313 | DROP TABLE IF EXISTS system_sms_log; |
| 4314 | 4314 | CREATE TABLE system_sms_log |
| 4315 | 4315 | ( |
| 4316 | - id int8 NOT NULL, | |
| 4316 | + id int8 NOT NULL default nextval('system_sms_log_seq'), | |
| 4317 | 4317 | channel_id int8 NOT NULL, |
| 4318 | 4318 | channel_code varchar(63) NOT NULL, |
| 4319 | 4319 | template_id int8 NOT NULL, |
| ... | ... | @@ -4384,7 +4384,7 @@ CREATE SEQUENCE system_sms_log_seq |
| 4384 | 4384 | DROP TABLE IF EXISTS system_sms_template; |
| 4385 | 4385 | CREATE TABLE system_sms_template |
| 4386 | 4386 | ( |
| 4387 | - id int8 NOT NULL, | |
| 4387 | + id int8 NOT NULL default nextval('system_sms_template_seq'), | |
| 4388 | 4388 | type int2 NOT NULL, |
| 4389 | 4389 | status int2 NOT NULL, |
| 4390 | 4390 | code varchar(63) NOT NULL, |
| ... | ... | @@ -4456,7 +4456,7 @@ CREATE SEQUENCE system_sms_template_seq |
| 4456 | 4456 | DROP TABLE IF EXISTS system_social_client; |
| 4457 | 4457 | CREATE TABLE system_social_client |
| 4458 | 4458 | ( |
| 4459 | - id int8 NOT NULL, | |
| 4459 | + id int8 NOT NULL default nextval('system_social_client_seq'), | |
| 4460 | 4460 | name varchar(255) NOT NULL, |
| 4461 | 4461 | social_type int2 NOT NULL, |
| 4462 | 4462 | user_type int2 NOT NULL, |
| ... | ... | @@ -4514,7 +4514,7 @@ CREATE SEQUENCE system_social_client_seq |
| 4514 | 4514 | DROP TABLE IF EXISTS system_social_user; |
| 4515 | 4515 | CREATE TABLE system_social_user |
| 4516 | 4516 | ( |
| 4517 | - id int8 NOT NULL, | |
| 4517 | + id int8 NOT NULL default nextval('system_social_user_seq'), | |
| 4518 | 4518 | type int2 NOT NULL, |
| 4519 | 4519 | openid varchar(32) NOT NULL, |
| 4520 | 4520 | token varchar(256) NULL DEFAULT NULL, |
| ... | ... | @@ -4563,7 +4563,7 @@ CREATE SEQUENCE system_social_user_seq |
| 4563 | 4563 | DROP TABLE IF EXISTS system_social_user_bind; |
| 4564 | 4564 | CREATE TABLE system_social_user_bind |
| 4565 | 4565 | ( |
| 4566 | - id int8 NOT NULL, | |
| 4566 | + id int8 NOT NULL default nextval('system_social_user_bind_seq'), | |
| 4567 | 4567 | user_id int8 NOT NULL, |
| 4568 | 4568 | user_type int2 NOT NULL, |
| 4569 | 4569 | social_type int2 NOT NULL, |
| ... | ... | @@ -4602,7 +4602,7 @@ CREATE SEQUENCE system_social_user_bind_seq |
| 4602 | 4602 | DROP TABLE IF EXISTS system_tenant; |
| 4603 | 4603 | CREATE TABLE system_tenant |
| 4604 | 4604 | ( |
| 4605 | - id int8 NOT NULL, | |
| 4605 | + id int8 NOT NULL default nextval('system_tenant_seq'), | |
| 4606 | 4606 | name varchar(30) NOT NULL, |
| 4607 | 4607 | contact_user_id int8 NULL DEFAULT NULL, |
| 4608 | 4608 | contact_name varchar(30) NOT NULL, |
| ... | ... | @@ -4660,7 +4660,7 @@ CREATE SEQUENCE system_tenant_seq |
| 4660 | 4660 | DROP TABLE IF EXISTS system_tenant_package; |
| 4661 | 4661 | CREATE TABLE system_tenant_package |
| 4662 | 4662 | ( |
| 4663 | - id int8 NOT NULL, | |
| 4663 | + id int8 NOT NULL default nextval('system_tenant_package_seq'), | |
| 4664 | 4664 | name varchar(30) NOT NULL, |
| 4665 | 4665 | status int2 NOT NULL DEFAULT 0, |
| 4666 | 4666 | remark varchar(256) NULL DEFAULT '', |
| ... | ... | @@ -4707,7 +4707,7 @@ CREATE SEQUENCE system_tenant_package_seq |
| 4707 | 4707 | DROP TABLE IF EXISTS system_user_post; |
| 4708 | 4708 | CREATE TABLE system_user_post |
| 4709 | 4709 | ( |
| 4710 | - id int8 NOT NULL, | |
| 4710 | + id int8 NOT NULL default nextval('system_user_post_seq'), | |
| 4711 | 4711 | user_id int8 NOT NULL DEFAULT 0, |
| 4712 | 4712 | post_id int8 NOT NULL DEFAULT 0, |
| 4713 | 4713 | creator varchar(64) NULL DEFAULT '', |
| ... | ... | @@ -4759,7 +4759,7 @@ CREATE SEQUENCE system_user_post_seq |
| 4759 | 4759 | DROP TABLE IF EXISTS system_user_role; |
| 4760 | 4760 | CREATE TABLE system_user_role |
| 4761 | 4761 | ( |
| 4762 | - id int8 NOT NULL, | |
| 4762 | + id int8 NOT NULL default nextval('system_user_role_seq'), | |
| 4763 | 4763 | user_id int8 NOT NULL, |
| 4764 | 4764 | role_id int8 NOT NULL, |
| 4765 | 4765 | creator varchar(64) NULL DEFAULT '', |
| ... | ... | @@ -4819,7 +4819,7 @@ CREATE SEQUENCE system_user_role_seq |
| 4819 | 4819 | DROP TABLE IF EXISTS system_users; |
| 4820 | 4820 | CREATE TABLE system_users |
| 4821 | 4821 | ( |
| 4822 | - id int8 NOT NULL, | |
| 4822 | + id int8 NOT NULL default nextval('system_users_seq'), | |
| 4823 | 4823 | username varchar(30) NOT NULL, |
| 4824 | 4824 | password varchar(100) NOT NULL DEFAULT '', |
| 4825 | 4825 | nickname varchar(30) NOT NULL, |
| ... | ... | @@ -4902,7 +4902,7 @@ CREATE SEQUENCE system_users_seq |
| 4902 | 4902 | DROP TABLE IF EXISTS yudao_demo01_contact; |
| 4903 | 4903 | CREATE TABLE yudao_demo01_contact |
| 4904 | 4904 | ( |
| 4905 | - id int8 NOT NULL, | |
| 4905 | + id int8 NOT NULL default nextval('yudao_demo01_contact_seq'), | |
| 4906 | 4906 | name varchar(100) NOT NULL DEFAULT '', |
| 4907 | 4907 | sex int2 NOT NULL, |
| 4908 | 4908 | birthday timestamp NOT NULL, |
| ... | ... | @@ -4952,7 +4952,7 @@ CREATE SEQUENCE yudao_demo01_contact_seq |
| 4952 | 4952 | DROP TABLE IF EXISTS yudao_demo02_category; |
| 4953 | 4953 | CREATE TABLE yudao_demo02_category |
| 4954 | 4954 | ( |
| 4955 | - id int8 NOT NULL, | |
| 4955 | + id int8 NOT NULL default nextval('yudao_demo02_category_seq'), | |
| 4956 | 4956 | name varchar(100) NOT NULL DEFAULT '', |
| 4957 | 4957 | parent_id int8 NOT NULL, |
| 4958 | 4958 | creator varchar(64) NULL DEFAULT '', |
| ... | ... | @@ -5001,7 +5001,7 @@ CREATE SEQUENCE yudao_demo02_category_seq |
| 5001 | 5001 | DROP TABLE IF EXISTS yudao_demo03_course; |
| 5002 | 5002 | CREATE TABLE yudao_demo03_course |
| 5003 | 5003 | ( |
| 5004 | - id int8 NOT NULL, | |
| 5004 | + id int8 NOT NULL default nextval('yudao_demo03_course_seq'), | |
| 5005 | 5005 | student_id int8 NOT NULL, |
| 5006 | 5006 | name varchar(100) NOT NULL DEFAULT '', |
| 5007 | 5007 | score int2 NOT NULL, |
| ... | ... | @@ -5063,7 +5063,7 @@ CREATE SEQUENCE yudao_demo03_course_seq |
| 5063 | 5063 | DROP TABLE IF EXISTS yudao_demo03_grade; |
| 5064 | 5064 | CREATE TABLE yudao_demo03_grade |
| 5065 | 5065 | ( |
| 5066 | - id int8 NOT NULL, | |
| 5066 | + id int8 NOT NULL default nextval('yudao_demo03_grade_seq'), | |
| 5067 | 5067 | student_id int8 NOT NULL, |
| 5068 | 5068 | name varchar(100) NOT NULL DEFAULT '', |
| 5069 | 5069 | teacher varchar(255) NOT NULL, |
| ... | ... | @@ -5111,7 +5111,7 @@ CREATE SEQUENCE yudao_demo03_grade_seq |
| 5111 | 5111 | DROP TABLE IF EXISTS yudao_demo03_student; |
| 5112 | 5112 | CREATE TABLE yudao_demo03_student |
| 5113 | 5113 | ( |
| 5114 | - id int8 NOT NULL, | |
| 5114 | + id int8 NOT NULL default nextval('yudao_demo03_student_seq'), | |
| 5115 | 5115 | name varchar(100) NOT NULL DEFAULT '', |
| 5116 | 5116 | sex int2 NOT NULL, |
| 5117 | 5117 | birthday timestamp NOT NULL, | ... | ... |
yudao-module-ai/pom.xml
| ... | ... | @@ -19,9 +19,9 @@ |
| 19 | 19 | 国外:OpenAI、Ollama、Midjourney、StableDiffusion、Suno |
| 20 | 20 | </description> |
| 21 | 21 | <properties> |
| 22 | - <spring-ai.version>1.0.1</spring-ai.version> | |
| 23 | - <alibaba-ai.version>1.0.0.3</alibaba-ai.version> | |
| 24 | - <tinyflow.version>1.0.2</tinyflow.version> | |
| 22 | + <spring-ai.version>1.1.0</spring-ai.version> | |
| 23 | + <alibaba-ai.version>1.0.0.4</alibaba-ai.version> | |
| 24 | + <tinyflow.version>1.2.6</tinyflow.version> | |
| 25 | 25 | </properties> |
| 26 | 26 | |
| 27 | 27 | <dependencies> | ... | ... |
yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/enums/model/AiPlatformEnum.java
| ... | ... | @@ -40,6 +40,7 @@ public enum AiPlatformEnum implements ArrayValuable<String> { |
| 40 | 40 | STABLE_DIFFUSION("StableDiffusion", "StableDiffusion"), // Stability AI |
| 41 | 41 | MIDJOURNEY("Midjourney", "Midjourney"), // Midjourney |
| 42 | 42 | SUNO("Suno", "Suno"), // Suno AI |
| 43 | + GROK("Grok","Grok"), // Grok | |
| 43 | 44 | |
| 44 | 45 | ; |
| 45 | 46 | ... | ... |
yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/framework/ai/config/AiAutoConfiguration.java
| ... | ... | @@ -7,6 +7,7 @@ import cn.iocoder.yudao.module.ai.framework.ai.core.model.AiModelFactoryImpl; |
| 7 | 7 | import cn.iocoder.yudao.module.ai.framework.ai.core.model.baichuan.BaiChuanChatModel; |
| 8 | 8 | import cn.iocoder.yudao.module.ai.framework.ai.core.model.doubao.DouBaoChatModel; |
| 9 | 9 | import cn.iocoder.yudao.module.ai.framework.ai.core.model.gemini.GeminiChatModel; |
| 10 | +import cn.iocoder.yudao.module.ai.framework.ai.core.model.grok.GrokChatModel; | |
| 10 | 11 | import cn.iocoder.yudao.module.ai.framework.ai.core.model.hunyuan.HunYuanChatModel; |
| 11 | 12 | import cn.iocoder.yudao.module.ai.framework.ai.core.model.midjourney.api.MidjourneyApi; |
| 12 | 13 | import cn.iocoder.yudao.module.ai.framework.ai.core.model.siliconflow.SiliconFlowApiConstants; |
| ... | ... | @@ -16,7 +17,9 @@ import cn.iocoder.yudao.module.ai.framework.ai.core.model.xinghuo.XingHuoChatMod |
| 16 | 17 | import cn.iocoder.yudao.module.ai.framework.ai.core.webserch.AiWebSearchClient; |
| 17 | 18 | import cn.iocoder.yudao.module.ai.framework.ai.core.webserch.bocha.AiBoChaWebSearchClient; |
| 18 | 19 | import cn.iocoder.yudao.module.ai.tool.method.PersonService; |
| 20 | +import io.micrometer.observation.ObservationRegistry; | |
| 19 | 21 | import lombok.extern.slf4j.Slf4j; |
| 22 | +import org.springframework.ai.chat.model.ChatModel; | |
| 20 | 23 | import org.springframework.ai.deepseek.DeepSeekChatModel; |
| 21 | 24 | import org.springframework.ai.deepseek.DeepSeekChatOptions; |
| 22 | 25 | import org.springframework.ai.deepseek.api.DeepSeekApi; |
| ... | ... | @@ -34,12 +37,14 @@ import org.springframework.ai.vectorstore.milvus.autoconfigure.MilvusServiceClie |
| 34 | 37 | import org.springframework.ai.vectorstore.milvus.autoconfigure.MilvusVectorStoreProperties; |
| 35 | 38 | import org.springframework.ai.vectorstore.qdrant.autoconfigure.QdrantVectorStoreProperties; |
| 36 | 39 | import org.springframework.ai.vectorstore.redis.autoconfigure.RedisVectorStoreProperties; |
| 40 | +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | |
| 37 | 41 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| 38 | 42 | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| 39 | 43 | import org.springframework.context.annotation.Bean; |
| 40 | 44 | import org.springframework.context.annotation.Configuration; |
| 41 | 45 | |
| 42 | 46 | import java.util.List; |
| 47 | +import java.util.Optional; | |
| 43 | 48 | |
| 44 | 49 | /** |
| 45 | 50 | * 芋道 AI 自动配置 |
| ... | ... | @@ -60,6 +65,13 @@ public class AiAutoConfiguration { |
| 60 | 65 | return new AiModelFactoryImpl(); |
| 61 | 66 | } |
| 62 | 67 | |
| 68 | + @Bean | |
| 69 | + @ConditionalOnMissingBean | |
| 70 | + public ObservationRegistry observationRegistry() { | |
| 71 | + // 特殊:兜底有 ObservationRegistry Bean,避免相关的 ChatModel 创建报错。相关 issue:https://t.zsxq.com/CuPu4 | |
| 72 | + return ObservationRegistry.NOOP; | |
| 73 | + } | |
| 74 | + | |
| 63 | 75 | // ========== 各种 AI Client 创建 ========== |
| 64 | 76 | |
| 65 | 77 | @Bean |
| ... | ... | @@ -252,6 +264,28 @@ public class AiAutoConfiguration { |
| 252 | 264 | return new SunoApi(yudaoAiProperties.getSuno().getBaseUrl()); |
| 253 | 265 | } |
| 254 | 266 | |
| 267 | + public ChatModel buildGrokChatClient(YudaoAiProperties.Grok properties) { | |
| 268 | + if (StrUtil.isEmpty(properties.getModel())) { | |
| 269 | + properties.setModel(GrokChatModel.MODEL_DEFAULT); | |
| 270 | + } | |
| 271 | + OpenAiChatModel openAiChatModel = OpenAiChatModel.builder() | |
| 272 | + .openAiApi(OpenAiApi.builder() | |
| 273 | + .baseUrl(Optional.ofNullable(properties.getBaseUrl()) | |
| 274 | + .orElse(GrokChatModel.BASE_URL)) | |
| 275 | + .completionsPath(GrokChatModel.COMPLETE_PATH) | |
| 276 | + .apiKey(properties.getApiKey()) | |
| 277 | + .build()) | |
| 278 | + .defaultOptions(OpenAiChatOptions.builder() | |
| 279 | + .model(properties.getModel()) | |
| 280 | + .temperature(properties.getTemperature()) | |
| 281 | + .maxTokens(properties.getMaxTokens()) | |
| 282 | + .topP(properties.getTopP()) | |
| 283 | + .build()) | |
| 284 | + .toolCallingManager(getToolCallingManager()) | |
| 285 | + .build(); | |
| 286 | + return new DouBaoChatModel(openAiChatModel); | |
| 287 | + } | |
| 288 | + | |
| 255 | 289 | // ========== RAG 相关 ========== |
| 256 | 290 | |
| 257 | 291 | @Bean | ... | ... |
yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/framework/ai/config/YudaoAiProperties.java
| ... | ... | @@ -161,6 +161,20 @@ public class YudaoAiProperties { |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | @Data |
| 164 | + public static class Grok { | |
| 165 | + | |
| 166 | + private String enable; | |
| 167 | + private String apiKey; | |
| 168 | + private String baseUrl; | |
| 169 | + | |
| 170 | + private String model; | |
| 171 | + private Double temperature; | |
| 172 | + private Integer maxTokens; | |
| 173 | + private Double topP; | |
| 174 | + | |
| 175 | + } | |
| 176 | + | |
| 177 | + @Data | |
| 164 | 178 | public static class WebSearch { |
| 165 | 179 | |
| 166 | 180 | private boolean enable; | ... | ... |
yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/AiModelFactoryImpl.java
| ... | ... | @@ -87,7 +87,7 @@ import org.springframework.ai.model.zhipuai.autoconfigure.ZhiPuAiImageAutoConfig |
| 87 | 87 | import org.springframework.ai.ollama.OllamaChatModel; |
| 88 | 88 | import org.springframework.ai.ollama.OllamaEmbeddingModel; |
| 89 | 89 | import org.springframework.ai.ollama.api.OllamaApi; |
| 90 | -import org.springframework.ai.ollama.api.OllamaOptions; | |
| 90 | +import org.springframework.ai.ollama.api.OllamaEmbeddingOptions; | |
| 91 | 91 | import org.springframework.ai.openai.OpenAiChatModel; |
| 92 | 92 | import org.springframework.ai.openai.OpenAiEmbeddingModel; |
| 93 | 93 | import org.springframework.ai.openai.OpenAiEmbeddingOptions; |
| ... | ... | @@ -178,6 +178,8 @@ public class AiModelFactoryImpl implements AiModelFactory { |
| 178 | 178 | return buildGeminiChatModel(apiKey); |
| 179 | 179 | case OLLAMA: |
| 180 | 180 | return buildOllamaChatModel(url); |
| 181 | + case GROK: | |
| 182 | + return buildGrokChatModel(apiKey,url); | |
| 181 | 183 | default: |
| 182 | 184 | throw new IllegalArgumentException(StrUtil.format("未知平台({})", platform)); |
| 183 | 185 | } |
| ... | ... | @@ -436,10 +438,12 @@ public class AiModelFactoryImpl implements AiModelFactory { |
| 436 | 438 | * 可参考 {@link ZhiPuAiChatAutoConfiguration} 的 zhiPuAiChatModel 方法 |
| 437 | 439 | */ |
| 438 | 440 | private ZhiPuAiChatModel buildZhiPuChatModel(String apiKey, String url) { |
| 439 | - ZhiPuAiApi zhiPuAiApi = StrUtil.isEmpty(url) ? new ZhiPuAiApi(apiKey) | |
| 440 | - : new ZhiPuAiApi(url, apiKey); | |
| 441 | + ZhiPuAiApi.Builder zhiPuAiApiBuilder = ZhiPuAiApi.builder().apiKey(apiKey); | |
| 442 | + if (StrUtil.isNotEmpty(url)) { | |
| 443 | + zhiPuAiApiBuilder.baseUrl(url); | |
| 444 | + } | |
| 441 | 445 | ZhiPuAiChatOptions options = ZhiPuAiChatOptions.builder().model(ZhiPuAiApi.DEFAULT_CHAT_MODEL).temperature(0.7).build(); |
| 442 | - return new ZhiPuAiChatModel(zhiPuAiApi, options, getToolCallingManager(), DEFAULT_RETRY_TEMPLATE, | |
| 446 | + return new ZhiPuAiChatModel(zhiPuAiApiBuilder.build(), options, getToolCallingManager(), DEFAULT_RETRY_TEMPLATE, | |
| 443 | 447 | getObservationRegistry().getIfAvailable()); |
| 444 | 448 | } |
| 445 | 449 | |
| ... | ... | @@ -586,6 +590,13 @@ public class AiModelFactoryImpl implements AiModelFactory { |
| 586 | 590 | return new StabilityAiImageModel(stabilityAiApi); |
| 587 | 591 | } |
| 588 | 592 | |
| 593 | + private ChatModel buildGrokChatModel(String apiKey,String url) { | |
| 594 | + YudaoAiProperties.Grok properties = new YudaoAiProperties.Grok() | |
| 595 | + .setBaseUrl(url) | |
| 596 | + .setApiKey(apiKey); | |
| 597 | + return new AiAutoConfiguration().buildGrokChatClient(properties); | |
| 598 | + } | |
| 599 | + | |
| 589 | 600 | // ========== 各种创建 EmbeddingModel 的方法 ========== |
| 590 | 601 | |
| 591 | 602 | /** |
| ... | ... | @@ -601,10 +612,12 @@ public class AiModelFactoryImpl implements AiModelFactory { |
| 601 | 612 | * 可参考 {@link ZhiPuAiEmbeddingAutoConfiguration} 的 zhiPuAiEmbeddingModel 方法 |
| 602 | 613 | */ |
| 603 | 614 | private ZhiPuAiEmbeddingModel buildZhiPuEmbeddingModel(String apiKey, String url, String model) { |
| 604 | - ZhiPuAiApi zhiPuAiApi = StrUtil.isEmpty(url) ? new ZhiPuAiApi(apiKey) | |
| 605 | - : new ZhiPuAiApi(url, apiKey); | |
| 615 | + ZhiPuAiApi.Builder zhiPuAiApiBuilder = ZhiPuAiApi.builder().apiKey(apiKey); | |
| 616 | + if (StrUtil.isNotEmpty(url)) { | |
| 617 | + zhiPuAiApiBuilder.baseUrl(url); | |
| 618 | + } | |
| 606 | 619 | ZhiPuAiEmbeddingOptions zhiPuAiEmbeddingOptions = ZhiPuAiEmbeddingOptions.builder().model(model).build(); |
| 607 | - return new ZhiPuAiEmbeddingModel(zhiPuAiApi, MetadataMode.EMBED, zhiPuAiEmbeddingOptions); | |
| 620 | + return new ZhiPuAiEmbeddingModel(zhiPuAiApiBuilder.build(), MetadataMode.EMBED, zhiPuAiEmbeddingOptions); | |
| 608 | 621 | } |
| 609 | 622 | |
| 610 | 623 | /** |
| ... | ... | @@ -632,7 +645,7 @@ public class AiModelFactoryImpl implements AiModelFactory { |
| 632 | 645 | |
| 633 | 646 | private OllamaEmbeddingModel buildOllamaEmbeddingModel(String url, String model) { |
| 634 | 647 | OllamaApi ollamaApi = OllamaApi.builder().baseUrl(url).build(); |
| 635 | - OllamaOptions ollamaOptions = OllamaOptions.builder().model(model).build(); | |
| 648 | + OllamaEmbeddingOptions ollamaOptions = OllamaEmbeddingOptions.builder().model(model).build(); | |
| 636 | 649 | return OllamaEmbeddingModel.builder() |
| 637 | 650 | .ollamaApi(ollamaApi) |
| 638 | 651 | .defaultOptions(ollamaOptions) | ... | ... |
yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/framework/ai/core/model/grok/GrokChatModel.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.ai.framework.ai.core.model.grok; | |
| 2 | + | |
| 3 | +import lombok.RequiredArgsConstructor; | |
| 4 | +import lombok.extern.slf4j.Slf4j; | |
| 5 | +import org.springframework.ai.chat.model.ChatModel; | |
| 6 | +import org.springframework.ai.chat.model.ChatResponse; | |
| 7 | +import org.springframework.ai.chat.prompt.ChatOptions; | |
| 8 | +import org.springframework.ai.chat.prompt.Prompt; | |
| 9 | +import reactor.core.publisher.Flux; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * Grok {@link ChatModel} 实现类 | |
| 13 | + * | |
| 14 | + * | |
| 15 | + */ | |
| 16 | +@Slf4j | |
| 17 | +@RequiredArgsConstructor | |
| 18 | +public class GrokChatModel implements ChatModel { | |
| 19 | + | |
| 20 | + public static final String BASE_URL = "https://api.x.ai"; | |
| 21 | + public static final String COMPLETE_PATH = "/v1/chat/completions"; | |
| 22 | + public static final String MODEL_DEFAULT = "grok-4-fast-reasoning"; | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * 兼容 OpenAI 接口,进行复用 | |
| 26 | + */ | |
| 27 | + private final ChatModel openAiChatModel; | |
| 28 | + | |
| 29 | + @Override | |
| 30 | + public ChatResponse call(Prompt prompt) { | |
| 31 | + return openAiChatModel.call(prompt); | |
| 32 | + } | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public Flux<ChatResponse> stream(Prompt prompt) { | |
| 36 | + return openAiChatModel.stream(prompt); | |
| 37 | + } | |
| 38 | + | |
| 39 | + @Override | |
| 40 | + public ChatOptions getDefaultOptions() { | |
| 41 | + return openAiChatModel.getDefaultOptions(); | |
| 42 | + } | |
| 43 | + | |
| 44 | +} | ... | ... |
yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/framework/security/config/SecurityConfiguration.java
| ... | ... | @@ -2,7 +2,8 @@ package cn.iocoder.yudao.module.ai.framework.security.config; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.security.config.AuthorizeRequestsCustomizer; |
| 4 | 4 | import jakarta.annotation.Resource; |
| 5 | -import org.springframework.ai.mcp.server.autoconfigure.McpServerProperties; | |
| 5 | +import org.springframework.ai.mcp.server.common.autoconfigure.properties.McpServerSseProperties; | |
| 6 | +import org.springframework.ai.mcp.server.common.autoconfigure.properties.McpServerStreamableHttpProperties; | |
| 6 | 7 | import org.springframework.context.annotation.Bean; |
| 7 | 8 | import org.springframework.context.annotation.Configuration; |
| 8 | 9 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; |
| ... | ... | @@ -17,7 +18,9 @@ import java.util.Optional; |
| 17 | 18 | public class SecurityConfiguration { |
| 18 | 19 | |
| 19 | 20 | @Resource |
| 20 | - private Optional<McpServerProperties> serverProperties; | |
| 21 | + private Optional<McpServerSseProperties> mcpServerSseProperties; | |
| 22 | + @Resource | |
| 23 | + private Optional<McpServerStreamableHttpProperties> mcpServerStreamableHttpProperties; | |
| 21 | 24 | |
| 22 | 25 | @Bean("aiAuthorizeRequestsCustomizer") |
| 23 | 26 | public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() { |
| ... | ... | @@ -25,11 +28,12 @@ public class SecurityConfiguration { |
| 25 | 28 | |
| 26 | 29 | @Override |
| 27 | 30 | public void customize(AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry registry) { |
| 28 | - // MCP Server | |
| 29 | - serverProperties.ifPresent(properties -> { | |
| 31 | + mcpServerSseProperties.ifPresent(properties -> { | |
| 30 | 32 | registry.requestMatchers(properties.getSseEndpoint()).permitAll(); |
| 31 | 33 | registry.requestMatchers(properties.getSseMessageEndpoint()).permitAll(); |
| 32 | 34 | }); |
| 35 | + mcpServerStreamableHttpProperties.ifPresent(properties -> | |
| 36 | + registry.requestMatchers(properties.getMcpEndpoint()).permitAll()); | |
| 33 | 37 | } |
| 34 | 38 | |
| 35 | 39 | }; | ... | ... |
yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/service/chat/AiChatMessageServiceImpl.java
| ... | ... | @@ -49,7 +49,7 @@ import org.springframework.ai.chat.model.StreamingChatModel; |
| 49 | 49 | import org.springframework.ai.chat.prompt.ChatOptions; |
| 50 | 50 | import org.springframework.ai.chat.prompt.Prompt; |
| 51 | 51 | import org.springframework.ai.mcp.SyncMcpToolCallbackProvider; |
| 52 | -import org.springframework.ai.mcp.client.autoconfigure.properties.McpClientCommonProperties; | |
| 52 | +import org.springframework.ai.mcp.client.common.autoconfigure.properties.McpClientCommonProperties; | |
| 53 | 53 | import org.springframework.ai.tool.ToolCallback; |
| 54 | 54 | import org.springframework.ai.tool.resolution.ToolCallbackResolver; |
| 55 | 55 | import org.springframework.beans.factory.annotation.Autowired; | ... | ... |
yudao-module-ai/src/main/java/cn/iocoder/yudao/module/ai/util/AiUtils.java
| ... | ... | @@ -16,7 +16,7 @@ import org.springframework.ai.chat.prompt.ChatOptions; |
| 16 | 16 | import org.springframework.ai.deepseek.DeepSeekAssistantMessage; |
| 17 | 17 | import org.springframework.ai.deepseek.DeepSeekChatOptions; |
| 18 | 18 | import org.springframework.ai.minimax.MiniMaxChatOptions; |
| 19 | -import org.springframework.ai.ollama.api.OllamaOptions; | |
| 19 | +import org.springframework.ai.ollama.api.OllamaChatOptions; | |
| 20 | 20 | import org.springframework.ai.openai.OpenAiChatOptions; |
| 21 | 21 | import org.springframework.ai.tool.ToolCallback; |
| 22 | 22 | import org.springframework.ai.zhipuai.ZhiPuAiChatOptions; |
| ... | ... | @@ -68,6 +68,7 @@ public class AiUtils { |
| 68 | 68 | case OPENAI: |
| 69 | 69 | case GEMINI: // 复用 OpenAI 客户端 |
| 70 | 70 | case BAI_CHUAN: // 复用 OpenAI 客户端 |
| 71 | + case GROK: // 复用 OpenAI 客户端 | |
| 71 | 72 | return OpenAiChatOptions.builder().model(model).temperature(temperature).maxTokens(maxTokens) |
| 72 | 73 | .toolCallbacks(toolCallbacks).toolContext(toolContext).build(); |
| 73 | 74 | case AZURE_OPENAI: |
| ... | ... | @@ -77,7 +78,7 @@ public class AiUtils { |
| 77 | 78 | return AnthropicChatOptions.builder().model(model).temperature(temperature).maxTokens(maxTokens) |
| 78 | 79 | .toolCallbacks(toolCallbacks).toolContext(toolContext).build(); |
| 79 | 80 | case OLLAMA: |
| 80 | - return OllamaOptions.builder().model(model).temperature(temperature).numPredict(maxTokens) | |
| 81 | + return OllamaChatOptions.builder().model(model).temperature(temperature).numPredict(maxTokens) | |
| 81 | 82 | .toolCallbacks(toolCallbacks).toolContext(toolContext).build(); |
| 82 | 83 | default: |
| 83 | 84 | throw new IllegalArgumentException(StrUtil.format("未知平台({})", platform)); | ... | ... |
yudao-server/src/main/resources/application.yaml