File tree 1 file changed +29
-0
lines changed
src/main/java/br/com/catalog
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ package br .com .catalog ;
2
+
3
+ import br .com .catalog .models .enums .UserRole ;
4
+ import br .com .catalog .services .IAuthenticationService ;
5
+ import br .com .catalog .services .impls .dtos .AuthenticationDTO ;
6
+ import br .com .catalog .services .impls .dtos .RegisterDTO ;
7
+ import br .com .catalog .services .impls .dtos .UserResponseDTO ;
8
+ import org .springframework .boot .CommandLineRunner ;
9
+ import org .springframework .boot .SpringApplication ;
10
+ import org .springframework .boot .autoconfigure .SpringBootApplication ;
11
+
12
+ @ SpringBootApplication
13
+ public class CatalogApplication implements CommandLineRunner {
14
+ private final IAuthenticationService <AuthenticationDTO , UserResponseDTO , RegisterDTO > authenticationService ;
15
+
16
+ public CatalogApplication (IAuthenticationService <AuthenticationDTO , UserResponseDTO , RegisterDTO > authenticationService ) {
17
+ this .authenticationService = authenticationService ;
18
+ }
19
+
20
+ public static void main (String [] args ) {
21
+ SpringApplication .run (CatalogApplication .class , args );
22
+ }
23
+
24
+ @ Override
25
+ public void run (String ... args ) throws Exception {
26
+ authenticationService .register (new RegisterDTO ("useradmin" , "passwordadmin" , UserRole .ADMIN ));
27
+ authenticationService .register (new RegisterDTO ("userstandard" , "passwordstandard" , UserRole .USER ));
28
+ }
29
+ }
You can’t perform that action at this time.
0 commit comments