This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>com.graphql-java</groupId> | |
<artifactId>graphql-spring-boot-starter</artifactId> | |
<version>5.0.2</version> | |
</dependency> | |
<dependency> | |
<groupId>com.graphql-java</groupId> | |
<artifactId>graphql-java-tools</artifactId> | |
<version>5.2.4</version> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service | |
public class UserService{ | |
@Autowired | |
private ItemsServiceClient itemsServiceClient; | |
@Autowired | |
protected UserRepository userRepository; | |
public List<Item> findAllItemById() { | |
Long userId = userRepository.findByEmail(getUsername()).get().getId(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>org.springframework.cloud</groupId> | |
<artifactId>spring-cloud-starter-openfeign</artifactId> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spring.application.name=item-service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@FeignClient(name = "item-service") | |
public interface ItemsServiceClient { | |
@GetMapping(value = "/item/user-items") | |
public List<Item> getItems(@RequestParam Long userId); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@EnableFeignClients | |
@SpringBootApplication | |
@EnableEurekaClient | |
public class UserApplication { | |
public static void main(String[] args) { | |
SpringApplication.run(UsersApplication.class, args); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<build> | |
<plugins> | |
... | |
<plugin> | |
<groupId>com.github.ulisesbocchio</groupId> | |
<artifactId>jasypt-maven-plugin</artifactId> | |
<version>3.0.3</version> | |
</plugin> | |
</plugins> | |
</build> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>com.github.ulisesbocchio</groupId> | |
<artifactId>jasypt-spring-boot-starter</artifactId> | |
<version>3.0.3</version> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spring.profiles.active=native |
NewerOlder