-- 10.1.init-authx.sql


/* 升级认证授权接口时，执行 */
/*
update TB_MGT_ROUTE set MEMO='废弃', STATUS='0' where ID='1';

commit;

insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX) 
values ('30', 0, 'authx-admin-api', '认证授权 - 认证授权接口', '1', '/api/v1/admin', 'http://localhost:8009', 0);

update TB_MGT_ROUTE set URL='http://authx-service-bff-svc.authx-service.svc.cluster.local:8080' where ID='30';

*/


/* 部署云平台2.0时，执行以下脚本 */
insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX) 
values ('1', 0, 'bff-admin-api', '管理门户 - 聚合接口', '1', '/api/v1/admin', 'http://localhost:8081', 0);
insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX) 
values ('2', 0, 'bff-me-api', '管理门户 - 聚合接口（当前用户）', '1', '/api/v1/me', 'http://localhost:8081', 0);
insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX) 
values ('3', 0, 'bff-open-api', '管理门户 - 聚合接口（公开）', '1', '/api/v1/open', 'http://localhost:8081', 0);

update TB_MGT_ROUTE set URL='http://admin-center-bff-svc.admin-center.svc.cluster.local:8080' where ID='1';
update TB_MGT_ROUTE set URL='http://admin-center-bff-svc.admin-center.svc.cluster.local:8080' where ID='2';
update TB_MGT_ROUTE set URL='http://admin-center-bff-svc.admin-center.svc.cluster.local:8080' where ID='3';

commit;


insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX) 
values ('10', 0, 'authx-admin-api', '认证授权 - 认证授权接口', '1', '/api/v2/admin', 'http://localhost:8009', 0);

update TB_MGT_ROUTE set URL='http://authx-service-bff-svc.authx-service.svc.cluster.local:8080' where ID='10';

commit;


insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX) 
values ('20', 0, 'user-api', '认证授权 - 用户接口', '1', '/api/v1/base', 'https://localhost:8022', 0);

insert into TB_MGT_ROUTE (ID, DELETED, CODE, NAME, STATUS, PATH_PREFIX, URL, STRIP_PREFIX) 
values ('40', 0, 'personal-api', '认证授权 - 个人信息接口', '1', '/api/v1/personal', 'http://localhost:8041/api/v1', 1);

update TB_MGT_ROUTE set URL='http://user-data-service-goa-svc.user-data-service.svc.cluster.local:8080' where ID='20';
update TB_MGT_ROUTE set URL='http://personal-security-center-bff-svc.personal-security-center.svc.cluster.local:8080/api/v1' where ID='40';

commit;


/* 菜单、角色的初始化，请参考《认证授权菜单初始化》 */


