diff --git a/src/main/java/org/ntlab/acanthus_server/entities/Account.java b/src/main/java/org/ntlab/acanthus_server/entities/Account.java index 58f16db..5ffe796 100644 --- a/src/main/java/org/ntlab/acanthus_server/entities/Account.java +++ b/src/main/java/org/ntlab/acanthus_server/entities/Account.java @@ -20,6 +20,8 @@ // //////////////////////////////////////////////////////////////////////////////////////// package org.ntlab.acanthus_server.entities; +import java.util.UUID; + public class Account { private int uid; private String name; @@ -34,43 +36,49 @@ this.password = password; } + //----------------------------------------------------------------- + //----------------------------------------------------------------- //uidを返す //GetとSetを実装 public int getUid() { return uid; } + //----------------------------------------------------------------- public void setUid(int uid) { this.uid = uid; } - + //----------------------------------------------------------------- //tokenを返す //GetとSetを実装 public String getToken() { return token; } - public void setToken(String token) { - this.token = token; + //----------------------------------------------------------------- + // トークンを生成する + public void createToken() { + this.token = UUID.randomUUID().toString(); } + //----------------------------------------------------------------- //passwordをtoken認証後返す public String getPassword(String token) { //IFでトークン認証をしたのちに返す return password; } - + //----------------------------------------------------------------- //emailを返す public String getEmail() { return email; } - + //----------------------------------------------------------------- public void setEmail(String email) { this.email = email; } - - //Auth関数でpassword認証 + //----------------------------------------------------------------- + // パスワードが一致しているかを判定 public boolean isMatchedPassword(String password) { return this.password.equals(password); }