From 4bf23e1f4a480873569e99fb6d7c180537685294 Mon Sep 17 00:00:00 2001 From: Rogee Date: Thu, 25 Dec 2025 14:55:02 +0800 Subject: [PATCH] feat: tenant management api paths --- backend/app/http/tenant/content_admin.go | 12 +- backend/app/http/tenant/ledger_admin.go | 2 +- backend/app/http/tenant/media_asset_admin.go | 10 +- backend/app/http/tenant/order_admin.go | 8 +- backend/app/http/tenant/routes.gen.go | 104 +- .../app/http/tenant/tenant_invite_admin.go | 6 +- backend/app/http/tenant/tenant_join_admin.go | 6 +- backend/app/http/tenant/tenant_user_admin.go | 8 +- backend/docs/docs.go | 3420 ++++++++--------- backend/docs/swagger.json | 3420 ++++++++--------- backend/docs/swagger.yaml | 2304 +++++------ .../src/views/management/ContentPublish.vue | 2 +- 12 files changed, 4651 insertions(+), 4651 deletions(-) diff --git a/backend/app/http/tenant/content_admin.go b/backend/app/http/tenant/content_admin.go index e3471e0..f87c98a 100644 --- a/backend/app/http/tenant/content_admin.go +++ b/backend/app/http/tenant/content_admin.go @@ -39,7 +39,7 @@ func requireTenantAdmin(tenantUser *models.TenantUser) error { // @Param filter query dto.AdminContentListFilter true "Filter" // @Success 200 {object} requests.Pager{items=dto.AdminContentItem} // -// @Router /t/:tenantCode/v1/admin/contents [get] +// @Router /t/:tenantCode/v1/management/contents [get] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind filter query @@ -78,7 +78,7 @@ func (*contentAdmin) list(ctx fiber.Ctx, tenant *models.Tenant, tenantUser *mode // @Param form body dto.ContentCreateForm true "Form" // @Success 200 {object} models.Content // -// @Router /t/:tenantCode/v1/admin/contents [post] +// @Router /t/:tenantCode/v1/management/contents [post] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind form body @@ -105,7 +105,7 @@ func (*contentAdmin) create(ctx fiber.Ctx, tenant *models.Tenant, tenantUser *mo // @Param form body dto.ContentPublishForm true "Form" // @Success 200 {object} dto.ContentPublishResponse // -// @Router /t/:tenantCode/v1/admin/contents/publish [post] +// @Router /t/:tenantCode/v1/management/contents/publish [post] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind form body @@ -144,7 +144,7 @@ func (*contentAdmin) publish(ctx fiber.Ctx, tenant *models.Tenant, tenantUser *m // @Param form body dto.ContentUpdateForm true "Form" // @Success 200 {object} models.Content // -// @Router /t/:tenantCode/v1/admin/contents/:contentID [patch] +// @Router /t/:tenantCode/v1/management/contents/:contentID [patch] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind contentID path @@ -174,7 +174,7 @@ func (*contentAdmin) update(ctx fiber.Ctx, tenant *models.Tenant, tenantUser *mo // @Param form body dto.ContentPriceUpsertForm true "Form" // @Success 200 {object} models.ContentPrice // -// @Router /t/:tenantCode/v1/admin/contents/:contentID/price [put] +// @Router /t/:tenantCode/v1/management/contents/:contentID/price [put] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind contentID path @@ -204,7 +204,7 @@ func (*contentAdmin) upsertPrice(ctx fiber.Ctx, tenant *models.Tenant, tenantUse // @Param form body dto.ContentAssetAttachForm true "Form" // @Success 200 {object} models.ContentAsset // -// @Router /t/:tenantCode/v1/admin/contents/:contentID/assets [post] +// @Router /t/:tenantCode/v1/management/contents/:contentID/assets [post] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind contentID path diff --git a/backend/app/http/tenant/ledger_admin.go b/backend/app/http/tenant/ledger_admin.go index 575f950..6c9c7ef 100644 --- a/backend/app/http/tenant/ledger_admin.go +++ b/backend/app/http/tenant/ledger_admin.go @@ -25,7 +25,7 @@ type ledgerAdmin struct{} // @Param filter query dto.AdminLedgerListFilter true "Filter" // @Success 200 {object} requests.Pager{items=dto.AdminLedgerItem} // -// @Router /t/:tenantCode/v1/admin/ledgers [get] +// @Router /t/:tenantCode/v1/management/ledgers [get] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind filter query diff --git a/backend/app/http/tenant/media_asset_admin.go b/backend/app/http/tenant/media_asset_admin.go index de68554..13113df 100644 --- a/backend/app/http/tenant/media_asset_admin.go +++ b/backend/app/http/tenant/media_asset_admin.go @@ -28,7 +28,7 @@ type mediaAssetAdmin struct{} // @Param filter query dto.AdminMediaAssetListFilter true "Filter" // @Success 200 {object} requests.Pager{items=models.MediaAsset} // -// @Router /t/:tenantCode/v1/admin/media_assets [get] +// @Router /t/:tenantCode/v1/management/media_assets [get] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind filter query @@ -65,7 +65,7 @@ func (*mediaAssetAdmin) adminList( // @Param assetID path int64 true "AssetID" // @Success 200 {object} models.MediaAsset // -// @Router /t/:tenantCode/v1/admin/media_assets/:assetID [get] +// @Router /t/:tenantCode/v1/management/media_assets/:assetID [get] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind assetID path @@ -98,7 +98,7 @@ func (*mediaAssetAdmin) adminDetail( // @Param form body dto.AdminMediaAssetUploadInitForm true "Form" // @Success 200 {object} dto.AdminMediaAssetUploadInitResponse // -// @Router /t/:tenantCode/v1/admin/media_assets/upload_init [post] +// @Router /t/:tenantCode/v1/management/media_assets/upload_init [post] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind form body @@ -135,7 +135,7 @@ func (*mediaAssetAdmin) uploadInit( // @Param form body dto.AdminMediaAssetUploadCompleteForm false "Form" // @Success 200 {object} models.MediaAsset // -// @Router /t/:tenantCode/v1/admin/media_assets/:assetID/upload_complete [post] +// @Router /t/:tenantCode/v1/management/media_assets/:assetID/upload_complete [post] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind assetID path @@ -170,7 +170,7 @@ func (*mediaAssetAdmin) uploadComplete( // @Param assetID path int64 true "AssetID" // @Success 200 {object} models.MediaAsset // -// @Router /t/:tenantCode/v1/admin/media_assets/:assetID [delete] +// @Router /t/:tenantCode/v1/management/media_assets/:assetID [delete] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind assetID path diff --git a/backend/app/http/tenant/order_admin.go b/backend/app/http/tenant/order_admin.go index fa0bd6c..7ec3c4b 100644 --- a/backend/app/http/tenant/order_admin.go +++ b/backend/app/http/tenant/order_admin.go @@ -28,7 +28,7 @@ type orderAdmin struct{} // @Param filter query dto.AdminOrderListFilter true "Filter" // @Success 200 {object} requests.Pager{items=models.Order} // -// @Router /t/:tenantCode/v1/admin/orders [get] +// @Router /t/:tenantCode/v1/management/orders [get] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind filter query @@ -73,7 +73,7 @@ func (*orderAdmin) adminOrderList( // @Param filter query dto.AdminOrderListFilter true "Filter" // @Success 200 {object} dto.AdminOrderExportResponse // -// @Router /t/:tenantCode/v1/admin/orders/export [get] +// @Router /t/:tenantCode/v1/management/orders/export [get] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind filter query @@ -108,7 +108,7 @@ func (*orderAdmin) adminOrderExport( // @Param orderID path int64 true "OrderID" // @Success 200 {object} dto.AdminOrderDetail // -// @Router /t/:tenantCode/v1/admin/orders/:orderID [get] +// @Router /t/:tenantCode/v1/management/orders/:orderID [get] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind orderID path @@ -148,7 +148,7 @@ func (*orderAdmin) adminOrderDetail( // @Param form body dto.AdminOrderRefundForm true "Form" // @Success 200 {object} models.Order // -// @Router /t/:tenantCode/v1/admin/orders/:orderID/refund [post] +// @Router /t/:tenantCode/v1/management/orders/:orderID/refund [post] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind orderID path diff --git a/backend/app/http/tenant/routes.gen.go b/backend/app/http/tenant/routes.gen.go index 1e72956..f01a5bf 100644 --- a/backend/app/http/tenant/routes.gen.go +++ b/backend/app/http/tenant/routes.gen.go @@ -82,45 +82,45 @@ func (r *Routes) Register(router fiber.Router) { PathParam[int64]("contentID"), )) // Register routes for controller: contentAdmin - r.log.Debugf("Registering route: Get /t/:tenantCode/v1/admin/contents -> contentAdmin.list") - router.Get("/t/:tenantCode/v1/admin/contents"[len(r.Path()):], DataFunc3( + r.log.Debugf("Registering route: Get /t/:tenantCode/v1/management/contents -> contentAdmin.list") + router.Get("/t/:tenantCode/v1/management/contents"[len(r.Path()):], DataFunc3( r.contentAdmin.list, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), Query[dto.AdminContentListFilter]("filter"), )) - r.log.Debugf("Registering route: Patch /t/:tenantCode/v1/admin/contents/:contentID -> contentAdmin.update") - router.Patch("/t/:tenantCode/v1/admin/contents/:contentID"[len(r.Path()):], DataFunc4( + r.log.Debugf("Registering route: Patch /t/:tenantCode/v1/management/contents/:contentID -> contentAdmin.update") + router.Patch("/t/:tenantCode/v1/management/contents/:contentID"[len(r.Path()):], DataFunc4( r.contentAdmin.update, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), PathParam[int64]("contentID"), Body[dto.ContentUpdateForm]("form"), )) - r.log.Debugf("Registering route: Post /t/:tenantCode/v1/admin/contents -> contentAdmin.create") - router.Post("/t/:tenantCode/v1/admin/contents"[len(r.Path()):], DataFunc3( + r.log.Debugf("Registering route: Post /t/:tenantCode/v1/management/contents -> contentAdmin.create") + router.Post("/t/:tenantCode/v1/management/contents"[len(r.Path()):], DataFunc3( r.contentAdmin.create, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), Body[dto.ContentCreateForm]("form"), )) - r.log.Debugf("Registering route: Post /t/:tenantCode/v1/admin/contents/:contentID/assets -> contentAdmin.attachAsset") - router.Post("/t/:tenantCode/v1/admin/contents/:contentID/assets"[len(r.Path()):], DataFunc4( + r.log.Debugf("Registering route: Post /t/:tenantCode/v1/management/contents/:contentID/assets -> contentAdmin.attachAsset") + router.Post("/t/:tenantCode/v1/management/contents/:contentID/assets"[len(r.Path()):], DataFunc4( r.contentAdmin.attachAsset, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), PathParam[int64]("contentID"), Body[dto.ContentAssetAttachForm]("form"), )) - r.log.Debugf("Registering route: Post /t/:tenantCode/v1/admin/contents/publish -> contentAdmin.publish") - router.Post("/t/:tenantCode/v1/admin/contents/publish"[len(r.Path()):], DataFunc3( + r.log.Debugf("Registering route: Post /t/:tenantCode/v1/management/contents/publish -> contentAdmin.publish") + router.Post("/t/:tenantCode/v1/management/contents/publish"[len(r.Path()):], DataFunc3( r.contentAdmin.publish, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), Body[dto.ContentPublishForm]("form"), )) - r.log.Debugf("Registering route: Put /t/:tenantCode/v1/admin/contents/:contentID/price -> contentAdmin.upsertPrice") - router.Put("/t/:tenantCode/v1/admin/contents/:contentID/price"[len(r.Path()):], DataFunc4( + r.log.Debugf("Registering route: Put /t/:tenantCode/v1/management/contents/:contentID/price -> contentAdmin.upsertPrice") + router.Put("/t/:tenantCode/v1/management/contents/:contentID/price"[len(r.Path()):], DataFunc4( r.contentAdmin.upsertPrice, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), @@ -128,8 +128,8 @@ func (r *Routes) Register(router fiber.Router) { Body[dto.ContentPriceUpsertForm]("form"), )) // Register routes for controller: ledgerAdmin - r.log.Debugf("Registering route: Get /t/:tenantCode/v1/admin/ledgers -> ledgerAdmin.adminLedgers") - router.Get("/t/:tenantCode/v1/admin/ledgers"[len(r.Path()):], DataFunc3( + r.log.Debugf("Registering route: Get /t/:tenantCode/v1/management/ledgers -> ledgerAdmin.adminLedgers") + router.Get("/t/:tenantCode/v1/management/ledgers"[len(r.Path()):], DataFunc3( r.ledgerAdmin.adminLedgers, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), @@ -157,37 +157,37 @@ func (r *Routes) Register(router fiber.Router) { Query[dto.MyLedgerListFilter]("filter"), )) // Register routes for controller: mediaAssetAdmin - r.log.Debugf("Registering route: Delete /t/:tenantCode/v1/admin/media_assets/:assetID -> mediaAssetAdmin.adminDelete") - router.Delete("/t/:tenantCode/v1/admin/media_assets/:assetID"[len(r.Path()):], DataFunc3( + r.log.Debugf("Registering route: Delete /t/:tenantCode/v1/management/media_assets/:assetID -> mediaAssetAdmin.adminDelete") + router.Delete("/t/:tenantCode/v1/management/media_assets/:assetID"[len(r.Path()):], DataFunc3( r.mediaAssetAdmin.adminDelete, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), PathParam[int64]("assetID"), )) - r.log.Debugf("Registering route: Get /t/:tenantCode/v1/admin/media_assets -> mediaAssetAdmin.adminList") - router.Get("/t/:tenantCode/v1/admin/media_assets"[len(r.Path()):], DataFunc3( + r.log.Debugf("Registering route: Get /t/:tenantCode/v1/management/media_assets -> mediaAssetAdmin.adminList") + router.Get("/t/:tenantCode/v1/management/media_assets"[len(r.Path()):], DataFunc3( r.mediaAssetAdmin.adminList, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), Query[dto.AdminMediaAssetListFilter]("filter"), )) - r.log.Debugf("Registering route: Get /t/:tenantCode/v1/admin/media_assets/:assetID -> mediaAssetAdmin.adminDetail") - router.Get("/t/:tenantCode/v1/admin/media_assets/:assetID"[len(r.Path()):], DataFunc3( + r.log.Debugf("Registering route: Get /t/:tenantCode/v1/management/media_assets/:assetID -> mediaAssetAdmin.adminDetail") + router.Get("/t/:tenantCode/v1/management/media_assets/:assetID"[len(r.Path()):], DataFunc3( r.mediaAssetAdmin.adminDetail, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), PathParam[int64]("assetID"), )) - r.log.Debugf("Registering route: Post /t/:tenantCode/v1/admin/media_assets/:assetID/upload_complete -> mediaAssetAdmin.uploadComplete") - router.Post("/t/:tenantCode/v1/admin/media_assets/:assetID/upload_complete"[len(r.Path()):], DataFunc4( + r.log.Debugf("Registering route: Post /t/:tenantCode/v1/management/media_assets/:assetID/upload_complete -> mediaAssetAdmin.uploadComplete") + router.Post("/t/:tenantCode/v1/management/media_assets/:assetID/upload_complete"[len(r.Path()):], DataFunc4( r.mediaAssetAdmin.uploadComplete, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), PathParam[int64]("assetID"), Body[dto.AdminMediaAssetUploadCompleteForm]("form"), )) - r.log.Debugf("Registering route: Post /t/:tenantCode/v1/admin/media_assets/upload_init -> mediaAssetAdmin.uploadInit") - router.Post("/t/:tenantCode/v1/admin/media_assets/upload_init"[len(r.Path()):], DataFunc3( + r.log.Debugf("Registering route: Post /t/:tenantCode/v1/management/media_assets/upload_init -> mediaAssetAdmin.uploadInit") + router.Post("/t/:tenantCode/v1/management/media_assets/upload_init"[len(r.Path()):], DataFunc3( r.mediaAssetAdmin.uploadInit, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), @@ -203,29 +203,29 @@ func (r *Routes) Register(router fiber.Router) { Body[dto.PurchaseContentForm]("form"), )) // Register routes for controller: orderAdmin - r.log.Debugf("Registering route: Get /t/:tenantCode/v1/admin/orders -> orderAdmin.adminOrderList") - router.Get("/t/:tenantCode/v1/admin/orders"[len(r.Path()):], DataFunc3( + r.log.Debugf("Registering route: Get /t/:tenantCode/v1/management/orders -> orderAdmin.adminOrderList") + router.Get("/t/:tenantCode/v1/management/orders"[len(r.Path()):], DataFunc3( r.orderAdmin.adminOrderList, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), Query[dto.AdminOrderListFilter]("filter"), )) - r.log.Debugf("Registering route: Get /t/:tenantCode/v1/admin/orders/:orderID -> orderAdmin.adminOrderDetail") - router.Get("/t/:tenantCode/v1/admin/orders/:orderID"[len(r.Path()):], DataFunc3( + r.log.Debugf("Registering route: Get /t/:tenantCode/v1/management/orders/:orderID -> orderAdmin.adminOrderDetail") + router.Get("/t/:tenantCode/v1/management/orders/:orderID"[len(r.Path()):], DataFunc3( r.orderAdmin.adminOrderDetail, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), PathParam[int64]("orderID"), )) - r.log.Debugf("Registering route: Get /t/:tenantCode/v1/admin/orders/export -> orderAdmin.adminOrderExport") - router.Get("/t/:tenantCode/v1/admin/orders/export"[len(r.Path()):], DataFunc3( + r.log.Debugf("Registering route: Get /t/:tenantCode/v1/management/orders/export -> orderAdmin.adminOrderExport") + router.Get("/t/:tenantCode/v1/management/orders/export"[len(r.Path()):], DataFunc3( r.orderAdmin.adminOrderExport, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), Query[dto.AdminOrderListFilter]("filter"), )) - r.log.Debugf("Registering route: Post /t/:tenantCode/v1/admin/orders/:orderID/refund -> orderAdmin.adminRefund") - router.Post("/t/:tenantCode/v1/admin/orders/:orderID/refund"[len(r.Path()):], DataFunc4( + r.log.Debugf("Registering route: Post /t/:tenantCode/v1/management/orders/:orderID/refund -> orderAdmin.adminRefund") + router.Post("/t/:tenantCode/v1/management/orders/:orderID/refund"[len(r.Path()):], DataFunc4( r.orderAdmin.adminRefund, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), @@ -248,46 +248,46 @@ func (r *Routes) Register(router fiber.Router) { PathParam[int64]("orderID"), )) // Register routes for controller: tenantInviteAdmin - r.log.Debugf("Registering route: Get /t/:tenantCode/v1/admin/invites -> tenantInviteAdmin.adminInviteList") - router.Get("/t/:tenantCode/v1/admin/invites"[len(r.Path()):], DataFunc3( + r.log.Debugf("Registering route: Get /t/:tenantCode/v1/management/invites -> tenantInviteAdmin.adminInviteList") + router.Get("/t/:tenantCode/v1/management/invites"[len(r.Path()):], DataFunc3( r.tenantInviteAdmin.adminInviteList, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), Query[dto.AdminTenantInviteListFilter]("filter"), )) - r.log.Debugf("Registering route: Patch /t/:tenantCode/v1/admin/invites/:inviteID/disable -> tenantInviteAdmin.adminDisableInvite") - router.Patch("/t/:tenantCode/v1/admin/invites/:inviteID/disable"[len(r.Path()):], DataFunc4( + r.log.Debugf("Registering route: Patch /t/:tenantCode/v1/management/invites/:inviteID/disable -> tenantInviteAdmin.adminDisableInvite") + router.Patch("/t/:tenantCode/v1/management/invites/:inviteID/disable"[len(r.Path()):], DataFunc4( r.tenantInviteAdmin.adminDisableInvite, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), PathParam[int64]("inviteID"), Body[dto.AdminTenantInviteDisableForm]("form"), )) - r.log.Debugf("Registering route: Post /t/:tenantCode/v1/admin/invites -> tenantInviteAdmin.adminCreateInvite") - router.Post("/t/:tenantCode/v1/admin/invites"[len(r.Path()):], DataFunc3( + r.log.Debugf("Registering route: Post /t/:tenantCode/v1/management/invites -> tenantInviteAdmin.adminCreateInvite") + router.Post("/t/:tenantCode/v1/management/invites"[len(r.Path()):], DataFunc3( r.tenantInviteAdmin.adminCreateInvite, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), Body[dto.AdminTenantInviteCreateForm]("form"), )) // Register routes for controller: tenantJoinAdmin - r.log.Debugf("Registering route: Get /t/:tenantCode/v1/admin/join-requests -> tenantJoinAdmin.adminJoinRequests") - router.Get("/t/:tenantCode/v1/admin/join-requests"[len(r.Path()):], DataFunc3( + r.log.Debugf("Registering route: Get /t/:tenantCode/v1/management/join-requests -> tenantJoinAdmin.adminJoinRequests") + router.Get("/t/:tenantCode/v1/management/join-requests"[len(r.Path()):], DataFunc3( r.tenantJoinAdmin.adminJoinRequests, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), Query[dto.AdminTenantJoinRequestListFilter]("filter"), )) - r.log.Debugf("Registering route: Post /t/:tenantCode/v1/admin/join-requests/:requestID/approve -> tenantJoinAdmin.adminApproveJoinRequest") - router.Post("/t/:tenantCode/v1/admin/join-requests/:requestID/approve"[len(r.Path()):], DataFunc4( + r.log.Debugf("Registering route: Post /t/:tenantCode/v1/management/join-requests/:requestID/approve -> tenantJoinAdmin.adminApproveJoinRequest") + router.Post("/t/:tenantCode/v1/management/join-requests/:requestID/approve"[len(r.Path()):], DataFunc4( r.tenantJoinAdmin.adminApproveJoinRequest, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), PathParam[int64]("requestID"), Body[dto.AdminTenantJoinRequestDecideForm]("form"), )) - r.log.Debugf("Registering route: Post /t/:tenantCode/v1/admin/join-requests/:requestID/reject -> tenantJoinAdmin.adminRejectJoinRequest") - router.Post("/t/:tenantCode/v1/admin/join-requests/:requestID/reject"[len(r.Path()):], DataFunc4( + r.log.Debugf("Registering route: Post /t/:tenantCode/v1/management/join-requests/:requestID/reject -> tenantJoinAdmin.adminRejectJoinRequest") + router.Post("/t/:tenantCode/v1/management/join-requests/:requestID/reject"[len(r.Path()):], DataFunc4( r.tenantJoinAdmin.adminRejectJoinRequest, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), @@ -295,30 +295,30 @@ func (r *Routes) Register(router fiber.Router) { Body[dto.AdminTenantJoinRequestDecideForm]("form"), )) // Register routes for controller: tenantUserAdmin - r.log.Debugf("Registering route: Delete /t/:tenantCode/v1/admin/users/:userID -> tenantUserAdmin.adminRemoveUser") - router.Delete("/t/:tenantCode/v1/admin/users/:userID"[len(r.Path()):], Func3( + r.log.Debugf("Registering route: Delete /t/:tenantCode/v1/management/users/:userID -> tenantUserAdmin.adminRemoveUser") + router.Delete("/t/:tenantCode/v1/management/users/:userID"[len(r.Path()):], Func3( r.tenantUserAdmin.adminRemoveUser, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), PathParam[int64]("userID"), )) - r.log.Debugf("Registering route: Get /t/:tenantCode/v1/admin/users -> tenantUserAdmin.adminTenantUsers") - router.Get("/t/:tenantCode/v1/admin/users"[len(r.Path()):], DataFunc3( + r.log.Debugf("Registering route: Get /t/:tenantCode/v1/management/users -> tenantUserAdmin.adminTenantUsers") + router.Get("/t/:tenantCode/v1/management/users"[len(r.Path()):], DataFunc3( r.tenantUserAdmin.adminTenantUsers, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), Query[dto.AdminTenantUserListFilter]("filter"), )) - r.log.Debugf("Registering route: Patch /t/:tenantCode/v1/admin/users/:userID/role -> tenantUserAdmin.adminSetUserRole") - router.Patch("/t/:tenantCode/v1/admin/users/:userID/role"[len(r.Path()):], DataFunc4( + r.log.Debugf("Registering route: Patch /t/:tenantCode/v1/management/users/:userID/role -> tenantUserAdmin.adminSetUserRole") + router.Patch("/t/:tenantCode/v1/management/users/:userID/role"[len(r.Path()):], DataFunc4( r.tenantUserAdmin.adminSetUserRole, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), PathParam[int64]("userID"), Body[dto.AdminTenantUserRoleUpdateForm]("form"), )) - r.log.Debugf("Registering route: Post /t/:tenantCode/v1/admin/users/:userID/join -> tenantUserAdmin.adminJoinUser") - router.Post("/t/:tenantCode/v1/admin/users/:userID/join"[len(r.Path()):], DataFunc3( + r.log.Debugf("Registering route: Post /t/:tenantCode/v1/management/users/:userID/join -> tenantUserAdmin.adminJoinUser") + router.Post("/t/:tenantCode/v1/management/users/:userID/join"[len(r.Path()):], DataFunc3( r.tenantUserAdmin.adminJoinUser, Local[*models.Tenant]("tenant"), Local[*models.TenantUser]("tenant_user"), diff --git a/backend/app/http/tenant/tenant_invite_admin.go b/backend/app/http/tenant/tenant_invite_admin.go index 4dbf56c..b273122 100644 --- a/backend/app/http/tenant/tenant_invite_admin.go +++ b/backend/app/http/tenant/tenant_invite_admin.go @@ -28,7 +28,7 @@ type tenantInviteAdmin struct{} // @Param form body dto.AdminTenantInviteCreateForm true "Form" // @Success 200 {object} models.TenantInvite // -// @Router /t/:tenantCode/v1/admin/invites [post] +// @Router /t/:tenantCode/v1/management/invites [post] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind form body @@ -63,7 +63,7 @@ func (*tenantInviteAdmin) adminCreateInvite( // @Param filter query dto.AdminTenantInviteListFilter true "Filter" // @Success 200 {object} requests.Pager{items=models.TenantInvite} // -// @Router /t/:tenantCode/v1/admin/invites [get] +// @Router /t/:tenantCode/v1/management/invites [get] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind filter query @@ -101,7 +101,7 @@ func (*tenantInviteAdmin) adminInviteList( // @Param form body dto.AdminTenantInviteDisableForm true "Form" // @Success 200 {object} models.TenantInvite // -// @Router /t/:tenantCode/v1/admin/invites/:inviteID/disable [patch] +// @Router /t/:tenantCode/v1/management/invites/:inviteID/disable [patch] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind inviteID path diff --git a/backend/app/http/tenant/tenant_join_admin.go b/backend/app/http/tenant/tenant_join_admin.go index a8ac766..fba82f7 100644 --- a/backend/app/http/tenant/tenant_join_admin.go +++ b/backend/app/http/tenant/tenant_join_admin.go @@ -28,7 +28,7 @@ type tenantJoinAdmin struct{} // @Param filter query dto.AdminTenantJoinRequestListFilter true "Filter" // @Success 200 {object} requests.Pager{items=models.TenantJoinRequest} // -// @Router /t/:tenantCode/v1/admin/join-requests [get] +// @Router /t/:tenantCode/v1/management/join-requests [get] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind filter query @@ -66,7 +66,7 @@ func (*tenantJoinAdmin) adminJoinRequests( // @Param form body dto.AdminTenantJoinRequestDecideForm true "Form" // @Success 200 {object} models.TenantJoinRequest // -// @Router /t/:tenantCode/v1/admin/join-requests/:requestID/approve [post] +// @Router /t/:tenantCode/v1/management/join-requests/:requestID/approve [post] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind requestID path @@ -109,7 +109,7 @@ func (*tenantJoinAdmin) adminApproveJoinRequest( // @Param form body dto.AdminTenantJoinRequestDecideForm true "Form" // @Success 200 {object} models.TenantJoinRequest // -// @Router /t/:tenantCode/v1/admin/join-requests/:requestID/reject [post] +// @Router /t/:tenantCode/v1/management/join-requests/:requestID/reject [post] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind requestID path diff --git a/backend/app/http/tenant/tenant_user_admin.go b/backend/app/http/tenant/tenant_user_admin.go index fcb3966..4872a33 100644 --- a/backend/app/http/tenant/tenant_user_admin.go +++ b/backend/app/http/tenant/tenant_user_admin.go @@ -29,7 +29,7 @@ type tenantUserAdmin struct{} // @Param userID path int64 true "UserID" // @Success 200 {object} requests.Pager // -// @Router /t/:tenantCode/v1/admin/users/:userID [delete] +// @Router /t/:tenantCode/v1/management/users/:userID [delete] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind userID path @@ -67,7 +67,7 @@ func (*tenantUserAdmin) adminRemoveUser( // @Param userID path int64 true "UserID" // @Success 200 {object} dto.AdminTenantUserJoinResponse // -// @Router /t/:tenantCode/v1/admin/users/:userID/join [post] +// @Router /t/:tenantCode/v1/management/users/:userID/join [post] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind userID path @@ -114,7 +114,7 @@ func (*tenantUserAdmin) adminJoinUser( // @Param form body dto.AdminTenantUserRoleUpdateForm true "Form" // @Success 200 {object} dto.AdminTenantUserJoinResponse // -// @Router /t/:tenantCode/v1/admin/users/:userID/role [patch] +// @Router /t/:tenantCode/v1/management/users/:userID/role [patch] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind userID path @@ -176,7 +176,7 @@ func (*tenantUserAdmin) adminSetUserRole( // @Param filter query dto.AdminTenantUserListFilter true "Filter" // @Success 200 {object} requests.Pager{items=dto.AdminTenantUserItem} // -// @Router /t/:tenantCode/v1/admin/users [get] +// @Router /t/:tenantCode/v1/management/users [get] // @Bind tenant local key(tenant) // @Bind tenantUser local key(tenant_user) // @Bind filter query diff --git a/backend/docs/docs.go b/backend/docs/docs.go index 24525da..70ce036 100644 --- a/backend/docs/docs.go +++ b/backend/docs/docs.go @@ -1428,1716 +1428,6 @@ const docTemplate = `{ } } }, - "/t/{tenantCode}/v1/admin/contents": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "内容列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "string", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "integer", - "name": "id", - "in": "query" - }, - { - "type": "string", - "name": "keyword", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "type": "string", - "name": "published_at_from", - "in": "query" - }, - { - "type": "string", - "name": "published_at_to", - "in": "query" - }, - { - "enum": [ - "draft", - "reviewing", - "published", - "unpublished", - "blocked" - ], - "type": "string", - "x-enum-varnames": [ - "ContentStatusDraft", - "ContentStatusReviewing", - "ContentStatusPublished", - "ContentStatusUnpublished", - "ContentStatusBlocked" - ], - "name": "status", - "in": "query" - }, - { - "type": "integer", - "name": "user_id", - "in": "query" - }, - { - "enum": [ - "public", - "tenant_only", - "private" - ], - "type": "string", - "x-enum-varnames": [ - "ContentVisibilityPublic", - "ContentVisibilityTenantOnly", - "ContentVisibilityPrivate" - ], - "name": "visibility", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/dto.AdminContentItem" - } - } - } - ] - } - } - } - }, - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "创建内容(草稿)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.ContentCreateForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.Content" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/contents/publish": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "内容发布(创建+绑定资源+定价)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.ContentPublishForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.ContentPublishResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/contents/{contentID}": { - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "更新内容(标题/描述/状态等)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "ContentID", - "name": "contentID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.ContentUpdateForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.Content" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/contents/{contentID}/assets": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "绑定媒体资源到内容(main/cover/preview)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "ContentID", - "name": "contentID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.ContentAssetAttachForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.ContentAsset" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/contents/{contentID}/price": { - "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "设置内容价格与折扣", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "ContentID", - "name": "contentID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.ContentPriceUpsertForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.ContentPrice" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/invites": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "邀请码列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Code 按邀请码模糊过滤(可选):支持部分匹配(like)。", - "name": "code", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "enum": [ - "active", - "disabled", - "expired" - ], - "type": "string", - "x-enum-varnames": [ - "TenantInviteStatusActive", - "TenantInviteStatusDisabled", - "TenantInviteStatusExpired" - ], - "description": "Status 按状态过滤(可选):active/disabled/expired。", - "name": "status", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/models.TenantInvite" - } - } - } - ] - } - } - } - }, - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "创建邀请码(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminTenantInviteCreateForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.TenantInvite" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/invites/{inviteID}/disable": { - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "禁用邀请码(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "InviteID", - "name": "inviteID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminTenantInviteDisableForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.TenantInvite" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/join-requests": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "加入申请列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "enum": [ - "pending", - "approved", - "rejected" - ], - "type": "string", - "x-enum-varnames": [ - "TenantJoinRequestStatusPending", - "TenantJoinRequestStatusApproved", - "TenantJoinRequestStatusRejected" - ], - "description": "Status 按申请状态过滤(可选):pending/approved/rejected。", - "name": "status", - "in": "query" - }, - { - "type": "integer", - "description": "UserID 按申请人用户ID过滤(可选)。", - "name": "user_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/models.TenantJoinRequest" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/join-requests/{requestID}/approve": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "通过加入申请(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "RequestID", - "name": "requestID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminTenantJoinRequestDecideForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.TenantJoinRequest" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/join-requests/{requestID}/reject": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "拒绝加入申请(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "RequestID", - "name": "requestID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminTenantJoinRequestDecideForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.TenantJoinRequest" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/ledgers": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "余额流水列表(租户管理/审计)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "BizRefID 按业务引用ID过滤(可选)。", - "name": "biz_ref_id", - "in": "query" - }, - { - "type": "string", - "description": "BizRefType 按业务引用类型过滤(可选)。\n约定:当前业务写入为 \"order\";未来可扩展为 refund 等。", - "name": "biz_ref_type", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtFrom 创建时间起(可选)。", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtTo 创建时间止(可选)。", - "name": "created_at_to", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "OperatorUserID 按操作者用户ID过滤(可选)。\n典型场景:后台检索“某个管理员发起的退款/调账”等敏感操作流水。", - "name": "operator_user_id", - "in": "query" - }, - { - "type": "integer", - "description": "OrderID 按关联订单过滤(可选)。", - "name": "order_id", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "enum": [ - "debit_purchase", - "credit_refund", - "freeze", - "unfreeze", - "adjustment" - ], - "type": "string", - "x-enum-varnames": [ - "TenantLedgerTypeDebitPurchase", - "TenantLedgerTypeCreditRefund", - "TenantLedgerTypeFreeze", - "TenantLedgerTypeUnfreeze", - "TenantLedgerTypeAdjustment" - ], - "description": "Type 按流水类型过滤(可选)。", - "name": "type", - "in": "query" - }, - { - "type": "integer", - "description": "UserID 按余额账户归属用户ID过滤(可选)。\n典型场景:查看某个租户成员的资金变化全链路。", - "name": "user_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/dto.AdminLedgerItem" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/media_assets": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "媒体资源列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtFrom filters assets by created_at \u003e= this time; optional.", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtTo filters assets by created_at \u003c= this time; optional.", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "enum": [ - "uploaded", - "processing", - "ready", - "failed", - "deleted" - ], - "type": "string", - "x-enum-varnames": [ - "MediaAssetStatusUploaded", - "MediaAssetStatusProcessing", - "MediaAssetStatusReady", - "MediaAssetStatusFailed", - "MediaAssetStatusDeleted" - ], - "description": "Status filters by processing status (uploaded/processing/ready/failed/deleted); optional.", - "name": "status", - "in": "query" - }, - { - "enum": [ - "video", - "audio", - "image" - ], - "type": "string", - "x-enum-varnames": [ - "MediaAssetTypeVideo", - "MediaAssetTypeAudio", - "MediaAssetTypeImage" - ], - "description": "Type filters by media type (video/audio/image); optional.", - "name": "type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/models.MediaAsset" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/media_assets/upload_init": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "初始化媒体资源上传(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminMediaAssetUploadInitForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.AdminMediaAssetUploadInitResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/media_assets/{assetID}": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "媒体资源详情(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "AssetID", - "name": "assetID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.MediaAsset" - } - } - } - }, - "delete": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "删除媒体资源(租户管理,软删)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "AssetID", - "name": "assetID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.MediaAsset" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/media_assets/{assetID}/upload_complete": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "确认上传完成并进入处理(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "AssetID", - "name": "assetID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.AdminMediaAssetUploadCompleteForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.MediaAsset" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/orders": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "订单列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "AmountPaidMax 实付金额上限(可选):amount_paid \u003c= 该值(单位分)。", - "name": "amount_paid_max", - "in": "query" - }, - { - "type": "integer", - "description": "AmountPaidMin 实付金额下限(可选):amount_paid \u003e= 该值(单位分)。", - "name": "amount_paid_min", - "in": "query" - }, - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "integer", - "description": "ContentID 内容ID(可选):通过 order_items 关联过滤。", - "name": "content_id", - "in": "query" - }, - { - "type": "string", - "description": "ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。", - "name": "content_title", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtFrom 创建时间起(可选):created_at \u003e= 该时间(用于按创建时间筛选)。", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtTo 创建时间止(可选):created_at \u003c= 该时间(用于按创建时间筛选)。", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "type": "string", - "description": "PaidAtFrom 支付时间起(可选):paid_at \u003e= 该时间(用于按支付时间筛选)。", - "name": "paid_at_from", - "in": "query" - }, - { - "type": "string", - "description": "PaidAtTo 支付时间止(可选):paid_at \u003c= 该时间(用于按支付时间筛选)。", - "name": "paid_at_to", - "in": "query" - }, - { - "enum": [ - "created", - "paid", - "refunding", - "refunded", - "canceled", - "failed" - ], - "type": "string", - "x-enum-varnames": [ - "OrderStatusCreated", - "OrderStatusPaid", - "OrderStatusRefunding", - "OrderStatusRefunded", - "OrderStatusCanceled", - "OrderStatusFailed" - ], - "description": "Status 订单状态(可选):created/paid/refunding/refunded/canceled/failed。", - "name": "status", - "in": "query" - }, - { - "enum": [ - "content_purchase" - ], - "type": "string", - "x-enum-varnames": [ - "OrderTypeContentPurchase" - ], - "description": "Type 订单类型(可选):content_purchase 等。", - "name": "type", - "in": "query" - }, - { - "type": "integer", - "description": "UserID 下单用户ID(可选):按买家用户ID精确过滤。", - "name": "user_id", - "in": "query" - }, - { - "type": "string", - "description": "Username 下单用户用户名关键字(可选):模糊匹配 users.username(like)。", - "name": "username", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/models.Order" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/orders/export": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "订单导出(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "AmountPaidMax 实付金额上限(可选):amount_paid \u003c= 该值(单位分)。", - "name": "amount_paid_max", - "in": "query" - }, - { - "type": "integer", - "description": "AmountPaidMin 实付金额下限(可选):amount_paid \u003e= 该值(单位分)。", - "name": "amount_paid_min", - "in": "query" - }, - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "integer", - "description": "ContentID 内容ID(可选):通过 order_items 关联过滤。", - "name": "content_id", - "in": "query" - }, - { - "type": "string", - "description": "ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。", - "name": "content_title", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtFrom 创建时间起(可选):created_at \u003e= 该时间(用于按创建时间筛选)。", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtTo 创建时间止(可选):created_at \u003c= 该时间(用于按创建时间筛选)。", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "type": "string", - "description": "PaidAtFrom 支付时间起(可选):paid_at \u003e= 该时间(用于按支付时间筛选)。", - "name": "paid_at_from", - "in": "query" - }, - { - "type": "string", - "description": "PaidAtTo 支付时间止(可选):paid_at \u003c= 该时间(用于按支付时间筛选)。", - "name": "paid_at_to", - "in": "query" - }, - { - "enum": [ - "created", - "paid", - "refunding", - "refunded", - "canceled", - "failed" - ], - "type": "string", - "x-enum-varnames": [ - "OrderStatusCreated", - "OrderStatusPaid", - "OrderStatusRefunding", - "OrderStatusRefunded", - "OrderStatusCanceled", - "OrderStatusFailed" - ], - "description": "Status 订单状态(可选):created/paid/refunding/refunded/canceled/failed。", - "name": "status", - "in": "query" - }, - { - "enum": [ - "content_purchase" - ], - "type": "string", - "x-enum-varnames": [ - "OrderTypeContentPurchase" - ], - "description": "Type 订单类型(可选):content_purchase 等。", - "name": "type", - "in": "query" - }, - { - "type": "integer", - "description": "UserID 下单用户ID(可选):按买家用户ID精确过滤。", - "name": "user_id", - "in": "query" - }, - { - "type": "string", - "description": "Username 下单用户用户名关键字(可选):模糊匹配 users.username(like)。", - "name": "username", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.AdminOrderExportResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/orders/{orderID}": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "订单详情(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "OrderID", - "name": "orderID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.AdminOrderDetail" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/orders/{orderID}/refund": { - "post": { - "description": "该接口只负责将订单从 paid 推进到 refunding,并提交异步退款任务;退款入账与权益回收由 worker 异步完成。\n重复请求幂等:订单处于 refunding/refunded 时会返回当前订单状态,不会重复入账/重复回收权益。", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "订单退款(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "OrderID", - "name": "orderID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminOrderRefundForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.Order" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/users": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "成员列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "enum": [ - "member", - "tenant_admin" - ], - "type": "string", - "x-enum-varnames": [ - "TenantUserRoleMember", - "TenantUserRoleTenantAdmin" - ], - "description": "Role 按角色过滤(可选):member/tenant_admin。", - "name": "role", - "in": "query" - }, - { - "enum": [ - "pending_verify", - "verified", - "banned" - ], - "type": "string", - "x-enum-varnames": [ - "UserStatusPendingVerify", - "UserStatusVerified", - "UserStatusBanned" - ], - "description": "Status 按成员状态过滤(可选):pending_verify/verified/banned。", - "name": "status", - "in": "query" - }, - { - "type": "integer", - "description": "UserID 按用户ID过滤(可选)。", - "name": "user_id", - "in": "query" - }, - { - "type": "string", - "description": "Username 按用户名模糊查询(可选,支持包含匹配)。", - "name": "username", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/dto.AdminTenantUserItem" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/users/{userID}": { - "delete": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "移除租户成员(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "UserID", - "name": "userID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/requests.Pager" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/users/{userID}/join": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "添加租户成员(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "UserID", - "name": "userID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.AdminTenantUserJoinResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/users/{userID}/role": { - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "设置成员角色(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "UserID", - "name": "userID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminTenantUserRoleUpdateForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.AdminTenantUserJoinResponse" - } - } - } - } - }, "/t/{tenantCode}/v1/contents": { "get": { "consumes": [ @@ -3444,6 +1734,1716 @@ const docTemplate = `{ } } }, + "/t/{tenantCode}/v1/management/contents": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "内容列表(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Asc specifies comma-separated field names to sort ascending by.", + "name": "asc", + "in": "query" + }, + { + "type": "string", + "name": "created_at_from", + "in": "query" + }, + { + "type": "string", + "name": "created_at_to", + "in": "query" + }, + { + "type": "string", + "description": "Desc specifies comma-separated field names to sort descending by.", + "name": "desc", + "in": "query" + }, + { + "type": "integer", + "name": "id", + "in": "query" + }, + { + "type": "string", + "name": "keyword", + "in": "query" + }, + { + "type": "integer", + "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "name": "page", + "in": "query" + }, + { + "type": "string", + "name": "published_at_from", + "in": "query" + }, + { + "type": "string", + "name": "published_at_to", + "in": "query" + }, + { + "enum": [ + "draft", + "reviewing", + "published", + "unpublished", + "blocked" + ], + "type": "string", + "x-enum-varnames": [ + "ContentStatusDraft", + "ContentStatusReviewing", + "ContentStatusPublished", + "ContentStatusUnpublished", + "ContentStatusBlocked" + ], + "name": "status", + "in": "query" + }, + { + "type": "integer", + "name": "user_id", + "in": "query" + }, + { + "enum": [ + "public", + "tenant_only", + "private" + ], + "type": "string", + "x-enum-varnames": [ + "ContentVisibilityPublic", + "ContentVisibilityTenantOnly", + "ContentVisibilityPrivate" + ], + "name": "visibility", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/requests.Pager" + }, + { + "type": "object", + "properties": { + "items": { + "$ref": "#/definitions/dto.AdminContentItem" + } + } + } + ] + } + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "创建内容(草稿)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ContentCreateForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Content" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/contents/publish": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "内容发布(创建+绑定资源+定价)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ContentPublishForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.ContentPublishResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/contents/{contentID}": { + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "更新内容(标题/描述/状态等)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "ContentID", + "name": "contentID", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ContentUpdateForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Content" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/contents/{contentID}/assets": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "绑定媒体资源到内容(main/cover/preview)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "ContentID", + "name": "contentID", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ContentAssetAttachForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.ContentAsset" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/contents/{contentID}/price": { + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "设置内容价格与折扣", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "ContentID", + "name": "contentID", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ContentPriceUpsertForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.ContentPrice" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/invites": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "邀请码列表(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Code 按邀请码模糊过滤(可选):支持部分匹配(like)。", + "name": "code", + "in": "query" + }, + { + "type": "integer", + "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "name": "page", + "in": "query" + }, + { + "enum": [ + "active", + "disabled", + "expired" + ], + "type": "string", + "x-enum-varnames": [ + "TenantInviteStatusActive", + "TenantInviteStatusDisabled", + "TenantInviteStatusExpired" + ], + "description": "Status 按状态过滤(可选):active/disabled/expired。", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/requests.Pager" + }, + { + "type": "object", + "properties": { + "items": { + "$ref": "#/definitions/models.TenantInvite" + } + } + } + ] + } + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "创建邀请码(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AdminTenantInviteCreateForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.TenantInvite" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/invites/{inviteID}/disable": { + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "禁用邀请码(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "InviteID", + "name": "inviteID", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AdminTenantInviteDisableForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.TenantInvite" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/join-requests": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "加入申请列表(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "name": "page", + "in": "query" + }, + { + "enum": [ + "pending", + "approved", + "rejected" + ], + "type": "string", + "x-enum-varnames": [ + "TenantJoinRequestStatusPending", + "TenantJoinRequestStatusApproved", + "TenantJoinRequestStatusRejected" + ], + "description": "Status 按申请状态过滤(可选):pending/approved/rejected。", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "UserID 按申请人用户ID过滤(可选)。", + "name": "user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/requests.Pager" + }, + { + "type": "object", + "properties": { + "items": { + "$ref": "#/definitions/models.TenantJoinRequest" + } + } + } + ] + } + } + } + } + }, + "/t/{tenantCode}/v1/management/join-requests/{requestID}/approve": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "通过加入申请(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "RequestID", + "name": "requestID", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AdminTenantJoinRequestDecideForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.TenantJoinRequest" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/join-requests/{requestID}/reject": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "拒绝加入申请(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "RequestID", + "name": "requestID", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AdminTenantJoinRequestDecideForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.TenantJoinRequest" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/ledgers": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "余额流水列表(租户管理/审计)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "BizRefID 按业务引用ID过滤(可选)。", + "name": "biz_ref_id", + "in": "query" + }, + { + "type": "string", + "description": "BizRefType 按业务引用类型过滤(可选)。\n约定:当前业务写入为 \"order\";未来可扩展为 refund 等。", + "name": "biz_ref_type", + "in": "query" + }, + { + "type": "string", + "description": "CreatedAtFrom 创建时间起(可选)。", + "name": "created_at_from", + "in": "query" + }, + { + "type": "string", + "description": "CreatedAtTo 创建时间止(可选)。", + "name": "created_at_to", + "in": "query" + }, + { + "type": "integer", + "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "OperatorUserID 按操作者用户ID过滤(可选)。\n典型场景:后台检索“某个管理员发起的退款/调账”等敏感操作流水。", + "name": "operator_user_id", + "in": "query" + }, + { + "type": "integer", + "description": "OrderID 按关联订单过滤(可选)。", + "name": "order_id", + "in": "query" + }, + { + "type": "integer", + "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "name": "page", + "in": "query" + }, + { + "enum": [ + "debit_purchase", + "credit_refund", + "freeze", + "unfreeze", + "adjustment" + ], + "type": "string", + "x-enum-varnames": [ + "TenantLedgerTypeDebitPurchase", + "TenantLedgerTypeCreditRefund", + "TenantLedgerTypeFreeze", + "TenantLedgerTypeUnfreeze", + "TenantLedgerTypeAdjustment" + ], + "description": "Type 按流水类型过滤(可选)。", + "name": "type", + "in": "query" + }, + { + "type": "integer", + "description": "UserID 按余额账户归属用户ID过滤(可选)。\n典型场景:查看某个租户成员的资金变化全链路。", + "name": "user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/requests.Pager" + }, + { + "type": "object", + "properties": { + "items": { + "$ref": "#/definitions/dto.AdminLedgerItem" + } + } + } + ] + } + } + } + } + }, + "/t/{tenantCode}/v1/management/media_assets": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "媒体资源列表(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Asc specifies comma-separated field names to sort ascending by.", + "name": "asc", + "in": "query" + }, + { + "type": "string", + "description": "CreatedAtFrom filters assets by created_at \u003e= this time; optional.", + "name": "created_at_from", + "in": "query" + }, + { + "type": "string", + "description": "CreatedAtTo filters assets by created_at \u003c= this time; optional.", + "name": "created_at_to", + "in": "query" + }, + { + "type": "string", + "description": "Desc specifies comma-separated field names to sort descending by.", + "name": "desc", + "in": "query" + }, + { + "type": "integer", + "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "name": "page", + "in": "query" + }, + { + "enum": [ + "uploaded", + "processing", + "ready", + "failed", + "deleted" + ], + "type": "string", + "x-enum-varnames": [ + "MediaAssetStatusUploaded", + "MediaAssetStatusProcessing", + "MediaAssetStatusReady", + "MediaAssetStatusFailed", + "MediaAssetStatusDeleted" + ], + "description": "Status filters by processing status (uploaded/processing/ready/failed/deleted); optional.", + "name": "status", + "in": "query" + }, + { + "enum": [ + "video", + "audio", + "image" + ], + "type": "string", + "x-enum-varnames": [ + "MediaAssetTypeVideo", + "MediaAssetTypeAudio", + "MediaAssetTypeImage" + ], + "description": "Type filters by media type (video/audio/image); optional.", + "name": "type", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/requests.Pager" + }, + { + "type": "object", + "properties": { + "items": { + "$ref": "#/definitions/models.MediaAsset" + } + } + } + ] + } + } + } + } + }, + "/t/{tenantCode}/v1/management/media_assets/upload_init": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "初始化媒体资源上传(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AdminMediaAssetUploadInitForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.AdminMediaAssetUploadInitResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/media_assets/{assetID}": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "媒体资源详情(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "AssetID", + "name": "assetID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.MediaAsset" + } + } + } + }, + "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "删除媒体资源(租户管理,软删)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "AssetID", + "name": "assetID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.MediaAsset" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/media_assets/{assetID}/upload_complete": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "确认上传完成并进入处理(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "AssetID", + "name": "assetID", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "schema": { + "$ref": "#/definitions/dto.AdminMediaAssetUploadCompleteForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.MediaAsset" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/orders": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "订单列表(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "AmountPaidMax 实付金额上限(可选):amount_paid \u003c= 该值(单位分)。", + "name": "amount_paid_max", + "in": "query" + }, + { + "type": "integer", + "description": "AmountPaidMin 实付金额下限(可选):amount_paid \u003e= 该值(单位分)。", + "name": "amount_paid_min", + "in": "query" + }, + { + "type": "string", + "description": "Asc specifies comma-separated field names to sort ascending by.", + "name": "asc", + "in": "query" + }, + { + "type": "integer", + "description": "ContentID 内容ID(可选):通过 order_items 关联过滤。", + "name": "content_id", + "in": "query" + }, + { + "type": "string", + "description": "ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。", + "name": "content_title", + "in": "query" + }, + { + "type": "string", + "description": "CreatedAtFrom 创建时间起(可选):created_at \u003e= 该时间(用于按创建时间筛选)。", + "name": "created_at_from", + "in": "query" + }, + { + "type": "string", + "description": "CreatedAtTo 创建时间止(可选):created_at \u003c= 该时间(用于按创建时间筛选)。", + "name": "created_at_to", + "in": "query" + }, + { + "type": "string", + "description": "Desc specifies comma-separated field names to sort descending by.", + "name": "desc", + "in": "query" + }, + { + "type": "integer", + "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "name": "page", + "in": "query" + }, + { + "type": "string", + "description": "PaidAtFrom 支付时间起(可选):paid_at \u003e= 该时间(用于按支付时间筛选)。", + "name": "paid_at_from", + "in": "query" + }, + { + "type": "string", + "description": "PaidAtTo 支付时间止(可选):paid_at \u003c= 该时间(用于按支付时间筛选)。", + "name": "paid_at_to", + "in": "query" + }, + { + "enum": [ + "created", + "paid", + "refunding", + "refunded", + "canceled", + "failed" + ], + "type": "string", + "x-enum-varnames": [ + "OrderStatusCreated", + "OrderStatusPaid", + "OrderStatusRefunding", + "OrderStatusRefunded", + "OrderStatusCanceled", + "OrderStatusFailed" + ], + "description": "Status 订单状态(可选):created/paid/refunding/refunded/canceled/failed。", + "name": "status", + "in": "query" + }, + { + "enum": [ + "content_purchase" + ], + "type": "string", + "x-enum-varnames": [ + "OrderTypeContentPurchase" + ], + "description": "Type 订单类型(可选):content_purchase 等。", + "name": "type", + "in": "query" + }, + { + "type": "integer", + "description": "UserID 下单用户ID(可选):按买家用户ID精确过滤。", + "name": "user_id", + "in": "query" + }, + { + "type": "string", + "description": "Username 下单用户用户名关键字(可选):模糊匹配 users.username(like)。", + "name": "username", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/requests.Pager" + }, + { + "type": "object", + "properties": { + "items": { + "$ref": "#/definitions/models.Order" + } + } + } + ] + } + } + } + } + }, + "/t/{tenantCode}/v1/management/orders/export": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "订单导出(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "AmountPaidMax 实付金额上限(可选):amount_paid \u003c= 该值(单位分)。", + "name": "amount_paid_max", + "in": "query" + }, + { + "type": "integer", + "description": "AmountPaidMin 实付金额下限(可选):amount_paid \u003e= 该值(单位分)。", + "name": "amount_paid_min", + "in": "query" + }, + { + "type": "string", + "description": "Asc specifies comma-separated field names to sort ascending by.", + "name": "asc", + "in": "query" + }, + { + "type": "integer", + "description": "ContentID 内容ID(可选):通过 order_items 关联过滤。", + "name": "content_id", + "in": "query" + }, + { + "type": "string", + "description": "ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。", + "name": "content_title", + "in": "query" + }, + { + "type": "string", + "description": "CreatedAtFrom 创建时间起(可选):created_at \u003e= 该时间(用于按创建时间筛选)。", + "name": "created_at_from", + "in": "query" + }, + { + "type": "string", + "description": "CreatedAtTo 创建时间止(可选):created_at \u003c= 该时间(用于按创建时间筛选)。", + "name": "created_at_to", + "in": "query" + }, + { + "type": "string", + "description": "Desc specifies comma-separated field names to sort descending by.", + "name": "desc", + "in": "query" + }, + { + "type": "integer", + "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "name": "page", + "in": "query" + }, + { + "type": "string", + "description": "PaidAtFrom 支付时间起(可选):paid_at \u003e= 该时间(用于按支付时间筛选)。", + "name": "paid_at_from", + "in": "query" + }, + { + "type": "string", + "description": "PaidAtTo 支付时间止(可选):paid_at \u003c= 该时间(用于按支付时间筛选)。", + "name": "paid_at_to", + "in": "query" + }, + { + "enum": [ + "created", + "paid", + "refunding", + "refunded", + "canceled", + "failed" + ], + "type": "string", + "x-enum-varnames": [ + "OrderStatusCreated", + "OrderStatusPaid", + "OrderStatusRefunding", + "OrderStatusRefunded", + "OrderStatusCanceled", + "OrderStatusFailed" + ], + "description": "Status 订单状态(可选):created/paid/refunding/refunded/canceled/failed。", + "name": "status", + "in": "query" + }, + { + "enum": [ + "content_purchase" + ], + "type": "string", + "x-enum-varnames": [ + "OrderTypeContentPurchase" + ], + "description": "Type 订单类型(可选):content_purchase 等。", + "name": "type", + "in": "query" + }, + { + "type": "integer", + "description": "UserID 下单用户ID(可选):按买家用户ID精确过滤。", + "name": "user_id", + "in": "query" + }, + { + "type": "string", + "description": "Username 下单用户用户名关键字(可选):模糊匹配 users.username(like)。", + "name": "username", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.AdminOrderExportResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/orders/{orderID}": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "订单详情(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "OrderID", + "name": "orderID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.AdminOrderDetail" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/orders/{orderID}/refund": { + "post": { + "description": "该接口只负责将订单从 paid 推进到 refunding,并提交异步退款任务;退款入账与权益回收由 worker 异步完成。\n重复请求幂等:订单处于 refunding/refunded 时会返回当前订单状态,不会重复入账/重复回收权益。", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "订单退款(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "OrderID", + "name": "orderID", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AdminOrderRefundForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Order" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/users": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "成员列表(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "name": "page", + "in": "query" + }, + { + "enum": [ + "member", + "tenant_admin" + ], + "type": "string", + "x-enum-varnames": [ + "TenantUserRoleMember", + "TenantUserRoleTenantAdmin" + ], + "description": "Role 按角色过滤(可选):member/tenant_admin。", + "name": "role", + "in": "query" + }, + { + "enum": [ + "pending_verify", + "verified", + "banned" + ], + "type": "string", + "x-enum-varnames": [ + "UserStatusPendingVerify", + "UserStatusVerified", + "UserStatusBanned" + ], + "description": "Status 按成员状态过滤(可选):pending_verify/verified/banned。", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "UserID 按用户ID过滤(可选)。", + "name": "user_id", + "in": "query" + }, + { + "type": "string", + "description": "Username 按用户名模糊查询(可选,支持包含匹配)。", + "name": "username", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/requests.Pager" + }, + { + "type": "object", + "properties": { + "items": { + "$ref": "#/definitions/dto.AdminTenantUserItem" + } + } + } + ] + } + } + } + } + }, + "/t/{tenantCode}/v1/management/users/{userID}": { + "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "移除租户成员(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "UserID", + "name": "userID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/requests.Pager" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/users/{userID}/join": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "添加租户成员(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "UserID", + "name": "userID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.AdminTenantUserJoinResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/users/{userID}/role": { + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "设置成员角色(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "UserID", + "name": "userID", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AdminTenantUserRoleUpdateForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.AdminTenantUserJoinResponse" + } + } + } + } + }, "/t/{tenantCode}/v1/me": { "get": { "consumes": [ diff --git a/backend/docs/swagger.json b/backend/docs/swagger.json index 39b5063..f234228 100644 --- a/backend/docs/swagger.json +++ b/backend/docs/swagger.json @@ -1422,1716 +1422,6 @@ } } }, - "/t/{tenantCode}/v1/admin/contents": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "内容列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "string", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "integer", - "name": "id", - "in": "query" - }, - { - "type": "string", - "name": "keyword", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "type": "string", - "name": "published_at_from", - "in": "query" - }, - { - "type": "string", - "name": "published_at_to", - "in": "query" - }, - { - "enum": [ - "draft", - "reviewing", - "published", - "unpublished", - "blocked" - ], - "type": "string", - "x-enum-varnames": [ - "ContentStatusDraft", - "ContentStatusReviewing", - "ContentStatusPublished", - "ContentStatusUnpublished", - "ContentStatusBlocked" - ], - "name": "status", - "in": "query" - }, - { - "type": "integer", - "name": "user_id", - "in": "query" - }, - { - "enum": [ - "public", - "tenant_only", - "private" - ], - "type": "string", - "x-enum-varnames": [ - "ContentVisibilityPublic", - "ContentVisibilityTenantOnly", - "ContentVisibilityPrivate" - ], - "name": "visibility", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/dto.AdminContentItem" - } - } - } - ] - } - } - } - }, - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "创建内容(草稿)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.ContentCreateForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.Content" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/contents/publish": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "内容发布(创建+绑定资源+定价)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.ContentPublishForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.ContentPublishResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/contents/{contentID}": { - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "更新内容(标题/描述/状态等)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "ContentID", - "name": "contentID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.ContentUpdateForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.Content" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/contents/{contentID}/assets": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "绑定媒体资源到内容(main/cover/preview)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "ContentID", - "name": "contentID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.ContentAssetAttachForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.ContentAsset" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/contents/{contentID}/price": { - "put": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "设置内容价格与折扣", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "ContentID", - "name": "contentID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.ContentPriceUpsertForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.ContentPrice" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/invites": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "邀请码列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Code 按邀请码模糊过滤(可选):支持部分匹配(like)。", - "name": "code", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "enum": [ - "active", - "disabled", - "expired" - ], - "type": "string", - "x-enum-varnames": [ - "TenantInviteStatusActive", - "TenantInviteStatusDisabled", - "TenantInviteStatusExpired" - ], - "description": "Status 按状态过滤(可选):active/disabled/expired。", - "name": "status", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/models.TenantInvite" - } - } - } - ] - } - } - } - }, - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "创建邀请码(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminTenantInviteCreateForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.TenantInvite" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/invites/{inviteID}/disable": { - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "禁用邀请码(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "InviteID", - "name": "inviteID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminTenantInviteDisableForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.TenantInvite" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/join-requests": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "加入申请列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "enum": [ - "pending", - "approved", - "rejected" - ], - "type": "string", - "x-enum-varnames": [ - "TenantJoinRequestStatusPending", - "TenantJoinRequestStatusApproved", - "TenantJoinRequestStatusRejected" - ], - "description": "Status 按申请状态过滤(可选):pending/approved/rejected。", - "name": "status", - "in": "query" - }, - { - "type": "integer", - "description": "UserID 按申请人用户ID过滤(可选)。", - "name": "user_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/models.TenantJoinRequest" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/join-requests/{requestID}/approve": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "通过加入申请(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "RequestID", - "name": "requestID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminTenantJoinRequestDecideForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.TenantJoinRequest" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/join-requests/{requestID}/reject": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "拒绝加入申请(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "RequestID", - "name": "requestID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminTenantJoinRequestDecideForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.TenantJoinRequest" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/ledgers": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "余额流水列表(租户管理/审计)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "BizRefID 按业务引用ID过滤(可选)。", - "name": "biz_ref_id", - "in": "query" - }, - { - "type": "string", - "description": "BizRefType 按业务引用类型过滤(可选)。\n约定:当前业务写入为 \"order\";未来可扩展为 refund 等。", - "name": "biz_ref_type", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtFrom 创建时间起(可选)。", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtTo 创建时间止(可选)。", - "name": "created_at_to", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "OperatorUserID 按操作者用户ID过滤(可选)。\n典型场景:后台检索“某个管理员发起的退款/调账”等敏感操作流水。", - "name": "operator_user_id", - "in": "query" - }, - { - "type": "integer", - "description": "OrderID 按关联订单过滤(可选)。", - "name": "order_id", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "enum": [ - "debit_purchase", - "credit_refund", - "freeze", - "unfreeze", - "adjustment" - ], - "type": "string", - "x-enum-varnames": [ - "TenantLedgerTypeDebitPurchase", - "TenantLedgerTypeCreditRefund", - "TenantLedgerTypeFreeze", - "TenantLedgerTypeUnfreeze", - "TenantLedgerTypeAdjustment" - ], - "description": "Type 按流水类型过滤(可选)。", - "name": "type", - "in": "query" - }, - { - "type": "integer", - "description": "UserID 按余额账户归属用户ID过滤(可选)。\n典型场景:查看某个租户成员的资金变化全链路。", - "name": "user_id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/dto.AdminLedgerItem" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/media_assets": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "媒体资源列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtFrom filters assets by created_at \u003e= this time; optional.", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtTo filters assets by created_at \u003c= this time; optional.", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "enum": [ - "uploaded", - "processing", - "ready", - "failed", - "deleted" - ], - "type": "string", - "x-enum-varnames": [ - "MediaAssetStatusUploaded", - "MediaAssetStatusProcessing", - "MediaAssetStatusReady", - "MediaAssetStatusFailed", - "MediaAssetStatusDeleted" - ], - "description": "Status filters by processing status (uploaded/processing/ready/failed/deleted); optional.", - "name": "status", - "in": "query" - }, - { - "enum": [ - "video", - "audio", - "image" - ], - "type": "string", - "x-enum-varnames": [ - "MediaAssetTypeVideo", - "MediaAssetTypeAudio", - "MediaAssetTypeImage" - ], - "description": "Type filters by media type (video/audio/image); optional.", - "name": "type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/models.MediaAsset" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/media_assets/upload_init": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "初始化媒体资源上传(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminMediaAssetUploadInitForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.AdminMediaAssetUploadInitResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/media_assets/{assetID}": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "媒体资源详情(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "AssetID", - "name": "assetID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.MediaAsset" - } - } - } - }, - "delete": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "删除媒体资源(租户管理,软删)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "AssetID", - "name": "assetID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.MediaAsset" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/media_assets/{assetID}/upload_complete": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "确认上传完成并进入处理(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "AssetID", - "name": "assetID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.AdminMediaAssetUploadCompleteForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.MediaAsset" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/orders": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "订单列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "AmountPaidMax 实付金额上限(可选):amount_paid \u003c= 该值(单位分)。", - "name": "amount_paid_max", - "in": "query" - }, - { - "type": "integer", - "description": "AmountPaidMin 实付金额下限(可选):amount_paid \u003e= 该值(单位分)。", - "name": "amount_paid_min", - "in": "query" - }, - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "integer", - "description": "ContentID 内容ID(可选):通过 order_items 关联过滤。", - "name": "content_id", - "in": "query" - }, - { - "type": "string", - "description": "ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。", - "name": "content_title", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtFrom 创建时间起(可选):created_at \u003e= 该时间(用于按创建时间筛选)。", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtTo 创建时间止(可选):created_at \u003c= 该时间(用于按创建时间筛选)。", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "type": "string", - "description": "PaidAtFrom 支付时间起(可选):paid_at \u003e= 该时间(用于按支付时间筛选)。", - "name": "paid_at_from", - "in": "query" - }, - { - "type": "string", - "description": "PaidAtTo 支付时间止(可选):paid_at \u003c= 该时间(用于按支付时间筛选)。", - "name": "paid_at_to", - "in": "query" - }, - { - "enum": [ - "created", - "paid", - "refunding", - "refunded", - "canceled", - "failed" - ], - "type": "string", - "x-enum-varnames": [ - "OrderStatusCreated", - "OrderStatusPaid", - "OrderStatusRefunding", - "OrderStatusRefunded", - "OrderStatusCanceled", - "OrderStatusFailed" - ], - "description": "Status 订单状态(可选):created/paid/refunding/refunded/canceled/failed。", - "name": "status", - "in": "query" - }, - { - "enum": [ - "content_purchase" - ], - "type": "string", - "x-enum-varnames": [ - "OrderTypeContentPurchase" - ], - "description": "Type 订单类型(可选):content_purchase 等。", - "name": "type", - "in": "query" - }, - { - "type": "integer", - "description": "UserID 下单用户ID(可选):按买家用户ID精确过滤。", - "name": "user_id", - "in": "query" - }, - { - "type": "string", - "description": "Username 下单用户用户名关键字(可选):模糊匹配 users.username(like)。", - "name": "username", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/models.Order" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/orders/export": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "订单导出(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "AmountPaidMax 实付金额上限(可选):amount_paid \u003c= 该值(单位分)。", - "name": "amount_paid_max", - "in": "query" - }, - { - "type": "integer", - "description": "AmountPaidMin 实付金额下限(可选):amount_paid \u003e= 该值(单位分)。", - "name": "amount_paid_min", - "in": "query" - }, - { - "type": "string", - "description": "Asc specifies comma-separated field names to sort ascending by.", - "name": "asc", - "in": "query" - }, - { - "type": "integer", - "description": "ContentID 内容ID(可选):通过 order_items 关联过滤。", - "name": "content_id", - "in": "query" - }, - { - "type": "string", - "description": "ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。", - "name": "content_title", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtFrom 创建时间起(可选):created_at \u003e= 该时间(用于按创建时间筛选)。", - "name": "created_at_from", - "in": "query" - }, - { - "type": "string", - "description": "CreatedAtTo 创建时间止(可选):created_at \u003c= 该时间(用于按创建时间筛选)。", - "name": "created_at_to", - "in": "query" - }, - { - "type": "string", - "description": "Desc specifies comma-separated field names to sort descending by.", - "name": "desc", - "in": "query" - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "type": "string", - "description": "PaidAtFrom 支付时间起(可选):paid_at \u003e= 该时间(用于按支付时间筛选)。", - "name": "paid_at_from", - "in": "query" - }, - { - "type": "string", - "description": "PaidAtTo 支付时间止(可选):paid_at \u003c= 该时间(用于按支付时间筛选)。", - "name": "paid_at_to", - "in": "query" - }, - { - "enum": [ - "created", - "paid", - "refunding", - "refunded", - "canceled", - "failed" - ], - "type": "string", - "x-enum-varnames": [ - "OrderStatusCreated", - "OrderStatusPaid", - "OrderStatusRefunding", - "OrderStatusRefunded", - "OrderStatusCanceled", - "OrderStatusFailed" - ], - "description": "Status 订单状态(可选):created/paid/refunding/refunded/canceled/failed。", - "name": "status", - "in": "query" - }, - { - "enum": [ - "content_purchase" - ], - "type": "string", - "x-enum-varnames": [ - "OrderTypeContentPurchase" - ], - "description": "Type 订单类型(可选):content_purchase 等。", - "name": "type", - "in": "query" - }, - { - "type": "integer", - "description": "UserID 下单用户ID(可选):按买家用户ID精确过滤。", - "name": "user_id", - "in": "query" - }, - { - "type": "string", - "description": "Username 下单用户用户名关键字(可选):模糊匹配 users.username(like)。", - "name": "username", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.AdminOrderExportResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/orders/{orderID}": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "订单详情(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "OrderID", - "name": "orderID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.AdminOrderDetail" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/orders/{orderID}/refund": { - "post": { - "description": "该接口只负责将订单从 paid 推进到 refunding,并提交异步退款任务;退款入账与权益回收由 worker 异步完成。\n重复请求幂等:订单处于 refunding/refunded 时会返回当前订单状态,不会重复入账/重复回收权益。", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "订单退款(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "OrderID", - "name": "orderID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminOrderRefundForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/models.Order" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/users": { - "get": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "成员列表(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", - "name": "page", - "in": "query" - }, - { - "enum": [ - "member", - "tenant_admin" - ], - "type": "string", - "x-enum-varnames": [ - "TenantUserRoleMember", - "TenantUserRoleTenantAdmin" - ], - "description": "Role 按角色过滤(可选):member/tenant_admin。", - "name": "role", - "in": "query" - }, - { - "enum": [ - "pending_verify", - "verified", - "banned" - ], - "type": "string", - "x-enum-varnames": [ - "UserStatusPendingVerify", - "UserStatusVerified", - "UserStatusBanned" - ], - "description": "Status 按成员状态过滤(可选):pending_verify/verified/banned。", - "name": "status", - "in": "query" - }, - { - "type": "integer", - "description": "UserID 按用户ID过滤(可选)。", - "name": "user_id", - "in": "query" - }, - { - "type": "string", - "description": "Username 按用户名模糊查询(可选,支持包含匹配)。", - "name": "username", - "in": "query" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/requests.Pager" - }, - { - "type": "object", - "properties": { - "items": { - "$ref": "#/definitions/dto.AdminTenantUserItem" - } - } - } - ] - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/users/{userID}": { - "delete": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "移除租户成员(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "UserID", - "name": "userID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/requests.Pager" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/users/{userID}/join": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "添加租户成员(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "UserID", - "name": "userID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.AdminTenantUserJoinResponse" - } - } - } - } - }, - "/t/{tenantCode}/v1/admin/users/{userID}/role": { - "patch": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Tenant" - ], - "summary": "设置成员角色(租户管理)", - "parameters": [ - { - "type": "string", - "description": "Tenant Code", - "name": "tenantCode", - "in": "path", - "required": true - }, - { - "type": "integer", - "format": "int64", - "description": "UserID", - "name": "userID", - "in": "path", - "required": true - }, - { - "description": "Form", - "name": "form", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/dto.AdminTenantUserRoleUpdateForm" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/dto.AdminTenantUserJoinResponse" - } - } - } - } - }, "/t/{tenantCode}/v1/contents": { "get": { "consumes": [ @@ -3438,6 +1728,1716 @@ } } }, + "/t/{tenantCode}/v1/management/contents": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "内容列表(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Asc specifies comma-separated field names to sort ascending by.", + "name": "asc", + "in": "query" + }, + { + "type": "string", + "name": "created_at_from", + "in": "query" + }, + { + "type": "string", + "name": "created_at_to", + "in": "query" + }, + { + "type": "string", + "description": "Desc specifies comma-separated field names to sort descending by.", + "name": "desc", + "in": "query" + }, + { + "type": "integer", + "name": "id", + "in": "query" + }, + { + "type": "string", + "name": "keyword", + "in": "query" + }, + { + "type": "integer", + "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "name": "page", + "in": "query" + }, + { + "type": "string", + "name": "published_at_from", + "in": "query" + }, + { + "type": "string", + "name": "published_at_to", + "in": "query" + }, + { + "enum": [ + "draft", + "reviewing", + "published", + "unpublished", + "blocked" + ], + "type": "string", + "x-enum-varnames": [ + "ContentStatusDraft", + "ContentStatusReviewing", + "ContentStatusPublished", + "ContentStatusUnpublished", + "ContentStatusBlocked" + ], + "name": "status", + "in": "query" + }, + { + "type": "integer", + "name": "user_id", + "in": "query" + }, + { + "enum": [ + "public", + "tenant_only", + "private" + ], + "type": "string", + "x-enum-varnames": [ + "ContentVisibilityPublic", + "ContentVisibilityTenantOnly", + "ContentVisibilityPrivate" + ], + "name": "visibility", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/requests.Pager" + }, + { + "type": "object", + "properties": { + "items": { + "$ref": "#/definitions/dto.AdminContentItem" + } + } + } + ] + } + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "创建内容(草稿)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ContentCreateForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Content" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/contents/publish": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "内容发布(创建+绑定资源+定价)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ContentPublishForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.ContentPublishResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/contents/{contentID}": { + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "更新内容(标题/描述/状态等)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "ContentID", + "name": "contentID", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ContentUpdateForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Content" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/contents/{contentID}/assets": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "绑定媒体资源到内容(main/cover/preview)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "ContentID", + "name": "contentID", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ContentAssetAttachForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.ContentAsset" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/contents/{contentID}/price": { + "put": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "设置内容价格与折扣", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "ContentID", + "name": "contentID", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.ContentPriceUpsertForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.ContentPrice" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/invites": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "邀请码列表(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Code 按邀请码模糊过滤(可选):支持部分匹配(like)。", + "name": "code", + "in": "query" + }, + { + "type": "integer", + "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "name": "page", + "in": "query" + }, + { + "enum": [ + "active", + "disabled", + "expired" + ], + "type": "string", + "x-enum-varnames": [ + "TenantInviteStatusActive", + "TenantInviteStatusDisabled", + "TenantInviteStatusExpired" + ], + "description": "Status 按状态过滤(可选):active/disabled/expired。", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/requests.Pager" + }, + { + "type": "object", + "properties": { + "items": { + "$ref": "#/definitions/models.TenantInvite" + } + } + } + ] + } + } + } + }, + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "创建邀请码(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AdminTenantInviteCreateForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.TenantInvite" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/invites/{inviteID}/disable": { + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "禁用邀请码(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "InviteID", + "name": "inviteID", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AdminTenantInviteDisableForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.TenantInvite" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/join-requests": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "加入申请列表(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "name": "page", + "in": "query" + }, + { + "enum": [ + "pending", + "approved", + "rejected" + ], + "type": "string", + "x-enum-varnames": [ + "TenantJoinRequestStatusPending", + "TenantJoinRequestStatusApproved", + "TenantJoinRequestStatusRejected" + ], + "description": "Status 按申请状态过滤(可选):pending/approved/rejected。", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "UserID 按申请人用户ID过滤(可选)。", + "name": "user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/requests.Pager" + }, + { + "type": "object", + "properties": { + "items": { + "$ref": "#/definitions/models.TenantJoinRequest" + } + } + } + ] + } + } + } + } + }, + "/t/{tenantCode}/v1/management/join-requests/{requestID}/approve": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "通过加入申请(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "RequestID", + "name": "requestID", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AdminTenantJoinRequestDecideForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.TenantJoinRequest" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/join-requests/{requestID}/reject": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "拒绝加入申请(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "RequestID", + "name": "requestID", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AdminTenantJoinRequestDecideForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.TenantJoinRequest" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/ledgers": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "余额流水列表(租户管理/审计)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "BizRefID 按业务引用ID过滤(可选)。", + "name": "biz_ref_id", + "in": "query" + }, + { + "type": "string", + "description": "BizRefType 按业务引用类型过滤(可选)。\n约定:当前业务写入为 \"order\";未来可扩展为 refund 等。", + "name": "biz_ref_type", + "in": "query" + }, + { + "type": "string", + "description": "CreatedAtFrom 创建时间起(可选)。", + "name": "created_at_from", + "in": "query" + }, + { + "type": "string", + "description": "CreatedAtTo 创建时间止(可选)。", + "name": "created_at_to", + "in": "query" + }, + { + "type": "integer", + "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "OperatorUserID 按操作者用户ID过滤(可选)。\n典型场景:后台检索“某个管理员发起的退款/调账”等敏感操作流水。", + "name": "operator_user_id", + "in": "query" + }, + { + "type": "integer", + "description": "OrderID 按关联订单过滤(可选)。", + "name": "order_id", + "in": "query" + }, + { + "type": "integer", + "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "name": "page", + "in": "query" + }, + { + "enum": [ + "debit_purchase", + "credit_refund", + "freeze", + "unfreeze", + "adjustment" + ], + "type": "string", + "x-enum-varnames": [ + "TenantLedgerTypeDebitPurchase", + "TenantLedgerTypeCreditRefund", + "TenantLedgerTypeFreeze", + "TenantLedgerTypeUnfreeze", + "TenantLedgerTypeAdjustment" + ], + "description": "Type 按流水类型过滤(可选)。", + "name": "type", + "in": "query" + }, + { + "type": "integer", + "description": "UserID 按余额账户归属用户ID过滤(可选)。\n典型场景:查看某个租户成员的资金变化全链路。", + "name": "user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/requests.Pager" + }, + { + "type": "object", + "properties": { + "items": { + "$ref": "#/definitions/dto.AdminLedgerItem" + } + } + } + ] + } + } + } + } + }, + "/t/{tenantCode}/v1/management/media_assets": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "媒体资源列表(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Asc specifies comma-separated field names to sort ascending by.", + "name": "asc", + "in": "query" + }, + { + "type": "string", + "description": "CreatedAtFrom filters assets by created_at \u003e= this time; optional.", + "name": "created_at_from", + "in": "query" + }, + { + "type": "string", + "description": "CreatedAtTo filters assets by created_at \u003c= this time; optional.", + "name": "created_at_to", + "in": "query" + }, + { + "type": "string", + "description": "Desc specifies comma-separated field names to sort descending by.", + "name": "desc", + "in": "query" + }, + { + "type": "integer", + "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "name": "page", + "in": "query" + }, + { + "enum": [ + "uploaded", + "processing", + "ready", + "failed", + "deleted" + ], + "type": "string", + "x-enum-varnames": [ + "MediaAssetStatusUploaded", + "MediaAssetStatusProcessing", + "MediaAssetStatusReady", + "MediaAssetStatusFailed", + "MediaAssetStatusDeleted" + ], + "description": "Status filters by processing status (uploaded/processing/ready/failed/deleted); optional.", + "name": "status", + "in": "query" + }, + { + "enum": [ + "video", + "audio", + "image" + ], + "type": "string", + "x-enum-varnames": [ + "MediaAssetTypeVideo", + "MediaAssetTypeAudio", + "MediaAssetTypeImage" + ], + "description": "Type filters by media type (video/audio/image); optional.", + "name": "type", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/requests.Pager" + }, + { + "type": "object", + "properties": { + "items": { + "$ref": "#/definitions/models.MediaAsset" + } + } + } + ] + } + } + } + } + }, + "/t/{tenantCode}/v1/management/media_assets/upload_init": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "初始化媒体资源上传(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AdminMediaAssetUploadInitForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.AdminMediaAssetUploadInitResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/media_assets/{assetID}": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "媒体资源详情(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "AssetID", + "name": "assetID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.MediaAsset" + } + } + } + }, + "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "删除媒体资源(租户管理,软删)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "AssetID", + "name": "assetID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.MediaAsset" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/media_assets/{assetID}/upload_complete": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "确认上传完成并进入处理(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "AssetID", + "name": "assetID", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "schema": { + "$ref": "#/definitions/dto.AdminMediaAssetUploadCompleteForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.MediaAsset" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/orders": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "订单列表(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "AmountPaidMax 实付金额上限(可选):amount_paid \u003c= 该值(单位分)。", + "name": "amount_paid_max", + "in": "query" + }, + { + "type": "integer", + "description": "AmountPaidMin 实付金额下限(可选):amount_paid \u003e= 该值(单位分)。", + "name": "amount_paid_min", + "in": "query" + }, + { + "type": "string", + "description": "Asc specifies comma-separated field names to sort ascending by.", + "name": "asc", + "in": "query" + }, + { + "type": "integer", + "description": "ContentID 内容ID(可选):通过 order_items 关联过滤。", + "name": "content_id", + "in": "query" + }, + { + "type": "string", + "description": "ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。", + "name": "content_title", + "in": "query" + }, + { + "type": "string", + "description": "CreatedAtFrom 创建时间起(可选):created_at \u003e= 该时间(用于按创建时间筛选)。", + "name": "created_at_from", + "in": "query" + }, + { + "type": "string", + "description": "CreatedAtTo 创建时间止(可选):created_at \u003c= 该时间(用于按创建时间筛选)。", + "name": "created_at_to", + "in": "query" + }, + { + "type": "string", + "description": "Desc specifies comma-separated field names to sort descending by.", + "name": "desc", + "in": "query" + }, + { + "type": "integer", + "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "name": "page", + "in": "query" + }, + { + "type": "string", + "description": "PaidAtFrom 支付时间起(可选):paid_at \u003e= 该时间(用于按支付时间筛选)。", + "name": "paid_at_from", + "in": "query" + }, + { + "type": "string", + "description": "PaidAtTo 支付时间止(可选):paid_at \u003c= 该时间(用于按支付时间筛选)。", + "name": "paid_at_to", + "in": "query" + }, + { + "enum": [ + "created", + "paid", + "refunding", + "refunded", + "canceled", + "failed" + ], + "type": "string", + "x-enum-varnames": [ + "OrderStatusCreated", + "OrderStatusPaid", + "OrderStatusRefunding", + "OrderStatusRefunded", + "OrderStatusCanceled", + "OrderStatusFailed" + ], + "description": "Status 订单状态(可选):created/paid/refunding/refunded/canceled/failed。", + "name": "status", + "in": "query" + }, + { + "enum": [ + "content_purchase" + ], + "type": "string", + "x-enum-varnames": [ + "OrderTypeContentPurchase" + ], + "description": "Type 订单类型(可选):content_purchase 等。", + "name": "type", + "in": "query" + }, + { + "type": "integer", + "description": "UserID 下单用户ID(可选):按买家用户ID精确过滤。", + "name": "user_id", + "in": "query" + }, + { + "type": "string", + "description": "Username 下单用户用户名关键字(可选):模糊匹配 users.username(like)。", + "name": "username", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/requests.Pager" + }, + { + "type": "object", + "properties": { + "items": { + "$ref": "#/definitions/models.Order" + } + } + } + ] + } + } + } + } + }, + "/t/{tenantCode}/v1/management/orders/export": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "订单导出(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "AmountPaidMax 实付金额上限(可选):amount_paid \u003c= 该值(单位分)。", + "name": "amount_paid_max", + "in": "query" + }, + { + "type": "integer", + "description": "AmountPaidMin 实付金额下限(可选):amount_paid \u003e= 该值(单位分)。", + "name": "amount_paid_min", + "in": "query" + }, + { + "type": "string", + "description": "Asc specifies comma-separated field names to sort ascending by.", + "name": "asc", + "in": "query" + }, + { + "type": "integer", + "description": "ContentID 内容ID(可选):通过 order_items 关联过滤。", + "name": "content_id", + "in": "query" + }, + { + "type": "string", + "description": "ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。", + "name": "content_title", + "in": "query" + }, + { + "type": "string", + "description": "CreatedAtFrom 创建时间起(可选):created_at \u003e= 该时间(用于按创建时间筛选)。", + "name": "created_at_from", + "in": "query" + }, + { + "type": "string", + "description": "CreatedAtTo 创建时间止(可选):created_at \u003c= 该时间(用于按创建时间筛选)。", + "name": "created_at_to", + "in": "query" + }, + { + "type": "string", + "description": "Desc specifies comma-separated field names to sort descending by.", + "name": "desc", + "in": "query" + }, + { + "type": "integer", + "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "name": "page", + "in": "query" + }, + { + "type": "string", + "description": "PaidAtFrom 支付时间起(可选):paid_at \u003e= 该时间(用于按支付时间筛选)。", + "name": "paid_at_from", + "in": "query" + }, + { + "type": "string", + "description": "PaidAtTo 支付时间止(可选):paid_at \u003c= 该时间(用于按支付时间筛选)。", + "name": "paid_at_to", + "in": "query" + }, + { + "enum": [ + "created", + "paid", + "refunding", + "refunded", + "canceled", + "failed" + ], + "type": "string", + "x-enum-varnames": [ + "OrderStatusCreated", + "OrderStatusPaid", + "OrderStatusRefunding", + "OrderStatusRefunded", + "OrderStatusCanceled", + "OrderStatusFailed" + ], + "description": "Status 订单状态(可选):created/paid/refunding/refunded/canceled/failed。", + "name": "status", + "in": "query" + }, + { + "enum": [ + "content_purchase" + ], + "type": "string", + "x-enum-varnames": [ + "OrderTypeContentPurchase" + ], + "description": "Type 订单类型(可选):content_purchase 等。", + "name": "type", + "in": "query" + }, + { + "type": "integer", + "description": "UserID 下单用户ID(可选):按买家用户ID精确过滤。", + "name": "user_id", + "in": "query" + }, + { + "type": "string", + "description": "Username 下单用户用户名关键字(可选):模糊匹配 users.username(like)。", + "name": "username", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.AdminOrderExportResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/orders/{orderID}": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "订单详情(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "OrderID", + "name": "orderID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.AdminOrderDetail" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/orders/{orderID}/refund": { + "post": { + "description": "该接口只负责将订单从 paid 推进到 refunding,并提交异步退款任务;退款入账与权益回收由 worker 异步完成。\n重复请求幂等:订单处于 refunding/refunded 时会返回当前订单状态,不会重复入账/重复回收权益。", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "订单退款(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "OrderID", + "name": "orderID", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AdminOrderRefundForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/models.Order" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/users": { + "get": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "成员列表(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "description": "Limit is page size; only values in {10,20,50,100} are accepted (otherwise defaults to 10).", + "name": "limit", + "in": "query" + }, + { + "type": "integer", + "description": "Page is 1-based page index; values \u003c= 0 are normalized to 1.", + "name": "page", + "in": "query" + }, + { + "enum": [ + "member", + "tenant_admin" + ], + "type": "string", + "x-enum-varnames": [ + "TenantUserRoleMember", + "TenantUserRoleTenantAdmin" + ], + "description": "Role 按角色过滤(可选):member/tenant_admin。", + "name": "role", + "in": "query" + }, + { + "enum": [ + "pending_verify", + "verified", + "banned" + ], + "type": "string", + "x-enum-varnames": [ + "UserStatusPendingVerify", + "UserStatusVerified", + "UserStatusBanned" + ], + "description": "Status 按成员状态过滤(可选):pending_verify/verified/banned。", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "UserID 按用户ID过滤(可选)。", + "name": "user_id", + "in": "query" + }, + { + "type": "string", + "description": "Username 按用户名模糊查询(可选,支持包含匹配)。", + "name": "username", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "allOf": [ + { + "$ref": "#/definitions/requests.Pager" + }, + { + "type": "object", + "properties": { + "items": { + "$ref": "#/definitions/dto.AdminTenantUserItem" + } + } + } + ] + } + } + } + } + }, + "/t/{tenantCode}/v1/management/users/{userID}": { + "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "移除租户成员(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "UserID", + "name": "userID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/requests.Pager" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/users/{userID}/join": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "添加租户成员(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "UserID", + "name": "userID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.AdminTenantUserJoinResponse" + } + } + } + } + }, + "/t/{tenantCode}/v1/management/users/{userID}/role": { + "patch": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Tenant" + ], + "summary": "设置成员角色(租户管理)", + "parameters": [ + { + "type": "string", + "description": "Tenant Code", + "name": "tenantCode", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "UserID", + "name": "userID", + "in": "path", + "required": true + }, + { + "description": "Form", + "name": "form", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/dto.AdminTenantUserRoleUpdateForm" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/dto.AdminTenantUserJoinResponse" + } + } + } + } + }, "/t/{tenantCode}/v1/me": { "get": { "consumes": [ diff --git a/backend/docs/swagger.yaml b/backend/docs/swagger.yaml index 9e2c022..3a96783 100644 --- a/backend/docs/swagger.yaml +++ b/backend/docs/swagger.yaml @@ -2751,1158 +2751,6 @@ paths: summary: 用户状态列表 tags: - Super - /t/{tenantCode}/v1/admin/contents: - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: Asc specifies comma-separated field names to sort ascending by. - in: query - name: asc - type: string - - in: query - name: created_at_from - type: string - - in: query - name: created_at_to - type: string - - description: Desc specifies comma-separated field names to sort descending - by. - in: query - name: desc - type: string - - in: query - name: id - type: integer - - in: query - name: keyword - type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. - in: query - name: page - type: integer - - in: query - name: published_at_from - type: string - - in: query - name: published_at_to - type: string - - enum: - - draft - - reviewing - - published - - unpublished - - blocked - in: query - name: status - type: string - x-enum-varnames: - - ContentStatusDraft - - ContentStatusReviewing - - ContentStatusPublished - - ContentStatusUnpublished - - ContentStatusBlocked - - in: query - name: user_id - type: integer - - enum: - - public - - tenant_only - - private - in: query - name: visibility - type: string - x-enum-varnames: - - ContentVisibilityPublic - - ContentVisibilityTenantOnly - - ContentVisibilityPrivate - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/requests.Pager' - - properties: - items: - $ref: '#/definitions/dto.AdminContentItem' - type: object - summary: 内容列表(租户管理) - tags: - - Tenant - post: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.ContentCreateForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.Content' - summary: 创建内容(草稿) - tags: - - Tenant - /t/{tenantCode}/v1/admin/contents/{contentID}: - patch: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: ContentID - format: int64 - in: path - name: contentID - required: true - type: integer - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.ContentUpdateForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.Content' - summary: 更新内容(标题/描述/状态等) - tags: - - Tenant - /t/{tenantCode}/v1/admin/contents/{contentID}/assets: - post: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: ContentID - format: int64 - in: path - name: contentID - required: true - type: integer - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.ContentAssetAttachForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.ContentAsset' - summary: 绑定媒体资源到内容(main/cover/preview) - tags: - - Tenant - /t/{tenantCode}/v1/admin/contents/{contentID}/price: - put: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: ContentID - format: int64 - in: path - name: contentID - required: true - type: integer - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.ContentPriceUpsertForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.ContentPrice' - summary: 设置内容价格与折扣 - tags: - - Tenant - /t/{tenantCode}/v1/admin/contents/publish: - post: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.ContentPublishForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dto.ContentPublishResponse' - summary: 内容发布(创建+绑定资源+定价) - tags: - - Tenant - /t/{tenantCode}/v1/admin/invites: - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: Code 按邀请码模糊过滤(可选):支持部分匹配(like)。 - in: query - name: code - type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. - in: query - name: page - type: integer - - description: Status 按状态过滤(可选):active/disabled/expired。 - enum: - - active - - disabled - - expired - in: query - name: status - type: string - x-enum-varnames: - - TenantInviteStatusActive - - TenantInviteStatusDisabled - - TenantInviteStatusExpired - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/requests.Pager' - - properties: - items: - $ref: '#/definitions/models.TenantInvite' - type: object - summary: 邀请码列表(租户管理) - tags: - - Tenant - post: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.AdminTenantInviteCreateForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.TenantInvite' - summary: 创建邀请码(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/admin/invites/{inviteID}/disable: - patch: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: InviteID - format: int64 - in: path - name: inviteID - required: true - type: integer - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.AdminTenantInviteDisableForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.TenantInvite' - summary: 禁用邀请码(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/admin/join-requests: - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. - in: query - name: page - type: integer - - description: Status 按申请状态过滤(可选):pending/approved/rejected。 - enum: - - pending - - approved - - rejected - in: query - name: status - type: string - x-enum-varnames: - - TenantJoinRequestStatusPending - - TenantJoinRequestStatusApproved - - TenantJoinRequestStatusRejected - - description: UserID 按申请人用户ID过滤(可选)。 - in: query - name: user_id - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/requests.Pager' - - properties: - items: - $ref: '#/definitions/models.TenantJoinRequest' - type: object - summary: 加入申请列表(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/admin/join-requests/{requestID}/approve: - post: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: RequestID - format: int64 - in: path - name: requestID - required: true - type: integer - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.AdminTenantJoinRequestDecideForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.TenantJoinRequest' - summary: 通过加入申请(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/admin/join-requests/{requestID}/reject: - post: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: RequestID - format: int64 - in: path - name: requestID - required: true - type: integer - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.AdminTenantJoinRequestDecideForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.TenantJoinRequest' - summary: 拒绝加入申请(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/admin/ledgers: - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: BizRefID 按业务引用ID过滤(可选)。 - in: query - name: biz_ref_id - type: integer - - description: |- - BizRefType 按业务引用类型过滤(可选)。 - 约定:当前业务写入为 "order";未来可扩展为 refund 等。 - in: query - name: biz_ref_type - type: string - - description: CreatedAtFrom 创建时间起(可选)。 - in: query - name: created_at_from - type: string - - description: CreatedAtTo 创建时间止(可选)。 - in: query - name: created_at_to - type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - description: |- - OperatorUserID 按操作者用户ID过滤(可选)。 - 典型场景:后台检索“某个管理员发起的退款/调账”等敏感操作流水。 - in: query - name: operator_user_id - type: integer - - description: OrderID 按关联订单过滤(可选)。 - in: query - name: order_id - type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. - in: query - name: page - type: integer - - description: Type 按流水类型过滤(可选)。 - enum: - - debit_purchase - - credit_refund - - freeze - - unfreeze - - adjustment - in: query - name: type - type: string - x-enum-varnames: - - TenantLedgerTypeDebitPurchase - - TenantLedgerTypeCreditRefund - - TenantLedgerTypeFreeze - - TenantLedgerTypeUnfreeze - - TenantLedgerTypeAdjustment - - description: |- - UserID 按余额账户归属用户ID过滤(可选)。 - 典型场景:查看某个租户成员的资金变化全链路。 - in: query - name: user_id - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/requests.Pager' - - properties: - items: - $ref: '#/definitions/dto.AdminLedgerItem' - type: object - summary: 余额流水列表(租户管理/审计) - tags: - - Tenant - /t/{tenantCode}/v1/admin/media_assets: - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: Asc specifies comma-separated field names to sort ascending by. - in: query - name: asc - type: string - - description: CreatedAtFrom filters assets by created_at >= this time; optional. - in: query - name: created_at_from - type: string - - description: CreatedAtTo filters assets by created_at <= this time; optional. - in: query - name: created_at_to - type: string - - description: Desc specifies comma-separated field names to sort descending - by. - in: query - name: desc - type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. - in: query - name: page - type: integer - - description: Status filters by processing status (uploaded/processing/ready/failed/deleted); - optional. - enum: - - uploaded - - processing - - ready - - failed - - deleted - in: query - name: status - type: string - x-enum-varnames: - - MediaAssetStatusUploaded - - MediaAssetStatusProcessing - - MediaAssetStatusReady - - MediaAssetStatusFailed - - MediaAssetStatusDeleted - - description: Type filters by media type (video/audio/image); optional. - enum: - - video - - audio - - image - in: query - name: type - type: string - x-enum-varnames: - - MediaAssetTypeVideo - - MediaAssetTypeAudio - - MediaAssetTypeImage - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/requests.Pager' - - properties: - items: - $ref: '#/definitions/models.MediaAsset' - type: object - summary: 媒体资源列表(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/admin/media_assets/{assetID}: - delete: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: AssetID - format: int64 - in: path - name: assetID - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.MediaAsset' - summary: 删除媒体资源(租户管理,软删) - tags: - - Tenant - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: AssetID - format: int64 - in: path - name: assetID - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.MediaAsset' - summary: 媒体资源详情(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/admin/media_assets/{assetID}/upload_complete: - post: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: AssetID - format: int64 - in: path - name: assetID - required: true - type: integer - - description: Form - in: body - name: form - schema: - $ref: '#/definitions/dto.AdminMediaAssetUploadCompleteForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.MediaAsset' - summary: 确认上传完成并进入处理(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/admin/media_assets/upload_init: - post: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.AdminMediaAssetUploadInitForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dto.AdminMediaAssetUploadInitResponse' - summary: 初始化媒体资源上传(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/admin/orders: - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: AmountPaidMax 实付金额上限(可选):amount_paid <= 该值(单位分)。 - in: query - name: amount_paid_max - type: integer - - description: AmountPaidMin 实付金额下限(可选):amount_paid >= 该值(单位分)。 - in: query - name: amount_paid_min - type: integer - - description: Asc specifies comma-separated field names to sort ascending by. - in: query - name: asc - type: string - - description: ContentID 内容ID(可选):通过 order_items 关联过滤。 - in: query - name: content_id - type: integer - - description: ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。 - in: query - name: content_title - type: string - - description: CreatedAtFrom 创建时间起(可选):created_at >= 该时间(用于按创建时间筛选)。 - in: query - name: created_at_from - type: string - - description: CreatedAtTo 创建时间止(可选):created_at <= 该时间(用于按创建时间筛选)。 - in: query - name: created_at_to - type: string - - description: Desc specifies comma-separated field names to sort descending - by. - in: query - name: desc - type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. - in: query - name: page - type: integer - - description: PaidAtFrom 支付时间起(可选):paid_at >= 该时间(用于按支付时间筛选)。 - in: query - name: paid_at_from - type: string - - description: PaidAtTo 支付时间止(可选):paid_at <= 该时间(用于按支付时间筛选)。 - in: query - name: paid_at_to - type: string - - description: Status 订单状态(可选):created/paid/refunding/refunded/canceled/failed。 - enum: - - created - - paid - - refunding - - refunded - - canceled - - failed - in: query - name: status - type: string - x-enum-varnames: - - OrderStatusCreated - - OrderStatusPaid - - OrderStatusRefunding - - OrderStatusRefunded - - OrderStatusCanceled - - OrderStatusFailed - - description: Type 订单类型(可选):content_purchase 等。 - enum: - - content_purchase - in: query - name: type - type: string - x-enum-varnames: - - OrderTypeContentPurchase - - description: UserID 下单用户ID(可选):按买家用户ID精确过滤。 - in: query - name: user_id - type: integer - - description: Username 下单用户用户名关键字(可选):模糊匹配 users.username(like)。 - in: query - name: username - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/requests.Pager' - - properties: - items: - $ref: '#/definitions/models.Order' - type: object - summary: 订单列表(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/admin/orders/{orderID}: - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: OrderID - format: int64 - in: path - name: orderID - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dto.AdminOrderDetail' - summary: 订单详情(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/admin/orders/{orderID}/refund: - post: - consumes: - - application/json - description: |- - 该接口只负责将订单从 paid 推进到 refunding,并提交异步退款任务;退款入账与权益回收由 worker 异步完成。 - 重复请求幂等:订单处于 refunding/refunded 时会返回当前订单状态,不会重复入账/重复回收权益。 - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: OrderID - format: int64 - in: path - name: orderID - required: true - type: integer - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.AdminOrderRefundForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/models.Order' - summary: 订单退款(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/admin/orders/export: - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: AmountPaidMax 实付金额上限(可选):amount_paid <= 该值(单位分)。 - in: query - name: amount_paid_max - type: integer - - description: AmountPaidMin 实付金额下限(可选):amount_paid >= 该值(单位分)。 - in: query - name: amount_paid_min - type: integer - - description: Asc specifies comma-separated field names to sort ascending by. - in: query - name: asc - type: string - - description: ContentID 内容ID(可选):通过 order_items 关联过滤。 - in: query - name: content_id - type: integer - - description: ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。 - in: query - name: content_title - type: string - - description: CreatedAtFrom 创建时间起(可选):created_at >= 该时间(用于按创建时间筛选)。 - in: query - name: created_at_from - type: string - - description: CreatedAtTo 创建时间止(可选):created_at <= 该时间(用于按创建时间筛选)。 - in: query - name: created_at_to - type: string - - description: Desc specifies comma-separated field names to sort descending - by. - in: query - name: desc - type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. - in: query - name: page - type: integer - - description: PaidAtFrom 支付时间起(可选):paid_at >= 该时间(用于按支付时间筛选)。 - in: query - name: paid_at_from - type: string - - description: PaidAtTo 支付时间止(可选):paid_at <= 该时间(用于按支付时间筛选)。 - in: query - name: paid_at_to - type: string - - description: Status 订单状态(可选):created/paid/refunding/refunded/canceled/failed。 - enum: - - created - - paid - - refunding - - refunded - - canceled - - failed - in: query - name: status - type: string - x-enum-varnames: - - OrderStatusCreated - - OrderStatusPaid - - OrderStatusRefunding - - OrderStatusRefunded - - OrderStatusCanceled - - OrderStatusFailed - - description: Type 订单类型(可选):content_purchase 等。 - enum: - - content_purchase - in: query - name: type - type: string - x-enum-varnames: - - OrderTypeContentPurchase - - description: UserID 下单用户ID(可选):按买家用户ID精确过滤。 - in: query - name: user_id - type: integer - - description: Username 下单用户用户名关键字(可选):模糊匹配 users.username(like)。 - in: query - name: username - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dto.AdminOrderExportResponse' - summary: 订单导出(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/admin/users: - get: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: Limit is page size; only values in {10,20,50,100} are accepted - (otherwise defaults to 10). - in: query - name: limit - type: integer - - description: Page is 1-based page index; values <= 0 are normalized to 1. - in: query - name: page - type: integer - - description: Role 按角色过滤(可选):member/tenant_admin。 - enum: - - member - - tenant_admin - in: query - name: role - type: string - x-enum-varnames: - - TenantUserRoleMember - - TenantUserRoleTenantAdmin - - description: Status 按成员状态过滤(可选):pending_verify/verified/banned。 - enum: - - pending_verify - - verified - - banned - in: query - name: status - type: string - x-enum-varnames: - - UserStatusPendingVerify - - UserStatusVerified - - UserStatusBanned - - description: UserID 按用户ID过滤(可选)。 - in: query - name: user_id - type: integer - - description: Username 按用户名模糊查询(可选,支持包含匹配)。 - in: query - name: username - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/requests.Pager' - - properties: - items: - $ref: '#/definitions/dto.AdminTenantUserItem' - type: object - summary: 成员列表(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/admin/users/{userID}: - delete: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: UserID - format: int64 - in: path - name: userID - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/requests.Pager' - summary: 移除租户成员(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/admin/users/{userID}/join: - post: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: UserID - format: int64 - in: path - name: userID - required: true - type: integer - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dto.AdminTenantUserJoinResponse' - summary: 添加租户成员(租户管理) - tags: - - Tenant - /t/{tenantCode}/v1/admin/users/{userID}/role: - patch: - consumes: - - application/json - parameters: - - description: Tenant Code - in: path - name: tenantCode - required: true - type: string - - description: UserID - format: int64 - in: path - name: userID - required: true - type: integer - - description: Form - in: body - name: form - required: true - schema: - $ref: '#/definitions/dto.AdminTenantUserRoleUpdateForm' - produces: - - application/json - responses: - "200": - description: OK - schema: - $ref: '#/definitions/dto.AdminTenantUserJoinResponse' - summary: 设置成员角色(租户管理) - tags: - - Tenant /t/{tenantCode}/v1/contents: get: consumes: @@ -4103,6 +2951,1158 @@ paths: summary: 提交加入租户申请 tags: - TenantJoin + /t/{tenantCode}/v1/management/contents: + get: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: Asc specifies comma-separated field names to sort ascending by. + in: query + name: asc + type: string + - in: query + name: created_at_from + type: string + - in: query + name: created_at_to + type: string + - description: Desc specifies comma-separated field names to sort descending + by. + in: query + name: desc + type: string + - in: query + name: id + type: integer + - in: query + name: keyword + type: string + - description: Limit is page size; only values in {10,20,50,100} are accepted + (otherwise defaults to 10). + in: query + name: limit + type: integer + - description: Page is 1-based page index; values <= 0 are normalized to 1. + in: query + name: page + type: integer + - in: query + name: published_at_from + type: string + - in: query + name: published_at_to + type: string + - enum: + - draft + - reviewing + - published + - unpublished + - blocked + in: query + name: status + type: string + x-enum-varnames: + - ContentStatusDraft + - ContentStatusReviewing + - ContentStatusPublished + - ContentStatusUnpublished + - ContentStatusBlocked + - in: query + name: user_id + type: integer + - enum: + - public + - tenant_only + - private + in: query + name: visibility + type: string + x-enum-varnames: + - ContentVisibilityPublic + - ContentVisibilityTenantOnly + - ContentVisibilityPrivate + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/requests.Pager' + - properties: + items: + $ref: '#/definitions/dto.AdminContentItem' + type: object + summary: 内容列表(租户管理) + tags: + - Tenant + post: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: Form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.ContentCreateForm' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.Content' + summary: 创建内容(草稿) + tags: + - Tenant + /t/{tenantCode}/v1/management/contents/{contentID}: + patch: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: ContentID + format: int64 + in: path + name: contentID + required: true + type: integer + - description: Form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.ContentUpdateForm' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.Content' + summary: 更新内容(标题/描述/状态等) + tags: + - Tenant + /t/{tenantCode}/v1/management/contents/{contentID}/assets: + post: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: ContentID + format: int64 + in: path + name: contentID + required: true + type: integer + - description: Form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.ContentAssetAttachForm' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.ContentAsset' + summary: 绑定媒体资源到内容(main/cover/preview) + tags: + - Tenant + /t/{tenantCode}/v1/management/contents/{contentID}/price: + put: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: ContentID + format: int64 + in: path + name: contentID + required: true + type: integer + - description: Form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.ContentPriceUpsertForm' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.ContentPrice' + summary: 设置内容价格与折扣 + tags: + - Tenant + /t/{tenantCode}/v1/management/contents/publish: + post: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: Form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.ContentPublishForm' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.ContentPublishResponse' + summary: 内容发布(创建+绑定资源+定价) + tags: + - Tenant + /t/{tenantCode}/v1/management/invites: + get: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: Code 按邀请码模糊过滤(可选):支持部分匹配(like)。 + in: query + name: code + type: string + - description: Limit is page size; only values in {10,20,50,100} are accepted + (otherwise defaults to 10). + in: query + name: limit + type: integer + - description: Page is 1-based page index; values <= 0 are normalized to 1. + in: query + name: page + type: integer + - description: Status 按状态过滤(可选):active/disabled/expired。 + enum: + - active + - disabled + - expired + in: query + name: status + type: string + x-enum-varnames: + - TenantInviteStatusActive + - TenantInviteStatusDisabled + - TenantInviteStatusExpired + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/requests.Pager' + - properties: + items: + $ref: '#/definitions/models.TenantInvite' + type: object + summary: 邀请码列表(租户管理) + tags: + - Tenant + post: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: Form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.AdminTenantInviteCreateForm' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.TenantInvite' + summary: 创建邀请码(租户管理) + tags: + - Tenant + /t/{tenantCode}/v1/management/invites/{inviteID}/disable: + patch: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: InviteID + format: int64 + in: path + name: inviteID + required: true + type: integer + - description: Form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.AdminTenantInviteDisableForm' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.TenantInvite' + summary: 禁用邀请码(租户管理) + tags: + - Tenant + /t/{tenantCode}/v1/management/join-requests: + get: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: Limit is page size; only values in {10,20,50,100} are accepted + (otherwise defaults to 10). + in: query + name: limit + type: integer + - description: Page is 1-based page index; values <= 0 are normalized to 1. + in: query + name: page + type: integer + - description: Status 按申请状态过滤(可选):pending/approved/rejected。 + enum: + - pending + - approved + - rejected + in: query + name: status + type: string + x-enum-varnames: + - TenantJoinRequestStatusPending + - TenantJoinRequestStatusApproved + - TenantJoinRequestStatusRejected + - description: UserID 按申请人用户ID过滤(可选)。 + in: query + name: user_id + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/requests.Pager' + - properties: + items: + $ref: '#/definitions/models.TenantJoinRequest' + type: object + summary: 加入申请列表(租户管理) + tags: + - Tenant + /t/{tenantCode}/v1/management/join-requests/{requestID}/approve: + post: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: RequestID + format: int64 + in: path + name: requestID + required: true + type: integer + - description: Form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.AdminTenantJoinRequestDecideForm' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.TenantJoinRequest' + summary: 通过加入申请(租户管理) + tags: + - Tenant + /t/{tenantCode}/v1/management/join-requests/{requestID}/reject: + post: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: RequestID + format: int64 + in: path + name: requestID + required: true + type: integer + - description: Form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.AdminTenantJoinRequestDecideForm' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.TenantJoinRequest' + summary: 拒绝加入申请(租户管理) + tags: + - Tenant + /t/{tenantCode}/v1/management/ledgers: + get: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: BizRefID 按业务引用ID过滤(可选)。 + in: query + name: biz_ref_id + type: integer + - description: |- + BizRefType 按业务引用类型过滤(可选)。 + 约定:当前业务写入为 "order";未来可扩展为 refund 等。 + in: query + name: biz_ref_type + type: string + - description: CreatedAtFrom 创建时间起(可选)。 + in: query + name: created_at_from + type: string + - description: CreatedAtTo 创建时间止(可选)。 + in: query + name: created_at_to + type: string + - description: Limit is page size; only values in {10,20,50,100} are accepted + (otherwise defaults to 10). + in: query + name: limit + type: integer + - description: |- + OperatorUserID 按操作者用户ID过滤(可选)。 + 典型场景:后台检索“某个管理员发起的退款/调账”等敏感操作流水。 + in: query + name: operator_user_id + type: integer + - description: OrderID 按关联订单过滤(可选)。 + in: query + name: order_id + type: integer + - description: Page is 1-based page index; values <= 0 are normalized to 1. + in: query + name: page + type: integer + - description: Type 按流水类型过滤(可选)。 + enum: + - debit_purchase + - credit_refund + - freeze + - unfreeze + - adjustment + in: query + name: type + type: string + x-enum-varnames: + - TenantLedgerTypeDebitPurchase + - TenantLedgerTypeCreditRefund + - TenantLedgerTypeFreeze + - TenantLedgerTypeUnfreeze + - TenantLedgerTypeAdjustment + - description: |- + UserID 按余额账户归属用户ID过滤(可选)。 + 典型场景:查看某个租户成员的资金变化全链路。 + in: query + name: user_id + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/requests.Pager' + - properties: + items: + $ref: '#/definitions/dto.AdminLedgerItem' + type: object + summary: 余额流水列表(租户管理/审计) + tags: + - Tenant + /t/{tenantCode}/v1/management/media_assets: + get: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: Asc specifies comma-separated field names to sort ascending by. + in: query + name: asc + type: string + - description: CreatedAtFrom filters assets by created_at >= this time; optional. + in: query + name: created_at_from + type: string + - description: CreatedAtTo filters assets by created_at <= this time; optional. + in: query + name: created_at_to + type: string + - description: Desc specifies comma-separated field names to sort descending + by. + in: query + name: desc + type: string + - description: Limit is page size; only values in {10,20,50,100} are accepted + (otherwise defaults to 10). + in: query + name: limit + type: integer + - description: Page is 1-based page index; values <= 0 are normalized to 1. + in: query + name: page + type: integer + - description: Status filters by processing status (uploaded/processing/ready/failed/deleted); + optional. + enum: + - uploaded + - processing + - ready + - failed + - deleted + in: query + name: status + type: string + x-enum-varnames: + - MediaAssetStatusUploaded + - MediaAssetStatusProcessing + - MediaAssetStatusReady + - MediaAssetStatusFailed + - MediaAssetStatusDeleted + - description: Type filters by media type (video/audio/image); optional. + enum: + - video + - audio + - image + in: query + name: type + type: string + x-enum-varnames: + - MediaAssetTypeVideo + - MediaAssetTypeAudio + - MediaAssetTypeImage + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/requests.Pager' + - properties: + items: + $ref: '#/definitions/models.MediaAsset' + type: object + summary: 媒体资源列表(租户管理) + tags: + - Tenant + /t/{tenantCode}/v1/management/media_assets/{assetID}: + delete: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: AssetID + format: int64 + in: path + name: assetID + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.MediaAsset' + summary: 删除媒体资源(租户管理,软删) + tags: + - Tenant + get: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: AssetID + format: int64 + in: path + name: assetID + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.MediaAsset' + summary: 媒体资源详情(租户管理) + tags: + - Tenant + /t/{tenantCode}/v1/management/media_assets/{assetID}/upload_complete: + post: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: AssetID + format: int64 + in: path + name: assetID + required: true + type: integer + - description: Form + in: body + name: form + schema: + $ref: '#/definitions/dto.AdminMediaAssetUploadCompleteForm' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.MediaAsset' + summary: 确认上传完成并进入处理(租户管理) + tags: + - Tenant + /t/{tenantCode}/v1/management/media_assets/upload_init: + post: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: Form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.AdminMediaAssetUploadInitForm' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.AdminMediaAssetUploadInitResponse' + summary: 初始化媒体资源上传(租户管理) + tags: + - Tenant + /t/{tenantCode}/v1/management/orders: + get: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: AmountPaidMax 实付金额上限(可选):amount_paid <= 该值(单位分)。 + in: query + name: amount_paid_max + type: integer + - description: AmountPaidMin 实付金额下限(可选):amount_paid >= 该值(单位分)。 + in: query + name: amount_paid_min + type: integer + - description: Asc specifies comma-separated field names to sort ascending by. + in: query + name: asc + type: string + - description: ContentID 内容ID(可选):通过 order_items 关联过滤。 + in: query + name: content_id + type: integer + - description: ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。 + in: query + name: content_title + type: string + - description: CreatedAtFrom 创建时间起(可选):created_at >= 该时间(用于按创建时间筛选)。 + in: query + name: created_at_from + type: string + - description: CreatedAtTo 创建时间止(可选):created_at <= 该时间(用于按创建时间筛选)。 + in: query + name: created_at_to + type: string + - description: Desc specifies comma-separated field names to sort descending + by. + in: query + name: desc + type: string + - description: Limit is page size; only values in {10,20,50,100} are accepted + (otherwise defaults to 10). + in: query + name: limit + type: integer + - description: Page is 1-based page index; values <= 0 are normalized to 1. + in: query + name: page + type: integer + - description: PaidAtFrom 支付时间起(可选):paid_at >= 该时间(用于按支付时间筛选)。 + in: query + name: paid_at_from + type: string + - description: PaidAtTo 支付时间止(可选):paid_at <= 该时间(用于按支付时间筛选)。 + in: query + name: paid_at_to + type: string + - description: Status 订单状态(可选):created/paid/refunding/refunded/canceled/failed。 + enum: + - created + - paid + - refunding + - refunded + - canceled + - failed + in: query + name: status + type: string + x-enum-varnames: + - OrderStatusCreated + - OrderStatusPaid + - OrderStatusRefunding + - OrderStatusRefunded + - OrderStatusCanceled + - OrderStatusFailed + - description: Type 订单类型(可选):content_purchase 等。 + enum: + - content_purchase + in: query + name: type + type: string + x-enum-varnames: + - OrderTypeContentPurchase + - description: UserID 下单用户ID(可选):按买家用户ID精确过滤。 + in: query + name: user_id + type: integer + - description: Username 下单用户用户名关键字(可选):模糊匹配 users.username(like)。 + in: query + name: username + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/requests.Pager' + - properties: + items: + $ref: '#/definitions/models.Order' + type: object + summary: 订单列表(租户管理) + tags: + - Tenant + /t/{tenantCode}/v1/management/orders/{orderID}: + get: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: OrderID + format: int64 + in: path + name: orderID + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.AdminOrderDetail' + summary: 订单详情(租户管理) + tags: + - Tenant + /t/{tenantCode}/v1/management/orders/{orderID}/refund: + post: + consumes: + - application/json + description: |- + 该接口只负责将订单从 paid 推进到 refunding,并提交异步退款任务;退款入账与权益回收由 worker 异步完成。 + 重复请求幂等:订单处于 refunding/refunded 时会返回当前订单状态,不会重复入账/重复回收权益。 + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: OrderID + format: int64 + in: path + name: orderID + required: true + type: integer + - description: Form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.AdminOrderRefundForm' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/models.Order' + summary: 订单退款(租户管理) + tags: + - Tenant + /t/{tenantCode}/v1/management/orders/export: + get: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: AmountPaidMax 实付金额上限(可选):amount_paid <= 该值(单位分)。 + in: query + name: amount_paid_max + type: integer + - description: AmountPaidMin 实付金额下限(可选):amount_paid >= 该值(单位分)。 + in: query + name: amount_paid_min + type: integer + - description: Asc specifies comma-separated field names to sort ascending by. + in: query + name: asc + type: string + - description: ContentID 内容ID(可选):通过 order_items 关联过滤。 + in: query + name: content_id + type: integer + - description: ContentTitle 内容标题关键字(可选):通过 order_items + contents 关联,模糊匹配 contents.title(like)。 + in: query + name: content_title + type: string + - description: CreatedAtFrom 创建时间起(可选):created_at >= 该时间(用于按创建时间筛选)。 + in: query + name: created_at_from + type: string + - description: CreatedAtTo 创建时间止(可选):created_at <= 该时间(用于按创建时间筛选)。 + in: query + name: created_at_to + type: string + - description: Desc specifies comma-separated field names to sort descending + by. + in: query + name: desc + type: string + - description: Limit is page size; only values in {10,20,50,100} are accepted + (otherwise defaults to 10). + in: query + name: limit + type: integer + - description: Page is 1-based page index; values <= 0 are normalized to 1. + in: query + name: page + type: integer + - description: PaidAtFrom 支付时间起(可选):paid_at >= 该时间(用于按支付时间筛选)。 + in: query + name: paid_at_from + type: string + - description: PaidAtTo 支付时间止(可选):paid_at <= 该时间(用于按支付时间筛选)。 + in: query + name: paid_at_to + type: string + - description: Status 订单状态(可选):created/paid/refunding/refunded/canceled/failed。 + enum: + - created + - paid + - refunding + - refunded + - canceled + - failed + in: query + name: status + type: string + x-enum-varnames: + - OrderStatusCreated + - OrderStatusPaid + - OrderStatusRefunding + - OrderStatusRefunded + - OrderStatusCanceled + - OrderStatusFailed + - description: Type 订单类型(可选):content_purchase 等。 + enum: + - content_purchase + in: query + name: type + type: string + x-enum-varnames: + - OrderTypeContentPurchase + - description: UserID 下单用户ID(可选):按买家用户ID精确过滤。 + in: query + name: user_id + type: integer + - description: Username 下单用户用户名关键字(可选):模糊匹配 users.username(like)。 + in: query + name: username + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.AdminOrderExportResponse' + summary: 订单导出(租户管理) + tags: + - Tenant + /t/{tenantCode}/v1/management/users: + get: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: Limit is page size; only values in {10,20,50,100} are accepted + (otherwise defaults to 10). + in: query + name: limit + type: integer + - description: Page is 1-based page index; values <= 0 are normalized to 1. + in: query + name: page + type: integer + - description: Role 按角色过滤(可选):member/tenant_admin。 + enum: + - member + - tenant_admin + in: query + name: role + type: string + x-enum-varnames: + - TenantUserRoleMember + - TenantUserRoleTenantAdmin + - description: Status 按成员状态过滤(可选):pending_verify/verified/banned。 + enum: + - pending_verify + - verified + - banned + in: query + name: status + type: string + x-enum-varnames: + - UserStatusPendingVerify + - UserStatusVerified + - UserStatusBanned + - description: UserID 按用户ID过滤(可选)。 + in: query + name: user_id + type: integer + - description: Username 按用户名模糊查询(可选,支持包含匹配)。 + in: query + name: username + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + allOf: + - $ref: '#/definitions/requests.Pager' + - properties: + items: + $ref: '#/definitions/dto.AdminTenantUserItem' + type: object + summary: 成员列表(租户管理) + tags: + - Tenant + /t/{tenantCode}/v1/management/users/{userID}: + delete: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: UserID + format: int64 + in: path + name: userID + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/requests.Pager' + summary: 移除租户成员(租户管理) + tags: + - Tenant + /t/{tenantCode}/v1/management/users/{userID}/join: + post: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: UserID + format: int64 + in: path + name: userID + required: true + type: integer + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.AdminTenantUserJoinResponse' + summary: 添加租户成员(租户管理) + tags: + - Tenant + /t/{tenantCode}/v1/management/users/{userID}/role: + patch: + consumes: + - application/json + parameters: + - description: Tenant Code + in: path + name: tenantCode + required: true + type: string + - description: UserID + format: int64 + in: path + name: userID + required: true + type: integer + - description: Form + in: body + name: form + required: true + schema: + $ref: '#/definitions/dto.AdminTenantUserRoleUpdateForm' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.AdminTenantUserJoinResponse' + summary: 设置成员角色(租户管理) + tags: + - Tenant /t/{tenantCode}/v1/me: get: consumes: diff --git a/frontend/portal/src/views/management/ContentPublish.vue b/frontend/portal/src/views/management/ContentPublish.vue index 49160e4..169dd7c 100644 --- a/frontend/portal/src/views/management/ContentPublish.vue +++ b/frontend/portal/src/views/management/ContentPublish.vue @@ -82,7 +82,7 @@ async function submit() { try { submitting.value = true; - const payload = await requestJson(`/t/${encodeURIComponent(tenant)}/v1/admin/contents/publish`, { + const payload = await requestJson(`/t/${encodeURIComponent(tenant)}/v1/management/contents/publish`, { method: 'POST', auth: true, body: {