Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Aleksandr Filichkin Aleksandr-Filichkin

🏠
Working from home
View GitHub Profile
View ApiGatewayHandler.java
private static Gson gson = new GsonBuilder().setPrettyPrinting().create();
private static SdkHttpClient sdkHttpClient = UrlConnectionHttpClient.create();
private static DynamoDbClient client = DynamoDbClient.builder()
.httpClient(sdkHttpClient)
.region(Region.US_EAST_1)
.credentialsProvider(EnvironmentVariableCredentialsProvider.create())
.build();
private static UserRepository userRepository = new DynamoDBUserRepository(client, gson);
static {
View Controller.java
@RestController
@RequestMapping("/reactive")
public class Controller {
private final R2DBCSubscriptionRepository userRepository;
@Autowired
public Controller(R2DBCSubscriptionRepository userRepository) {
this.userRepository = userRepository;
}
View User.java
@Data
@Table("blog.user")
@Builder
public class User {
@Id
private long id;
@Column
private String name;