feat: 路由策略新增第一个和最后一个

This commit is contained in:
xlsea 2024-07-30 16:16:05 +08:00
parent 6974e1347d
commit 31bbe835f2
5 changed files with 13 additions and 5 deletions

View File

@ -112,7 +112,9 @@ export const routeKeyRecord: Record<Api.Common.RouteKey, App.I18n.I18nKey> = {
1: 'common.routeKey.items.consistentHash',
2: 'common.routeKey.items.random',
3: 'common.routeKey.items.lru',
4: 'common.routeKey.items.round'
4: 'common.routeKey.items.round',
5: 'common.routeKey.items.first',
6: 'common.routeKey.items.last'
};
export const routeKeyRecordOptions = transformRecordToNumberOption(routeKeyRecord, true);

View File

@ -107,7 +107,9 @@ const local: App.I18n.Schema = {
consistentHash: 'Consistent hash',
random: 'Random',
lru: 'LRU',
round: 'Round robin'
round: 'Round robin',
first: 'First',
last: 'Last'
}
},
blockStrategy: {

View File

@ -107,7 +107,9 @@ const local: App.I18n.Schema = {
consistentHash: '一致性哈希',
random: '随机',
lru: 'LRU',
round: '轮询'
round: '轮询',
first: '第一个',
last: '最后一个'
}
},
blockStrategy: {

View File

@ -70,8 +70,8 @@ declare namespace Api {
status?: EnableStatus | null;
} & T;
/** 1: 一致性Hash 2: 随机 3: LRU 4: 轮询 */
type RouteKey = 1 | 2 | 3 | 4;
/** 1: 一致性Hash 2: 随机 3: LRU 4: 轮询 5: 第一个 6: 最后一个 */
type RouteKey = 1 | 2 | 3 | 4 | 5 | 6;
/** 阻塞策略 1:丢弃 2:覆盖 3:并行 4:恢复 */
type BlockStrategy = 1 | 2 | 3 | 4;

View File

@ -387,6 +387,8 @@ declare namespace App {
random: string;
lru: string;
round: string;
first: string;
last: string;
};
};
blockStrategy: {