Documentation ¶
Index ¶
- func GetArrayFormValueAsUint(ctx *gin.Context, name string) ([]uint, error)
- func GetArrayOfFromFiles(ctx *gin.Context, name string) ([]*multipart.FileHeader, error)
- func GetFormValuesAsString(ctx *gin.Context, name string) (value string, err error)
- func GetFormValuesAsUint(ctx *gin.Context, name string) (uint, error)
- func GetParamAsUint(ctx *gin.Context, key string) (uint, error)
- func GetQueryValueAsUint(ctx *gin.Context, key string) (uint, error)
- type Address
- type ApplyCoupon
- type ApproveOrder
- type BlockUser
- type Brand
- type Cart
- type Category
- type Coupon
- type EditAddress
- type EditCoupon
- type EditUser
- type Login
- type OTPLogin
- type OTPVerify
- type Offer
- type OfferCategory
- type OfferProduct
- type OrderPayment
- type Pagination
- type PaymentMethod
- type PaymentMethodUpdate
- type Product
- type ProductItem
- type RazorpayVerify
- type RefreshToken
- type Return
- type SalesReport
- type SubCategory
- type UpdateCartItem
- type UpdateCategoryOffer
- type UpdateOrder
- type UpdateOrderReturn
- type UpdateProduct
- type UpdateProductOffer
- type UpdateStock
- type UserSignUp
- type Variation
- type VariationOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetArrayFormValueAsUint ¶
Get value from request form as array slice
func GetArrayOfFromFiles ¶
Get multiple form files from request body
func GetFormValuesAsString ¶
Get values from request form as string
func GetFormValuesAsUint ¶
Get values from request form as string
func GetParamAsUint ¶
Get query params as uint from request url
Types ¶
type Address ¶
type Address struct { Name string `json:"name" binding:"required,min=2,max=50"` PhoneNumber string `json:"phone_number" binding:"required,min=10,max=10"` House string `json:"house" binding:"required"` Area string `json:"area"` LandMark string `json:"land_mark" binding:"required"` City string `json:"city"` Pincode uint `json:"pincode" binding:"required"` IsDefault *bool `json:"is_default"` }
for address add address
type ApplyCoupon ¶
type ApplyCoupon struct {
CouponCode string `json:"coupon_code" binding:"required"`
}
type ApproveOrder ¶
type ApproveOrder struct { ShopOrderID uint PaymentType domain.PaymentType }
type Brand ¶
type Brand struct {
Name string `json:"category_name" binding:"required,min=3,max=25"`
}
type Cart ¶
type Cart struct { UserID uint `json:"-"` ProductItemID uint `json:"product_item_id" binding:"required"` }
user side
type Coupon ¶
type Coupon struct { CouponName string `json:"coupon_name" binding:"required,min=3,max=25"` Description string `json:"description" binding:"required,min=6,max=150"` ExpireDate time.Time `json:"expire_date" binding:"required"` DiscountRate uint `json:"discount_rate" binding:"required,numeric,min=1,max=100"` MinimumCartPrice uint `json:"minimum_cart_price" binding:"required,numeric,min=1"` Image string `json:"image" binding:"required"` BlockStatus bool `json:"block_status"` }
type EditAddress ¶
type EditAddress struct { ID uint `json:"address_id" binding:"required"` Name string `json:"name" binding:"required,min=2,max=50"` PhoneNumber string `json:"phone_number" binding:"required,min=10,max=10"` House string `json:"house" binding:"required"` Area string `json:"area"` LandMark string `json:"land_mark" binding:"required"` City string `json:"city"` Pincode uint `json:"pincode" binding:"required"` IsDefault *bool `json:"is_default"` }
type EditCoupon ¶
type EditCoupon struct { CouponID uint `json:"coupon_id"` CouponName string `json:"coupon_name" binding:"required,min=3,max=25"` Description string `json:"description" binding:"required,min=6,max=150"` ExpireDate time.Time `json:"expire_date" binding:"required"` DiscountRate uint `json:"discount_rate" binding:"required,numeric,min=1,max=100"` MinimumCartPrice uint `json:"minimum_cart_price" binding:"required,numeric,min=1"` Image string `json:"image" binding:"required"` BlockStatus bool `json:"block_status"` }
type EditUser ¶
type EditUser struct { UserName string `json:"user_name" binding:"required,min=3,max=15"` FirstName string `json:"first_name" binding:"required,min=2,max=50"` LastName string `json:"last_name" binding:"required,min=1,max=50"` Age uint `json:"age" binding:"required,numeric"` Email string `json:"email" binding:"required,email"` Phone string `json:"phone" binding:"required,min=10,max=10"` Password string `json:"password" binding:"omitempty,eqfield=ConfirmPassword"` ConfirmPassword string `json:"confirm_password" binding:"omitempty"` }
type Offer ¶
type Offer struct { Name string `json:"offer_name" binding:"required"` Description string `json:"description" binding:"required,min=6,max=50"` DiscountRate uint `json:"discount_rate" binding:"required,numeric,min=1,max=100"` StartDate time.Time `json:"start_date" binding:"required"` EndDate time.Time `json:"end_date" binding:"required,gtfield=StartDate"` }
offer
type OfferCategory ¶
type OfferProduct ¶
type OrderPayment ¶
type Pagination ¶
func GetPagination ¶
func GetPagination(ctx *gin.Context) Pagination
type PaymentMethod ¶
type PaymentMethodUpdate ¶
type Product ¶
type Product struct { Name string `json:"product_name" binding:"required,min=3,max=50"` Description string `json:"description" binding:"required,min=10,max=100"` CategoryID uint `json:"category_id" binding:"required"` BrandID uint `json:"brand_id" binding:"required"` Price uint `json:"price" binding:"required,numeric"` ImageFileHeader *multipart.FileHeader }
for a new product
type ProductItem ¶
type ProductItem struct { Price uint `json:"price" binding:"required,min=1"` VariationOptionIDs []uint `json:"variation_option_ids" binding:"required,gte=1"` QtyInStock uint `json:"qty_in_stock" binding:"required,min=1"` SKU string `json:"-"` ImageFileHeaders []*multipart.FileHeader `json:"images" binding:"required,gte=1"` }
for a new productItem
type RazorpayVerify ¶
type RefreshToken ¶
type RefreshToken struct {
RefreshToken string `json:"refresh_token" binding:"min=10"`
}
type Return ¶
type Return struct { ShopOrderID uint `json:"shop_order_id" binding:"required"` ReturnReason string `json:"return_reason" binding:"required,min=6,max=150"` }
return request
type SalesReport ¶
type SalesReport struct { StartDate time.Time `json:"start_date"` EndDate time.Time `json:"end_date"` Pagination Pagination `json:"pagination"` }
type SubCategory ¶
type UpdateCartItem ¶
type UpdateCategoryOffer ¶
type UpdateOrder ¶
type UpdateOrderReturn ¶
type UpdateProduct ¶
type UpdateProduct struct { ID uint `json:"product_id" binding:"required"` Name string `json:"product_name" binding:"required,min=3,max=50"` Description string `json:"description" binding:"required,min=10,max=100"` CategoryID uint `json:"category_id" binding:"required"` BrandID uint `json:"brand_id" binding:"required"` Price uint `json:"price" binding:"required,numeric"` Image string `json:"image"` }
type UpdateProductOffer ¶
type UpdateStock ¶
stock
type UserSignUp ¶
type UserSignUp struct { UserName string `json:"user_name" binding:"required,min=3,max=15"` FirstName string `json:"first_name" binding:"required,min=2,max=50"` LastName string `json:"last_name" binding:"required,min=1,max=50"` Age uint `json:"age" binding:"required,numeric"` Email string `json:"email" binding:"required,email"` Phone string `json:"phone" binding:"required,min=10,max=10"` Password string `json:"password" binding:"required,eqfield=ConfirmPassword"` ConfirmPassword string `json:"confirm_password" binding:"required"` }
type Variation ¶
type Variation struct {
Names []string `json:"variation_names" binding:"required,dive,min=1"`
}
type VariationOption ¶
type VariationOption struct {
Values []string `json:"variation_value" binding:"required,dive,min=1"`
}
Click to show internal directories.
Click to hide internal directories.