TASK:AiDA
This commit is contained in:
@@ -2,6 +2,7 @@ package com.ai.da.service;
|
||||
|
||||
import com.ai.da.common.response.PageBaseResponse;
|
||||
import com.ai.da.mapper.primary.entity.Account;
|
||||
import com.ai.da.mapper.primary.entity.AccountExtend;
|
||||
import com.ai.da.mapper.primary.entity.GoogleUser;
|
||||
import com.ai.da.mapper.primary.entity.TrialOrder;
|
||||
import com.ai.da.model.dto.*;
|
||||
@@ -210,9 +211,9 @@ public interface AccountService extends IService<Account> {
|
||||
|
||||
AccountLoginVO getAccountDetail();
|
||||
|
||||
Boolean bindGoogle(String credential);
|
||||
AccountExtend bindGoogle(String credential);
|
||||
|
||||
Boolean bindWeChat(String code);
|
||||
AccountExtend bindWeChat(String code);
|
||||
|
||||
Boolean unbindWeChat();
|
||||
|
||||
|
||||
@@ -2432,7 +2432,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean bindGoogle(String credential) {
|
||||
public AccountExtend bindGoogle(String credential) {
|
||||
try {
|
||||
// 配置 Google ID Token 验证器
|
||||
GoogleIdTokenVerifier verifier = new GoogleIdTokenVerifier.Builder(
|
||||
@@ -2466,7 +2466,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
accountExtendInsert.setAccountId(authPrincipalVo.getId());
|
||||
accountExtendMapper.insert(accountExtendInsert);
|
||||
|
||||
return Boolean.TRUE;
|
||||
return accountExtendInsert;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Invalid ID token.");
|
||||
}
|
||||
@@ -2478,7 +2478,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean bindWeChat(String code) {
|
||||
public AccountExtend bindWeChat(String code) {
|
||||
// 1. 获取 access_token 和 openid
|
||||
JSONObject accessTokenResponse = getAccessTokenFromWeChat(code);
|
||||
String accessToken = accessTokenResponse.getString("access_token");
|
||||
@@ -2508,7 +2508,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
accountExtendInsert.setAccountId(authPrincipalVo.getId());
|
||||
accountExtendMapper.insert(accountExtendInsert);
|
||||
|
||||
return Boolean.TRUE;
|
||||
return accountExtendInsert;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user