Skip to content

Commit

Permalink
修复提交items的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalsonic committed Jul 2, 2019
1 parent 879eead commit 9a434bf
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.springframework.web.client.RestTemplate;

import java.net.URI;
import java.util.Collections;

@Component
@Slf4j
Expand Down Expand Up @@ -85,7 +86,7 @@ private void addOrder(Link link, Resource<Coffee> coffee) {

Resource<CoffeeOrder> order = resp.getBody();
Link items = order.getLink("items");
req = RequestEntity.post(items.getTemplate().expand()).body(coffee.getLink("self"));
req = RequestEntity.post(items.getTemplate().expand()).body(Collections.singletonMap("_links", coffee.getLink("self")));
ResponseEntity<String> itemResp = restTemplate.exchange(req, String.class);
log.info("add Order Items Response: {}", itemResp);
}
Expand Down

0 comments on commit 9a434bf

Please sign in to comment.