Merge branch 'feature/SCDD-220' into feature/SCDD-222-화면-데이터-api-개발

This commit is contained in:
ihyeon-yong 2023-09-08 15:18:17 +09:00
commit efff31605b
6 changed files with 48 additions and 35 deletions

View File

@ -50,9 +50,9 @@ class DefaultTubeService implements TubeService {
DeployRequest deployRequest = DeployRequest.builder()
.assetCode(request.getAssetCode())
.deviceType("nodeq")
.appName(request.getSlotNumber())
.commandType(CommandType.JSON)
.name("") // TODO
.parameters(tubeMap)
.build();
@ -83,9 +83,9 @@ class DefaultTubeService implements TubeService {
resultMap.forEach((assetCode, slot) -> slot.forEach((slotNumber, tube) -> {
DeployRequest deployRequest = DeployRequest.builder()
.assetCode(assetCode)
.deviceType("nodeq")
.appName(slotNumber)
.commandType(CommandType.JSON)
.name("") // TODO
.parameters(tube)
.build();

View File

@ -7,17 +7,16 @@ import java.util.Map;
*/
public class DeployRequest {
private String assetCode;
private String deviceType;
private String appName;
private String commandType;
// private String fileName; // TODO: deployer에 추가되면 추가
private String name;
private Map<String, String> parameters;
public DeployRequest(String assetCode, String deviceType, String appName, String commandType, Map<String, String> parameters) {
public DeployRequest(String assetCode, String appName, String commandType, String name, Map<String, String> parameters) {
this.assetCode = assetCode;
this.deviceType = deviceType;
this.appName = appName;
this.commandType = commandType;
this.name = name;
this.parameters = parameters;
}
@ -29,9 +28,6 @@ public class DeployRequest {
return assetCode;
}
public String getDeviceType() {
return deviceType;
}
public String getAppName() {
return appName;
@ -41,6 +37,10 @@ public class DeployRequest {
return commandType;
}
public String getName() {
return name;
}
public Map<String, String> getParameters() {
return parameters;
}
@ -49,18 +49,18 @@ public class DeployRequest {
public String toString() {
return "DeployRequest{" +
"assetCode='" + assetCode + '\'' +
", deviceType='" + deviceType + '\'' +
", appName='" + appName + '\'' +
", commandType=" + commandType +
", commandType='" + commandType + '\'' +
", name='" + name + '\'' +
", parameters=" + parameters +
'}';
}
public static final class Builder {
private String assetCode;
private String deviceType;
private String appName;
private String commandType;
private String name;
private Map<String, String> parameters;
private Builder() {
@ -71,11 +71,6 @@ public class DeployRequest {
return this;
}
public Builder deviceType(String deviceType) {
this.deviceType = deviceType;
return this;
}
public Builder appName(String appName) {
this.appName = appName;
return this;
@ -86,13 +81,18 @@ public class DeployRequest {
return this;
}
public Builder name(String name) {
this.name = name;
return this;
}
public Builder parameters(Map<String, String> parameters) {
this.parameters = parameters;
return this;
}
public DeployRequest build() {
return new DeployRequest(assetCode, deviceType, appName, commandType, parameters);
return new DeployRequest(assetCode, appName, commandType, name, parameters);
}
}
}

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())