refactor(relay): update channel retrieval to use RelayInfo structure

This commit is contained in:
CaIon
2025-12-12 22:04:38 +08:00
parent 2ac6a5b02f
commit ce6fb95f96
4 changed files with 29 additions and 21 deletions

View File

@@ -81,6 +81,7 @@ type TokenCountMeta struct {
type RelayInfo struct {
TokenId int
TokenKey string
TokenGroup string
UserId int
UsingGroup string // 使用的分组
UserGroup string // 用户所在分组
@@ -400,6 +401,7 @@ func genBaseRelayInfo(c *gin.Context, request dto.Request) *RelayInfo {
TokenId: common.GetContextKeyInt(c, constant.ContextKeyTokenId),
TokenKey: common.GetContextKeyString(c, constant.ContextKeyTokenKey),
TokenUnlimited: common.GetContextKeyBool(c, constant.ContextKeyTokenUnlimited),
TokenGroup: common.GetContextKeyString(c, constant.ContextKeyTokenGroup),
isFirstResponse: true,
RelayMode: relayconstant.Path2RelayMode(c.Request.URL.Path),