Guest User

Untitled

a guest
Nov 23rd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. private TransportClient<ArchiveBoxDTO> transportClient;
  2.  
  3. @Autowired
  4. public ArchiveBoxServiceImpl(TransportClient<ArchiveBoxDTO> transportClient) {
  5. this.transportClient = transportClient;
  6. }
  7.  
  8. @FeignClient("db-entry-point")
  9. public interface TransportClient<DTO extends BaseDTO> {
  10.  
  11. @GetMapping(value = "{uri}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
  12. ResponseEntity<List<DTO>> getAll(@PathVariable(value = "uri") String uri);
  13.  
  14. @GetMapping(value = "{uri}" + "/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
  15. ResponseEntity<DTO> getOne(@PathVariable(value = "uri") String uri, @PathVariable(value = "id") long id);
  16.  
  17. @PostMapping(value = "{uri}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
  18. ResponseEntity<DTO> create(@PathVariable(value = "uri") String uri, @RequestBody DTO parameters);
  19.  
  20. @PutMapping(value = "{uri}" + "/{id}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
  21. ResponseEntity<DTO> update(
  22. @PathVariable(value = "uri") String uri,
  23. @PathVariable(value = "id") Long id,
  24. @RequestBody DTO parameters);
  25. }
  26.  
  27. dependencies {
  28. compile('org.springframework.boot:spring-boot-starter-actuator')
  29. compile('org.springframework.cloud:spring-cloud-starter-feign')
  30. compile('org.springframework.cloud:spring-cloud-starter-consul-config')
  31. compile('org.springframework.cloud:spring-cloud-starter-consul-discovery')
  32. compile('org.springframework.boot:spring-boot-starter-web')
  33. compileOnly('org.projectlombok:lombok')
  34. compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.7.0'
  35. compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.7.0'
  36. /*Jackson Date modules*/
  37. compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.8"
  38. testCompile('org.springframework.boot:spring-boot-starter-test')
  39. testCompile group: 'org.testng', name: 'testng', version: '6.11'
  40. testCompile group: 'org.mockito', name: 'mockito-core', version: '2.11.0'
  41. }
Add Comment
Please, Sign In to add comment