完善平台、基准模型、定价规则和实时负载的紧凑查询与滚动展示,并固定关键操作列。 新增管理员任务记录、批量计费结算和用户组限流、额度及模型权限维护能力,同时补充任务脱敏、查询索引与 OpenAPI 契约。 验证:pnpm openapi、Go 全量测试、pnpm lint、pnpm test、pnpm build、gofmt 与差异格式检查均通过。
23 lines
635 B
Go
23 lines
635 B
Go
package httpapi
|
|
|
|
import "testing"
|
|
|
|
func TestParseAdminTaskSensitiveMode(t *testing.T) {
|
|
tests := []struct {
|
|
value string
|
|
full bool
|
|
accepted bool
|
|
}{
|
|
{value: "", full: false, accepted: true},
|
|
{value: "masked", full: false, accepted: true},
|
|
{value: "FULL", full: true, accepted: true},
|
|
{value: "invalid", full: false, accepted: false},
|
|
}
|
|
for _, test := range tests {
|
|
full, accepted := parseAdminTaskSensitiveMode(test.value)
|
|
if full != test.full || accepted != test.accepted {
|
|
t.Fatalf("parseAdminTaskSensitiveMode(%q)=(%v,%v), want (%v,%v)", test.value, full, accepted, test.full, test.accepted)
|
|
}
|
|
}
|
|
}
|