-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49b692c
commit ecb51e4
Showing
8 changed files
with
24 additions
and
23 deletions.
There are no files selected for viewing
Empty file.
7 changes: 1 addition & 6 deletions
7
.../boot-graphql-webflux/src/main/java/com/example/graphql/config/ApplicationProperties.java
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
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) {} |
14 changes: 8 additions & 6 deletions
14
graphql/boot-graphql-webflux/src/main/java/com/example/graphql/config/Initializer.java
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
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()); | ||
} | ||
} |
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
3 changes: 1 addition & 2 deletions
3
graphql/boot-graphql-webflux/src/main/java/com/example/graphql/dtos/Customer.java
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
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) {} |
3 changes: 1 addition & 2 deletions
3
graphql/boot-graphql-webflux/src/main/java/com/example/graphql/dtos/Orders.java
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
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) {} |
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
7 changes: 4 additions & 3 deletions
7
graphql/boot-graphql-webflux/src/main/java/com/example/graphql/utils/AppConstants.java
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
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"); | ||
} | ||
} |