TASK:试用时间;

This commit is contained in:
shahaibo
2024-05-17 15:23:26 +08:00
parent ebb6577e98
commit b3591f879d
2 changed files with 11 additions and 3 deletions

View File

@@ -9,5 +9,5 @@ import lombok.EqualsAndHashCode;
@Data
@ApiModel("AccountTrial")
public class AccountTrialDTO extends TrialOrder {
private String ref;
}

View File

@@ -516,7 +516,11 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
account.setIsTrial(1);
account.setIsBeginner(1);
account.setValidStartTime(System.currentTimeMillis());
account.setValidEndTime(Instant.now().plus(5, ChronoUnit.DAYS).toEpochMilli());
if (StringUtils.isNotBlank(accountTrialDTO.getRef())) {
account.setValidEndTime(Instant.now().plus(14, ChronoUnit.DAYS).toEpochMilli());
}else {
account.setValidEndTime(Instant.now().plus(5, ChronoUnit.DAYS).toEpochMilli());
}
accountMapper.updateById(account);
}else {
account.setUserName(trialOrder.getUserName());
@@ -524,7 +528,11 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
account.setUserEmail(trialOrder.getEmail());
account.setLanguage(Language.ENGLISH.name());
account.setValidStartTime(System.currentTimeMillis());
account.setValidEndTime(Instant.now().plus(5, ChronoUnit.DAYS).toEpochMilli());
if (StringUtils.isNotBlank(accountTrialDTO.getRef())) {
account.setValidEndTime(Instant.now().plus(14, ChronoUnit.DAYS).toEpochMilli());
}else {
account.setValidEndTime(Instant.now().plus(5, ChronoUnit.DAYS).toEpochMilli());
}
account.setCreateDate(new Date());
account.setIsTrial(1);
account.setIsBeginner(1);