Skip to content

Commit

Permalink
merge AWS
Browse files Browse the repository at this point in the history
  • Loading branch information
lahiru-rajapakshe committed Nov 27, 2022
2 parents f994990 + 685adae commit c337a88
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package online.lahiru.sprinngbotrestapi;

import online.lahiru.sprinngbotrestapi.entity.Role;
import online.lahiru.sprinngbotrestapi.repository.RoleRepository;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class SprinngbotRestApiApplication {
public class SprinngbotRestApiApplication implements CommandLineRunner {

@Bean
public ModelMapper modelMapper(){
Expand All @@ -16,4 +20,21 @@ public static void main(String[] args) {
SpringApplication.run(SprinngbotRestApiApplication.class, args);
}

@Autowired
private RoleRepository roleRepository;

@Override
public void run(String... args) throws Exception {
Role adminRole = new Role();
adminRole.setName("ROLE_ADMIN");
roleRepository.save(adminRole);

Role userRole = new Role();
userRole.setName("ROLE_USER");
roleRepository.save(userRole);




}
}
9 changes: 9 additions & 0 deletions src/main/resources/application-dev.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
spring.datasource.url = jdbc:mysql://localhost:3306/myblog?useSSL=false&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=Addy@789**$

spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.hibernate.ddl-auto=update



11 changes: 11 additions & 0 deletions src/main/resources/application-prod.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
spring.datasource.url = jdbc:mysql://localhost:3306/myblog?useSSL=false&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=Addy@789**$

spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.hibernate.ddl-auto=update

logging.level.org.springframework.security=DEBUG


#// you need to add this property for remove swagger issue
9 changes: 9 additions & 0 deletions src/main/resources/application-qa.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
spring.datasource.url = jdbc:mysql://localhost:3306/myblog?useSSL=false&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=Addy@789**$

spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.hibernate.ddl-auto=update

logging.level.org.springframework.security=DEBUG

27 changes: 20 additions & 7 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
spring.datasource.url = jdbc:mysql://localhost:3306/myblog?useSSL=false&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=Addy@789**$

spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.hibernate.ddl-auto=update
#spring.datasource.url = jdbc:mysql://localhost:3306/myblog?useSSL=false&serverTimezone=UTC
#spring.datasource.username=root
#spring.datasource.password=Addy@789**$
#
#spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
#spring.jpa.hibernate.ddl-auto=update

logging.level.org.springframework.security=DEBUG

Expand All @@ -19,4 +19,17 @@ app.jwt-expiration-milliseconds=604800000

spring.mvc.pathmatch.matching-strategy = ANT_PATH_MATCHER

#// you need to add this property for remove swagger issue
spring.profiles.active=dev

#// you need to add this property for remove swagger issue




#these are the linesa that i commnted before connecting prod.properties
#spring.datasource.url = jdbc:mysql://localhost:3306/myblog?useSSL=false&serverTimezone=UTC
#spring.datasource.username=root
#spring.datasource.password=Addy@789**$
#
#spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
#spring.jpa.hibernate.ddl-auto=update

0 comments on commit c337a88

Please sign in to comment.