517 lines
22 KiB
Go
517 lines
22 KiB
Go
// Code generated by atomctl. DO NOT EDIT.
|
|
|
|
// Package v1 provides HTTP route definitions and registration
|
|
// for the quyun/v2 application.
|
|
package v1
|
|
|
|
import (
|
|
dto "quyun/v2/app/http/super/v1/dto"
|
|
v1_dto "quyun/v2/app/http/v1/dto"
|
|
"quyun/v2/app/middlewares"
|
|
"quyun/v2/database/models"
|
|
|
|
"github.com/gofiber/fiber/v3"
|
|
log "github.com/sirupsen/logrus"
|
|
_ "go.ipao.vip/atom"
|
|
_ "go.ipao.vip/atom/contracts"
|
|
. "go.ipao.vip/atom/fen"
|
|
)
|
|
|
|
// Routes implements the HttpRoute contract and provides route registration
|
|
// for all controllers in the v1 module.
|
|
//
|
|
// @provider contracts.HttpRoute atom.GroupRoutes
|
|
type Routes struct {
|
|
log *log.Entry `inject:"false"`
|
|
middlewares *middlewares.Middlewares
|
|
// Controller instances
|
|
assets *assets
|
|
auditLogs *auditLogs
|
|
comments *comments
|
|
contentReports *contentReports
|
|
contents *contents
|
|
coupons *coupons
|
|
creatorApplications *creatorApplications
|
|
creators *creators
|
|
finance *finance
|
|
notifications *notifications
|
|
orders *orders
|
|
payoutAccounts *payoutAccounts
|
|
reports *reports
|
|
systemConfigs *systemConfigs
|
|
tenants *tenants
|
|
users *users
|
|
withdrawals *withdrawals
|
|
}
|
|
|
|
// Prepare initializes the routes provider with logging configuration.
|
|
func (r *Routes) Prepare() error {
|
|
r.log = log.WithField("module", "routes.v1")
|
|
r.log.Info("Initializing routes module")
|
|
return nil
|
|
}
|
|
|
|
// Name returns the unique identifier for this routes provider.
|
|
func (r *Routes) Name() string {
|
|
return "v1"
|
|
}
|
|
|
|
// Register registers all HTTP routes with the provided fiber router.
|
|
// Each route is registered with its corresponding controller action and parameter bindings.
|
|
func (r *Routes) Register(router fiber.Router) {
|
|
// Register routes for controller: assets
|
|
r.log.Debugf("Registering route: Delete /super/v1/assets/:id<int> -> assets.Delete")
|
|
router.Delete("/super/v1/assets/:id<int>"[len(r.Path()):], Func2(
|
|
r.assets.Delete,
|
|
PathParam[int64]("id"),
|
|
Query[dto.SuperAssetDeleteQuery]("query"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/assets -> assets.List")
|
|
router.Get("/super/v1/assets"[len(r.Path()):], DataFunc1(
|
|
r.assets.List,
|
|
Query[dto.SuperAssetListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/assets/usage -> assets.Usage")
|
|
router.Get("/super/v1/assets/usage"[len(r.Path()):], DataFunc1(
|
|
r.assets.Usage,
|
|
Query[dto.SuperAssetUsageFilter]("filter"),
|
|
))
|
|
// Register routes for controller: auditLogs
|
|
r.log.Debugf("Registering route: Get /super/v1/audit-logs -> auditLogs.List")
|
|
router.Get("/super/v1/audit-logs"[len(r.Path()):], DataFunc1(
|
|
r.auditLogs.List,
|
|
Query[dto.SuperAuditLogListFilter]("filter"),
|
|
))
|
|
// Register routes for controller: comments
|
|
r.log.Debugf("Registering route: Get /super/v1/comments -> comments.List")
|
|
router.Get("/super/v1/comments"[len(r.Path()):], DataFunc1(
|
|
r.comments.List,
|
|
Query[dto.SuperCommentListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/comments/:id<int>/delete -> comments.Delete")
|
|
router.Post("/super/v1/comments/:id<int>/delete"[len(r.Path()):], Func3(
|
|
r.comments.Delete,
|
|
Local[*models.User]("__ctx_user"),
|
|
PathParam[int64]("id"),
|
|
Body[dto.SuperCommentDeleteForm]("form"),
|
|
))
|
|
// Register routes for controller: contentReports
|
|
r.log.Debugf("Registering route: Get /super/v1/content-reports -> contentReports.List")
|
|
router.Get("/super/v1/content-reports"[len(r.Path()):], DataFunc1(
|
|
r.contentReports.List,
|
|
Query[dto.SuperContentReportListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/content-reports/:id<int>/process -> contentReports.Process")
|
|
router.Post("/super/v1/content-reports/:id<int>/process"[len(r.Path()):], Func3(
|
|
r.contentReports.Process,
|
|
Local[*models.User]("__ctx_user"),
|
|
PathParam[int64]("id"),
|
|
Body[dto.SuperContentReportProcessForm]("form"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/content-reports/process/batch -> contentReports.BatchProcess")
|
|
router.Post("/super/v1/content-reports/process/batch"[len(r.Path()):], Func2(
|
|
r.contentReports.BatchProcess,
|
|
Local[*models.User]("__ctx_user"),
|
|
Body[dto.SuperContentReportBatchProcessForm]("form"),
|
|
))
|
|
// Register routes for controller: contents
|
|
r.log.Debugf("Registering route: Get /super/v1/contents -> contents.List")
|
|
router.Get("/super/v1/contents"[len(r.Path()):], DataFunc1(
|
|
r.contents.List,
|
|
Query[dto.SuperContentListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/contents/statistics -> contents.Statistics")
|
|
router.Get("/super/v1/contents/statistics"[len(r.Path()):], DataFunc1(
|
|
r.contents.Statistics,
|
|
Query[dto.SuperContentStatisticsFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/tenants/:tenantID<int>/contents -> contents.ListTenantContents")
|
|
router.Get("/super/v1/tenants/:tenantID<int>/contents"[len(r.Path()):], DataFunc2(
|
|
r.contents.ListTenantContents,
|
|
PathParam[int64]("tenantID"),
|
|
Query[dto.SuperContentListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Patch /super/v1/tenants/:tenantID<int>/contents/:contentID<int>/status -> contents.UpdateStatus")
|
|
router.Patch("/super/v1/tenants/:tenantID<int>/contents/:contentID<int>/status"[len(r.Path()):], Func3(
|
|
r.contents.UpdateStatus,
|
|
PathParam[int64]("tenantID"),
|
|
PathParam[int64]("contentID"),
|
|
Body[dto.SuperTenantContentStatusUpdateForm]("form"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/contents/:id<int>/review -> contents.Review")
|
|
router.Post("/super/v1/contents/:id<int>/review"[len(r.Path()):], Func3(
|
|
r.contents.Review,
|
|
Local[*models.User]("__ctx_user"),
|
|
PathParam[int64]("id"),
|
|
Body[dto.SuperContentReviewForm]("form"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/contents/review/batch -> contents.BatchReview")
|
|
router.Post("/super/v1/contents/review/batch"[len(r.Path()):], Func2(
|
|
r.contents.BatchReview,
|
|
Local[*models.User]("__ctx_user"),
|
|
Body[dto.SuperContentBatchReviewForm]("form"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/contents/status/batch -> contents.BatchUpdateStatus")
|
|
router.Post("/super/v1/contents/status/batch"[len(r.Path()):], Func2(
|
|
r.contents.BatchUpdateStatus,
|
|
Local[*models.User]("__ctx_user"),
|
|
Body[dto.SuperContentBatchStatusForm]("form"),
|
|
))
|
|
// Register routes for controller: coupons
|
|
r.log.Debugf("Registering route: Get /super/v1/coupon-grants -> coupons.ListGrants")
|
|
router.Get("/super/v1/coupon-grants"[len(r.Path()):], DataFunc1(
|
|
r.coupons.ListGrants,
|
|
Query[dto.SuperCouponGrantListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/coupon-risks -> coupons.ListRisks")
|
|
router.Get("/super/v1/coupon-risks"[len(r.Path()):], DataFunc1(
|
|
r.coupons.ListRisks,
|
|
Query[dto.SuperCouponRiskListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/coupons -> coupons.List")
|
|
router.Get("/super/v1/coupons"[len(r.Path()):], DataFunc1(
|
|
r.coupons.List,
|
|
Query[dto.SuperCouponListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/tenants/:tenantID<int>/coupons/:id<int> -> coupons.Get")
|
|
router.Get("/super/v1/tenants/:tenantID<int>/coupons/:id<int>"[len(r.Path()):], DataFunc2(
|
|
r.coupons.Get,
|
|
PathParam[int64]("tenantID"),
|
|
PathParam[int64]("id"),
|
|
))
|
|
r.log.Debugf("Registering route: Patch /super/v1/coupons/:id<int>/status -> coupons.UpdateStatus")
|
|
router.Patch("/super/v1/coupons/:id<int>/status"[len(r.Path()):], Func3(
|
|
r.coupons.UpdateStatus,
|
|
Local[*models.User]("__ctx_user"),
|
|
PathParam[int64]("id"),
|
|
Body[dto.SuperCouponStatusUpdateForm]("form"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/tenants/:tenantID<int>/coupons -> coupons.Create")
|
|
router.Post("/super/v1/tenants/:tenantID<int>/coupons"[len(r.Path()):], DataFunc3(
|
|
r.coupons.Create,
|
|
Local[*models.User]("__ctx_user"),
|
|
PathParam[int64]("tenantID"),
|
|
Body[v1_dto.CouponCreateForm]("form"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/tenants/:tenantID<int>/coupons/:id<int>/grant -> coupons.Grant")
|
|
router.Post("/super/v1/tenants/:tenantID<int>/coupons/:id<int>/grant"[len(r.Path()):], DataFunc3(
|
|
r.coupons.Grant,
|
|
PathParam[int64]("tenantID"),
|
|
PathParam[int64]("id"),
|
|
Body[v1_dto.CouponGrantForm]("form"),
|
|
))
|
|
r.log.Debugf("Registering route: Put /super/v1/tenants/:tenantID<int>/coupons/:id<int> -> coupons.Update")
|
|
router.Put("/super/v1/tenants/:tenantID<int>/coupons/:id<int>"[len(r.Path()):], DataFunc4(
|
|
r.coupons.Update,
|
|
Local[*models.User]("__ctx_user"),
|
|
PathParam[int64]("tenantID"),
|
|
PathParam[int64]("id"),
|
|
Body[v1_dto.CouponUpdateForm]("form"),
|
|
))
|
|
// Register routes for controller: creatorApplications
|
|
r.log.Debugf("Registering route: Get /super/v1/creator-applications -> creatorApplications.List")
|
|
router.Get("/super/v1/creator-applications"[len(r.Path()):], DataFunc1(
|
|
r.creatorApplications.List,
|
|
Query[dto.TenantListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/creator-applications/:id<int>/review -> creatorApplications.Review")
|
|
router.Post("/super/v1/creator-applications/:id<int>/review"[len(r.Path()):], Func3(
|
|
r.creatorApplications.Review,
|
|
Local[*models.User]("__ctx_user"),
|
|
PathParam[int64]("id"),
|
|
Body[dto.SuperCreatorApplicationReviewForm]("form"),
|
|
))
|
|
// Register routes for controller: creators
|
|
r.log.Debugf("Registering route: Get /super/v1/creators -> creators.List")
|
|
router.Get("/super/v1/creators"[len(r.Path()):], DataFunc1(
|
|
r.creators.List,
|
|
Query[dto.TenantListFilter]("filter"),
|
|
))
|
|
// Register routes for controller: finance
|
|
r.log.Debugf("Registering route: Get /super/v1/finance/anomalies/balances -> finance.ListBalanceAnomalies")
|
|
router.Get("/super/v1/finance/anomalies/balances"[len(r.Path()):], DataFunc1(
|
|
r.finance.ListBalanceAnomalies,
|
|
Query[dto.SuperBalanceAnomalyFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/finance/anomalies/orders -> finance.ListOrderAnomalies")
|
|
router.Get("/super/v1/finance/anomalies/orders"[len(r.Path()):], DataFunc1(
|
|
r.finance.ListOrderAnomalies,
|
|
Query[dto.SuperOrderAnomalyFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/finance/ledgers -> finance.ListLedgers")
|
|
router.Get("/super/v1/finance/ledgers"[len(r.Path()):], DataFunc1(
|
|
r.finance.ListLedgers,
|
|
Query[dto.SuperLedgerListFilter]("filter"),
|
|
))
|
|
// Register routes for controller: notifications
|
|
r.log.Debugf("Registering route: Get /super/v1/notifications -> notifications.List")
|
|
router.Get("/super/v1/notifications"[len(r.Path()):], DataFunc1(
|
|
r.notifications.List,
|
|
Query[dto.SuperNotificationListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/notifications/templates -> notifications.ListTemplates")
|
|
router.Get("/super/v1/notifications/templates"[len(r.Path()):], DataFunc1(
|
|
r.notifications.ListTemplates,
|
|
Query[dto.SuperNotificationTemplateListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/notifications/broadcast -> notifications.Broadcast")
|
|
router.Post("/super/v1/notifications/broadcast"[len(r.Path()):], Func1(
|
|
r.notifications.Broadcast,
|
|
Body[dto.SuperNotificationBroadcastForm]("form"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/notifications/templates -> notifications.CreateTemplate")
|
|
router.Post("/super/v1/notifications/templates"[len(r.Path()):], DataFunc1(
|
|
r.notifications.CreateTemplate,
|
|
Body[dto.SuperNotificationTemplateCreateForm]("form"),
|
|
))
|
|
// Register routes for controller: orders
|
|
r.log.Debugf("Registering route: Get /super/v1/orders -> orders.List")
|
|
router.Get("/super/v1/orders"[len(r.Path()):], DataFunc1(
|
|
r.orders.List,
|
|
Query[dto.SuperOrderListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/orders/:id<int> -> orders.Get")
|
|
router.Get("/super/v1/orders/:id<int>"[len(r.Path()):], DataFunc1(
|
|
r.orders.Get,
|
|
PathParam[int64]("id"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/orders/statistics -> orders.Statistics")
|
|
router.Get("/super/v1/orders/statistics"[len(r.Path()):], DataFunc0(
|
|
r.orders.Statistics,
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/orders/:id<int>/flag -> orders.Flag")
|
|
router.Post("/super/v1/orders/:id<int>/flag"[len(r.Path()):], Func3(
|
|
r.orders.Flag,
|
|
Local[*models.User]("__ctx_user"),
|
|
PathParam[int64]("id"),
|
|
Body[dto.SuperOrderFlagForm]("form"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/orders/:id<int>/reconcile -> orders.Reconcile")
|
|
router.Post("/super/v1/orders/:id<int>/reconcile"[len(r.Path()):], Func3(
|
|
r.orders.Reconcile,
|
|
Local[*models.User]("__ctx_user"),
|
|
PathParam[int64]("id"),
|
|
Body[dto.SuperOrderReconcileForm]("form"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/orders/:id<int>/refund -> orders.Refund")
|
|
router.Post("/super/v1/orders/:id<int>/refund"[len(r.Path()):], Func2(
|
|
r.orders.Refund,
|
|
PathParam[int64]("id"),
|
|
Body[dto.SuperOrderRefundForm]("form"),
|
|
))
|
|
// Register routes for controller: payoutAccounts
|
|
r.log.Debugf("Registering route: Delete /super/v1/payout-accounts/:id<int> -> payoutAccounts.Remove")
|
|
router.Delete("/super/v1/payout-accounts/:id<int>"[len(r.Path()):], Func2(
|
|
r.payoutAccounts.Remove,
|
|
Local[*models.User]("__ctx_user"),
|
|
PathParam[int64]("id"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/payout-accounts -> payoutAccounts.List")
|
|
router.Get("/super/v1/payout-accounts"[len(r.Path()):], DataFunc1(
|
|
r.payoutAccounts.List,
|
|
Query[dto.SuperPayoutAccountListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/payout-accounts/:id<int>/review -> payoutAccounts.Review")
|
|
router.Post("/super/v1/payout-accounts/:id<int>/review"[len(r.Path()):], Func3(
|
|
r.payoutAccounts.Review,
|
|
Local[*models.User]("__ctx_user"),
|
|
PathParam[int64]("id"),
|
|
Body[dto.SuperPayoutAccountReviewForm]("form"),
|
|
))
|
|
// Register routes for controller: reports
|
|
r.log.Debugf("Registering route: Get /super/v1/reports/overview -> reports.Overview")
|
|
router.Get("/super/v1/reports/overview"[len(r.Path()):], DataFunc1(
|
|
r.reports.Overview,
|
|
Query[dto.SuperReportOverviewFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/reports/export -> reports.Export")
|
|
router.Post("/super/v1/reports/export"[len(r.Path()):], DataFunc1(
|
|
r.reports.Export,
|
|
Body[dto.SuperReportExportForm]("form"),
|
|
))
|
|
// Register routes for controller: systemConfigs
|
|
r.log.Debugf("Registering route: Get /super/v1/system-configs -> systemConfigs.List")
|
|
router.Get("/super/v1/system-configs"[len(r.Path()):], DataFunc1(
|
|
r.systemConfigs.List,
|
|
Query[dto.SuperSystemConfigListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Patch /super/v1/system-configs/:id<int> -> systemConfigs.Update")
|
|
router.Patch("/super/v1/system-configs/:id<int>"[len(r.Path()):], DataFunc3(
|
|
r.systemConfigs.Update,
|
|
Local[*models.User]("__ctx_user"),
|
|
PathParam[int64]("id"),
|
|
Body[dto.SuperSystemConfigUpdateForm]("form"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/system-configs -> systemConfigs.Create")
|
|
router.Post("/super/v1/system-configs"[len(r.Path()):], DataFunc2(
|
|
r.systemConfigs.Create,
|
|
Local[*models.User]("__ctx_user"),
|
|
Body[dto.SuperSystemConfigCreateForm]("form"),
|
|
))
|
|
// Register routes for controller: tenants
|
|
r.log.Debugf("Registering route: Get /super/v1/tenant-join-requests -> tenants.ListJoinRequests")
|
|
router.Get("/super/v1/tenant-join-requests"[len(r.Path()):], DataFunc1(
|
|
r.tenants.ListJoinRequests,
|
|
Query[dto.SuperTenantJoinRequestListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/tenants -> tenants.List")
|
|
router.Get("/super/v1/tenants"[len(r.Path()):], DataFunc1(
|
|
r.tenants.List,
|
|
Query[dto.TenantListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/tenants/:id<int> -> tenants.Get")
|
|
router.Get("/super/v1/tenants/:id<int>"[len(r.Path()):], DataFunc1(
|
|
r.tenants.Get,
|
|
PathParam[int64]("id"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/tenants/:tenantID<int>/users -> tenants.ListUsers")
|
|
router.Get("/super/v1/tenants/:tenantID<int>/users"[len(r.Path()):], DataFunc2(
|
|
r.tenants.ListUsers,
|
|
PathParam[int64]("tenantID"),
|
|
Query[dto.SuperTenantUserListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/tenants/health -> tenants.Health")
|
|
router.Get("/super/v1/tenants/health"[len(r.Path()):], DataFunc1(
|
|
r.tenants.Health,
|
|
Query[dto.TenantListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/tenants/statuses -> tenants.Statuses")
|
|
router.Get("/super/v1/tenants/statuses"[len(r.Path()):], DataFunc0(
|
|
r.tenants.Statuses,
|
|
))
|
|
r.log.Debugf("Registering route: Patch /super/v1/tenants/:id<int> -> tenants.UpdateExpire")
|
|
router.Patch("/super/v1/tenants/:id<int>"[len(r.Path()):], Func2(
|
|
r.tenants.UpdateExpire,
|
|
PathParam[int64]("id"),
|
|
Body[dto.TenantExpireUpdateForm]("form"),
|
|
))
|
|
r.log.Debugf("Registering route: Patch /super/v1/tenants/:id<int>/status -> tenants.UpdateStatus")
|
|
router.Patch("/super/v1/tenants/:id<int>/status"[len(r.Path()):], Func2(
|
|
r.tenants.UpdateStatus,
|
|
PathParam[int64]("id"),
|
|
Body[dto.TenantStatusUpdateForm]("form"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/tenant-join-requests/:id<int>/review -> tenants.ReviewJoinRequest")
|
|
router.Post("/super/v1/tenant-join-requests/:id<int>/review"[len(r.Path()):], Func3(
|
|
r.tenants.ReviewJoinRequest,
|
|
Local[*models.User]("__ctx_user"),
|
|
PathParam[int64]("id"),
|
|
Body[v1_dto.TenantJoinReviewForm]("form"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/tenants -> tenants.Create")
|
|
router.Post("/super/v1/tenants"[len(r.Path()):], Func1(
|
|
r.tenants.Create,
|
|
Body[dto.TenantCreateForm]("form"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/tenants/:tenantID<int>/invites -> tenants.CreateInvite")
|
|
router.Post("/super/v1/tenants/:tenantID<int>/invites"[len(r.Path()):], DataFunc2(
|
|
r.tenants.CreateInvite,
|
|
PathParam[int64]("tenantID"),
|
|
Body[v1_dto.TenantInviteCreateForm]("form"),
|
|
))
|
|
// Register routes for controller: users
|
|
r.log.Debugf("Registering route: Get /super/v1/users -> users.List")
|
|
router.Get("/super/v1/users"[len(r.Path()):], DataFunc1(
|
|
r.users.List,
|
|
Query[dto.UserListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/users/:id<int> -> users.Get")
|
|
router.Get("/super/v1/users/:id<int>"[len(r.Path()):], DataFunc1(
|
|
r.users.Get,
|
|
PathParam[int64]("id"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/users/:id<int>/coupons -> users.ListCoupons")
|
|
router.Get("/super/v1/users/:id<int>/coupons"[len(r.Path()):], DataFunc2(
|
|
r.users.ListCoupons,
|
|
PathParam[int64]("id"),
|
|
Query[dto.SuperUserCouponListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/users/:id<int>/favorites -> users.ListFavorites")
|
|
router.Get("/super/v1/users/:id<int>/favorites"[len(r.Path()):], DataFunc2(
|
|
r.users.ListFavorites,
|
|
PathParam[int64]("id"),
|
|
Query[dto.SuperUserContentActionListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/users/:id<int>/following -> users.ListFollowing")
|
|
router.Get("/super/v1/users/:id<int>/following"[len(r.Path()):], DataFunc2(
|
|
r.users.ListFollowing,
|
|
PathParam[int64]("id"),
|
|
Query[dto.SuperUserTenantListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/users/:id<int>/library -> users.ListLibrary")
|
|
router.Get("/super/v1/users/:id<int>/library"[len(r.Path()):], DataFunc2(
|
|
r.users.ListLibrary,
|
|
PathParam[int64]("id"),
|
|
Query[dto.SuperUserLibraryListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/users/:id<int>/likes -> users.ListLikes")
|
|
router.Get("/super/v1/users/:id<int>/likes"[len(r.Path()):], DataFunc2(
|
|
r.users.ListLikes,
|
|
PathParam[int64]("id"),
|
|
Query[dto.SuperUserContentActionListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/users/:id<int>/notifications -> users.ListNotifications")
|
|
router.Get("/super/v1/users/:id<int>/notifications"[len(r.Path()):], DataFunc2(
|
|
r.users.ListNotifications,
|
|
PathParam[int64]("id"),
|
|
Query[dto.SuperUserNotificationListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/users/:id<int>/realname -> users.RealName")
|
|
router.Get("/super/v1/users/:id<int>/realname"[len(r.Path()):], DataFunc1(
|
|
r.users.RealName,
|
|
PathParam[int64]("id"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/users/:id<int>/tenants -> users.ListTenants")
|
|
router.Get("/super/v1/users/:id<int>/tenants"[len(r.Path()):], DataFunc2(
|
|
r.users.ListTenants,
|
|
PathParam[int64]("id"),
|
|
Query[dto.SuperUserTenantListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/users/:id<int>/wallet -> users.Wallet")
|
|
router.Get("/super/v1/users/:id<int>/wallet"[len(r.Path()):], DataFunc1(
|
|
r.users.Wallet,
|
|
PathParam[int64]("id"),
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/users/statistics -> users.Statistics")
|
|
router.Get("/super/v1/users/statistics"[len(r.Path()):], DataFunc0(
|
|
r.users.Statistics,
|
|
))
|
|
r.log.Debugf("Registering route: Get /super/v1/users/statuses -> users.Statuses")
|
|
router.Get("/super/v1/users/statuses"[len(r.Path()):], DataFunc0(
|
|
r.users.Statuses,
|
|
))
|
|
r.log.Debugf("Registering route: Patch /super/v1/users/:id<int>/roles -> users.UpdateRoles")
|
|
router.Patch("/super/v1/users/:id<int>/roles"[len(r.Path()):], Func2(
|
|
r.users.UpdateRoles,
|
|
PathParam[int64]("id"),
|
|
Body[dto.UserRolesUpdateForm]("form"),
|
|
))
|
|
r.log.Debugf("Registering route: Patch /super/v1/users/:id<int>/status -> users.UpdateStatus")
|
|
router.Patch("/super/v1/users/:id<int>/status"[len(r.Path()):], Func2(
|
|
r.users.UpdateStatus,
|
|
PathParam[int64]("id"),
|
|
Body[dto.UserStatusUpdateForm]("form"),
|
|
))
|
|
// Register routes for controller: withdrawals
|
|
r.log.Debugf("Registering route: Get /super/v1/withdrawals -> withdrawals.List")
|
|
router.Get("/super/v1/withdrawals"[len(r.Path()):], DataFunc1(
|
|
r.withdrawals.List,
|
|
Query[dto.SuperOrderListFilter]("filter"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/withdrawals/:id<int>/approve -> withdrawals.Approve")
|
|
router.Post("/super/v1/withdrawals/:id<int>/approve"[len(r.Path()):], Func2(
|
|
r.withdrawals.Approve,
|
|
Local[*models.User]("__ctx_user"),
|
|
PathParam[int64]("id"),
|
|
))
|
|
r.log.Debugf("Registering route: Post /super/v1/withdrawals/:id<int>/reject -> withdrawals.Reject")
|
|
router.Post("/super/v1/withdrawals/:id<int>/reject"[len(r.Path()):], Func3(
|
|
r.withdrawals.Reject,
|
|
Local[*models.User]("__ctx_user"),
|
|
PathParam[int64]("id"),
|
|
Body[dto.SuperWithdrawalRejectForm]("form"),
|
|
))
|
|
|
|
r.log.Info("Successfully registered all routes")
|
|
}
|