forked from xiongyuxing/tiku-backend.net
feat: Add tags and endpoint summaries to various controllers for better API documentation
- Added tags to BrowserAuthController for browser authentication endpoints. - Added tags to CatalogController for public catalog access. - Added tags to CommerceController for student transaction operations. - Added tags to CommissionController for tenant commission management. - Added tags to CrmController for tenant CRM functionalities. - Added tags to HealthController for system health checks. - Added tags to LearningController for student learning resources. - Added tags to MeController for current user information. - Added tags to PlatformAdminController for platform management. - Introduced PlatformBackofficeController for backend permissions management. - Added tags to PlatformBillingCallbackController for billing callbacks. - Added tags to PlatformPaymentSettingsController for payment settings management. - Added tags to PlatformSaasController for SaaS package management. - Added tags to PlatformTenantCapabilitiesController for tenant capabilities. - Added tags to PointsController for student points management. - Added tags to ProfileController for student profile management. - Added tags to QuestionVideosController for question video resources. - Added tags to ReferralController for referral growth management. - Added tags to RuntimeController for runtime configurations. - Added tags to ScorelineController for scoreline management. - Added tags to TaxonomyController for category management. - Added tags to TenantAdminDirectController for tenant operations management. - Introduced TenantBackofficeController for tenant backend permissions. - Added tags to TenantBillingController for tenant billing operations. - Added tags to TenantCommerceController for tenant commerce operations. - Added tags to TenantContentController for tenant content management. - Added tags to TenantContentDirectController for direct content management. - Added tags to TenantFrontendConfigController for frontend configurations. - Added tags to TenantOnboardingController for onboarding guidance. - Added tags to TenantPublicController for public tenant configurations. - Added tags to TenantsController for current tenant information. - Added tags to VideosController for student video resources.
This commit is contained in:
@@ -8,6 +8,7 @@ using Tiku.Domain.Platform;
|
||||
namespace Tiku.Api.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Tags("平台端-SaaS 套餐")]
|
||||
[Route("api/platform-admin/saas")]
|
||||
[Authorize(Policy = TikuPolicies.PlatformBackofficeBootstrap)]
|
||||
public sealed class PlatformSaasController(
|
||||
@@ -16,16 +17,19 @@ public sealed class PlatformSaasController(
|
||||
ICurrentUser currentUser) : ControllerBase
|
||||
{
|
||||
[HttpGet("catalog")]
|
||||
[EndpointSummary("查询平台 SaaS 商品目录")]
|
||||
[Authorize(Policy = BackendPermissions.PlatformSaasCatalogManage)]
|
||||
public Task<SaasCatalogSnapshot> Catalog(CancellationToken cancellationToken) =>
|
||||
catalogService.GetCatalogAsync(Actor(), cancellationToken);
|
||||
|
||||
[HttpPut("features")]
|
||||
[EndpointSummary("新增或更新 SaaS 功能")]
|
||||
[Authorize(Policy = BackendPermissions.PlatformSaasCatalogManage)]
|
||||
public Task<SaasFeature> UpsertFeature(UpsertSaasFeatureDto request, CancellationToken cancellationToken) =>
|
||||
catalogService.UpsertFeatureAsync(Actor(), request.ToCommand(), cancellationToken);
|
||||
|
||||
[HttpPut("feature-limits")]
|
||||
[EndpointSummary("新增或更新 SaaS 功能限额")]
|
||||
[Authorize(Policy = BackendPermissions.PlatformSaasCatalogManage)]
|
||||
public Task<SaasFeatureLimitDefinition> UpsertFeatureLimit(
|
||||
UpsertSaasFeatureLimitDto request,
|
||||
@@ -33,61 +37,73 @@ public sealed class PlatformSaasController(
|
||||
catalogService.UpsertLimitDefinitionAsync(Actor(), request.ToCommand(), cancellationToken);
|
||||
|
||||
[HttpPut("offerings")]
|
||||
[EndpointSummary("新增或更新 SaaS 套餐")]
|
||||
[Authorize(Policy = BackendPermissions.PlatformSaasCatalogManage)]
|
||||
public Task<SaasOffering> UpsertOffering(UpsertSaasOfferingDto request, CancellationToken cancellationToken) =>
|
||||
catalogService.UpsertOfferingAsync(Actor(), request.ToCommand(), cancellationToken);
|
||||
|
||||
[HttpPut("offering-versions")]
|
||||
[EndpointSummary("新增或更新 SaaS 套餐版本草稿")]
|
||||
[Authorize(Policy = BackendPermissions.PlatformSaasCatalogManage)]
|
||||
public Task<SaasOfferingVersionItem> UpsertVersion(UpsertSaasOfferingVersionDto request, CancellationToken cancellationToken) =>
|
||||
catalogService.UpsertDraftVersionAsync(Actor(), request.ToCommand(), cancellationToken);
|
||||
|
||||
[HttpPost("offering-versions/{versionId:guid}/publish")]
|
||||
[EndpointSummary("发布 SaaS 套餐版本")]
|
||||
[Authorize(Policy = BackendPermissions.PlatformSaasCatalogManage)]
|
||||
public Task<SaasOfferingVersionItem> PublishVersion(Guid versionId, CancellationToken cancellationToken) =>
|
||||
catalogService.PublishVersionAsync(Actor(), versionId, cancellationToken);
|
||||
|
||||
[HttpPost("offering-versions/{versionId:guid}/clone")]
|
||||
[EndpointSummary("克隆 SaaS 套餐版本")]
|
||||
[Authorize(Policy = BackendPermissions.PlatformSaasCatalogManage)]
|
||||
public Task<SaasOfferingVersionItem> CloneVersion(Guid versionId, CancellationToken cancellationToken) =>
|
||||
catalogService.CloneVersionAsync(Actor(), versionId, cancellationToken);
|
||||
|
||||
[HttpPost("offering-versions/{versionId:guid}/retire")]
|
||||
[EndpointSummary("下架 SaaS 套餐版本")]
|
||||
[Authorize(Policy = BackendPermissions.PlatformSaasCatalogManage)]
|
||||
public Task<SaasOfferingVersionItem> RetireVersion(Guid versionId, CancellationToken cancellationToken) =>
|
||||
catalogService.RetireVersionAsync(Actor(), versionId, cancellationToken);
|
||||
|
||||
[HttpGet("orders")]
|
||||
[EndpointSummary("查询平台 SaaS 订单")]
|
||||
[Authorize(Policy = BackendPermissions.PlatformSaasBillingManage)]
|
||||
public Task<IReadOnlyCollection<PlatformBillingOrder>> Orders(Guid? tenantId, string? status, int limit = 100, CancellationToken cancellationToken = default) =>
|
||||
billingService.GetOrdersAsync(Actor(), new PlatformBillingAdminQuery(tenantId, status, limit), cancellationToken);
|
||||
|
||||
[HttpGet("payments")]
|
||||
[EndpointSummary("查询平台 SaaS 支付记录")]
|
||||
[Authorize(Policy = BackendPermissions.PlatformSaasBillingManage)]
|
||||
public Task<IReadOnlyCollection<PlatformBillingPayment>> Payments(Guid? tenantId, string? status, int limit = 100, CancellationToken cancellationToken = default) =>
|
||||
billingService.GetPaymentsAsync(Actor(), new PlatformBillingAdminQuery(tenantId, status, limit), cancellationToken);
|
||||
|
||||
[HttpGet("refunds")]
|
||||
[EndpointSummary("查询平台 SaaS 退款记录")]
|
||||
[Authorize(Policy = BackendPermissions.PlatformSaasBillingManage)]
|
||||
public Task<IReadOnlyCollection<PlatformBillingRefund>> Refunds(Guid? tenantId, string? status, int limit = 100, CancellationToken cancellationToken = default) =>
|
||||
billingService.GetRefundsAsync(Actor(), new PlatformBillingAdminQuery(tenantId, status, limit), cancellationToken);
|
||||
|
||||
[HttpGet("invoices")]
|
||||
[EndpointSummary("查询平台 SaaS 发票")]
|
||||
[Authorize(Policy = BackendPermissions.PlatformSaasBillingManage)]
|
||||
public Task<IReadOnlyCollection<PlatformBillingInvoice>> Invoices(Guid? tenantId, string? status, int limit = 100, CancellationToken cancellationToken = default) =>
|
||||
billingService.GetInvoicesAsync(Actor(), new PlatformBillingAdminQuery(tenantId, status, limit), cancellationToken);
|
||||
|
||||
[HttpGet("subscriptions")]
|
||||
[EndpointSummary("查询租户 SaaS 订阅")]
|
||||
[Authorize(Policy = BackendPermissions.PlatformSaasBillingManage)]
|
||||
public Task<IReadOnlyCollection<TenantSaasSubscription>> Subscriptions(Guid? tenantId, string? status, int limit = 100, CancellationToken cancellationToken = default) =>
|
||||
billingService.GetSubscriptionsAsync(Actor(), new PlatformBillingAdminQuery(tenantId, status, limit), cancellationToken);
|
||||
|
||||
[HttpPost("payments/manual/confirm")]
|
||||
[EndpointSummary("确认平台手工支付")]
|
||||
[Authorize(Policy = BackendPermissions.PlatformSaasBillingManage)]
|
||||
public Task<PlatformBillingPayment> ConfirmManualPayment(ConfirmManualPlatformPaymentDto request, CancellationToken cancellationToken) =>
|
||||
billingService.ConfirmManualPaymentAsync(Actor(), request.ToCommand(), cancellationToken);
|
||||
|
||||
[HttpPut("tenant-feature-overrides")]
|
||||
[EndpointSummary("新增或更新租户功能覆盖规则")]
|
||||
[Authorize(Policy = BackendPermissions.PlatformSaasBillingManage)]
|
||||
public Task<TenantFeatureOverride> UpsertFeatureOverride(UpsertTenantFeatureOverrideDto request, CancellationToken cancellationToken) =>
|
||||
billingService.UpsertFeatureOverrideAsync(Actor(), request.ToCommand(), cancellationToken);
|
||||
|
||||
Reference in New Issue
Block a user