26 lines
648 B
Go
26 lines
648 B
Go
|
|
package logic
|
||
|
|
|
||
|
|
import (
|
||
|
|
"fmt"
|
||
|
|
|
||
|
|
"muyu-apiserver/model"
|
||
|
|
"muyu-apiserver/rpc/inventory/pb"
|
||
|
|
)
|
||
|
|
|
||
|
|
func yarnToPb(yarn *model.InvYarn, supplierName string) *pb.YarnInfo {
|
||
|
|
return &pb.YarnInfo{
|
||
|
|
YarnId: yarn.YarnId,
|
||
|
|
YarnName: yarn.YarnName,
|
||
|
|
Color: yarn.Color,
|
||
|
|
WeightGM: fmt.Sprintf("%.4f", yarn.WeightGM),
|
||
|
|
SupplierId: yarn.SupplierId,
|
||
|
|
SupplierName: supplierName,
|
||
|
|
DyeFactory: yarn.DyeFactory,
|
||
|
|
ImageUrl: yarn.ImageUrl,
|
||
|
|
Remark: yarn.Remark.String,
|
||
|
|
Status: yarn.Status,
|
||
|
|
CreatedAt: yarn.CreatedAt.Format("2006-01-02 15:04:05"),
|
||
|
|
UpdatedAt: yarn.UpdatedAt.Format("2006-01-02 15:04:05"),
|
||
|
|
}
|
||
|
|
}
|