Skip to content

Commit

Permalink
[BSVR-187] infrastructure 모듈 병합 (#107)
Browse files Browse the repository at this point in the history
* feat: infrastructure 모듈 병합

* fix: 컴포넌트 스캔시 바뀐 패키지 따라가도록 수정

* fix: jpql에서 dto 사용하는 경우 패키지명 수정
  • Loading branch information
EunjiShin authored Aug 3, 2024
1 parent c33f364 commit 20445d8
Show file tree
Hide file tree
Showing 80 changed files with 276 additions and 281 deletions.
3 changes: 1 addition & 2 deletions application/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ dependencies {
implementation(project(":common"))
implementation(project(":domain"))
implementation(project(":usecase"))
implementation(project(":infrastructure:jpa"))
implementation(project(":infrastructure:ncp"))
implementation(project(":infrastructure"))

// spring
implementation("org.springframework:spring-aspects")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package org.depromeet.spot.application.common.config;

import org.depromeet.spot.jpa.config.JpaConfig;
import org.depromeet.spot.ncp.NcpConfig;
import org.depromeet.spot.infrastructure.aws.AwsConfig;
import org.depromeet.spot.infrastructure.jpa.config.JpaConfig;
import org.depromeet.spot.usecase.config.UsecaseConfig;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@ComponentScan(basePackages = {"org.depromeet.spot.application"})
@Configuration
@Import(value = {UsecaseConfig.class, JpaConfig.class, NcpConfig.class, SwaggerConfig.class})
@Import(value = {UsecaseConfig.class, JpaConfig.class, AwsConfig.class, SwaggerConfig.class})
public class SpotApplicationConfig {}
29 changes: 29 additions & 0 deletions infrastructure/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,2 +1,31 @@
dependencies {
implementation(project(":common"))
implementation(project(":domain"))
implementation(project(":usecase"))

// spring
implementation("org.springframework.boot:spring-boot-starter")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-data-jpa:_")

// mysql
runtimeOnly("com.mysql:mysql-connector-j")

// queryDSL
implementation("com.querydsl:querydsl-jpa:_:jakarta")
annotationProcessor("com.querydsl:querydsl-apt:_:jakarta")
annotationProcessor("jakarta.annotation:jakarta.annotation-api")
annotationProcessor("jakarta.persistence:jakarta.persistence-api")

// p6spy
implementation("com.github.gavlyukovskiy:p6spy-spring-boot-starter:_")

// aws
implementation("org.springframework.cloud:spring-cloud-starter-aws:_")

// webflux (HTTP 요청에 사용)
implementation("org.springframework.boot:spring-boot-starter-webflux")
}

tasks.bootJar { enabled = false }
tasks.jar { enabled = true }
26 changes: 0 additions & 26 deletions infrastructure/jpa/build.gradle.kts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

17 changes: 0 additions & 17 deletions infrastructure/ncp/build.gradle.kts

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.depromeet.spot.ncp;
package org.depromeet.spot.infrastructure.aws;

import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
Expand All @@ -7,6 +7,6 @@

@Configuration
@EnableConfigurationProperties
@ConfigurationPropertiesScan(basePackages = {"org.depromeet.spot.ncp.property"})
@ComponentScan(basePackages = {"org.depromeet.spot.ncp"})
public class NcpConfig {}
@ConfigurationPropertiesScan(basePackages = {"org.depromeet.spot.infrastructure.aws.property"})
@ComponentScan(basePackages = {"org.depromeet.spot.infrastructure.aws"})
public class AwsConfig {}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.depromeet.spot.ncp.config;
package org.depromeet.spot.infrastructure.aws.config;

import org.depromeet.spot.ncp.property.ObjectStorageProperties;
import org.depromeet.spot.infrastructure.aws.property.ObjectStorageProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.depromeet.spot.ncp.objectstorage;
package org.depromeet.spot.infrastructure.aws.objectstorage;

import org.depromeet.spot.domain.media.extension.ImageExtension;
import org.depromeet.spot.usecase.port.in.util.TimeUsecase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.depromeet.spot.ncp.objectstorage;
package org.depromeet.spot.infrastructure.aws.objectstorage;

import java.io.IOException;
import java.io.InputStream;
Expand All @@ -8,7 +8,7 @@
import org.depromeet.spot.domain.media.MediaProperty;
import org.depromeet.spot.domain.media.extension.ImageExtension;
import org.depromeet.spot.domain.media.extension.StadiumSeatMediaExtension;
import org.depromeet.spot.ncp.config.ObjectStorageConfig;
import org.depromeet.spot.infrastructure.aws.config.ObjectStorageConfig;
import org.depromeet.spot.usecase.port.out.media.ImageUploadPort;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.depromeet.spot.ncp.objectstorage;
package org.depromeet.spot.infrastructure.aws.objectstorage;

import java.net.URL;
import java.util.Date;

import org.depromeet.spot.common.exception.media.MediaException.InvalidExtensionException;
import org.depromeet.spot.domain.media.extension.ImageExtension;
import org.depromeet.spot.ncp.config.ObjectStorageConfig;
import org.depromeet.spot.infrastructure.aws.config.ObjectStorageConfig;
import org.depromeet.spot.usecase.port.out.media.CreatePresignedUrlPort;
import org.springframework.stereotype.Service;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.depromeet.spot.ncp.property;
package org.depromeet.spot.infrastructure.aws.property;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.depromeet.spot.jpa.block.entity;
package org.depromeet.spot.infrastructure.jpa.block.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;

import org.depromeet.spot.domain.block.Block;
import org.depromeet.spot.jpa.common.entity.BaseEntity;
import org.depromeet.spot.infrastructure.jpa.common.entity.BaseEntity;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.depromeet.spot.jpa.block.entity;
package org.depromeet.spot.infrastructure.jpa.block.entity;

import jakarta.persistence.Column;
import jakarta.persistence.ConstraintMode;
Expand All @@ -10,7 +10,7 @@
import jakarta.persistence.Table;

import org.depromeet.spot.domain.block.BlockRow;
import org.depromeet.spot.jpa.common.entity.BaseEntity;
import org.depromeet.spot.infrastructure.jpa.common.entity.BaseEntity;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package org.depromeet.spot.infrastructure.jpa.block.repository;

import static com.querydsl.core.group.GroupBy.list;

import java.util.List;
import java.util.Map;

import org.depromeet.spot.infrastructure.jpa.block.entity.BlockEntity;
import org.depromeet.spot.infrastructure.jpa.block.entity.BlockRowEntity;
import org.depromeet.spot.infrastructure.jpa.block.entity.QBlockEntity;
import org.depromeet.spot.infrastructure.jpa.block.entity.QBlockRowEntity;
import org.springframework.stereotype.Repository;

import com.querydsl.core.group.GroupBy;
import com.querydsl.jpa.impl.JPAQueryFactory;

import lombok.RequiredArgsConstructor;

@Repository
@RequiredArgsConstructor
public class BlockCustomRepository {

private final JPAQueryFactory queryFactory;

public Map<BlockEntity, List<BlockRowEntity>> findRowInfosBy(final Long sectionId) {
return queryFactory
.from(QBlockRowEntity.blockRowEntity)
.join(QBlockEntity.blockEntity)
.on(QBlockRowEntity.blockRowEntity.block.id.eq(QBlockEntity.blockEntity.id))
.where(QBlockEntity.blockEntity.sectionId.eq(sectionId))
.orderBy(QBlockRowEntity.blockRowEntity.number.asc())
.transform(
GroupBy.groupBy(QBlockEntity.blockEntity)
.as(list(QBlockRowEntity.blockRowEntity)));
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.depromeet.spot.jpa.block.repository;
package org.depromeet.spot.infrastructure.jpa.block.repository;

import java.util.List;
import java.util.Optional;

import org.depromeet.spot.jpa.block.entity.BlockEntity;
import org.depromeet.spot.infrastructure.jpa.block.entity.BlockEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.depromeet.spot.jpa.block.repository;
package org.depromeet.spot.infrastructure.jpa.block.repository;

import java.util.List;
import java.util.Map;
Expand All @@ -7,9 +7,9 @@
import org.depromeet.spot.common.exception.block.BlockException.BlockNotFoundException;
import org.depromeet.spot.domain.block.Block;
import org.depromeet.spot.domain.block.BlockRow;
import org.depromeet.spot.jpa.block.entity.BlockEntity;
import org.depromeet.spot.jpa.block.entity.BlockRowEntity;
import org.depromeet.spot.jpa.block.repository.row.BlockRowJpaRepository;
import org.depromeet.spot.infrastructure.jpa.block.entity.BlockEntity;
import org.depromeet.spot.infrastructure.jpa.block.entity.BlockRowEntity;
import org.depromeet.spot.infrastructure.jpa.block.repository.row.BlockRowJpaRepository;
import org.depromeet.spot.usecase.port.out.block.BlockRepository;
import org.springframework.stereotype.Repository;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.depromeet.spot.jpa.block.repository.row;
package org.depromeet.spot.infrastructure.jpa.block.repository.row;

import java.sql.PreparedStatement;
import java.sql.SQLException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.depromeet.spot.jpa.block.repository.row;
package org.depromeet.spot.infrastructure.jpa.block.repository.row;

import java.util.List;

import org.depromeet.spot.jpa.block.entity.BlockRowEntity;
import org.depromeet.spot.infrastructure.jpa.block.entity.BlockRowEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.depromeet.spot.jpa.block.repository.row;
package org.depromeet.spot.infrastructure.jpa.block.repository.row;

import java.util.List;

import org.depromeet.spot.domain.block.BlockRow;
import org.depromeet.spot.jpa.block.entity.BlockRowEntity;
import org.depromeet.spot.infrastructure.jpa.block.entity.BlockRowEntity;
import org.depromeet.spot.usecase.port.out.block.BlockRowRepository;
import org.springframework.stereotype.Repository;

Expand Down
Loading

0 comments on commit 20445d8

Please sign in to comment.