From 3d406591f5be286062c2fc071139add66a87a21f Mon Sep 17 00:00:00 2001
From: g-otn <44736064+g-otn@users.noreply.github.com>
Date: Fri, 29 Mar 2024 01:10:59 -0300
Subject: [PATCH] chore: cleanup, update common
---
pom.xml | 2 +-
.../grupo63/serviceorder/ServiceOrderApplication.java | 10 +++++++---
.../grupo63/serviceorder/config/JwtFilterConfig.java | 10 +++-------
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/pom.xml b/pom.xml
index 9689fee..e0e49cb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -93,7 +93,7 @@
com.github.soat-tech-challenge
service-common
- 5.0.0
+ 5.1.1
org.postgresql
diff --git a/src/main/java/br/com/grupo63/serviceorder/ServiceOrderApplication.java b/src/main/java/br/com/grupo63/serviceorder/ServiceOrderApplication.java
index 8e3196d..d315c87 100644
--- a/src/main/java/br/com/grupo63/serviceorder/ServiceOrderApplication.java
+++ b/src/main/java/br/com/grupo63/serviceorder/ServiceOrderApplication.java
@@ -1,5 +1,7 @@
package br.com.grupo63.serviceorder;
+import br.com.grupo63.techchallenge.common.config.auth.jwt.JwtService;
+import br.com.grupo63.techchallenge.common.config.aws.ecs.ECSTaskIdInfoContributor;
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
@@ -9,7 +11,6 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
-import org.springframework.context.annotation.ComponentScan;
@OpenAPIDefinition(
info = @Info(title = "${info.name}", description = "${info.description}", version = "${info.version}"),
@@ -25,9 +26,12 @@
bearerFormat = "JWT",
in = SecuritySchemeIn.HEADER
)
-@SpringBootApplication
+@SpringBootApplication(scanBasePackageClasses = {
+ ServiceOrderApplication.class,
+ JwtService.class,
+ ECSTaskIdInfoContributor.class
+})
@EnableFeignClients
-@ComponentScan(basePackages = {"br.com.grupo63"})
public class ServiceOrderApplication {
public static void main(String[] args) {
diff --git a/src/main/java/br/com/grupo63/serviceorder/config/JwtFilterConfig.java b/src/main/java/br/com/grupo63/serviceorder/config/JwtFilterConfig.java
index 4e6c680..8085d83 100644
--- a/src/main/java/br/com/grupo63/serviceorder/config/JwtFilterConfig.java
+++ b/src/main/java/br/com/grupo63/serviceorder/config/JwtFilterConfig.java
@@ -1,8 +1,7 @@
package br.com.grupo63.serviceorder.config;
-import br.com.grupo63.techchallenge.common.config.JwtFilter;
-import br.com.grupo63.techchallenge.common.config.JwtService;
-import org.springframework.beans.factory.annotation.Autowired;
+import br.com.grupo63.techchallenge.common.config.auth.jwt.JwtFilter;
+import br.com.grupo63.techchallenge.common.config.auth.jwt.JwtService;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -12,11 +11,8 @@
@Configuration
public class JwtFilterConfig {
- @Autowired
- private JwtService jwtService;
-
@Bean
- public FilterRegistrationBean jwtFilterFilterRegistrationBean() {
+ public FilterRegistrationBean jwtFilterFilterRegistrationBean(JwtService jwtService) {
FilterRegistrationBean jwtFilterFilterRegistrationBean = new FilterRegistrationBean<>();
jwtFilterFilterRegistrationBean.setFilter(new JwtFilter(jwtService));
jwtFilterFilterRegistrationBean.setUrlPatterns(List.of("/orders"));