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
37fa9805
Commit
37fa9805
authored
Feb 28, 2026
by
QTom
Browse files
feat: flatten RPM config fields in Account DTO
parent
f648b8e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
backend/internal/handler/dto/mappers.go
View file @
37fa9805
...
@@ -209,6 +209,13 @@ func AccountFromServiceShallow(a *service.Account) *Account {
...
@@ -209,6 +209,13 @@ func AccountFromServiceShallow(a *service.Account) *Account {
if
idleTimeout
:=
a
.
GetSessionIdleTimeoutMinutes
();
idleTimeout
>
0
{
if
idleTimeout
:=
a
.
GetSessionIdleTimeoutMinutes
();
idleTimeout
>
0
{
out
.
SessionIdleTimeoutMin
=
&
idleTimeout
out
.
SessionIdleTimeoutMin
=
&
idleTimeout
}
}
if
rpm
:=
a
.
GetBaseRPM
();
rpm
>
0
{
out
.
BaseRPM
=
&
rpm
strategy
:=
a
.
GetRPMStrategy
()
out
.
RPMStrategy
=
&
strategy
buffer
:=
a
.
GetRPMStickyBuffer
()
out
.
RPMStickyBuffer
=
&
buffer
}
// TLS指纹伪装开关
// TLS指纹伪装开关
if
a
.
IsTLSFingerprintEnabled
()
{
if
a
.
IsTLSFingerprintEnabled
()
{
enabled
:=
true
enabled
:=
true
...
...
backend/internal/handler/dto/types.go
View file @
37fa9805
...
@@ -153,6 +153,12 @@ type Account struct {
...
@@ -153,6 +153,12 @@ type Account struct {
MaxSessions
*
int
`json:"max_sessions,omitempty"`
MaxSessions
*
int
`json:"max_sessions,omitempty"`
SessionIdleTimeoutMin
*
int
`json:"session_idle_timeout_minutes,omitempty"`
SessionIdleTimeoutMin
*
int
`json:"session_idle_timeout_minutes,omitempty"`
// RPM 限制(仅 Anthropic OAuth/SetupToken 账号有效)
// 从 extra 字段提取,方便前端显示和编辑
BaseRPM
*
int
`json:"base_rpm,omitempty"`
RPMStrategy
*
string
`json:"rpm_strategy,omitempty"`
RPMStickyBuffer
*
int
`json:"rpm_sticky_buffer,omitempty"`
// TLS指纹伪装(仅 Anthropic OAuth/SetupToken 账号有效)
// TLS指纹伪装(仅 Anthropic OAuth/SetupToken 账号有效)
// 从 extra 字段提取,方便前端显示和编辑
// 从 extra 字段提取,方便前端显示和编辑
EnableTLSFingerprint
*
bool
`json:"enable_tls_fingerprint,omitempty"`
EnableTLSFingerprint
*
bool
`json:"enable_tls_fingerprint,omitempty"`
...
...
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