| | 1 | | using LGDXRobotCloud.Data.Models.DTOs.V1.Responses; |
| | 2 | |
|
| | 3 | | namespace LGDXRobotCloud.Data.Models.Business.Navigation; |
| | 4 | |
|
| | 5 | | public record RobotSystemInfoBusinessModel |
| | 6 | | { |
| | 7 | | public required int Id { get; set; } |
| | 8 | |
|
| | 9 | | public required string Cpu { get; set; } = null!; |
| | 10 | |
|
| | 11 | | public required bool IsLittleEndian { get; set; } |
| | 12 | |
|
| | 13 | | public required string Motherboard { get; set; } = null!; |
| | 14 | |
|
| | 15 | | public required string MotherboardSerialNumber { get; set; } = null!; |
| | 16 | |
|
| | 17 | | public required int RamMiB { get; set; } |
| | 18 | |
|
| | 19 | | public string? Gpu { get; set; } |
| | 20 | |
|
| | 21 | | public required string Os { get; set; } = null!; |
| | 22 | |
|
| | 23 | | public required bool Is32Bit { get; set; } |
| | 24 | |
|
| | 25 | | public string? McuSerialNumber { get; set; } |
| | 26 | | } |
| | 27 | |
|
| | 28 | | public static class RobotSystemInfoBusinessModelExtensions |
| | 29 | | { |
| | 30 | | public static RobotSystemInfoDto ToDto(this RobotSystemInfoBusinessModel robotSystemInfo) |
| 0 | 31 | | { |
| 0 | 32 | | return new RobotSystemInfoDto { |
| 0 | 33 | | Id = robotSystemInfo.Id, |
| 0 | 34 | | Cpu = robotSystemInfo.Cpu, |
| 0 | 35 | | IsLittleEndian = robotSystemInfo.IsLittleEndian, |
| 0 | 36 | | Motherboard = robotSystemInfo.Motherboard, |
| 0 | 37 | | MotherboardSerialNumber = robotSystemInfo.MotherboardSerialNumber, |
| 0 | 38 | | RamMiB = robotSystemInfo.RamMiB, |
| 0 | 39 | | Gpu = robotSystemInfo.Gpu, |
| 0 | 40 | | Os = robotSystemInfo.Os, |
| 0 | 41 | | Is32Bit = robotSystemInfo.Is32Bit, |
| 0 | 42 | | McuSerialNumber = robotSystemInfo.McuSerialNumber, |
| 0 | 43 | | }; |
| 0 | 44 | | } |
| | 45 | |
|
| | 46 | | public static RobotSystemInfoCreateBusinessModel ToCreateBusinessModel(this RobotSystemInfoBusinessModel model) |
| 0 | 47 | | { |
| 0 | 48 | | return new RobotSystemInfoCreateBusinessModel { |
| 0 | 49 | | Cpu = model.Cpu, |
| 0 | 50 | | IsLittleEndian = model.IsLittleEndian, |
| 0 | 51 | | Motherboard = model.Motherboard, |
| 0 | 52 | | MotherboardSerialNumber = model.MotherboardSerialNumber, |
| 0 | 53 | | RamMiB = model.RamMiB, |
| 0 | 54 | | Gpu = model.Gpu, |
| 0 | 55 | | Os = model.Os, |
| 0 | 56 | | Is32Bit = model.Is32Bit, |
| 0 | 57 | | McuSerialNumber = model.McuSerialNumber, |
| 0 | 58 | | }; |
| 0 | 59 | | } |
| | 60 | |
|
| | 61 | | public static RobotSystemInfoUpdateBusinessModel ToUpdateBusinessModel(this RobotSystemInfoBusinessModel model) |
| 0 | 62 | | { |
| 0 | 63 | | return new RobotSystemInfoUpdateBusinessModel { |
| 0 | 64 | | Cpu = model.Cpu, |
| 0 | 65 | | IsLittleEndian = model.IsLittleEndian, |
| 0 | 66 | | Motherboard = model.Motherboard, |
| 0 | 67 | | MotherboardSerialNumber = model.MotherboardSerialNumber, |
| 0 | 68 | | RamMiB = model.RamMiB, |
| 0 | 69 | | Gpu = model.Gpu, |
| 0 | 70 | | Os = model.Os, |
| 0 | 71 | | Is32Bit = model.Is32Bit, |
| 0 | 72 | | McuSerialNumber = model.McuSerialNumber, |
| 0 | 73 | | }; |
| 0 | 74 | | } |
| | 75 | | } |