diff --git a/build.gradle b/build.gradle index fe4bf344..57d10d17 100644 --- a/build.gradle +++ b/build.gradle @@ -11,6 +11,15 @@ ext { springdocVersion = "2.5.0" } +allprojects { + tasks.withType(JavaCompile).configureEach { + options.encoding = "UTF-8" + } + tasks.withType(Test).configureEach { + systemProperty "file.encoding", "UTF-8" + } +} + subprojects { apply plugin: "com.diffplug.spotless" diff --git a/common/build.gradle b/common/build.gradle deleted file mode 100644 index b595e66a..00000000 --- a/common/build.gradle +++ /dev/null @@ -1,49 +0,0 @@ -plugins { - id 'java-library' - id 'maven-publish' - id 'io.spring.dependency-management' version '1.1.7' -} - -group = 'com.github.ElevenHub' -version = '1.0.0' -description = 'Common utility module' - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(17) - } -} - -publishing { - publications { - mavenJava(MavenPublication) { - from components.java - } - } -} - -repositories { - mavenCentral() -} - -dependencies { - - implementation 'org.springframework:spring-context:6.1.2' - implementation 'org.springframework:spring-web:6.1.2' - implementation 'org.springframework:spring-webmvc:6.2.12' - implementation 'com.fasterxml.jackson.core:jackson-annotations:2.19.2' - - implementation 'org.springframework.data:spring-data-jpa:3.3.2' - implementation 'org.hibernate.orm:hibernate-core:6.6.33.Final' - implementation 'jakarta.persistence:jakarta.persistence-api:3.1.0' - - testImplementation 'org.springframework.boot:spring-boot-starter-test:3.5.7' - testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.10.2' - - compileOnly 'org.projectlombok:lombok:1.18.22' - annotationProcessor 'org.projectlombok:lombok:1.18.22' -} - -tasks.named('test') { - useJUnitPlatform() -} diff --git a/common/gradle/wrapper/gradle-wrapper.jar b/common/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 1b33c55b..00000000 Binary files a/common/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/common/gradle/wrapper/gradle-wrapper.properties b/common/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index d4081da4..00000000 --- a/common/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,7 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/common/src/main/java/com/hubEleven/common/annotation/SoftDeletable.java b/common/src/main/java/com/hubEleven/common/annotation/SoftDeletable.java deleted file mode 100644 index 4312188f..00000000 --- a/common/src/main/java/com/hubEleven/common/annotation/SoftDeletable.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.hubEleven.common.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import org.hibernate.annotations.SQLRestriction; - -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@SQLRestriction("deleted_at IS NULL") -public @interface SoftDeletable {} diff --git a/common/src/main/java/com/hubEleven/common/code/ErrorCode.java b/common/src/main/java/com/hubEleven/common/code/ErrorCode.java deleted file mode 100644 index 09c322d4..00000000 --- a/common/src/main/java/com/hubEleven/common/code/ErrorCode.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.hubEleven.common.code; - -import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR; - -import lombok.Getter; -import lombok.RequiredArgsConstructor; -import org.springframework.http.HttpStatus; - -@RequiredArgsConstructor -@Getter -public enum ErrorCode implements StatusCode { - SERVER_ERROR(INTERNAL_SERVER_ERROR, "서버 에러가 발생하였습니다."), - VALIDATION_ERROR(HttpStatus.BAD_REQUEST, "요청 값이 유효하지 않습니다."), - ACCESS_DENIED(HttpStatus.FORBIDDEN, "권한이 없습니다."); - - private final HttpStatus httpStatus; - private final String message; - - @Override - public String getName() { - return this.name(); - } -} diff --git a/common/src/main/java/com/hubEleven/common/code/StatusCode.java b/common/src/main/java/com/hubEleven/common/code/StatusCode.java deleted file mode 100644 index e855a70b..00000000 --- a/common/src/main/java/com/hubEleven/common/code/StatusCode.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.hubEleven.common.code; - -import org.springframework.http.HttpStatus; - -public interface StatusCode { - - HttpStatus getHttpStatus(); - - String getMessage(); - - String getName(); -} diff --git a/common/src/main/java/com/hubEleven/common/code/SuccessCode.java b/common/src/main/java/com/hubEleven/common/code/SuccessCode.java deleted file mode 100644 index 6a7a054e..00000000 --- a/common/src/main/java/com/hubEleven/common/code/SuccessCode.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.hubEleven.common.code; - -import static org.springframework.http.HttpStatus.*; - -import lombok.Getter; -import lombok.RequiredArgsConstructor; -import org.springframework.http.HttpStatus; - -@Getter -@RequiredArgsConstructor -public enum SuccessCode { - SUCCESS(HttpStatus.OK, "성공했습니다."), - CREATED(HttpStatus.CREATED, "생성되었습니다."), - UPDATED(HttpStatus.OK, "수정되었습니다."), - DELETED(HttpStatus.OK, "삭제되었습니다."); - - private final HttpStatus status; - private final String message; -} diff --git a/common/src/main/java/com/hubEleven/common/exception/GlobalException.java b/common/src/main/java/com/hubEleven/common/exception/GlobalException.java deleted file mode 100644 index 561c3ee2..00000000 --- a/common/src/main/java/com/hubEleven/common/exception/GlobalException.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.hubEleven.common.exception; - -import com.hubEleven.common.code.StatusCode; -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -@Getter -@RequiredArgsConstructor -public class GlobalException extends RuntimeException { - - private final StatusCode errorCode; -} diff --git a/common/src/main/java/com/hubEleven/common/exception/GlobalExceptionHandler.java b/common/src/main/java/com/hubEleven/common/exception/GlobalExceptionHandler.java deleted file mode 100644 index a8ffb794..00000000 --- a/common/src/main/java/com/hubEleven/common/exception/GlobalExceptionHandler.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.hubEleven.common.exception; - -import static com.hubEleven.common.code.ErrorCode.*; - -import com.hubEleven.common.response.ApiResponse; -import com.hubEleven.common.response.ApiResponseEntity; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.RestControllerAdvice; -import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; - -@RestControllerAdvice -public class GlobalExceptionHandler extends ResponseEntityExceptionHandler { - - @ExceptionHandler(GlobalException.class) - ResponseEntity globalExceptionHandler(GlobalException e) { - return ApiResponseEntity.onFailure(e.getErrorCode()); - } - - @ExceptionHandler(Exception.class) - public ResponseEntity> handleException(final Exception e) { - return ApiResponseEntity.onFailure(SERVER_ERROR); - } -} diff --git a/common/src/main/java/com/hubEleven/common/model/BaseEntity.java b/common/src/main/java/com/hubEleven/common/model/BaseEntity.java deleted file mode 100644 index ddd15468..00000000 --- a/common/src/main/java/com/hubEleven/common/model/BaseEntity.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.hubEleven.common.model; - -import jakarta.persistence.Column; -import jakarta.persistence.EntityListeners; -import jakarta.persistence.MappedSuperclass; -import java.time.LocalDateTime; -import lombok.Getter; -import org.springframework.data.annotation.CreatedBy; -import org.springframework.data.annotation.CreatedDate; -import org.springframework.data.annotation.LastModifiedBy; -import org.springframework.data.annotation.LastModifiedDate; -import org.springframework.data.jpa.domain.support.AuditingEntityListener; - -@Getter -@MappedSuperclass -@EntityListeners(AuditingEntityListener.class) -public abstract class BaseEntity { - - @CreatedDate - @Column(updatable = false, nullable = false) - private LocalDateTime createdAt; - - @CreatedBy - @Column(updatable = false) - private Long createdBy; - - @LastModifiedDate private LocalDateTime updatedAt; - - @LastModifiedBy private Long updatedBy; - - private LocalDateTime deletedAt; - - private Long deletedBy; - - public void delete(Long deletedBy) { - this.deletedAt = LocalDateTime.now(); - this.deletedBy = deletedBy; - } - - public boolean isDeleted() { - return this.deletedAt != null; - } -} diff --git a/common/src/main/java/com/hubEleven/common/request/CommonPageRequest.java b/common/src/main/java/com/hubEleven/common/request/CommonPageRequest.java deleted file mode 100644 index f79808ce..00000000 --- a/common/src/main/java/com/hubEleven/common/request/CommonPageRequest.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.hubEleven.common.request; - -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.Sort; - -public record CommonPageRequest( - int page, int size, SortType sortType, Sort.Direction direction, String keyword) { - public CommonPageRequest { - if (page < 0) { - page = 0; - } - - if (size != 10 && size != 30 && size != 50) { - size = 10; - } - - if (sortType == null) { - sortType = SortType.CREATED_AT; - } - - if (direction == null) { - direction = Sort.Direction.DESC; - } - } - - public Pageable toPageable() { - return PageRequest.of(page, size, Sort.by(direction, sortType.getFieldName())); - } - - public enum SortType { - CREATED_AT("createdAt"), - UPDATED_AT("updatedAt"); - - private final String fieldName; - - SortType(String fieldName) { - this.fieldName = fieldName; - } - - public String getFieldName() { - return fieldName; - } - } -} diff --git a/common/src/main/java/com/hubEleven/common/response/ApiResponse.java b/common/src/main/java/com/hubEleven/common/response/ApiResponse.java deleted file mode 100644 index 95630ec2..00000000 --- a/common/src/main/java/com/hubEleven/common/response/ApiResponse.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.hubEleven.common.response; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonPropertyOrder({"code", "message", "result"}) -public record ApiResponse( - String code, String message, @JsonInclude(JsonInclude.Include.NON_NULL) T result) {} diff --git a/common/src/main/java/com/hubEleven/common/response/ApiResponseEntity.java b/common/src/main/java/com/hubEleven/common/response/ApiResponseEntity.java deleted file mode 100644 index ece09fd0..00000000 --- a/common/src/main/java/com/hubEleven/common/response/ApiResponseEntity.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.hubEleven.common.response; - -import com.hubEleven.common.code.StatusCode; -import com.hubEleven.common.code.SuccessCode; -import java.net.URI; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; - -public class ApiResponseEntity { - - public static ResponseEntity> success(T result) { - return ResponseEntity.ok() - .body( - new ApiResponse<>( - SuccessCode.SUCCESS.name(), SuccessCode.SUCCESS.getMessage(), result)); - } - - public static ResponseEntity> from(StatusCode code, T result) { - return ResponseEntity.status(code.getHttpStatus()) - .body(new ApiResponse<>(code.getName(), code.getMessage(), result)); - } - - public static ResponseEntity> create(StatusCode code, String url, T result) { - return ResponseEntity.created(URI.create(url)) - .body(new ApiResponse<>(code.getName(), code.getMessage(), result)); - } - - public static ResponseEntity> onFailure(StatusCode code) { - return ResponseEntity.status(code.getHttpStatus()) - .body(new ApiResponse<>(code.getName(), code.getMessage(), null)); - } - - public static ResponseEntity> badRequest(String message) { - return ResponseEntity.badRequest() - .body(new ApiResponse<>(HttpStatus.BAD_REQUEST.name(), message, null)); - } - - public static ResponseEntity> ok(String message) { - return ResponseEntity.ok().body(new ApiResponse<>(HttpStatus.OK.name(), message, null)); - } -} diff --git a/common/src/main/java/com/hubEleven/common/response/CommonPageResponse.java b/common/src/main/java/com/hubEleven/common/response/CommonPageResponse.java deleted file mode 100644 index b9d9d2f1..00000000 --- a/common/src/main/java/com/hubEleven/common/response/CommonPageResponse.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.hubEleven.common.response; - -import java.util.List; -import org.springframework.data.domain.Page; - -public record CommonPageResponse( - List content, - int page, - int size, - long totalElements, - int totalPages, - boolean first, - boolean last) { - public static CommonPageResponse of(Page page) { - return new CommonPageResponse<>( - page.getContent(), - page.getNumber(), - page.getSize(), - page.getTotalElements(), - page.getTotalPages(), - page.isFirst(), - page.isLast()); - } -} diff --git a/common/src/main/java/com/hubEleven/common/utils/PagingUtils.java b/common/src/main/java/com/hubEleven/common/utils/PagingUtils.java deleted file mode 100644 index 5eb6b2db..00000000 --- a/common/src/main/java/com/hubEleven/common/utils/PagingUtils.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.hubEleven.common.utils; - -import com.hubEleven.common.response.CommonPageResponse; -import java.util.function.Function; -import org.springframework.data.domain.Page; - -public class PagingUtils { - - public static CommonPageResponse convert(Page page, Function mapper) { - return CommonPageResponse.of(page.map(mapper)); - } -} diff --git a/common/src/main/resources/application.yml b/common/src/main/resources/application.yml deleted file mode 100644 index ff103cc1..00000000 --- a/common/src/main/resources/application.yml +++ /dev/null @@ -1,3 +0,0 @@ -spring: - application: - name: common diff --git a/common/src/test/java/com/hubEleven/common/CommonApplicationTests.java b/common/src/test/java/com/hubEleven/common/CommonApplicationTests.java deleted file mode 100644 index e9e17456..00000000 --- a/common/src/test/java/com/hubEleven/common/CommonApplicationTests.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.hubEleven.common; - -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class CommonApplicationTests {} diff --git a/config/src/main/resources/config-repo/notification-service.yml b/config/src/main/resources/config-repo/notification-service.yml index a682b79e..ec635445 100644 --- a/config/src/main/resources/config-repo/notification-service.yml +++ b/config/src/main/resources/config-repo/notification-service.yml @@ -5,7 +5,7 @@ spring: application: name: notification-service datasource: - url: jdbc:mysql://localhost:3306/hubEleven?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Seoul + url: jdbc:mysql://mysql-hubeleven:3306/hubEleven?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Seoul username: ${DB_USERNAME} password: ${DB_PASSWORD} driver-class-name: com.mysql.cj.jdbc.Driver diff --git a/delivery/src/test/java/com/hubEleven/delivery/deliveryManager/DeliveryManagerCreateTest.java b/delivery/src/test/java/com/hubEleven/delivery/deliveryManager/DeliveryManagerCreateTest.java index d2c2fa81..d1fd7c7a 100644 --- a/delivery/src/test/java/com/hubEleven/delivery/deliveryManager/DeliveryManagerCreateTest.java +++ b/delivery/src/test/java/com/hubEleven/delivery/deliveryManager/DeliveryManagerCreateTest.java @@ -2,10 +2,9 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.annotation.Rollback; -import org.springframework.test.context.ActiveProfiles; @SpringBootTest -@ActiveProfiles("test") +// @ActiveProfiles("test") @Rollback public class DeliveryManagerCreateTest { diff --git a/delivery/src/test/java/com/hubEleven/delivery/deliveryManager/DeliveryManagerFeignClientTest.java b/delivery/src/test/java/com/hubEleven/delivery/deliveryManager/DeliveryManagerFeignClientTest.java index eae01612..c2300bf0 100644 --- a/delivery/src/test/java/com/hubEleven/delivery/deliveryManager/DeliveryManagerFeignClientTest.java +++ b/delivery/src/test/java/com/hubEleven/delivery/deliveryManager/DeliveryManagerFeignClientTest.java @@ -1,50 +1,40 @@ package com.hubEleven.delivery.deliveryManager; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import com.commonLib.common.response.ApiResponse; -import com.hubEleven.deliveryManager.infrastructure.client.UserFeignClient; -import com.hubEleven.deliveryManager.infrastructure.dto.UserInfoResponse; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.http.ResponseEntity; -import org.springframework.test.context.ActiveProfiles; -@ActiveProfiles("test") // 이 줄 추가 +// @ActiveProfiles("test") // 이 줄 추가 @SpringBootTest public class DeliveryManagerFeignClientTest { - @Autowired private UserFeignClient userFeignClient; - - @Test - void testUserFeignClient() { - // 실제 값으로 테스트 - Long userId = 2L; - Long requestUserId = 1L; // 실제 존재하는 유저 ID - String requestUserRole = "MASTER"; // 또는 "HUB_MANAGER" 등 - - // when - ResponseEntity> response = - userFeignClient.getUser(userId, requestUserId, requestUserRole); - - // then - assertNotNull(response, "응답이 null이 아니어야 합니다"); - assertNotNull(response.getBody(), "응답 body가 null이 아니어야 합니다"); - assertTrue(response.getStatusCode().is2xxSuccessful(), "HTTP 상태 코드가 2xx여야 합니다"); - - ApiResponse apiResponse = response.getBody(); - assertNotNull(apiResponse.result(), "result가 null이 아니어야 합니다"); - - UserInfoResponse userDto = apiResponse.result(); - assertThat(userDto.userId()).isEqualTo(userId); - // 로그 출력 - System.out.println("=== 응답 정보 ==="); - System.out.println("HTTP Status: " + response.getStatusCode()); - System.out.println("User ID: " + userDto.userId()); - System.out.println("Username: " + userDto.username()); - System.out.println("Role: " + userDto.role()); - } + // @Autowired private UserFeignClient userFeignClient; + + // @Test + // void testUserFeignClient() { + // // 실제 값으로 테스트 + // Long userId = 2L; + // Long requestUserId = 1L; // 실제 존재하는 유저 ID + // String requestUserRole = "MASTER"; // 또는 "HUB_MANAGER" 등 + // + // // when + // ResponseEntity> response = + // userFeignClient.getUser(userId, requestUserId, requestUserRole); + // + // // then + // assertNotNull(response, "응답이 null이 아니어야 합니다"); + // assertNotNull(response.getBody(), "응답 body가 null이 아니어야 합니다"); + // assertTrue(response.getStatusCode().is2xxSuccessful(), "HTTP 상태 코드가 2xx여야 합니다"); + // + // ApiResponse apiResponse = response.getBody(); + // assertNotNull(apiResponse.result(), "result가 null이 아니어야 합니다"); + // + // UserInfoResponse userDto = apiResponse.result(); + // assertThat(userDto.userId()).isEqualTo(userId); + // + // // 로그 출력 + // System.out.println("=== 응답 정보 ==="); + // System.out.println("HTTP Status: " + response.getStatusCode()); + // System.out.println("User ID: " + userDto.userId()); + // System.out.println("Username: " + userDto.username()); + // System.out.println("Role: " + userDto.role()); + // } } diff --git a/docker-compose.yml b/docker-compose.yml index 2a2fda36..7fa4ea5c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,10 +12,11 @@ services: networks: - hubeleven-network healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8761/actuator/health"] + test: [ "CMD", "curl", "-f", "http://localhost:8761/actuator/health" ] interval: 10s timeout: 5s retries: 5 + start_period: 60s config: image: hubeleven-config:latest @@ -27,6 +28,8 @@ services: container_name: config-service ports: - 8888:8888 + env_file: + - .env environment: - EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=${EUREKA_URL} depends_on: @@ -34,6 +37,12 @@ services: condition: service_healthy networks: - hubeleven-network + healthcheck: + test: [ "CMD", "curl", "-f", "http://localhost:8888/actuator/health" ] + interval: 10s + timeout: 5s + retries: 5 + start_period: 60s gateWay: image: hubeleven-gateway:latest @@ -64,7 +73,7 @@ services: SERVICE_NAME: user container_name: user-service ports: - - 8082:8082 + - 8081:8081 environment: - EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=${EUREKA_URL} - SPRING_CLOUD_CONFIG_URI=${CONFIG_SERVER_URI} @@ -79,8 +88,10 @@ services: - MANAGEMENT_ZIPKIN_TRACING_ENDPOINT=${ZIPKIN_ENDPOINT} - JWT_SECRET=${JWT_SECRET} depends_on: - - eurekaServer - - config + eurekaServer: + condition: service_healthy + config: + condition: service_healthy networks: - hubeleven-network @@ -93,7 +104,7 @@ services: SERVICE_NAME: hub container_name: hub-service ports: - - 8083:8083 + - 8082:8082 environment: - EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=${EUREKA_URL} - SPRING_CLOUD_CONFIG_URI=${CONFIG_SERVER_URI} @@ -107,8 +118,10 @@ services: - SPRING_REDIS_PORT=${REDIS_PORT} - MANAGEMENT_ZIPKIN_TRACING_ENDPOINT=${ZIPKIN_ENDPOINT} depends_on: - - eurekaServer - - config + eurekaServer: + condition: service_healthy + config: + condition: service_healthy networks: - hubeleven-network @@ -121,7 +134,7 @@ services: SERVICE_NAME: delivery container_name: delivery-service ports: - - 8084:8084 + - 8083:8083 environment: - EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=${EUREKA_URL} - SPRING_CLOUD_CONFIG_URI=${CONFIG_SERVER_URI} @@ -135,8 +148,10 @@ services: - SPRING_REDIS_PORT=${REDIS_PORT} - MANAGEMENT_ZIPKIN_TRACING_ENDPOINT=${ZIPKIN_ENDPOINT} depends_on: - - eurekaServer - - config + eurekaServer: + condition: service_healthy + config: + condition: service_healthy networks: - hubeleven-network @@ -149,7 +164,7 @@ services: SERVICE_NAME: order container_name: order-service ports: - - 8085:8085 + - 8084:8084 environment: - EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=${EUREKA_URL} - SPRING_CLOUD_CONFIG_URI=${CONFIG_SERVER_URI} @@ -163,8 +178,10 @@ services: - SPRING_REDIS_PORT=${REDIS_PORT} - MANAGEMENT_ZIPKIN_TRACING_ENDPOINT=${ZIPKIN_ENDPOINT} depends_on: - - eurekaServer - - config + eurekaServer: + condition: service_healthy + config: + condition: service_healthy networks: - hubeleven-network @@ -177,7 +194,7 @@ services: SERVICE_NAME: product container_name: product-service ports: - - 8086:8086 + - 8085:8085 environment: - EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=${EUREKA_URL} - SPRING_CLOUD_CONFIG_URI=${CONFIG_SERVER_URI} @@ -191,8 +208,10 @@ services: - SPRING_REDIS_PORT=${REDIS_PORT} - MANAGEMENT_ZIPKIN_TRACING_ENDPOINT=${ZIPKIN_ENDPOINT} depends_on: - - eurekaServer - - config + eurekaServer: + condition: service_healthy + config: + condition: service_healthy networks: - hubeleven-network @@ -205,7 +224,7 @@ services: SERVICE_NAME: company container_name: company-service ports: - - 8087:8087 + - 8086:8086 environment: - EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=${EUREKA_URL} - SPRING_CLOUD_CONFIG_URI=${CONFIG_SERVER_URI} @@ -219,8 +238,10 @@ services: - SPRING_REDIS_PORT=${REDIS_PORT} - MANAGEMENT_ZIPKIN_TRACING_ENDPOINT=${ZIPKIN_ENDPOINT} depends_on: - - eurekaServer - - config + eurekaServer: + condition: service_healthy + config: + condition: service_healthy networks: - hubeleven-network @@ -233,7 +254,7 @@ services: SERVICE_NAME: notification container_name: notification-service ports: - - 8088:8088 + - 8087:8087 environment: - EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=${EUREKA_URL} - SPRING_CLOUD_CONFIG_URI=${CONFIG_SERVER_URI} @@ -248,12 +269,14 @@ services: - MANAGEMENT_ZIPKIN_TRACING_ENDPOINT=${ZIPKIN_ENDPOINT} - JWT_SECRET=${JWT_SECRET} depends_on: - - eurekaServer - - config + eurekaServer: + condition: service_healthy + config: + condition: service_healthy networks: - hubeleven-network networks: - msa-network: + hubeleven-network: external: true name: hubeleven-network \ No newline at end of file diff --git a/notification/src/main/resources/application-eureka.yml b/notification/src/main/resources/application-eureka.yml deleted file mode 100644 index 3433a0bb..00000000 --- a/notification/src/main/resources/application-eureka.yml +++ /dev/null @@ -1,8 +0,0 @@ -eureka: - client: - register-with-eureka: true - fetch-registry: true - service-url: - defaultZone: http://localhost:8761/eureka/ - instance: - instance-id: ${spring.cloud.client.hostname}:${spring.application.instance_id:${random.value}} \ No newline at end of file diff --git a/notification/src/main/resources/application-swagger.yml b/notification/src/main/resources/application-swagger.yml deleted file mode 100644 index 9a9216f2..00000000 --- a/notification/src/main/resources/application-swagger.yml +++ /dev/null @@ -1,6 +0,0 @@ -springdoc: - api-docs: - path: /v3/api-docs - swagger-ui: - path: /swagger-ui.html - default-server-url: http://localhost:8080 \ No newline at end of file diff --git a/notification/src/main/resources/application.yml b/notification/src/main/resources/application.yml index 0618bf4f..37ccd2b3 100644 --- a/notification/src/main/resources/application.yml +++ b/notification/src/main/resources/application.yml @@ -1,17 +1,27 @@ +eureka: + client: + register-with-eureka: true + fetch-registry: true + service-url: + defaultZone: http://eureka-service:8761/eureka/ + instance: + instance-id: ${spring.cloud.client.hostname}:${spring.application.instance_id:${random.value}} + spring: application: name: notification-service - config: import: "configserver:" - cloud: config: discovery: enabled: true - service-id: config + service-id: CONFIG + +springdoc: + api-docs: + path: /v3/api-docs + swagger-ui: + path: /swagger-ui.html + default-server-url: http://localhost:8080 - profiles: - include: - - eureka - - swagger