-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code Refactor, Clean-up; Handle multiple domains
This is heavy commit as in it chages lot of stuff in the code. Changes are: - Code refactor - Code clean-up and used Lombok for removing boilerplate getter/setter code. - Support for config based max emailIds per user - version change from 1.0.0 -> 1.1.0 - Config restructuring. - And support for multiple domains is added. Now this bot can interact with multiple domains and can offer temp-mails from various domains. Config driven. - Update README to reflect new config. Fix #20
- Loading branch information
Showing
21 changed files
with
251 additions
and
534 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/io/github/trashemail/Configurations/EmailServerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.github.trashemail.Configurations; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import java.util.List; | ||
|
||
@Configuration | ||
@ConfigurationProperties(prefix = "email-server") | ||
@Getter @Setter @NoArgsConstructor | ||
public class EmailServerConfig { | ||
|
||
private List<String> hosts; | ||
private String adminEmail; | ||
private String adminPassword; | ||
private String addUrl; | ||
private String removeUrl; | ||
private Imap imap; | ||
|
||
|
||
@Configuration | ||
@ConfigurationProperties(prefix = "imap") | ||
@Getter @Setter @NoArgsConstructor | ||
public static class Imap{ | ||
private String host; | ||
private String port; | ||
private String email; | ||
private String password; | ||
} | ||
} |
107 changes: 0 additions & 107 deletions
107
src/main/java/io/github/trashemail/Configurations/EmailServerConfiguration.java
This file was deleted.
Oops, something went wrong.
30 changes: 6 additions & 24 deletions
30
src/main/java/io/github/trashemail/Configurations/TelegramConfg.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,18 @@ | ||
package io.github.trashemail.Configurations; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
@ConfigurationProperties(prefix="telegram") | ||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
public class TelegramConfg{ | ||
private String botToken; | ||
private String url; | ||
private int size; | ||
|
||
public String getUrl() { | ||
return url; | ||
} | ||
|
||
public void setUrl(String url) { | ||
this.url = url; | ||
} | ||
|
||
public String getBotToken() { | ||
return botToken; | ||
} | ||
|
||
public void setBotToken(String botToken) { | ||
this.botToken = botToken; | ||
} | ||
|
||
public int getSize() { | ||
return size; | ||
} | ||
|
||
public void setSize(int size) { | ||
this.size = size; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/io/github/trashemail/Configurations/TrashemailConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.github.trashemail.Configurations; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@Configuration | ||
@ConfigurationProperties(prefix = "trashemail") | ||
public class TrashemailConfig { | ||
private Integer maxEmailsPerUser; | ||
|
||
@Override | ||
public String toString() { | ||
return Integer.toString(maxEmailsPerUser); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.