diff --git a/examples/java/java-social_login-01_base/src/main/java/tv/codely/app/controller/login/EmailLoginPostController.java b/examples/java/java-social_login-01_base/src/main/java/tv/codely/app/controller/login/EmailLoginPostController.java new file mode 100644 index 00000000..a5e70be9 --- /dev/null +++ b/examples/java/java-social_login-01_base/src/main/java/tv/codely/app/controller/login/EmailLoginPostController.java @@ -0,0 +1,7 @@ +package tv.codely.app.controller.login; + +public final class EmailLoginPostController { + public void post(String email, String password) { + + } +} diff --git a/examples/java/java-social_login-01_base/src/main/java/tv/codely/app/controller/login/TwitterLoginPostController.java b/examples/java/java-social_login-01_base/src/main/java/tv/codely/app/controller/login/TwitterLoginPostController.java new file mode 100644 index 00000000..87a42f4b --- /dev/null +++ b/examples/java/java-social_login-01_base/src/main/java/tv/codely/app/controller/login/TwitterLoginPostController.java @@ -0,0 +1,7 @@ +package tv.codely.app.controller.login; + +public final class TwitterLoginPostController { + public void post(String username, String token) { + + } +} diff --git a/examples/java/java-social_login-01_base/src/main/java/tv/codely/app/controller/sign_up/EmailSignUpPostController.java b/examples/java/java-social_login-01_base/src/main/java/tv/codely/app/controller/sign_up/EmailSignUpPostController.java new file mode 100644 index 00000000..6be0654f --- /dev/null +++ b/examples/java/java-social_login-01_base/src/main/java/tv/codely/app/controller/sign_up/EmailSignUpPostController.java @@ -0,0 +1,7 @@ +package tv.codely.app.controller.sign_up; + +public final class EmailSignUpPostController { + public void post(String email, String password) { + + } +} diff --git a/examples/java/java-social_login-01_base/src/main/java/tv/codely/app/controller/sign_up/TwitterSignUpPostController.java b/examples/java/java-social_login-01_base/src/main/java/tv/codely/app/controller/sign_up/TwitterSignUpPostController.java new file mode 100644 index 00000000..f939c968 --- /dev/null +++ b/examples/java/java-social_login-01_base/src/main/java/tv/codely/app/controller/sign_up/TwitterSignUpPostController.java @@ -0,0 +1,7 @@ +package tv.codely.app.controller.sign_up; + +public final class TwitterSignUpPostController { + public void post(String username, String token) { + + } +} diff --git a/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/login/EmailLoginProvider.java b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/login/EmailLoginProvider.java new file mode 100644 index 00000000..c13ac03f --- /dev/null +++ b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/login/EmailLoginProvider.java @@ -0,0 +1,12 @@ +package tv.codely.ecommerce.login; + +public final class EmailLoginProvider extends LoginProvider { + private final String email; + private final String password; + + public EmailLoginProvider(String email, String password, String ip) { + super("email", ip); + this.email = email; + this.password = password; + } +} diff --git a/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/login/FacebookLoginProvider.java b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/login/FacebookLoginProvider.java new file mode 100644 index 00000000..9f42040e --- /dev/null +++ b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/login/FacebookLoginProvider.java @@ -0,0 +1,12 @@ +package tv.codely.ecommerce.login; + +public final class FacebookLoginProvider extends LoginProvider { + private final String email; + private final String hash; + + public FacebookLoginProvider(String email, String hash, String ip) { + super("facebook", ip); + this.email = email; + this.hash = hash; + } +} diff --git a/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/login/GitHubLoginProvider.java b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/login/GitHubLoginProvider.java new file mode 100644 index 00000000..6eb06f14 --- /dev/null +++ b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/login/GitHubLoginProvider.java @@ -0,0 +1,13 @@ +package tv.codely.ecommerce.login; + +public final class GitHubLoginProvider extends LoginProvider { + private final String username; + private final String secretKey; + + public GitHubLoginProvider(String username, String secretKey, String ip) { + super("github", ip); + + this.username = username; + this.secretKey = secretKey; + } +} diff --git a/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/login/LoginProvider.java b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/login/LoginProvider.java new file mode 100644 index 00000000..6eaa35f2 --- /dev/null +++ b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/login/LoginProvider.java @@ -0,0 +1,11 @@ +package tv.codely.ecommerce.login; + +public abstract class LoginProvider { + private String provider; + private String ip; + + public LoginProvider(String provider, String ip) { + this.provider = provider; + this.ip = ip; + } +} diff --git a/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/login/TwitterLoginProvider.java b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/login/TwitterLoginProvider.java new file mode 100644 index 00000000..95c84230 --- /dev/null +++ b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/login/TwitterLoginProvider.java @@ -0,0 +1,12 @@ +package tv.codely.ecommerce.login; + +public final class TwitterLoginProvider extends LoginProvider { + private String username; + private String token; + + public TwitterLoginProvider(String username, String token, String ip) { + super("twitter", ip); + this.username = username; + this.token = token; + } +} diff --git a/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/login_attempt/LoginAttempt.java b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/login_attempt/LoginAttempt.java new file mode 100644 index 00000000..1eecfb73 --- /dev/null +++ b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/login_attempt/LoginAttempt.java @@ -0,0 +1,7 @@ +package tv.codely.ecommerce.login_attempt; + +public abstract class LoginAttempt { + public LoginAttempt(String dsf) { + + } +} diff --git a/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/sign_up/EmailSignUpProvider.java b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/sign_up/EmailSignUpProvider.java new file mode 100644 index 00000000..6d2d497f --- /dev/null +++ b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/sign_up/EmailSignUpProvider.java @@ -0,0 +1,12 @@ +package tv.codely.ecommerce.sign_up; + +public final class EmailSignUpProvider extends SignUpProvider { + private final String email; + private final String password; + + public EmailSignUpProvider(String email, String password) { + super("email"); + this.email = email; + this.password = password; + } +} diff --git a/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/sign_up/FacebookSignUpProvider.java b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/sign_up/FacebookSignUpProvider.java new file mode 100644 index 00000000..74a8cd1b --- /dev/null +++ b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/sign_up/FacebookSignUpProvider.java @@ -0,0 +1,12 @@ +package tv.codely.ecommerce.sign_up; + +public final class FacebookSignUpProvider extends SignUpProvider { + private final String email; + private final String hash; + + public FacebookSignUpProvider(String email, String hash) { + super("facebook"); + this.email = email; + this.hash = hash; + } +} diff --git a/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/sign_up/GitHubSignUpProvider.java b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/sign_up/GitHubSignUpProvider.java new file mode 100644 index 00000000..c1981cce --- /dev/null +++ b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/sign_up/GitHubSignUpProvider.java @@ -0,0 +1,12 @@ +package tv.codely.ecommerce.sign_up; + +public final class GitHubSignUpProvider extends SignUpProvider { + private final String username; + private final String secretKey; + + public GitHubSignUpProvider(String username, String secretKey) { + super("github"); + this.username = username; + this.secretKey = secretKey; + } +} diff --git a/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/sign_up/SignUpProvider.java b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/sign_up/SignUpProvider.java new file mode 100644 index 00000000..b0cabda2 --- /dev/null +++ b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/sign_up/SignUpProvider.java @@ -0,0 +1,9 @@ +package tv.codely.ecommerce.sign_up; + +public abstract class SignUpProvider { + private String provider; + + public SignUpProvider(String provider) { + this.provider = provider; + } +} diff --git a/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/sign_up/TwitterSignUpProvider.java b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/sign_up/TwitterSignUpProvider.java new file mode 100644 index 00000000..ab797cf7 --- /dev/null +++ b/examples/java/java-social_login-01_base/src/main/java/tv/codely/ecommerce/sign_up/TwitterSignUpProvider.java @@ -0,0 +1,12 @@ +package tv.codely.ecommerce.sign_up; + +public final class TwitterSignUpProvider extends SignUpProvider { + private String username; + private String token; + + public TwitterSignUpProvider(String username, String token) { + super("twitter"); + this.username = username; + this.token = token; + } +} diff --git a/examples/java/java-social_login-01_base/src/main/java/tv/codely/java_basic_skeleton/Greeter.java b/examples/java/java-social_login-01_base/src/main/java/tv/codely/java_basic_skeleton/Greeter.java deleted file mode 100644 index 85d66c4f..00000000 --- a/examples/java/java-social_login-01_base/src/main/java/tv/codely/java_basic_skeleton/Greeter.java +++ /dev/null @@ -1,7 +0,0 @@ -package tv.codely.java_basic_skeleton; - -public class Greeter { - public String greet(String name) { - return "Hello " + name; - } -} diff --git a/examples/java/java-social_login-01_base/src/test/java/tv/codely/java_basic_skeleton/GreeterShould.java b/examples/java/java-social_login-01_base/src/test/java/tv/codely/java_basic_skeleton/GreeterShould.java deleted file mode 100644 index aaf21278..00000000 --- a/examples/java/java-social_login-01_base/src/test/java/tv/codely/java_basic_skeleton/GreeterShould.java +++ /dev/null @@ -1,24 +0,0 @@ -package tv.codely.java_basic_skeleton; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.junit.jupiter.api.Test; - -public class GreeterShould { - - @Test - void greet_with_a_hello_message_to_the_name_it_receives() { - Greeter greeter = new Greeter(); - assertEquals("Hello Jhon", greeter.greet("Jhon")); - } - - @Test - void save_logs_to_the_file() { - Logger logger = LogManager.getLogger(GreeterShould.class); - RuntimeException error = new RuntimeException("exceptioooon"); - logger.error("Hello error world!", error); - } - -}