Skip to content

Commit

Permalink
jwt test complete
Browse files Browse the repository at this point in the history
  • Loading branch information
vw2019 committed Dec 26, 2018
1 parent ceb4f43 commit cac2323
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
24 changes: 12 additions & 12 deletions quick-jwt/src/main/java/com/quick/jwt/JwtAuthApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ public ModelMapper modelMapper() {

@Override
public void run(String... params) throws Exception {
// User admin = new User();
// admin.setUsername("admin");
// admin.setPassword("admin");
// admin.setEmail("admin@email.com");
// admin.setRoles(new ArrayList<Role>(Arrays.asList(Role.ROLE_ADMIN)));
// userService.signup(admin);
// User client = new User();
// client.setUsername("client");
// client.setPassword("client");
// client.setEmail("client@email.com");
// client.setRoles(new ArrayList<Role>(Arrays.asList(Role.ROLE_CLIENT)));
// userService.signup(client);
User admin = new User();
admin.setUsername("admin");
admin.setPassword("admin");
admin.setEmail("admin@email.com");
admin.setRoles(new ArrayList<Role>(Arrays.asList(Role.ROLE_ADMIN)));
userService.signup(admin);
User client = new User();
client.setUsername("client");
client.setPassword("client");
client.setEmail("client@email.com");
client.setRoles(new ArrayList<Role>(Arrays.asList(Role.ROLE_CLIENT)));
userService.signup(client);
}

}
1 change: 1 addition & 0 deletions quick-jwt/src/main/java/com/quick/jwt/model/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.List;

@Entity
@Table(name = "user")
public class User {

@Id
Expand Down
20 changes: 11 additions & 9 deletions quick-jwt/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
spring:
datasource:
# url: jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
url: jdbc:mysql://localhost:3308/testdb
url: jdbc:mysql://localhost:3306/testdb
username: root
password: 123456
password: root123
driver-class-name: com.mysql.jdbc.Driver
tomcat:
max-wait: 20000
max-active: 50
max-idle: 20
min-idle: 15
jpa:
hibernate:
ddl-auto: create-drop
properties:
hibernate:
dialect: org.hibernate.dialect.H2Dialect
format_sql: true
id:
new_generator_mappings: false
ddl-auto: update
# properties:
# hibernate:
# dialect: org.hibernate.dialect.MySQLInnoDBDialect
# format_sql: true
# id:
# new_generator_mappings: false
show-sql: true

security:
jwt:
Expand Down

0 comments on commit cac2323

Please sign in to comment.