Skip to content

Commit

Permalink
some cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
coolsamson7 committed Oct 10, 2024
1 parent 30aa8bf commit f301a8b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 22 deletions.
13 changes: 4 additions & 9 deletions dorm/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@
<artifactId>kotlin-stdlib</artifactId>
</dependency>

<!--dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</dependency-->

<!-- local -->

<dependency>
Expand All @@ -55,25 +50,25 @@
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<!-- test -->

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>

<!-- test -->

<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<scope>test</scope>
</dependency>

<!-- TODO ?? dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test-junit5</artifactId>
<scope>test</scope>
</dependency-->
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

=== NOW


- grapgql?
- doku

=== DONE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import java.util.function.Function
class LocalDateTimeScalar : Coercing<LocalDateTime, String> {
// instance data

var formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")
var formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm") // TODO s?

// implement

Expand All @@ -29,9 +29,6 @@ class LocalDateTimeScalar : Coercing<LocalDateTime, String> {
val offsetDateTime: LocalDateTime = if (input is LocalDateTime) {
input
}
//else if (input is ZonedDateTime) {
// input.toOffsetDateTime()
//}
else if (input is String) {
parse(input.toString()) { message: String? ->
CoercingSerializeException(message)
Expand All @@ -53,9 +50,6 @@ class LocalDateTimeScalar : Coercing<LocalDateTime, String> {
val offsetDateTime: LocalDateTime = if (input is LocalDateTime) {
input
}
//else if (input is ZonedDateTime) {
// input.toOffsetDateTime()
//}
else if (input is String) {
parse(input.toString()) { message: String? ->
CoercingParseValueException(message)
Expand Down Expand Up @@ -90,11 +84,6 @@ class LocalDateTimeScalar : Coercing<LocalDateTime, String> {
private fun parse(s: String, exceptionMaker: Function<String, RuntimeException>): LocalDateTime {
return try {
LocalDateTime.parse(s, formatter)
//val parse = OffsetDateTime.parse(s, DateTimeFormatter.ISO_OFFSET_DATE_TIME)
//if (parse[ChronoField.OFFSET_SECONDS] == 0 && s.endsWith("-00:00")) {
// throw exceptionMaker.apply("Invalid value : '$s'. Negative zero offset is not allowed")
//}
//parse
}
catch (e: DateTimeParseException) {
throw exceptionMaker.apply("Invalid RFC3339 value : '" + s + "'. because of : '" + e.message + "'")
Expand Down

0 comments on commit f301a8b

Please sign in to comment.