Documentation ¶
Index ¶
- func CreatePlan(c *fiber.Ctx) error
- func CreateSubscription(c *fiber.Ctx) error
- func GetPlanByID(c *fiber.Ctx) error
- func GetPlans(c *fiber.Ctx) error
- func GetUserSubscriptions(c *fiber.Ctx) error
- func SubscribeUser(c *fiber.Ctx) error
- type PlanRequest
- type PlanResponse
- type SubscriptionRequest
- type SubscriptionResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePlan ¶
func CreatePlan(c *fiber.Ctx) error
func CreateSubscription ¶
func CreateSubscription(c *fiber.Ctx) error
func GetPlanByID ¶
func GetPlanByID(c *fiber.Ctx) error
func GetUserSubscriptions ¶
func GetUserSubscriptions(c *fiber.Ctx) error
GetUserSubscriptions retrieves all subscriptions for a user
func SubscribeUser ¶
func SubscribeUser(c *fiber.Ctx) error
SubscribeUser handles user subscription requests
Types ¶
type PlanRequest ¶
type PlanRequest struct { Name string `json:"name" validate:"required"` Price float64 `json:"price" validate:"required"` Duration int `json:"duration" validate:"required"` }
PlanRequest represents the plan request payload
type PlanResponse ¶
type PlanResponse struct { Success bool `json:"success"` Data *models.Plan `json:"data,omitempty"` Error string `json:"error,omitempty"` }
PlanResponse represents the standardized response for plans
type SubscriptionRequest ¶
type SubscriptionRequest struct { UserID uint `json:"user_id" validate:"required"` PlanID uint `json:"plan_id" validate:"required"` }
SubscriptionRequest represents the subscription request payload
type SubscriptionResponse ¶
type SubscriptionResponse struct { Success bool `json:"success"` Data *models.Subscription `json:"data,omitempty"` Error string `json:"error,omitempty"` }
SubscriptionResponse represents the standardized response
Click to show internal directories.
Click to hide internal directories.