Files
open-gateway-service/docs/sql/03_target.sql
T
chenxing 50f9948b49
build / build-push (push) Successful in 1m39s
E11: open_api_target 表与 DB>yml 地址解析
target base-url 由 open_api_target 快照优先解析,无行/禁用行/空白地址行回落
yml yh.gateway.routes;/api/internal/routes/refresh 同时重载两表。
2026-09-22 10:14:46 +08:00

19 lines
1.2 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- =====================================================================
-- 开放接口中心 target 地址表(E11,T-D1a)
-- 语义:target_code → 提供方 base-url(容器网内直连)。地址解析优先级 DB > yml(yh.gateway.routes);
-- DB 无行 / enabled=0 / base_url 空白 三者一律回落 yml,故本表可整表为空、可逐行灰度。
-- 写入方:projman Apply 派生(E12)+ 存量回填(E13);网关运行时只读,
-- 改行后 POST /api/internal/routes/refresh 重载即生效(不重启)。
-- 可重复执行:CREATE TABLE IF NOT EXISTS(不 DROP——生产回填数据不可丢)
-- =====================================================================
CREATE TABLE IF NOT EXISTS open_api_target (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
target_code VARCHAR(32) NOT NULL COMMENT '目标应用 ctx(剥掉首斜杠,如 userbase/notice/flowcenter)',
base_url VARCHAR(256) NOT NULL COMMENT '提供方 base-url(如 http://notice-service:8080,不含路径)',
enabled TINYINT NOT NULL DEFAULT 1,
gmt_create DATETIME NOT NULL,
gmt_modified DATETIME NOT NULL,
UNIQUE KEY uk_target (target_code)
);