Пример #1
0
 public Account accountByEmail(String account, String status) throws AuthServerException {
   try {
     Account acct = authRepository.Authbyemail(account, status);
     return acct;
   } catch (Exception e) {
     throw new AuthServerException("获取账号信息出错!");
   }
 }
Пример #2
0
 public Account createAccount(Account acount) throws AuthServerException {
   try {
     Account account = acount;
     account.setStatus("2");
     account.setId(nextSequenceNumber());
     Account accountd = authRepository.Authbyemail(acount.getEmail(), "1");
     if (accountd != null) {
       throw new AuthServerException("该邮箱账号已被激活使用,请检查修改!");
     }
     authRepository.insertAuth(account);
     return account;
   } catch (AuthServerException e) {
     throw new AuthServerException(e.getMessage());
   } catch (Exception e) {
     throw new AuthServerException("创建账号失败!");
   }
 }