diff --git a/src/main/java/com/cmhi/cf/restapi/imapstruct/IStructConvert.java b/src/main/java/com/cmhi/cf/restapi/imapstruct/IStructConvert.java index 9fca111..f63b115 100644 --- a/src/main/java/com/cmhi/cf/restapi/imapstruct/IStructConvert.java +++ b/src/main/java/com/cmhi/cf/restapi/imapstruct/IStructConvert.java @@ -15,7 +15,7 @@ import oshi.hardware.Firmware; @Mapper public interface IStructConvert { - IStructConvert INSTINCT = Mappers.getMapper(IStructConvert.class); + IStructConvert INSTANCE = Mappers.getMapper(IStructConvert.class); @Mappings({ @Mapping(expression = "java(f.getName())", target = "name"), @@ -27,7 +27,7 @@ public interface IStructConvert { HwFirmware toHwFirmware(Firmware f); @Mappings({ - @Mapping(expression = "java(b.getVersion())", target = "version"), + @Mapping(expression = "java(b.getVersion().trim())", target = "version"), @Mapping(expression = "java(b.getManufacturer())", target = "manufacturer"), @Mapping(expression = "java(b.getModel())", target = "model"), @Mapping(expression = "java(b.getSerialNumber())", target = "serialNumber") diff --git a/src/main/java/com/cmhi/cf/restapi/pojo/po/ProcessorInfo.java b/src/main/java/com/cmhi/cf/restapi/pojo/po/ProcessorInfo.java index 44ec3d7..de99178 100644 --- a/src/main/java/com/cmhi/cf/restapi/pojo/po/ProcessorInfo.java +++ b/src/main/java/com/cmhi/cf/restapi/pojo/po/ProcessorInfo.java @@ -1,15 +1,9 @@ package com.cmhi.cf.restapi.pojo.po; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import lombok.AllArgsConstructor; -import lombok.Builder; import lombok.Data; -import lombok.NoArgsConstructor; @Data -@Builder -@NoArgsConstructor -@AllArgsConstructor @JsonPropertyOrder({"cpuVendor", "cpuName", "processorId", "cpuIdentifier", "microArchitecture", "cpu64bit", "cpuVendorFreq", "physicalCpus", "physicalCores", "logicalCpu"}) public class ProcessorInfo { diff --git a/src/main/java/com/cmhi/cf/service/impl/SystemInfoServiceImpl.java b/src/main/java/com/cmhi/cf/service/impl/SystemInfoServiceImpl.java index e0a9246..0bffffc 100644 --- a/src/main/java/com/cmhi/cf/service/impl/SystemInfoServiceImpl.java +++ b/src/main/java/com/cmhi/cf/service/impl/SystemInfoServiceImpl.java @@ -25,14 +25,13 @@ public class SystemInfoServiceImpl implements SystemInfoService { @Override public ProcessorInfo getProcessInfo() { - CentralProcessor proc = si.getHardware().getProcessor(); - CentralProcessor.ProcessorIdentifier pi = proc.getProcessorIdentifier(); - return IStructConvert.INSTINCT.toProcessorInfo(proc, pi); + CentralProcessor proc = si.getHardware().getProcessor(); + return IStructConvert.INSTANCE.toProcessorInfo(proc, proc.getProcessorIdentifier()); } @Override public HwInfo getHardwareInfo() { ComputerSystem cs = si.getHardware().getComputerSystem(); - return IStructConvert.INSTINCT.toHwInfo(cs); + return IStructConvert.INSTANCE.toHwInfo(cs); } }