Skip to content

Commit 7a06ffd

Browse files
committed
feat: main class
1 parent 3b5be4d commit 7a06ffd

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
}

0 commit comments

Comments
 (0)