Commit Graph
27 Commits
Author SHA1 Message Date
Sakurasan ef3025dd80 refactor: complete backend rewrite for multi-protocol proxy
Major rewrite of the Go backend to support:
- Three API format imports: openai, anthropic, compatible
- Three protocol conversions: Chat Completions, Responses, Messages
- Hub-and-spoke architecture with Chat as intermediate format

Deleted:
- opencat.go (old entry)
- store/, team/, pkg/team/, pkg/store/ (old data layer)
- internal/model/, internal/consts/ (old types)
- internal/service/team/, internal/controller/team/ (old handlers)
- llm/ (removed LLM client library, pure proxy mode)
- dist/, assets/ (old build artifacts)

Added:
- internal/store/ — 9 GORM models + multi-DB support
- internal/pkg/ — crypto (AES-GCM), apikey, jwt, ratelimit, resp, tokenizer
- internal/channel/ — channel selection, weighted LB, health checks
- internal/proxy/convert/ — 6 protocol conversion functions + SSE streaming
- internal/proxy/ — gateway with request dispatch and upstream selection
- internal/usage/ — async usage recorder with batch writes
- internal/api/ — management API (auth, users, keys, channels, models)
- Makefile for build/test/deploy

Fixed API to match frontend expectations:
- Login response wraps token in { data: { token } }
- GET /api/profile route added
- Profile response wraps user in { code, data }
- Role returned as number (10=admin, 1=user)
2026-08-30 11:49:31 +08:00
Sakurasan aa0d87f132 fix(proxy): guard nil SupportModels before dereference in setModelCache 2026-08-30 03:16:50 +08:00
Sakurasan 4a68ff6162 add claude proxy 2025-07-30 11:18:47 +08:00
Sakurasan 9c604460b1 fix empty models 2025-04-22 02:52:56 +08:00
Sakurasan 8d34f8d6fe up 2025-04-22 02:16:28 +08:00
Sakurasan 6d1d0f3b6b up 2025-04-22 02:08:32 +08:00
Sakurasan 24529189d9 fix daily usage 2025-04-22 01:50:50 +08:00
Sakurasan 000162b1b1 fix usage 2025-04-22 01:06:03 +08:00
Sakurasan 6662ea5e04 fix record usage 2025-04-22 00:48:24 +08:00
Sakurasan 5789d50e9e update record usage 2025-04-21 23:59:30 +08:00
Sakurasan a9ff7e1c94 add log 2025-04-21 21:50:29 +08:00
Sakurasan 51d4651c6c up 2025-04-21 20:19:48 +08:00
Sakurasan e112f3af12 collect usage 2025-04-21 19:10:27 +08:00
Sakurasan 73e53c2333 add models task 2025-04-21 01:40:06 +08:00
Sakurasan 470e49b850 support fetch models 2025-04-21 01:30:17 +08:00
Sakurasan d426781e47 UP 2025-04-20 19:21:51 +08:00
Sakurasan b80f0759a5 fix select key 2025-04-20 18:33:59 +08:00
Sakurasan b83c6d9786 fix active key,suffix 2025-04-20 16:22:23 +08:00
Sakurasan ca305f4199 fetch model & add apitype 2025-04-19 01:21:28 +08:00
Sakurasan f8e539c9b4 add cli load 2025-04-18 19:05:23 +08:00
Sakurasan e0b531c578 fix passkey 2025-04-18 02:47:10 +08:00
Sakurasan 20c3cda4a7 fix bugs 2025-04-17 21:02:00 +08:00
Sakurasan 9045130778 fix findkey 2025-04-17 20:42:08 +08:00
Sakurasan 5403ed0cba fix store bug 2025-04-17 20:15:41 +08:00
Sakurasan b0d68ba338 fix bugs 2025-04-17 02:17:19 +08:00
Sakurasan e7ffc9e8b9 reface to openteam 2025-04-16 18:01:27 +08:00
Sakurasan bc223d6530 team api 2025-02-01 23:52:55 +08:00