Commit Graph
21 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 f8e539c9b4 add cli load 2025-04-18 19:05:23 +08:00
Sakurasan 9e0c33ad93 fix filepath 2025-04-17 18:38:34 +08:00
Sakurasan e7ffc9e8b9 reface to openteam 2025-04-16 18:01:27 +08:00
Sakurasan 65d6d12972 refact:openteam 2025-01-01 23:10:01 +08:00
Sakurasan 78e3be4575 update: allow cors 2024-11-17 22:32:14 +08:00
Sakurasan ae3b72c0ff update: package version 2024-10-21 16:24:58 +08:00
Sakurasan 236dffa256 add realtime proxy 2024-10-06 00:44:48 +08:00
Sakurasan a3920f11fa gemini flash 2024-05-15 18:27:29 +08:00
Sakurasan dd2d583ffc update depend 2024-05-08 22:31:07 +08:00
Sakurasan 151757c2fe gemini 2024-04-21 00:27:35 +08:00
Sakurasan f336eba19a update go.mod 2023-12-03 15:32:24 +08:00
Sakurasan c838e7be16 support dall-e 2023-11-23 18:03:15 +08:00
Sakurasan a0155fc0b1 whisper 2023-08-10 22:54:56 +08:00
Sakurasan e110eb28ee update: num token 2023-07-08 21:29:53 +08:00
Sakurasan 9c5ac69024 更新依赖 2023-06-20 15:34:46 +08:00
Sakurasan 933a70a474 fix:gorm not autoIncrement && update doc 2023-06-12 21:32:27 +08:00
Sakurasan 70168fd01e add frontend (#5)
添加前端页面
2023-05-13 05:01:35 +08:00
Sakurasan 33034a9db0 支持统计用户的使用量 2023-04-27 18:08:05 +08:00
Sakurasan 6a6fca6c88 fuck gcc 2023-03-30 03:29:08 +08:00
Sakurasan 6bf21b4bd7 first up 2023-03-30 02:27:54 +08:00