ddangelorb
3 years ago
7 changed files with 151 additions and 11 deletions
-
15db/ddl.sql
-
14src/main/java/org/waterproofingdata/wpdauth/controller/ForgotPasswordController.java
-
27src/main/java/org/waterproofingdata/wpdauth/model/ForgotPasswordQuestions.java
-
31src/main/java/org/waterproofingdata/wpdauth/model/ForgotPasswordQuestionsUsersAnswers.java
-
7src/main/java/org/waterproofingdata/wpdauth/repository/ForgotPasswordQuestionsRepository.java
-
10src/main/java/org/waterproofingdata/wpdauth/repository/ForgotPasswordQuestionsUsersAnswersRepository.java
-
58src/main/java/org/waterproofingdata/wpdauth/service/ForgotPasswordService.java
@ -0,0 +1,27 @@ |
|||||
|
package org.waterproofingdata.wpdauth.model; |
||||
|
|
||||
|
import javax.persistence.Column; |
||||
|
import javax.persistence.Entity; |
||||
|
import javax.persistence.GeneratedValue; |
||||
|
import javax.persistence.GenerationType; |
||||
|
import javax.persistence.Id; |
||||
|
|
||||
|
import lombok.Getter; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
@Entity(name = "forgotpassword_questions") |
||||
|
@Getter |
||||
|
@Setter |
||||
|
@NoArgsConstructor |
||||
|
public class ForgotPasswordQuestions { |
||||
|
@Id |
||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY) |
||||
|
private Integer id; |
||||
|
|
||||
|
@Column(nullable = false) |
||||
|
private String question; |
||||
|
|
||||
|
@Column(nullable = false) |
||||
|
private Integer active; |
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
package org.waterproofingdata.wpdauth.model; |
||||
|
|
||||
|
import javax.persistence.Column; |
||||
|
import javax.persistence.Entity; |
||||
|
import javax.persistence.GeneratedValue; |
||||
|
import javax.persistence.GenerationType; |
||||
|
import javax.persistence.Id; |
||||
|
|
||||
|
import lombok.Getter; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
import lombok.Setter; |
||||
|
|
||||
|
@Entity(name = "forgotpassword_questions_users_answers") |
||||
|
@Getter |
||||
|
@Setter |
||||
|
@NoArgsConstructor |
||||
|
public class ForgotPasswordQuestionsUsersAnswers { |
||||
|
@Id |
||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY) |
||||
|
private Integer id; |
||||
|
|
||||
|
@Column(nullable = false, name="forgotpassword_questions_id") |
||||
|
private Integer forgotpasswordquestionsid; |
||||
|
|
||||
|
@Column(nullable = false, name="users_id") |
||||
|
private Integer usersid; |
||||
|
|
||||
|
@Column(nullable = false) |
||||
|
private String answer; |
||||
|
|
||||
|
} |
@ -0,0 +1,7 @@ |
|||||
|
package org.waterproofingdata.wpdauth.repository; |
||||
|
|
||||
|
import org.springframework.data.jpa.repository.JpaRepository; |
||||
|
import org.waterproofingdata.wpdauth.model.ForgotPasswordQuestions; |
||||
|
|
||||
|
public interface ForgotPasswordQuestionsRepository extends JpaRepository<ForgotPasswordQuestions, Integer> { |
||||
|
} |
@ -0,0 +1,10 @@ |
|||||
|
package org.waterproofingdata.wpdauth.repository; |
||||
|
|
||||
|
import org.springframework.data.jpa.repository.JpaRepository; |
||||
|
import org.springframework.data.jpa.repository.Query; |
||||
|
import org.waterproofingdata.wpdauth.model.ForgotPasswordQuestionsUsersAnswers; |
||||
|
|
||||
|
public interface ForgotPasswordQuestionsUsersAnswersRepository extends JpaRepository<ForgotPasswordQuestionsUsersAnswers, Integer> { |
||||
|
@Query(value = "SELECT fqua.* FROM forgotpassword_questions_users_answers fqua WHERE fqua.forgotpassword_questions_id = ?1 AND fqua.users_id = ?2", nativeQuery = true) |
||||
|
ForgotPasswordQuestionsUsersAnswers findByForgotPasswordQuestionsAndUserid(Integer forgotpasswordquestionsid, Integer usersid); |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue