用户服务 4 个 crate 合并为单一 user-service,按 DDD 限界上下文聚合

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
fish
2026-04-26 16:36:04 +08:00
parent 4e004f5a85
commit b5cb9daad7
28 changed files with 489 additions and 1038 deletions

View File

@@ -1,12 +1,15 @@
# 用户服务路由
#
# 全部接口统一打到 user_service upstream合并后的单一服务
# rewrite 统一去掉 /api/v1 前缀,下游按 /auth/* 和 /users/* 组织路由
# 账号登录(严格限流)
location /api/v1/auth/login/account {
limit_req zone=api_strict burst=5 nodelay;
limit_conn addr 3;
rewrite ^/api/v1/auth/login/account$ /login break;
proxy_pass http://user_login_account;
rewrite ^/api/v1(/.*)$ $1 break;
proxy_pass http://user_service;
proxy_http_version 1.1;
proxy_set_header Host $host;
@@ -21,8 +24,8 @@ location /api/v1/auth/login/email {
limit_req zone=api_strict burst=5 nodelay;
limit_conn addr 3;
rewrite ^/api/v1/auth/login/email$ /login break;
proxy_pass http://user_login_email;
rewrite ^/api/v1(/.*)$ $1 break;
proxy_pass http://user_service;
proxy_http_version 1.1;
proxy_set_header Host $host;
@@ -37,8 +40,8 @@ location /api/v1/users/register/account {
limit_req zone=general burst=20 nodelay;
limit_conn addr 10;
rewrite ^/api/v1/users/register/account$ /register break;
proxy_pass http://user_register_account;
rewrite ^/api/v1(/.*)$ $1 break;
proxy_pass http://user_service;
proxy_http_version 1.1;
proxy_set_header Host $host;
@@ -53,8 +56,8 @@ location /api/v1/users/register/email {
limit_req zone=general burst=20 nodelay;
limit_conn addr 10;
rewrite ^/api/v1/users/register/email$ /register break;
proxy_pass http://user_register_email;
rewrite ^/api/v1(/.*)$ $1 break;
proxy_pass http://user_service;
proxy_http_version 1.1;
proxy_set_header Host $host;