新增系统商品

This commit is contained in:
2023-12-22 15:42:07 +08:00
parent a988ba3743
commit f7387bfd4d
10 changed files with 315 additions and 45 deletions
+9
View File
@@ -9,6 +9,9 @@ import (
type ProductDto struct {
ProductId string `json:"product_id"` // 主键id
ProductPlatformId string `json:"product_platform_id"` // 处方平台商品id
ProductStatus int `json:"product_status"` // 商品状态(1:正常 2:下架)
IsDelete int `json:"is_delete"` // 是否删除(0:否 1:是)
PrescriptionNum int `json:"prescription_num"` // 处方可开具的数量
ProductName string `json:"product_name"` // 商品名称
CommonName string `json:"common_name"` // 商品通用名
ProductPrice float64 `json:"product_price"` // 商品价格
@@ -36,6 +39,9 @@ func GetProductDto(m *model.Product) *ProductDto {
return &ProductDto{
ProductId: fmt.Sprintf("%d", m.ProductId),
ProductPlatformId: fmt.Sprintf("%d", m.ProductPlatformId),
ProductStatus: m.ProductStatus,
IsDelete: m.IsDelete,
PrescriptionNum: m.PrescriptionNum,
ProductName: m.ProductName,
CommonName: m.ProductName,
ProductPrice: m.ProductPrice,
@@ -68,6 +74,9 @@ func GetProductListDto(m []*model.Product) []*ProductDto {
response := &ProductDto{
ProductId: fmt.Sprintf("%d", v.ProductId),
ProductPlatformId: fmt.Sprintf("%d", v.ProductPlatformId),
ProductStatus: v.ProductStatus,
IsDelete: v.IsDelete,
PrescriptionNum: v.PrescriptionNum,
ProductName: v.ProductName,
CommonName: v.ProductName,
ProductPrice: v.ProductPrice,