Skip to content

Commit

Permalink
#882 Create a shared project
Browse files Browse the repository at this point in the history
  • Loading branch information
nashtech-huyphamphu committed Sep 19, 2024
1 parent c6bea06 commit bac0a79
Show file tree
Hide file tree
Showing 9 changed files with 127 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.yas.commonlibrary.config;
package com.yas.cart.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.yas.commonlibrary.config;
package com.yas.cart.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand Down
20 changes: 20 additions & 0 deletions customer/src/main/java/com/yas/customer/config/CorsConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.yas.customer.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class CorsConfig {
@Bean
public WebMvcConfigurer corsConfigure() {
return new WebMvcConfigurer() {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedMethods("*").allowedOrigins("*")
.allowedHeaders("*");
}
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.yas.customer.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestClient;

@Configuration
public class RestClientConfig {

@Bean
public RestClient restClient() {
return RestClient.builder().build();
}

}
20 changes: 20 additions & 0 deletions inventory/src/main/java/com/yas/inventory/config/CorsConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.yas.inventory.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class CorsConfig {
@Bean
public WebMvcConfigurer corsConfigure() {
return new WebMvcConfigurer() {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedMethods("*").allowedOrigins("*")
.allowedHeaders("*");
}
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.yas.inventory.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestClient;

@Configuration
public class RestClientConfig {

@Bean
public RestClient restClient() {
return RestClient.builder().build();
}

}
20 changes: 20 additions & 0 deletions location/src/main/java/com/yas/location/config/CorsConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.yas.location.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class CorsConfig {
@Bean
public WebMvcConfigurer corsConfigure() {
return new WebMvcConfigurer() {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedMethods("*").allowedOrigins("*")
.allowedHeaders("*");
}
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.yas.location.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestClient;

@Configuration
public class RestClientConfig {

@Bean
public RestClient restClient() {
return RestClient.builder().build();
}

}
20 changes: 20 additions & 0 deletions product/src/main/java/com/yas/product/config/CorsConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.yas.product.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class CorsConfig {
@Bean
public WebMvcConfigurer corsConfigure() {
return new WebMvcConfigurer() {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedMethods("*").allowedOrigins("*")
.allowedHeaders("*");
}
};
}
}

0 comments on commit bac0a79

Please sign in to comment.