OCT 1. 更新部分语法检查问题

This commit is contained in:
黄昕 2024-02-26 14:09:49 +08:00
parent 6d228b0448
commit 4eabd13d41
3 changed files with 5 additions and 12 deletions

View File

@ -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")

View File

@ -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 {

View File

@ -26,13 +26,12 @@ 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);
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);
}
}