Tube 전압, 전류 offset 추가

This commit is contained in:
장선애 2023-09-08 14:24:46 +09:00
parent 8f906b5fb4
commit 1fbc721599
4 changed files with 30 additions and 17 deletions

View File

@ -5,29 +5,35 @@ package inc.sdt.controlcentermanagement.domain;
*/
public class Tube {
private String code;
private String offset;
private Float voltageOffset;
private Float ampereOffset;
protected Tube() {
}
public Tube(String code, String offset) {
public Tube(String code, Float voltageOffset, Float ampereOffset) {
this.code = code;
this.offset = offset;
this.voltageOffset = voltageOffset;
this.ampereOffset = ampereOffset;
}
public String getCode() {
return code;
}
public String getOffset() {
return offset;
public Float getVoltageOffset() {
return voltageOffset;
}
public Float getAmpereOffset() {
return ampereOffset;
}
@Override
public String toString() {
return "Tube{" +
"number='" + code + '\'' +
", offset=" + offset +
"code='" + code + '\'' +
", voltageOffset=" + voltageOffset +
", ampereOffset=" + ampereOffset +
'}';
}
}

View File

@ -40,7 +40,7 @@ public class SlotNoSQLRepository implements SlotRepositoryDelegate {
.chamberNumber(slotDocument.getChamberNumber())
.tube(slotDocument.getTube()
.stream()
.map(tubeDocument -> new Tube(tubeDocument.getCode(), tubeDocument.getOffset()))
.map(tubeDocument -> new Tube(tubeDocument.getCode(), tubeDocument.getVoltageOffset(), tubeDocument.getAmpereOffset()))
.toList())
.build();
}

View File

@ -5,26 +5,33 @@ package inc.sdt.controlcentermanagement.infrastructure.nosql;
*/
public class TubeDocument {
private String code;
private String offset;
private Float voltageOffset;
private Float ampereOffset;
public TubeDocument(String code, String offset) {
public TubeDocument(String code, Float voltageOffset, Float ampereOffset) {
this.code = code;
this.offset = offset;
this.voltageOffset = voltageOffset;
this.ampereOffset = ampereOffset;
}
public String getCode() {
return code;
}
public String getOffset() {
return offset;
public Float getVoltageOffset() {
return voltageOffset;
}
public Float getAmpereOffset() {
return ampereOffset;
}
@Override
public String toString() {
return "TubeDocument{" +
"id='" + code + '\'' +
", offset=" + offset +
"code='" + code + '\'' +
", voltageOffset=" + voltageOffset +
", ampereOffset=" + ampereOffset +
'}';
}
}

View File

@ -29,7 +29,7 @@ class SlotNoSQLRepositoryTest {
private Slot to(SlotDocument slotDocument) {
List<Tube> tube = slotDocument.getTube().stream()
.map(tubeDocument -> new Tube(tubeDocument.getCode(), tubeDocument.getOffset())).toList();
.map(tubeDocument -> new Tube(tubeDocument.getCode(), tubeDocument.getVoltageOffset(), tubeDocument.getAmpereOffset())).toList();
return Slot.builder()
.id(slotDocument.getId())
.slotNumber(slotDocument.getSlotNumber())