Skip to content

Commit

Permalink
remove lombok usage
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Nov 14, 2023
1 parent 49b692c commit ecb51e4
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 23 deletions.
Empty file modified graphql/boot-graphql-webflux/mvnw
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
package com.example.graphql.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

@Data
@ConfigurationProperties("application")
public class ApplicationProperties {
private String endpointUri;
private String region;
}
public record ApplicationProperties(String endpointUri, String region) {}
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
package com.example.graphql.config;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
@Slf4j
public class Initializer implements CommandLineRunner {

private static final Logger log = LoggerFactory.getLogger(Initializer.class);
private final ApplicationProperties properties;

public Initializer(ApplicationProperties properties) {
this.properties = properties;
}

@Override
public void run(String... args) {
log.info("Running Initializer.....@ {}", properties.getEndpointUri());
log.info("Running Initializer.....@ {}", properties.endpointUri());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import jakarta.validation.constraints.Positive;
import java.util.List;
import java.util.Map;
import lombok.RequiredArgsConstructor;
import org.springframework.graphql.data.method.annotation.Argument;
import org.springframework.graphql.data.method.annotation.BatchMapping;
import org.springframework.graphql.data.method.annotation.MutationMapping;
Expand All @@ -19,11 +18,14 @@

@Controller
@Validated
@RequiredArgsConstructor
public class CustomerGraphQLController {

private final CustomerGraphQLService customerGraphQLService;

public CustomerGraphQLController(CustomerGraphQLService customerGraphQLService) {
this.customerGraphQLService = customerGraphQLService;
}

// @SchemaMapping(typeName = "Query", field = "customers") or
@QueryMapping
Flux<Customer> customers() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.example.graphql.dtos;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.data.annotation.Id;

public record Customer(@JsonProperty("id") @Id Integer id, @JsonProperty("name") String name) {}
public record Customer(@Id Integer id, String name) {}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.example.graphql.dtos;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.data.annotation.Id;

public record Orders(@JsonProperty("id") @Id Integer id, @JsonProperty("customerId") Integer customerId) {}
public record Orders(@Id Integer id, Integer customerId) {}
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,22 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

@Service
@RequiredArgsConstructor
public class CustomerGraphQLServiceImpl implements CustomerGraphQLService {

private final CustomerRepository customerRepository;

private final OrdersRepository ordersRepository;

public CustomerGraphQLServiceImpl(CustomerRepository customerRepository, OrdersRepository ordersRepository) {
this.customerRepository = customerRepository;
this.ordersRepository = ordersRepository;
}

@Override
public Flux<Customer> findAllCustomers() {
return this.customerRepository.findAll();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package com.example.graphql.utils;

import lombok.experimental.UtilityClass;

@UtilityClass
public final class AppConstants {
public static final String PROFILE_LOCAL = "local";
public static final String PROFILE_PROD = "prod";
public static final String PROFILE_NOT_PROD = "!" + PROFILE_PROD;
public static final String PROFILE_TEST = "test";
public static final String PROFILE_IT = "integration-test";

private AppConstants() {
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
}
}

0 comments on commit ecb51e4

Please sign in to comment.