Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private TransportClient<ArchiveBoxDTO> transportClient;
- @Autowired
- public ArchiveBoxServiceImpl(TransportClient<ArchiveBoxDTO> transportClient) {
- this.transportClient = transportClient;
- }
- @FeignClient("db-entry-point")
- public interface TransportClient<DTO extends BaseDTO> {
- @GetMapping(value = "{uri}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
- ResponseEntity<List<DTO>> getAll(@PathVariable(value = "uri") String uri);
- @GetMapping(value = "{uri}" + "/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
- ResponseEntity<DTO> getOne(@PathVariable(value = "uri") String uri, @PathVariable(value = "id") long id);
- @PostMapping(value = "{uri}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
- ResponseEntity<DTO> create(@PathVariable(value = "uri") String uri, @RequestBody DTO parameters);
- @PutMapping(value = "{uri}" + "/{id}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
- ResponseEntity<DTO> update(
- @PathVariable(value = "uri") String uri,
- @PathVariable(value = "id") Long id,
- @RequestBody DTO parameters);
- }
- dependencies {
- compile('org.springframework.boot:spring-boot-starter-actuator')
- compile('org.springframework.cloud:spring-cloud-starter-feign')
- compile('org.springframework.cloud:spring-cloud-starter-consul-config')
- compile('org.springframework.cloud:spring-cloud-starter-consul-discovery')
- compile('org.springframework.boot:spring-boot-starter-web')
- compileOnly('org.projectlombok:lombok')
- compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.7.0'
- compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.7.0'
- /*Jackson Date modules*/
- compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.8"
- testCompile('org.springframework.boot:spring-boot-starter-test')
- testCompile group: 'org.testng', name: 'testng', version: '6.11'
- testCompile group: 'org.mockito', name: 'mockito-core', version: '2.11.0'
- }
Add Comment
Please, Sign In to add comment