tenant: add invites and join requests

This commit is contained in:
2025-12-18 18:27:23 +08:00
parent 462bde351d
commit ec4506fd2d
28 changed files with 5206 additions and 201 deletions

View File

@@ -6,6 +6,24 @@
# - Get a token via `tests/super.http` (`/super/v1/auth/token`) then paste it below.
@token = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoyLCJpc3MiOiJ2MiIsImV4cCI6MTc2NjYzMzAyMSwibmJmIjoxNzY2MDI4MjExfQ.RjLVil6EnbPi4LMPyVBzR2vFaeXelypk5fKInsAzqc8
### Tenant Join - Join by invite (JWT required, membership NOT required)
POST {{ host }}/t/{{ tenantCode }}/v1/join/invite
Content-Type: application/json
Authorization: Bearer {{ token }}
{
"invite_code": "paste_invite_code_here"
}
### Tenant Join - Create join request (JWT required, membership NOT required)
POST {{ host }}/t/{{ tenantCode }}/v1/join/request
Content-Type: application/json
Authorization: Bearer {{ token }}
{
"reason": "申请加入租户用于联调"
}
### Tenant - Me (resolved tenant/user/tenant_user)
GET {{ host }}/t/{{ tenantCode }}/v1/me
@@ -171,3 +189,53 @@ Authorization: Bearer {{ token }}
GET {{ host }}/t/{{ tenantCode }}/v1/admin/users?page=1&limit=20
Content-Type: application/json
Authorization: Bearer {{ token }}
### Tenant Admin - Create invite
POST {{ host }}/t/{{ tenantCode }}/v1/admin/invites
Content-Type: application/json
Authorization: Bearer {{ token }}
{
"code": "",
"max_uses": 1,
"remark": "联调用邀请码"
}
### Tenant Admin - Invite list
GET {{ host }}/t/{{ tenantCode }}/v1/admin/invites?page=1&limit=20
Content-Type: application/json
Authorization: Bearer {{ token }}
### Tenant Admin - Disable invite
@inviteID = 1
PATCH {{ host }}/t/{{ tenantCode }}/v1/admin/invites/{{ inviteID }}/disable
Content-Type: application/json
Authorization: Bearer {{ token }}
{
"reason": "联调禁用"
}
### Tenant Admin - Join requests list
GET {{ host }}/t/{{ tenantCode }}/v1/admin/join-requests?page=1&limit=20&status=pending
Content-Type: application/json
Authorization: Bearer {{ token }}
### Tenant Admin - Approve join request
@requestID = 1
POST {{ host }}/t/{{ tenantCode }}/v1/admin/join-requests/{{ requestID }}/approve
Content-Type: application/json
Authorization: Bearer {{ token }}
{
"reason": "联调通过"
}
### Tenant Admin - Reject join request
POST {{ host }}/t/{{ tenantCode }}/v1/admin/join-requests/{{ requestID }}/reject
Content-Type: application/json
Authorization: Bearer {{ token }}
{
"reason": "联调拒绝"
}