|
8 | 8 | import org.baeldung.persistence.model.Foo; |
9 | 9 | import org.baeldung.persistence.service.IFooService; |
10 | 10 | import org.baeldung.web.exception.MyResourceNotFoundException; |
11 | | -import org.baeldung.web.hateoas.PaginatedResultsRetrievedEvent; |
12 | | -import org.baeldung.web.util.ResourceCreated; |
| 11 | +import org.baeldung.web.hateoas.event.PaginatedResultsRetrievedEvent; |
| 12 | +import org.baeldung.web.hateoas.event.ResourceCreatedEvent; |
| 13 | +import org.baeldung.web.hateoas.event.SingleResourceRetrievedEvent; |
13 | 14 | import org.baeldung.web.util.RestPreconditions; |
14 | | -import org.baeldung.web.util.SingleResourceRetrieved; |
15 | 15 | import org.springframework.beans.factory.annotation.Autowired; |
16 | 16 | import org.springframework.context.ApplicationEventPublisher; |
17 | 17 | import org.springframework.data.domain.Page; |
@@ -51,7 +51,7 @@ public FooController() { |
51 | 51 | public Foo findById(@PathVariable("id") final Long id, final HttpServletRequest request, final HttpServletResponse response) { |
52 | 52 | final Foo resourceById = RestPreconditions.checkFound(service.findOne(id)); |
53 | 53 |
|
54 | | - eventPublisher.publishEvent(new SingleResourceRetrieved(this, request, response)); |
| 54 | + eventPublisher.publishEvent(new SingleResourceRetrievedEvent(this, request, response)); |
55 | 55 | return resourceById; |
56 | 56 | } |
57 | 57 |
|
@@ -83,7 +83,7 @@ public void create(@RequestBody final Foo resource, final HttpServletResponse re |
83 | 83 | Preconditions.checkNotNull(resource); |
84 | 84 | final Long idOfCreatedResource = service.create(resource).getId(); |
85 | 85 |
|
86 | | - eventPublisher.publishEvent(new ResourceCreated(this, response, idOfCreatedResource)); |
| 86 | + eventPublisher.publishEvent(new ResourceCreatedEvent(this, response, idOfCreatedResource)); |
87 | 87 | } |
88 | 88 |
|
89 | 89 | } |
0 commit comments