Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
234e98f1
Commit
234e98f1
authored
Dec 29, 2025
by
song
Browse files
feat(antigravity): 保存 ineligibleTiers 原因信息
parent
b31bfd53
Changes
2
Hide whitespace changes
Inline
Side-by-side
backend/internal/pkg/antigravity/client.go
View file @
234e98f1
...
@@ -38,16 +38,25 @@ type LoadCodeAssistRequest struct {
...
@@ -38,16 +38,25 @@ type LoadCodeAssistRequest struct {
// TierInfo 账户类型信息
// TierInfo 账户类型信息
type
TierInfo
struct
{
type
TierInfo
struct
{
ID
string
`json:"id"`
//
standard-tier,
free-tier, g1-pro-tier, g1-ultra-tier
ID
string
`json:"id"`
// free-tier, g1-pro-tier, g1-ultra-tier
Name
string
`json:"name"`
// 显示名称
Name
string
`json:"name"`
// 显示名称
Description
string
`json:"description"`
// 描述
Description
string
`json:"description"`
// 描述
}
}
// IneligibleTier 不符合条件的层级信息
type
IneligibleTier
struct
{
Tier
*
TierInfo
`json:"tier,omitempty"`
// ReasonCode 不符合条件的原因代码,如 INELIGIBLE_ACCOUNT
ReasonCode
string
`json:"reasonCode,omitempty"`
ReasonMessage
string
`json:"reasonMessage,omitempty"`
}
// LoadCodeAssistResponse loadCodeAssist 响应
// LoadCodeAssistResponse loadCodeAssist 响应
type
LoadCodeAssistResponse
struct
{
type
LoadCodeAssistResponse
struct
{
CloudAICompanionProject
string
`json:"cloudaicompanionProject"`
CloudAICompanionProject
string
`json:"cloudaicompanionProject"`
CurrentTier
*
TierInfo
`json:"currentTier,omitempty"`
CurrentTier
*
TierInfo
`json:"currentTier,omitempty"`
PaidTier
*
TierInfo
`json:"paidTier,omitempty"`
PaidTier
*
TierInfo
`json:"paidTier,omitempty"`
IneligibleTiers
[]
*
IneligibleTier
`json:"ineligibleTiers,omitempty"`
}
}
// GetTier 获取账户类型
// GetTier 获取账户类型
...
...
backend/internal/service/antigravity_quota_refresher.go
View file @
234e98f1
...
@@ -187,6 +187,17 @@ func (r *AntigravityQuotaRefresher) updateAccountTier(account *Account, loadResp
...
@@ -187,6 +187,17 @@ func (r *AntigravityQuotaRefresher) updateAccountTier(account *Account, loadResp
if
tier
!=
""
{
if
tier
!=
""
{
account
.
Extra
[
"tier"
]
=
tier
account
.
Extra
[
"tier"
]
=
tier
}
}
// 保存不符合条件的原因(如 INELIGIBLE_ACCOUNT)
if
len
(
loadResp
.
IneligibleTiers
)
>
0
&&
loadResp
.
IneligibleTiers
[
0
]
!=
nil
{
ineligible
:=
loadResp
.
IneligibleTiers
[
0
]
if
ineligible
.
ReasonCode
!=
""
{
account
.
Extra
[
"ineligible_reason_code"
]
=
ineligible
.
ReasonCode
}
if
ineligible
.
ReasonMessage
!=
""
{
account
.
Extra
[
"ineligible_reason_message"
]
=
ineligible
.
ReasonMessage
}
}
}
}
// updateAccountQuota 更新账户的配额信息
// updateAccountQuota 更新账户的配额信息
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment