added filter by city
This commit is contained in:
@@ -48,7 +48,7 @@ public class PostController {
|
||||
@GetMapping("/{id}")
|
||||
public List<PostResponse> getById(@PathVariable Long id) {
|
||||
log.info("get feed by id {}", id);
|
||||
return service.getById(id);
|
||||
return service.getPostsByUserId(id);
|
||||
}
|
||||
|
||||
@PutMapping(value = "/{id}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
@@ -71,4 +71,17 @@ public class PostController {
|
||||
log.info("update feed {} on status {}", id, request.getStatus());
|
||||
return service.updateStatus(id, request.getStatus());
|
||||
}
|
||||
|
||||
@GetMapping("/search")
|
||||
public List<PostResponse> search(@RequestParam(required = false) String city) {
|
||||
log.info("search posts by city {}", city);
|
||||
return service.searchByCity(city);
|
||||
}
|
||||
|
||||
@GetMapping("/cities")
|
||||
public List<String> getCities() {
|
||||
log.info("get distinct cities");
|
||||
return service.getCities();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user