-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
155 changed files
with
3,755 additions
and
1,889 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
17 changes: 17 additions & 0 deletions
17
src/main/java/org/recordy/server/common/config/GeometryConfig.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.recordy.server.common.config; | ||
|
||
import org.locationtech.jts.geom.GeometryFactory; | ||
import org.locationtech.jts.geom.PrecisionModel; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class GeometryConfig { | ||
|
||
private static final int WGS84_SRID = 4326; | ||
|
||
@Bean | ||
public GeometryFactory geometryFactory() { | ||
return new GeometryFactory(new PrecisionModel(), WGS84_SRID); | ||
} | ||
} |
18 changes: 16 additions & 2 deletions
18
src/main/java/org/recordy/server/common/config/QueryDslConfig.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,15 +1,29 @@ | ||
package org.recordy.server.common.config; | ||
|
||
import com.querydsl.jpa.JPQLTemplates; | ||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import com.querydsl.spatial.SpatialOps; | ||
import jakarta.persistence.EntityManager; | ||
import jakarta.persistence.PersistenceContext; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class QueryDslConfig { | ||
|
||
@PersistenceContext | ||
private EntityManager entityManager; | ||
|
||
private static class RecordyJPQLTemplates extends JPQLTemplates { | ||
|
||
public RecordyJPQLTemplates() { | ||
add(SpatialOps.BUFFER, "ST_Buffer({0}, {1})"); | ||
add(SpatialOps.CONTAINS, "ST_Contains({0}, {1})"); | ||
} | ||
} | ||
|
||
@Bean | ||
public JPAQueryFactory jpaQueryFactory(EntityManager entityManager) { | ||
return new JPAQueryFactory(entityManager); | ||
public JPAQueryFactory jpaQueryFactory() { | ||
return new JPAQueryFactory(new RecordyJPQLTemplates(), entityManager); | ||
} | ||
} |
11 changes: 0 additions & 11 deletions
11
src/main/java/org/recordy/server/common/exception/ExternalException.java
This file was deleted.
Oops, something went wrong.
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
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
32 changes: 32 additions & 0 deletions
32
src/main/java/org/recordy/server/common/util/DomainUtils.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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.recordy.server.common.util; | ||
|
||
import java.util.Objects; | ||
import java.util.function.Function; | ||
|
||
public class DomainUtils { | ||
|
||
public static <T> T updateIfNotNull(T existing, T update) { | ||
if (Objects.nonNull(update)) { | ||
return update; | ||
} | ||
|
||
return existing; | ||
} | ||
|
||
public static String updateIfNotEmpty(String existing, String update) { | ||
if (Objects.nonNull(update) && !update.isEmpty()) { | ||
return update; | ||
} | ||
|
||
return existing; | ||
} | ||
|
||
|
||
public static <T, R> R mapIfNotNull(T entity, Function<T, R> mapper) { | ||
if (Objects.nonNull(entity)) { | ||
return mapper.apply(entity); | ||
} | ||
|
||
return null; | ||
} | ||
} |
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
Oops, something went wrong.