Fix given dependencies
This commit is contained in:
parent
7e871f824c
commit
7b40c6edea
4 changed files with 10 additions and 9 deletions
|
@ -146,8 +146,8 @@ public class Main{
|
|||
}
|
||||
|
||||
private static void initRoutes(Router<PeerAtUser> router, DatabaseRepository repo, Configuration config) throws Exception{
|
||||
router.registerPackages(new DependencyInjector()
|
||||
.of(repo, router, config, new RouteExtracter(router))
|
||||
router.registerPackages("dev.peerat.backend.routes",new DependencyInjector()
|
||||
.of(repo, router, config, new RouteExtracter(router), config.getMail())
|
||||
.of("waitting", new HashMap<>())
|
||||
.of("leaderboard", new Locker<>())
|
||||
.of("groups", new Locker<>()));
|
||||
|
|
|
@ -17,7 +17,7 @@ public class Swagger implements Response{
|
|||
|
||||
public Swagger(RouteExtracter extracter, Configuration config){
|
||||
try{
|
||||
this.json = extracter.swagger(config.getTokenIssuer()).toString();
|
||||
// this.json = extracter.swagger(config.getTokenIssuer()).toString();
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
json = "{}";
|
||||
|
|
|
@ -29,6 +29,7 @@ import javax.net.ssl.HttpsURLConnection;
|
|||
import org.jose4j.json.internal.json_simple.JSONAware;
|
||||
import org.jose4j.json.internal.json_simple.JSONObject;
|
||||
|
||||
import dev.peerat.backend.Configuration;
|
||||
import dev.peerat.backend.bonus.extract.RouteDoc;
|
||||
import dev.peerat.backend.model.PeerAtUser;
|
||||
import dev.peerat.backend.repository.DatabaseAuthRepository;
|
||||
|
@ -58,15 +59,14 @@ public class MailConfirmation extends FormResponse{
|
|||
public MailConfirmation(
|
||||
DatabaseRepository databaseRepo,
|
||||
Router<PeerAtUser> router,
|
||||
@Injection("usersFiles") String initUsersFilesPath,
|
||||
@Injection("gitToken") String gitToken,
|
||||
Configuration config,
|
||||
@Injection("waitting") Map<String, String> playersWaiting,
|
||||
Mail mail) throws NoSuchAlgorithmException{
|
||||
|
||||
this.databaseRepo = databaseRepo.getAuthRepository();
|
||||
this.router = router;
|
||||
this.usersFilesPath = initUsersFilesPath;
|
||||
this.gitToken = gitToken;
|
||||
this.usersFilesPath = config.getUsersFiles();
|
||||
this.gitToken = config.getGitToken();
|
||||
this.playersWaiting = playersWaiting;
|
||||
this.mail = mail;
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import java.util.Random;
|
|||
import java.util.UUID;
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
import dev.peerat.backend.Configuration;
|
||||
import dev.peerat.backend.bonus.extract.RouteDoc;
|
||||
import dev.peerat.backend.repository.DatabaseAuthRepository;
|
||||
import dev.peerat.backend.repository.DatabaseRepository;
|
||||
|
@ -31,11 +32,11 @@ public class Register extends FormResponse{
|
|||
private String host;
|
||||
private List<Random> randoms;
|
||||
|
||||
public Register(DatabaseRepository databaseRepo, @Injection("waitting") Map<String, String> playersWaiting, Mail mail, @Injection("issuer") String host){
|
||||
public Register(DatabaseRepository databaseRepo, @Injection("waitting") Map<String, String> playersWaiting, Mail mail, Configuration config){
|
||||
this.databaseRepo = databaseRepo.getAuthRepository();
|
||||
this.playersWaiting = playersWaiting;
|
||||
this.mail = mail;
|
||||
this.host = host;
|
||||
this.host = config.getTokenIssuer();
|
||||
this.randoms = new ArrayList<>();
|
||||
|
||||
Random random = new Random();
|
||||
|
|
Loading…
Add table
Reference in a new issue