Skip to content

Instantly share code, notes, and snippets.

@sabbarmehdi
Created July 28, 2021 15:22
Show Gist options
  • Save sabbarmehdi/eb38907bf95e92ba5fbcf484cdbdb46e to your computer and use it in GitHub Desktop.
Save sabbarmehdi/eb38907bf95e92ba5fbcf484cdbdb46e to your computer and use it in GitHub Desktop.
feign
@RestController
@RequestMapping("/item")
@RepositoryRestController
@RequiredArgsConstructor
public class ItemController {
@Autowired
ItemService itemService;
@GetMapping(value = "/user-items")
public ResponseEntity<List<Item>> getItemByUserId(@RequestParam(value = "userId") Long userId){
return new ResponseEntity<List<Item>>(itemService.findAllItemsByUserId(userId), HttpStatus.OK);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment