feat: product store

This commit is contained in:
zzw
2026-08-07 15:41:18 +08:00
parent 39fb09e7df
commit 089bdc9761
15 changed files with 1313 additions and 762 deletions
-46
View File
@@ -2,7 +2,6 @@ package logic
import (
"context"
"time"
"product/internal/dao"
"product/internal/model"
@@ -75,48 +74,3 @@ func (l *ItemsLogic) Items(in *product.ItemsReq) (*product.Response, error) {
Items: items,
})), nil
}
func toProductItem(row dao.ProductInfo) *product.Item {
publishTime := ""
if !row.PublishTime.IsZero() {
publishTime = row.PublishTime.Format(time.DateTime)
}
return &product.Item{
Id: int64(row.Id),
Name: row.Name,
Subhead: row.Subhead,
Content: row.Content,
ModelCode: row.ModelCode,
Price: float64(row.Price),
StorePrice: float64(row.StorePrice),
SalePrice: float64(row.SalePrice),
SharePrice: float64(row.SharePrice),
AgentPrice: float64(row.AgentPrice),
SaleReward: row.SaleReward,
SalesModel: uint32(row.SalesModel),
Waybill: row.Waybill,
Status: uint32(row.Status),
Weight: float64(row.Weight),
IsIndex: uint32(row.IsIndex),
IndexImage: row.IndexImage,
Cubage: row.Cubage,
Label: row.Label,
Images: row.Images,
IsBuy: uint32(row.IsBuy),
PeriodValidity: int32(row.PeriodValidity),
PublishTime: publishTime,
Type: uint32(row.Type),
NormsNumber: uint32(row.NormsNumber),
BoxNumber: row.BoxNumber,
Sort: uint32(row.Sort),
Number: uint32(row.Number),
VerifyStatus: uint32(row.VerifyStatus),
VerifyId: int64(row.VerifyId),
VerifyName: row.VerifyName,
VerifySecondId: int64(row.VerifySecondId),
VerifySecondName: row.VerifySecondName,
Reason: row.Reason,
AdminName: row.AdminName,
Edit: uint32(row.Edit),
}
}