Skip to content

Commit

Permalink
feat: add pic id to status
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasM95 committed Jul 22, 2024
1 parent c51080c commit 1fc5286
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 3 deletions.
5 changes: 5 additions & 0 deletions skoda-api-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,7 @@ components:
- value
- unit
- textId
- picId
type: object
properties:
id:
Expand Down Expand Up @@ -792,6 +793,10 @@ components:
type: string
description: textId
example: interval.oil.distance
picId:
type: string
description: textId
example: ICON025_yellow.png
VehicleWebResponseResource:
required:
- id
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/be/nicholas/api/status/domain/Field.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import java.time.LocalDateTime;

public record Field(String id, LocalDateTime tsCarSentUtc, LocalDateTime tsCarSent, LocalDateTime tsCarCaptured, LocalDateTime tsTssReceivedUtc,
Integer milCarCaptured, Integer milCarSent, String value, String unit, String textId) {
Integer milCarCaptured, Integer milCarSent, String value, String unit, String textId, String picId) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ private FieldWebResponseResource createField(final Field field) {
.value(field.value())
.unit(field.unit())
.textId(field.textId())
.picId(field.picId())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class FieldResponseResource {
private String value;
private String unit;
private String textId;
private String picId;

public String getId() {
return id;
Expand Down Expand Up @@ -93,4 +94,12 @@ public String getTextId() {
public void setTextId(String textId) {
this.textId = textId;
}

public String getPicId() {
return picId;
}

public void setPicId(String picId) {
this.picId = picId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ private List<Data> getData(List<DataResponseResource> data) {

private Field getField(FieldResponseResource field) {
return new Field(field.getId(), field.getTsCarSentUtc(), field.getTsCarSent(), field.getTsTssReceivedUtc(),
field.getTsTssReceivedUtc(), field.getMilCarCaptured(), field.getMilCarSent(), field.getValue(), field.getUnit(), field.getTextId());
field.getTsTssReceivedUtc(), field.getMilCarCaptured(), field.getMilCarSent(), field.getValue(), field.getUnit(),
field.getTextId(), field.getPicId());
}

private Data getData(DataResponseResource data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public void getStatus() throws Exception {
"milCarSent":6,
"value":"VAL",
"unit":"UNIT",
"textId":"text"
"textId":"text",
"picId":"pic"
}
]
}
Expand Down Expand Up @@ -112,6 +113,7 @@ private static FieldResponseResource getFieldResponseResource(LocalDateTime loca
fieldResponseResource.setValue("VAL");
fieldResponseResource.setUnit("UNIT");
fieldResponseResource.setTextId("text");
fieldResponseResource.setPicId("pic");
return fieldResponseResource;
}
}

0 comments on commit 1fc5286

Please sign in to comment.