Open MrCoder opened 7 months ago
Database schema design for Postgres:
gpt_dock_client_data
CREATE TABLE gpt_dock_client_data (
client_id VARCHAR NOT NULL,
product_id VARCHAR NOT NULL,
_updated_at TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT (now() at time zone 'utc'),
max_quota INTEGER NOT NULL DEFAULT 500000,
token_quota INTEGER NOT NULL DEFAULT 500000,
version BIGINT NOT NULL,
PRIMARY KEY (client_id, product_id)
);
gpt_dock_user_data
CREATE TABLE gpt_dock_user_data (
user_id VARCHAR NOT NULL,
org_id VARCHAR NOT NULL, -- 格式为 client_id-product_id
_updated_at TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT (now() at time zone 'utc'),
token_used INTEGER NOT NULL DEFAULT 0,
version BIGINT NOT NULL,
PRIMARY KEY (user_id, org_id)
);
API Server repo: https://github.com/ZenGPT/api-server
相关设计文档:https://zenuml.atlassian.net/wiki/spaces/ZEN/pages/1754791956/GPTDock+Confluence
架构设计图