package yarn import ( "muyu-apiserver/gateway/internal/types" "muyu-apiserver/rpc/inventory/pb" ) func yarnInfoFromPB(y *pb.YarnInfo) types.YarnInfo { if y == nil { return types.YarnInfo{} } return types.YarnInfo{ YarnId: y.YarnId, YarnName: y.YarnName, Color: y.Color, WeightGM: y.WeightGM, SupplierId: y.SupplierId, SupplierName: y.SupplierName, DyeFactory: y.DyeFactory, ImageUrl: y.ImageUrl, Remark: y.Remark, Status: y.Status, CreatedAt: y.CreatedAt, UpdatedAt: y.UpdatedAt, } }