Documentation ¶
Index ¶
- func CreateOrder(c *gin.Context)
- func CreateProduct(c *gin.Context)
- func CreateReview(c *gin.Context)
- func CreateShiipingAddress(c *gin.Context)
- func DeleteProduct(c *gin.Context)
- func DeleteReview(c *gin.Context)
- func GetAllOrders(c *gin.Context)
- func GetAllProduct(c *gin.Context)
- func GetAllReviews(c *gin.Context)
- func GetAllUsers(c *gin.Context)
- func GetOrder(c *gin.Context)
- func GetProductById(c *gin.Context)
- func GetProfile(c *gin.Context)
- func GetRevById(c *gin.Context)
- func GetUser(c *gin.Context)
- func LoginUser(c *gin.Context)
- func LogoutUser(c *gin.Context)
- func RegisterUser(c *gin.Context)
- func UpdateOrde(c *gin.Context)
- func UpdateProduct(c *gin.Context)
- func UpdateReview(c *gin.Context)
- func UpdateUser(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOrder ¶
CreateOrder Create Order @Summary Create Order @Description Creates a new order. @Tags Order @Accept json @Produce json @Param order body models.Order true "Order object" @Success 201 {object} object "{"message": "Created Successfully", "id": string}" @Failure 500 {object} object "{"message": "Internal Server Error"}" @Router /order [post]
func CreateProduct ¶
CreateProduct Create Product @Summary Create Product @Description Creates a new product. @Tags Product @Security ApiKeyAuth @Accept multipart/form-data @Produce json @Param Authorization header string true "Bearer token" @Param name formData string true "Product Name" @Param description formData string false "Product Description" @Param price formData number true "Product Price" @Param color formData []string false "Product Colors" @Param file formData file true "Product Images" @Success 201 {object} object "{"message": "Created Product Successfully", "productId": string, "id": string}" @Failure 400 {object} object "{"message": "Bad Request"}" @Failure 500 {object} object "{"message": "Error during creation of product"}" @Router /product/ [post]
func CreateReview ¶
CreateReview Create Review @Summary Create Review @Description Creates a new review for a product by ID. @Tags Review @Accept json @Produce json @Param id path string true "Product ID" @Param review body models.Review true "Review object" @Success 200 {object} object "{"message": "Review added successfully", "id": string}" @Failure 400 {object} object "{"message": "Invalid data"}" @Failure 500 {object} object "{"message": "Error during creating review"}" @Router /review/{id} [post]
func CreateShiipingAddress ¶
CreateShiipingAddress Create Shipping Address @Summary Create Shipping Address @Description Creates a new shipping address. @Tags Shipping @Accept json @Produce json @Param shipping body models.Shipping true "Shipping object" @Success 200 {object} object "{"message": "Created Successfully", "_id": string}" @Failure 400 {object} object "{"message": "Bad Request"}" @Failure 500 {object} object "{"message": "Internal Server Error"}" @Router /order/shipping [post]
func DeleteProduct ¶
DeleteProduct Delete Product @Summary Delete Product @Description Deletes a product by ID. @Tags Product @Security ApiKeyAuth @Accept json @Produce json @Param Authorization header string true "Bearer token" @Param id path string true "Product ID" @Success 200 {object} object "{"message": "Product Deleted", "count": integer}" @Failure 500 {object} object "{"message": "Internal Server Error"}" @Router /product/{id} [delete]
func DeleteReview ¶
DeleteReview Delete Review @Summary Delete Review @Description Deletes a review by ID. @Tags Review @Accept json @Produce json @Param id path string true "Review ID" @Success 200 {object} object "{"count": integer}" @Failure 400 {object} object "{"message": "Please Provide ID"}" @Failure 500 {object} object "{"message": "Internal Server Error"}" @Router /review/{id} [delete]
func GetAllOrders ¶
GetAllOrders Get All Orders @Summary Get All Orders @Description Retrieves a list of all orders. @Tags Order @Accept json @Produce json @Success 200 {object} object "{"message": "All orders", "orders": []}" @Failure 500 {object} object "{"message": "Internal Server Error"}" @Router /order [get]
func GetAllProduct ¶
GetAllProduct Get All Products @Summary Get All Products @Description Retrieves a list of all products. @Tags Product @Accept json @Produce json @Param lt query string false "Price less than" @Param gt query string false "Price greater than" @Param color query string false "Color filter" @Success 200 {object} object "{"message": "All products", "products": []}" @Failure 500 {object} object "{"message": "Internal Server Error"}" @Router /product/ [get]
func GetAllReviews ¶
GetAllReviews Get All Reviews @Summary Get All Reviews @Description Retrieves a list of all reviews. @Tags Review @Accept json @Produce json @Success 200 {object} object "{"total": integer, "reviews": []}" @Failure 500 {object} object "{"message": "Internal Server Error"}" @Router /review [get]
func GetAllUsers ¶
GetAllUsers Get All User GetAllUsers Get All Users @Summary Get All Users @Description Retrieves a list of all users. @Tags User @Produce json @Success 200 {object} object "{"message": "All user list", "total": integer, "users": []}" @Failure 404 {object} object "{"message": "No users Found"}" @Router /user [get]
func GetOrder ¶
GetOrder Get Order @Summary Get Order @Description Retrieves an order by ID. @Tags Order @Accept json @Produce json @Param id path string true "Order ID" @Success 200 {object} object "{"message": "Success", "order": object}" @Failure 500 {object} object "{"message": "Internal Server Error"}" @Router /order/{id} [get]
func GetProductById ¶
GetProductById Get Product By ID @Summary Get Product By ID @Description Retrieves product information by ID. @Tags Product @Accept json @Produce json @Param id path string true "Product ID" @Success 200 {object} object "{"message": "Get product by id", "product": object}" @Failure 404 {object} object "{"message": "No Product Found"}" @Router /product/{id} [get]
func GetProfile ¶
GetProfile GEt Profile GetProfile Get User Profile @Summary Get User Profile @Description Retrieves the profile information of the authenticated user. @Tags User @Security ApiKeyAuth @Accept json @Produce json @Param Authorization header string true "Bearer token" @Success 200 {object} object "{"user": "User profile information"}" @Failure 401 {object} object "{"message": "Unauthorized"}" @Router /user/profile [get]
func GetRevById ¶
GetRevById Get Review By ID @Summary Get Review By ID @Description Retrieves a review by ID. @Tags Review @Accept json @Produce json @Param id path string true "Review ID" @Success 200 {object} object "{"message": "Got successfully", "review": object}" @Failure 500 {object} object "{"message": "Internal Server Error"}" @Router /review/{id} [get]
func GetUser ¶
GetUser Get User By Id GetUser By Id @Summary Get User By Id @Description Retrieves user information by ID. @Tags User @Param id path string true "User ID" @Produce json @Success 200 {object} object "{"message": "User information"}" @Failure 404 {object} object "{"message": "No user Found"}" @Router /user/{id} [get]
func LoginUser ¶
LoginUser Login User LoginUser Login User @Summary Login User @Description Responds with the message and token books as JSON. @Tags User @Param user body models.User true "User object" @Produce json @Success 200 {object} object "{"message": "Login Successfully", "token": string}" @Failure 400 {object} object "{"message": "Inavalid data"} "Bad request" @Failure 401 {object} object "{"message": "No user Found"} "Unauthorized er Error" @Router /user/register [post]
func LogoutUser ¶
LogoutUser Logout User @Summary Logout User @Description Logs out the user by removing the token cookie. @Tags User @Produce json @Success 200 {object} object "{"message": "Logout successfully"}" @Router /user/logout [get]
func RegisterUser ¶
RegisterUser Register User @Summary Create a new User @Description Responds with the message and token books as JSON. @Tags User @Param user body models.User true "User object" @Produce json @Success 200 {object} object "{"message": "User Created successfully", "token": string}" @Failure 400 {object} object "{"message": "Bad request"} "Bad request" @Failure 500 {object} object "{"message": "Internal Server Error"} "Internal Server Error" @Router /user/register [post]
func UpdateOrde ¶
UpdateOrde Update Order @Summary Update Order @Description Updates the status of an order by ID. @Tags Order @Accept json @Produce json @Param id path string true "Order ID" @Param order body models.Order true "Order object" @Success 200 {object} object "{"message": "Updated successfully", "count": integer}" @Failure 400 {object} object "{"message": "Order Status is empty"}" @Failure 500 {object} object "{"message": "Internal Server Error"}" @Router /order/{id} [put]
func UpdateProduct ¶
UpdateProduct Update Product @Summary Update Product @Description Updates product information by ID. @Tags Product @Security ApiKeyAuth @Accept json @Produce json @Param Authorization header string true "Bearer token" @Param id path string true "Product ID" @Param product body models.Product true "Product object" @Success 200 {object} object "{"message": "Updated Successfully", "count": integer}" @Failure 400 {object} object "{"message": "Bad Request"}" @Failure 500 {object} object "{"message": "Internal Server Error"}" @Router /product/{id} [put]
func UpdateReview ¶
UpdateReview Update Review @Summary Update Review @Description Updates a review by ID. @Tags Review @Accept json @Produce json @Param id path string true "Review ID" @Param review body models.Review true "Review object" @Success 200 {object} object "{"updatedCount": integer}" @Failure 400 {object} object "{"message": "Provide the valid data"}" @Failure 500 {object} object "{"message": "Internal Server Error"}" @Router /review/{id} [put]
func UpdateUser ¶
UpdateUser UPadte User Profile UpdateUser Update User @Summary Update User @Description Updates user information. @Tags User @Security ApiKeyAuth @Accept json @Produce json @Param Authorization header string true "Bearer token" @Param user body models.User true "User object" @Success 200 {object} object "{"message": "Updated successfully", "count": integer}" @Failure 400 {object} object "{"message": "Invalid info"}" @Failure 500 {object} object "{"message": "Error during updating user"}" @Router /user [put]
Types ¶
This section is empty.