feat: add tenant membership flow

This commit is contained in:
2026-01-13 10:26:11 +08:00
parent fa43c0355f
commit 2a670b3a78
11 changed files with 1719 additions and 0 deletions

View File

@@ -1631,6 +1631,82 @@
}
}
},
"/t/{tenantCode}/v1/creator/members/invite": {
"post": {
"description": "Create an invite for tenant members",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"CreatorCenter"
],
"summary": "Create member invite",
"parameters": [
{
"description": "Invite form",
"name": "form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.TenantInviteCreateForm"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.TenantInviteItem"
}
}
}
}
},
"/t/{tenantCode}/v1/creator/members/{id}/review": {
"post": {
"description": "Approve or reject a tenant join request",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"CreatorCenter"
],
"summary": "Review join request",
"parameters": [
{
"type": "integer",
"format": "int64",
"description": "Join request ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Review form",
"name": "form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.TenantJoinReviewForm"
}
}
],
"responses": {
"200": {
"description": "Reviewed",
"schema": {
"type": "string"
}
}
}
}
},
"/t/{tenantCode}/v1/creator/orders": {
"get": {
"description": "List sales orders",
@@ -2889,6 +2965,121 @@
}
}
},
"/t/{tenantCode}/v1/tenants/{id}/invites/accept": {
"post": {
"description": "Accept a tenant invite by code",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"TenantPublic"
],
"summary": "Accept tenant invite",
"parameters": [
{
"type": "integer",
"format": "int64",
"description": "Tenant ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Invite form",
"name": "form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.TenantInviteAcceptForm"
}
}
],
"responses": {
"200": {
"description": "Accepted",
"schema": {
"type": "string"
}
}
}
}
},
"/t/{tenantCode}/v1/tenants/{id}/join": {
"post": {
"description": "Submit join request for a tenant",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"TenantPublic"
],
"summary": "Apply to join tenant",
"parameters": [
{
"type": "integer",
"format": "int64",
"description": "Tenant ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Join form",
"name": "form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.TenantJoinApplyForm"
}
}
],
"responses": {
"200": {
"description": "Applied",
"schema": {
"type": "string"
}
}
}
},
"delete": {
"description": "Cancel join request for a tenant",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"TenantPublic"
],
"summary": "Cancel join request",
"parameters": [
{
"type": "integer",
"format": "int64",
"description": "Tenant ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Canceled",
"schema": {
"type": "string"
}
}
}
}
},
"/t/{tenantCode}/v1/topics": {
"get": {
"description": "List curated topics",
@@ -4618,6 +4809,69 @@
}
}
},
"dto.TenantInviteAcceptForm": {
"type": "object",
"properties": {
"code": {
"description": "Code 邀请码(必填)。",
"type": "string"
}
}
},
"dto.TenantInviteCreateForm": {
"type": "object",
"properties": {
"expires_at": {
"description": "ExpiresAt 过期时间RFC3339可选空值使用默认过期时间。",
"type": "string"
},
"max_uses": {
"description": "MaxUses 最大可使用次数(\u003c=0 默认 1。",
"type": "integer"
},
"remark": {
"description": "Remark 备注说明(可选)。",
"type": "string"
}
}
},
"dto.TenantInviteItem": {
"type": "object",
"properties": {
"code": {
"description": "Code 邀请码。",
"type": "string"
},
"created_at": {
"description": "CreatedAt 创建时间RFC3339。",
"type": "string"
},
"expires_at": {
"description": "ExpiresAt 过期时间RFC3339空字符串表示不限制。",
"type": "string"
},
"id": {
"description": "ID 邀请记录ID。",
"type": "integer"
},
"max_uses": {
"description": "MaxUses 最大可使用次数。",
"type": "integer"
},
"remark": {
"description": "Remark 备注说明。",
"type": "string"
},
"status": {
"description": "Status 邀请状态active/disabled/expired。",
"type": "string"
},
"used_count": {
"description": "UsedCount 已使用次数。",
"type": "integer"
}
}
},
"dto.TenantItem": {
"type": "object",
"properties": {
@@ -4704,6 +4958,28 @@
}
}
},
"dto.TenantJoinApplyForm": {
"type": "object",
"properties": {
"reason": {
"description": "Reason 申请加入原因(可选,空值会使用默认文案)。",
"type": "string"
}
}
},
"dto.TenantJoinReviewForm": {
"type": "object",
"properties": {
"action": {
"description": "Action 审核动作approve/reject。",
"type": "string"
},
"reason": {
"description": "Reason 审核说明(可选,用于展示驳回原因或备注)。",
"type": "string"
}
}
},
"dto.TenantOwnerUserLite": {
"type": "object",
"properties": {