Skip to content

Commit 37fa980

Browse files
author
QTom
committed
feat: flatten RPM config fields in Account DTO
1 parent f648b8e commit 37fa980

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

backend/internal/handler/dto/mappers.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,13 @@ func AccountFromServiceShallow(a *service.Account) *Account {
209209
if idleTimeout := a.GetSessionIdleTimeoutMinutes(); idleTimeout > 0 {
210210
out.SessionIdleTimeoutMin = &idleTimeout
211211
}
212+
if rpm := a.GetBaseRPM(); rpm > 0 {
213+
out.BaseRPM = &rpm
214+
strategy := a.GetRPMStrategy()
215+
out.RPMStrategy = &strategy
216+
buffer := a.GetRPMStickyBuffer()
217+
out.RPMStickyBuffer = &buffer
218+
}
212219
// TLS指纹伪装开关
213220
if a.IsTLSFingerprintEnabled() {
214221
enabled := true

backend/internal/handler/dto/types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ type Account struct {
153153
MaxSessions *int `json:"max_sessions,omitempty"`
154154
SessionIdleTimeoutMin *int `json:"session_idle_timeout_minutes,omitempty"`
155155

156+
// RPM 限制(仅 Anthropic OAuth/SetupToken 账号有效)
157+
// 从 extra 字段提取,方便前端显示和编辑
158+
BaseRPM *int `json:"base_rpm,omitempty"`
159+
RPMStrategy *string `json:"rpm_strategy,omitempty"`
160+
RPMStickyBuffer *int `json:"rpm_sticky_buffer,omitempty"`
161+
156162
// TLS指纹伪装(仅 Anthropic OAuth/SetupToken 账号有效)
157163
// 从 extra 字段提取,方便前端显示和编辑
158164
EnableTLSFingerprint *bool `json:"enable_tls_fingerprint,omitempty"`

0 commit comments

Comments
 (0)