device.go 925 字节
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 TransformToDeviceDomainModelFromPgModels(deviceModel *models.Device) (*domain.Device, error) {
	return &domain.Device{
		DeviceId:     deviceModel.DeviceId,
		CompanyId:    deviceModel.CompanyId,
		OrgId:        deviceModel.OrgId,
		DeviceCode:   deviceModel.DeviceCode,
		DeviceName:   deviceModel.DeviceName,
		DeviceModel:  deviceModel.DeviceModel,
		DeviceType:   deviceModel.DeviceType,
		Brand:        deviceModel.Brand,
		DeviceStatus: deviceModel.DeviceStatus,
		RiskLevel:    deviceModel.RiskLevel,
		CreatedAt:    deviceModel.CreatedAt,
		UpdatedAt:    deviceModel.UpdatedAt,
		DeletedAt:    deviceModel.DeletedAt,
		WorkStation:  deviceModel.WorkStation,
		Ext:          deviceModel.Ext,
	}, nil
}