绑定邮箱时需要填写国家和职业

This commit is contained in:
2025-01-10 16:54:44 +08:00
parent e7aa951e89
commit cb7099264e
5 changed files with 15 additions and 13 deletions

View File

@@ -102,7 +102,7 @@ public class PaymentTask {
} }
// @Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes @Scheduled(cron = "0 */5 * * * *") // Run every 5 minutes
public void updateAffiliateInfoWithPayment(){ public void updateAffiliateInfoWithPayment(){
affiliateService.updateAffiliateInfoWithPayment(); affiliateService.updateAffiliateInfoWithPayment();
} }

View File

@@ -56,7 +56,7 @@ public class RequestInfoUtil {
/** /**
* 免费 API 服务可能有请求频率限制,如果你需要处理大量 IP 地址,可能需要考虑使用付费服务或购买 IP 地理位置数据库。此外,始终要遵守 API 提供商的使用条款和隐私政策 * 免费 API 服务可能有请求频率限制,如果你需要处理大量 IP 地址,可能需要考虑使用付费服务或购买 IP 地理位置数据库。此外,始终要遵守 API 提供商的使用条款和隐私政策
* @param ip * @param ip https://ip-api.com/docs/api:json 使用的接口api
* @return * @return
* { * {
* "query": "24.48.0.1", * "query": "24.48.0.1",

View File

@@ -326,8 +326,8 @@ public class AccountController {
@GetMapping("/bindEmail") @GetMapping("/bindEmail")
@ApiOperation(value = "绑定邮箱") @ApiOperation(value = "绑定邮箱")
public Response<Boolean> bindEmail(@RequestParam("email") String email) { public Response<Boolean> bindEmail(@RequestParam("email") String email, @RequestParam("country") String country, @RequestParam("occupation") String occupation) {
return Response.success(accountService.bindEmail(email)); return Response.success(accountService.bindEmail(email, country, occupation));
} }
@GetMapping("/unbindWeChat") @GetMapping("/unbindWeChat")

View File

@@ -3,7 +3,6 @@ package com.ai.da.service;
import com.ai.da.common.response.PageBaseResponse; import com.ai.da.common.response.PageBaseResponse;
import com.ai.da.mapper.primary.entity.Account; import com.ai.da.mapper.primary.entity.Account;
import com.ai.da.mapper.primary.entity.AccountExtend; 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.mapper.primary.entity.TrialOrder;
import com.ai.da.model.dto.*; import com.ai.da.model.dto.*;
import com.ai.da.model.vo.AccountLoginVO; import com.ai.da.model.vo.AccountLoginVO;
@@ -49,7 +48,8 @@ public interface AccountService extends IService<Account> {
* @return * @return
*/ */
Boolean bindEmail(AccountBindEmailDTO accountBindEmailDTO); Boolean bindEmail(AccountBindEmailDTO accountBindEmailDTO);
Boolean bindEmail(String email);
Boolean bindEmail(String email, String country, String occupation);
/** /**
* 忘记密码 * 忘记密码

View File

@@ -1263,12 +1263,12 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
static { static {
HikariConfig config = new HikariConfig(); HikariConfig config = new HikariConfig();
config.setJdbcUrl("jdbc:mysql://code-create.com.hk:3306/db1nfvsgmjp3b8"); // config.setJdbcUrl("jdbc:mysql://code-create.com.hk:3306/db1nfvsgmjp3b8");
config.setUsername("uafqtz4gsvfrw"); // config.setUsername("uafqtz4gsvfrw");
config.setPassword("aida123456."); // config.setPassword("aida123456.");
// config.setJdbcUrl("jdbc:mysql://localhost:3306/code-create-local?serverTimezone=UTC"); config.setJdbcUrl("jdbc:mysql://localhost:3306/code-create-local?serverTimezone=UTC");
// config.setUsername("root"); config.setUsername("root");
// config.setPassword("root"); config.setPassword("root");
config.addDataSourceProperty("cachePrepStmts", "true"); config.addDataSourceProperty("cachePrepStmts", "true");
config.addDataSourceProperty("prepStmtCacheSize", "250"); config.addDataSourceProperty("prepStmtCacheSize", "250");
config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048"); config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
@@ -2586,10 +2586,12 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
} }
@Override @Override
public Boolean bindEmail(String email) { public Boolean bindEmail(String email, String country, String occupation) {
AuthPrincipalVo userHolder = UserContext.getUserHolder(); AuthPrincipalVo userHolder = UserContext.getUserHolder();
Account account = accountMapper.selectById(userHolder.getId()); Account account = accountMapper.selectById(userHolder.getId());
account.setUserEmail(email); account.setUserEmail(email);
account.setCountry(country);
account.setOccupation(occupation);
accountMapper.updateById(account); accountMapper.updateById(account);
return Boolean.TRUE; return Boolean.TRUE;
} }