新增患者详情

This commit is contained in:
2023-09-18 14:17:40 +08:00
parent ce3168867f
commit dbe0e24241
13 changed files with 496 additions and 57 deletions
@@ -2,8 +2,6 @@ package orderProductItemResponse
import (
"hospital-admin-api/api/model"
"hospital-admin-api/utils"
"strconv"
)
type OrderProductItem struct {
@@ -22,36 +20,3 @@ type OrderProductItem struct {
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
}
// GetOrderProductItemListResponse 获取订单商品列表
func GetOrderProductItemListResponse(u []*model.OrderProductItem) []*OrderProductItem {
// 处理返回值
orderProductItemResponses := make([]*OrderProductItem, len(u))
if len(u) > 0 {
for i, v := range u {
// 将原始结构体转换为新结构体
orderProductItemResponse := &OrderProductItem{
ProductItemId: strconv.Itoa(int(v.ProductItemId)),
OrderProductId: strconv.Itoa(int(v.OrderProductId)),
OrderInquiryId: strconv.Itoa(int(v.OrderInquiryId)),
OrderPrescriptionId: strconv.Itoa(int(v.OrderPrescriptionId)),
ProductId: strconv.Itoa(int(v.ProductId)),
ProductName: v.ProductName,
ProductPrice: v.ProductPrice,
ProductPlatformCode: v.ProductPlatformCode,
Amount: v.Amount,
Manufacturer: v.Manufacturer,
ProductCoverImg: utils.AddOssDomain(v.ProductCoverImg),
ProductSpec: v.ProductSpec,
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,
}
// 将转换后的结构体添加到新切片中
orderProductItemResponses[i] = orderProductItemResponse
}
}
return orderProductItemResponses
}