package view_model import "qteam/app/http/domains" type ProductCreateRequest struct { ProductName string `json:"product_name"` ProductType int `json:"product_type"` PacketRule int `json:"packet_rule"` ProductKind int `json:"'product_kind'"` Amount string `json:"'amount'"` CouponType int `json:"'coupon_type'"` IsSuperposition int `json:"'is_superposition' "` TemplateId int `json:"'template_id'"` Status int `json:"status"` IsNeedBill int `json:"'is_need_bill'"` //CreateTime string `json:"'create_time'"` SupplierProductId int64 `json:"supplier_product_id"` SupplierProductName string `json:"supplier_product_name"` } func (p *ProductCreateRequest) ToDomain() (do domains.Product, err error) { do.ProductName = p.ProductName do.ProductType = p.ProductType do.PacketRule = p.PacketRule do.ProductKind = p.ProductKind do.Amount = p.Amount do.CouponType = p.CouponType do.IsSuperposition = p.IsSuperposition do.TemplateId = do.TemplateId do.Status = p.Status do.SupplierProductId = p.SupplierProductId do.SupplierProductName = p.SupplierProductName return }