mirror of https://github.com/hykilpikonna/AquaDX
[+] Email confirmation table
parent
7fe869b98b
commit
5715fa97f7
|
@ -0,0 +1,32 @@
|
||||||
|
package icu.samnyan.aqua.net.db
|
||||||
|
|
||||||
|
import jakarta.persistence.*
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository
|
||||||
|
import org.springframework.stereotype.Repository
|
||||||
|
import java.io.Serializable
|
||||||
|
import java.time.Instant
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "aqua_net_email_confirmation")
|
||||||
|
class EmailConfirmation(
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
var id: Long = 0,
|
||||||
|
|
||||||
|
@Column(nullable = false)
|
||||||
|
var token: String = "",
|
||||||
|
|
||||||
|
// Token creation time
|
||||||
|
@Column(nullable = false)
|
||||||
|
var createdAt: Instant = Instant.now(),
|
||||||
|
|
||||||
|
// Linking to the AquaNetUser
|
||||||
|
@OneToOne
|
||||||
|
@JoinColumn(name = "auId", referencedColumnName = "auId")
|
||||||
|
var aquaNetUser: AquaNetUser = AquaNetUser()
|
||||||
|
) : Serializable
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
interface EmailConfirmationRepo : JpaRepository<EmailConfirmation, Long> {
|
||||||
|
fun findByToken(token: String): EmailConfirmation?
|
||||||
|
}
|
Loading…
Reference in New Issue