feat: restore creator controller methods and regenerate routes
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -150,6 +150,154 @@ func (r *Routes) Register(router fiber.Router) {
|
||||
r.content.AddLike,
|
||||
PathParam[int64]("id"),
|
||||
))
|
||||
// Register routes for controller: Creator
|
||||
r.log.Debugf("Registering route: Delete /v1/t/:tenantCode/creator/contents/:id<int> -> creator.DeleteContent")
|
||||
router.Delete("/v1/t/:tenantCode/creator/contents/:id<int>"[len(r.Path()):], Func1(
|
||||
r.creator.DeleteContent,
|
||||
PathParam[int64]("id"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Delete /v1/t/:tenantCode/creator/members/:id<int> -> creator.RemoveMember")
|
||||
router.Delete("/v1/t/:tenantCode/creator/members/:id<int>"[len(r.Path()):], Func1(
|
||||
r.creator.RemoveMember,
|
||||
PathParam[int64]("id"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Delete /v1/t/:tenantCode/creator/members/invites/:id<int> -> creator.DisableMemberInvite")
|
||||
router.Delete("/v1/t/:tenantCode/creator/members/invites/:id<int>"[len(r.Path()):], Func1(
|
||||
r.creator.DisableMemberInvite,
|
||||
PathParam[int64]("id"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Delete /v1/t/:tenantCode/creator/payout-accounts -> creator.RemovePayoutAccount")
|
||||
router.Delete("/v1/t/:tenantCode/creator/payout-accounts"[len(r.Path()):], Func1(
|
||||
r.creator.RemovePayoutAccount,
|
||||
QueryParam[int64]("id"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /v1/t/:tenantCode/creator/contents -> creator.ListContents")
|
||||
router.Get("/v1/t/:tenantCode/creator/contents"[len(r.Path()):], DataFunc1(
|
||||
r.creator.ListContents,
|
||||
Query[dto.CreatorContentListFilter]("filter"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /v1/t/:tenantCode/creator/contents/:id<int> -> creator.GetContent")
|
||||
router.Get("/v1/t/:tenantCode/creator/contents/:id<int>"[len(r.Path()):], DataFunc1(
|
||||
r.creator.GetContent,
|
||||
PathParam[int64]("id"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /v1/t/:tenantCode/creator/coupons -> creator.ListCoupons")
|
||||
router.Get("/v1/t/:tenantCode/creator/coupons"[len(r.Path()):], DataFunc1(
|
||||
r.creator.ListCoupons,
|
||||
Query[dto.CouponListFilter]("filter"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /v1/t/:tenantCode/creator/coupons/:id<int> -> creator.GetCoupon")
|
||||
router.Get("/v1/t/:tenantCode/creator/coupons/:id<int>"[len(r.Path()):], DataFunc1(
|
||||
r.creator.GetCoupon,
|
||||
PathParam[int64]("id"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /v1/t/:tenantCode/creator/dashboard -> creator.Dashboard")
|
||||
router.Get("/v1/t/:tenantCode/creator/dashboard"[len(r.Path()):], DataFunc0(
|
||||
r.creator.Dashboard,
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /v1/t/:tenantCode/creator/members -> creator.ListMembers")
|
||||
router.Get("/v1/t/:tenantCode/creator/members"[len(r.Path()):], DataFunc1(
|
||||
r.creator.ListMembers,
|
||||
Query[dto.TenantMemberListFilter]("filter"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /v1/t/:tenantCode/creator/members/invites -> creator.ListMemberInvites")
|
||||
router.Get("/v1/t/:tenantCode/creator/members/invites"[len(r.Path()):], DataFunc1(
|
||||
r.creator.ListMemberInvites,
|
||||
Query[dto.TenantInviteListFilter]("filter"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /v1/t/:tenantCode/creator/members/join-requests -> creator.ListMemberJoinRequests")
|
||||
router.Get("/v1/t/:tenantCode/creator/members/join-requests"[len(r.Path()):], DataFunc1(
|
||||
r.creator.ListMemberJoinRequests,
|
||||
Query[dto.TenantJoinRequestListFilter]("filter"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /v1/t/:tenantCode/creator/orders -> creator.ListOrders")
|
||||
router.Get("/v1/t/:tenantCode/creator/orders"[len(r.Path()):], DataFunc1(
|
||||
r.creator.ListOrders,
|
||||
Query[dto.CreatorOrderListFilter]("filter"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /v1/t/:tenantCode/creator/payout-accounts -> creator.ListPayoutAccounts")
|
||||
router.Get("/v1/t/:tenantCode/creator/payout-accounts"[len(r.Path()):], DataFunc0(
|
||||
r.creator.ListPayoutAccounts,
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /v1/t/:tenantCode/creator/reports/overview -> creator.ReportOverview")
|
||||
router.Get("/v1/t/:tenantCode/creator/reports/overview"[len(r.Path()):], DataFunc1(
|
||||
r.creator.ReportOverview,
|
||||
Query[dto.ReportOverviewFilter]("filter"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /v1/t/:tenantCode/creator/settings -> creator.GetSettings")
|
||||
router.Get("/v1/t/:tenantCode/creator/settings"[len(r.Path()):], DataFunc0(
|
||||
r.creator.GetSettings,
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /v1/t/:tenantCode/creator/apply -> creator.Apply")
|
||||
router.Post("/v1/t/:tenantCode/creator/apply"[len(r.Path()):], Func1(
|
||||
r.creator.Apply,
|
||||
Body[dto.ApplyForm]("form"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /v1/t/:tenantCode/creator/contents -> creator.CreateContent")
|
||||
router.Post("/v1/t/:tenantCode/creator/contents"[len(r.Path()):], Func1(
|
||||
r.creator.CreateContent,
|
||||
Body[dto.ContentCreateForm]("form"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /v1/t/:tenantCode/creator/coupons -> creator.CreateCoupon")
|
||||
router.Post("/v1/t/:tenantCode/creator/coupons"[len(r.Path()):], DataFunc1(
|
||||
r.creator.CreateCoupon,
|
||||
Body[dto.CouponCreateForm]("form"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /v1/t/:tenantCode/creator/coupons/:id<int>/grant -> creator.GrantCoupon")
|
||||
router.Post("/v1/t/:tenantCode/creator/coupons/:id<int>/grant"[len(r.Path()):], DataFunc2(
|
||||
r.creator.GrantCoupon,
|
||||
PathParam[int64]("id"),
|
||||
Body[dto.CouponGrantForm]("form"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /v1/t/:tenantCode/creator/members/:id<int>/review -> creator.ReviewMemberJoinRequest")
|
||||
router.Post("/v1/t/:tenantCode/creator/members/:id<int>/review"[len(r.Path()):], Func2(
|
||||
r.creator.ReviewMemberJoinRequest,
|
||||
PathParam[int64]("id"),
|
||||
Body[dto.TenantJoinReviewForm]("form"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /v1/t/:tenantCode/creator/members/invite -> creator.CreateMemberInvite")
|
||||
router.Post("/v1/t/:tenantCode/creator/members/invite"[len(r.Path()):], DataFunc1(
|
||||
r.creator.CreateMemberInvite,
|
||||
Body[dto.TenantInviteCreateForm]("form"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /v1/t/:tenantCode/creator/orders/:id<int>/refund -> creator.RefundOrder")
|
||||
router.Post("/v1/t/:tenantCode/creator/orders/:id<int>/refund"[len(r.Path()):], Func2(
|
||||
r.creator.RefundOrder,
|
||||
PathParam[int64]("id"),
|
||||
Body[dto.RefundForm]("form"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /v1/t/:tenantCode/creator/payout-accounts -> creator.AddPayoutAccount")
|
||||
router.Post("/v1/t/:tenantCode/creator/payout-accounts"[len(r.Path()):], Func1(
|
||||
r.creator.AddPayoutAccount,
|
||||
Body[dto.PayoutAccount]("form"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /v1/t/:tenantCode/creator/reports/export -> creator.ExportReport")
|
||||
router.Post("/v1/t/:tenantCode/creator/reports/export"[len(r.Path()):], DataFunc1(
|
||||
r.creator.ExportReport,
|
||||
Body[dto.ReportExportForm]("form"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /v1/t/:tenantCode/creator/withdraw -> creator.Withdraw")
|
||||
router.Post("/v1/t/:tenantCode/creator/withdraw"[len(r.Path()):], Func1(
|
||||
r.creator.Withdraw,
|
||||
Body[dto.WithdrawForm]("form"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Put /v1/t/:tenantCode/creator/contents/:id<int> -> creator.UpdateContent")
|
||||
router.Put("/v1/t/:tenantCode/creator/contents/:id<int>"[len(r.Path()):], Func2(
|
||||
r.creator.UpdateContent,
|
||||
PathParam[int64]("id"),
|
||||
Body[dto.ContentUpdateForm]("form"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Put /v1/t/:tenantCode/creator/coupons/:id<int> -> creator.UpdateCoupon")
|
||||
router.Put("/v1/t/:tenantCode/creator/coupons/:id<int>"[len(r.Path()):], DataFunc2(
|
||||
r.creator.UpdateCoupon,
|
||||
PathParam[int64]("id"),
|
||||
Body[dto.CouponUpdateForm]("form"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Put /v1/t/:tenantCode/creator/settings -> creator.UpdateSettings")
|
||||
router.Put("/v1/t/:tenantCode/creator/settings"[len(r.Path()):], Func1(
|
||||
r.creator.UpdateSettings,
|
||||
Body[dto.Settings]("form"),
|
||||
))
|
||||
// Register routes for controller: Storage
|
||||
r.log.Debugf("Registering route: Get /v1/t/:tenantCode/storage/* -> storage.Download")
|
||||
router.Get("/v1/t/:tenantCode/storage/*"[len(r.Path()):], Func2(
|
||||
@@ -163,6 +311,44 @@ func (r *Routes) Register(router fiber.Router) {
|
||||
QueryParam[string]("expires"),
|
||||
QueryParam[string]("sign"),
|
||||
))
|
||||
// Register routes for controller: Tenant
|
||||
r.log.Debugf("Registering route: Delete /v1/t/:tenantCode/tenants/:id<int>/follow -> tenant.Unfollow")
|
||||
router.Delete("/v1/t/:tenantCode/tenants/:id<int>/follow"[len(r.Path()):], Func1(
|
||||
r.tenant.Unfollow,
|
||||
PathParam[int64]("id"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Delete /v1/t/:tenantCode/tenants/:id<int>/join -> tenant.CancelJoin")
|
||||
router.Delete("/v1/t/:tenantCode/tenants/:id<int>/join"[len(r.Path()):], Func1(
|
||||
r.tenant.CancelJoin,
|
||||
PathParam[int64]("id"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /v1/t/:tenantCode/tenants -> tenant.List")
|
||||
router.Get("/v1/t/:tenantCode/tenants"[len(r.Path()):], DataFunc1(
|
||||
r.tenant.List,
|
||||
Query[dto.TenantListFilter]("filter"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /v1/t/:tenantCode/tenants/:id<int> -> tenant.Get")
|
||||
router.Get("/v1/t/:tenantCode/tenants/:id<int>"[len(r.Path()):], DataFunc1(
|
||||
r.tenant.Get,
|
||||
PathParam[int64]("id"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /v1/t/:tenantCode/tenants/:id<int>/follow -> tenant.Follow")
|
||||
router.Post("/v1/t/:tenantCode/tenants/:id<int>/follow"[len(r.Path()):], Func1(
|
||||
r.tenant.Follow,
|
||||
PathParam[int64]("id"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /v1/t/:tenantCode/tenants/:id<int>/invites/accept -> tenant.AcceptInvite")
|
||||
router.Post("/v1/t/:tenantCode/tenants/:id<int>/invites/accept"[len(r.Path()):], Func2(
|
||||
r.tenant.AcceptInvite,
|
||||
PathParam[int64]("id"),
|
||||
Body[dto.TenantInviteAcceptForm]("form"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /v1/t/:tenantCode/tenants/:id<int>/join -> tenant.ApplyJoin")
|
||||
router.Post("/v1/t/:tenantCode/tenants/:id<int>/join"[len(r.Path()):], Func2(
|
||||
r.tenant.ApplyJoin,
|
||||
PathParam[int64]("id"),
|
||||
Body[dto.TenantJoinApplyForm]("form"),
|
||||
))
|
||||
// Register routes for controller: Transaction
|
||||
r.log.Debugf("Registering route: Get /v1/t/:tenantCode/orders/:id<int>/status -> transaction.Status")
|
||||
router.Get("/v1/t/:tenantCode/orders/:id<int>/status"[len(r.Path()):], DataFunc1(
|
||||
|
||||
Reference in New Issue
Block a user