feat: add shipping template management and update favicon
This commit is contained in:
@@ -41,44 +41,46 @@ type UpdatePurchaseGroupRequest struct {
|
||||
}
|
||||
|
||||
type CreateProductRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
Description string `json:"description"`
|
||||
Price float64 `json:"price" binding:"gte=0"`
|
||||
Weight float64 `json:"weight"`
|
||||
MinPurchase int `json:"min_purchase"`
|
||||
MaxPurchase *int `json:"max_purchase"`
|
||||
MinWeight *float64 `json:"min_weight"`
|
||||
MaxWeight *float64 `json:"max_weight"`
|
||||
MinAmount *float64 `json:"min_amount"`
|
||||
MaxAmount *float64 `json:"max_amount"`
|
||||
RequireCredit bool `json:"require_credit"`
|
||||
CreditCost int `json:"credit_cost"`
|
||||
CreditReward int `json:"credit_reward"`
|
||||
Images string `json:"images"`
|
||||
BrandID *uint `json:"brand_id"`
|
||||
CategoryIDs []uint `json:"category_ids"`
|
||||
CustomFields []CustomFieldRequest `json:"custom_fields"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
Description string `json:"description"`
|
||||
Price float64 `json:"price" binding:"gte=0"`
|
||||
Weight float64 `json:"weight"`
|
||||
MinPurchase int `json:"min_purchase"`
|
||||
MaxPurchase *int `json:"max_purchase"`
|
||||
MinWeight *float64 `json:"min_weight"`
|
||||
MaxWeight *float64 `json:"max_weight"`
|
||||
MinAmount *float64 `json:"min_amount"`
|
||||
MaxAmount *float64 `json:"max_amount"`
|
||||
RequireCredit bool `json:"require_credit"`
|
||||
CreditCost int `json:"credit_cost"`
|
||||
CreditReward int `json:"credit_reward"`
|
||||
Images string `json:"images"`
|
||||
BrandID *uint `json:"brand_id"`
|
||||
ShippingTemplateID *uint `json:"shipping_template_id"`
|
||||
CategoryIDs []uint `json:"category_ids"`
|
||||
CustomFields []CustomFieldRequest `json:"custom_fields"`
|
||||
}
|
||||
|
||||
type UpdateProductRequest struct {
|
||||
Name *string `json:"name"`
|
||||
Description *string `json:"description"`
|
||||
Price *float64 `json:"price"`
|
||||
Weight *float64 `json:"weight"`
|
||||
MinPurchase *int `json:"min_purchase"`
|
||||
MaxPurchase *int `json:"max_purchase"`
|
||||
MinWeight *float64 `json:"min_weight"`
|
||||
MaxWeight *float64 `json:"max_weight"`
|
||||
MinAmount *float64 `json:"min_amount"`
|
||||
MaxAmount *float64 `json:"max_amount"`
|
||||
RequireCredit *bool `json:"require_credit"`
|
||||
CreditCost *int `json:"credit_cost"`
|
||||
CreditReward *int `json:"credit_reward"`
|
||||
Images *string `json:"images"`
|
||||
IsActive *bool `json:"is_active"`
|
||||
BrandID *uint `json:"brand_id"`
|
||||
CategoryIDs []uint `json:"category_ids"`
|
||||
CustomFields []CustomFieldRequest `json:"custom_fields"`
|
||||
Name *string `json:"name"`
|
||||
Description *string `json:"description"`
|
||||
Price *float64 `json:"price"`
|
||||
Weight *float64 `json:"weight"`
|
||||
MinPurchase *int `json:"min_purchase"`
|
||||
MaxPurchase *int `json:"max_purchase"`
|
||||
MinWeight *float64 `json:"min_weight"`
|
||||
MaxWeight *float64 `json:"max_weight"`
|
||||
MinAmount *float64 `json:"min_amount"`
|
||||
MaxAmount *float64 `json:"max_amount"`
|
||||
RequireCredit *bool `json:"require_credit"`
|
||||
CreditCost *int `json:"credit_cost"`
|
||||
CreditReward *int `json:"credit_reward"`
|
||||
Images *string `json:"images"`
|
||||
IsActive *bool `json:"is_active"`
|
||||
BrandID *uint `json:"brand_id"`
|
||||
ShippingTemplateID *uint `json:"shipping_template_id"`
|
||||
CategoryIDs []uint `json:"category_ids"`
|
||||
CustomFields []CustomFieldRequest `json:"custom_fields"`
|
||||
}
|
||||
|
||||
type CustomFieldRequest struct {
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package schemas
|
||||
|
||||
// CreateShippingTemplateRequest 创建运费模板请求
|
||||
type CreateShippingTemplateRequest struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
CalcType string `json:"calc_type" binding:"required,oneof=weight piece"`
|
||||
FirstUnit float64 `json:"first_unit" binding:"required,gt=0"`
|
||||
FirstFee float64 `json:"first_fee" binding:"gte=0"`
|
||||
AdditionalUnit float64 `json:"additional_unit" binding:"required,gt=0"`
|
||||
AdditionalFee float64 `json:"additional_fee" binding:"gte=0"`
|
||||
FreeAmount float64 `json:"free_amount"`
|
||||
Provinces []string `json:"provinces"` // 省份列表
|
||||
IsDefault bool `json:"is_default"`
|
||||
SortOrder int `json:"sort_order"`
|
||||
}
|
||||
|
||||
// UpdateShippingTemplateRequest 更新运费模板请求
|
||||
type UpdateShippingTemplateRequest struct {
|
||||
Name *string `json:"name"`
|
||||
CalcType *string `json:"calc_type" binding:"omitempty,oneof=weight piece"`
|
||||
FirstUnit *float64 `json:"first_unit" binding:"omitempty,gt=0"`
|
||||
FirstFee *float64 `json:"first_fee" binding:"omitempty,gte=0"`
|
||||
AdditionalUnit *float64 `json:"additional_unit" binding:"omitempty,gt=0"`
|
||||
AdditionalFee *float64 `json:"additional_fee" binding:"omitempty,gte=0"`
|
||||
FreeAmount *float64 `json:"free_amount"`
|
||||
Provinces []string `json:"provinces"`
|
||||
IsDefault *bool `json:"is_default"`
|
||||
SortOrder *int `json:"sort_order"`
|
||||
}
|
||||
Reference in New Issue
Block a user