2024-06-19 18:32:34 +08:00
|
|
|
package front
|
2024-06-24 11:44:38 +08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"qteam/app/models/productsmodel"
|
|
|
|
"qteam/app/utils"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ProductDetailRequest struct {
|
|
|
|
ProductId int `form:"product_id" validate:"required"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ProductDetailResponse struct {
|
|
|
|
Id string `json:"id"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
MainImage string `json:"main_image"`
|
|
|
|
Brand string `json:"brand"`
|
|
|
|
Stock string `json:"stock"`
|
|
|
|
ShowPrice string `json:"show_price"`
|
|
|
|
Price string `json:"price"`
|
|
|
|
CreateTime string `json:"create_time"`
|
|
|
|
Status string `json:"status"`
|
|
|
|
Description string `json:"description"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *ProductDetailResponse) ResponseFromDb(in productsmodel.Products) {
|
|
|
|
utils.EntityCopy(this, &in)
|
|
|
|
this.CreateTime = in.CreateTime.Format("2006-01-02 15:04:05")
|
|
|
|
}
|