device_collection.go 961 字节
package transform

import (
	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/pg/models"
)

func TransformToDeviceCollectionDomainModelFromPgModels(deviceCollectionModel *models.DeviceCollection) (*domain.DeviceCollection, error) {
	return &domain.DeviceCollection{
		DeviceCollectionId: deviceCollectionModel.DeviceCollectionId,
		WorkShopName:       deviceCollectionModel.WorkShopName,
		DeviceSn:           deviceCollectionModel.DeviceSn,
		DeviceType:         deviceCollectionModel.DeviceType,
		StartupStatus:      deviceCollectionModel.StartupStatus,
		CollectionTime:     deviceCollectionModel.CreatedAt,
		ComStatus:          deviceCollectionModel.ComStatus,
		Values:             deviceCollectionModel.Values,
		Count:              deviceCollectionModel.Count,
		LatestUpdateTime:   deviceCollectionModel.LatestUpdateTime,
	}, nil
}