feat: add tenant admin invite management, ledger overview, order details, and order management features
- Implemented Invite management with creation, searching, and disabling functionalities. - Added Ledger overview for financial transactions with filtering options. - Developed Order Detail view for individual order insights and refund capabilities. - Created Orders management page with search, reset, and pagination features. - Enhanced user experience with toast notifications for actions and error handling.
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
|
||||
"quyun/v2/app/errorx"
|
||||
"quyun/v2/app/http/tenant/dto"
|
||||
"quyun/v2/app/requests"
|
||||
"quyun/v2/app/services"
|
||||
"quyun/v2/database/models"
|
||||
"quyun/v2/pkg/consts"
|
||||
@@ -28,6 +29,45 @@ func requireTenantAdmin(tenantUser *models.TenantUser) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// list
|
||||
//
|
||||
// @Summary 内容列表(租户管理)
|
||||
// @Tags Tenant
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param tenantCode path string true "Tenant Code"
|
||||
// @Param filter query dto.AdminContentListFilter true "Filter"
|
||||
// @Success 200 {object} requests.Pager{items=dto.AdminContentItem}
|
||||
//
|
||||
// @Router /t/:tenantCode/v1/admin/contents [get]
|
||||
// @Bind tenant local key(tenant)
|
||||
// @Bind tenantUser local key(tenant_user)
|
||||
// @Bind filter query
|
||||
func (*contentAdmin) list(ctx fiber.Ctx, tenant *models.Tenant, tenantUser *models.TenantUser, filter *dto.AdminContentListFilter) (*requests.Pager, error) {
|
||||
if err := requireTenantAdmin(tenantUser); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if filter == nil {
|
||||
filter = &dto.AdminContentListFilter{}
|
||||
}
|
||||
filter.Pagination.Format()
|
||||
|
||||
log.WithFields(log.Fields{
|
||||
"tenant_id": tenant.ID,
|
||||
"user_id": tenantUser.UserID,
|
||||
"query_user_id": filter.UserID,
|
||||
"keyword": filter.KeywordTrimmed(),
|
||||
"status": filter.Status,
|
||||
"visibility": filter.Visibility,
|
||||
"published_at_from": filter.PublishedAtFrom,
|
||||
"published_at_to": filter.PublishedAtTo,
|
||||
"created_at_from": filter.CreatedAtFrom,
|
||||
"created_at_to": filter.CreatedAtTo,
|
||||
}).Info("tenant.admin.contents.list")
|
||||
|
||||
return services.Content.AdminContentPage(ctx.Context(), tenant.ID, filter)
|
||||
}
|
||||
|
||||
// create
|
||||
//
|
||||
// @Summary 创建内容(草稿)
|
||||
|
||||
Reference in New Issue
Block a user