Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kentaro.maeda committed Oct 17, 2019
1 parent eefe808 commit 488d3c0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,10 @@

public class GreetUpdate {

private int id;
private String message;

public GreetUpdate(){}

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getMessage() {
return message;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
public class GreetingResource {

private final GreetingService service;
private final int messageId;
private final int greetingId;

@Inject
public GreetingResource(GreetingService service, @ConfigProperty(name = "app.greeting") int messageId) {
public GreetingResource(GreetingService service, @ConfigProperty(name = "greeting.id") int greetingId) {
this.service = service;
this.messageId = messageId;
this.greetingId = greetingId;
}

/**
Expand All @@ -51,7 +51,7 @@ public GreetingResource(GreetingService service, @ConfigProperty(name = "app.gre
@Produces(MediaType.APPLICATION_JSON)
@Counted(name="call_greeting") // custom metrics
public Greeting greeting() {
String message = service.getMessage(messageId);
String message = service.getMessage(greetingId);
return new Greeting("helidon-mp", message);
}

Expand All @@ -62,6 +62,6 @@ public Greeting greeting() {
@Consumes(MediaType.APPLICATION_JSON)
public void updateMessage(GreetUpdate body) {

service.updateMessage(body.getId(), body.getMessage());
service.updateMessage(greetingId, body.getMessage());
}
}
4 changes: 2 additions & 2 deletions helidon-mp-sample/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
app:
greeting: 1
greeting:
id: 1

server:
port: 8081
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ run at 1100ms.

all jar ziped size : 10.9 MB


### MP

v 1.3.0
Expand Down

0 comments on commit 488d3c0

Please sign in to comment.