BUGFIX:试用注册;
This commit is contained in:
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -125,4 +126,13 @@ public class Account implements Serializable {
|
||||
private Integer subAccountNum;
|
||||
|
||||
private String invitationCode;
|
||||
|
||||
// @ApiModelProperty("title")
|
||||
// private String title;
|
||||
//
|
||||
// @ApiModelProperty("surname")
|
||||
// private String surname;
|
||||
//
|
||||
// @ApiModelProperty("givenName")
|
||||
// private String givenName;
|
||||
}
|
||||
|
||||
@@ -21,4 +21,19 @@ public class AccountBindEmailDTO {
|
||||
@NotBlank(message = "emailVerifyCode.cannot.be.empty")
|
||||
@ApiModelProperty("邮箱验证码")
|
||||
private String emailVerifyCode;
|
||||
|
||||
// @ApiModelProperty("国家")
|
||||
// private String country;
|
||||
//
|
||||
// @ApiModelProperty("职业")
|
||||
// private String occupation;
|
||||
//
|
||||
// @ApiModelProperty("title")
|
||||
// private String title;
|
||||
//
|
||||
// @ApiModelProperty("surname")
|
||||
// private String surname;
|
||||
//
|
||||
// @ApiModelProperty("givenName")
|
||||
// private String givenName;
|
||||
}
|
||||
|
||||
@@ -28,4 +28,6 @@ public class EmailSendDTO {
|
||||
@ApiModelProperty("职业")
|
||||
private String occupation;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -333,25 +333,16 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
result.setToken(createAccountToken(accountOld));
|
||||
}
|
||||
return result;
|
||||
}else {
|
||||
accountOld.setSystemUser(3);
|
||||
accountOld.setIsTrial(1);
|
||||
accountOld.setCredits(BigDecimal.valueOf(100));
|
||||
accountOld.setValidEndTime(toDayEnd(Instant.now().plus(5, ChronoUnit.DAYS).toEpochMilli()));
|
||||
accountOld.setUpdateDate(new Date());
|
||||
accountMapper.updateById(accountOld);
|
||||
TrialOrder trialOrder = CopyUtil.copyObject(accountOld, TrialOrder.class);
|
||||
trialOrder.setEmail(accountOld.getUserEmail());
|
||||
trialOrder.setCreateTime(LocalDateTime.now());
|
||||
trialOrder.setStatus(1);
|
||||
// 获取用户申请试用IP
|
||||
String ipAddress = RequestInfoUtil.getIpAddress(request);
|
||||
trialOrder.setIp(ipAddress);
|
||||
trialOrderMapper.insert(trialOrder);
|
||||
}
|
||||
}
|
||||
Account accountNew = accountMapper.selectById(userHolder.getId());
|
||||
accountNew.setUserEmail(accountBindEmailDTO.getUserEmail());
|
||||
// accountNew.setOccupation(accountBindEmailDTO.getOccupation());
|
||||
// accountNew.setCountry(accountBindEmailDTO.getCountry());
|
||||
// accountNew.setTitle(accountBindEmailDTO.getTitle());
|
||||
// accountNew.setSurname(accountBindEmailDTO.getSurname());
|
||||
// accountNew.setGivenName(accountBindEmailDTO.getGivenName());
|
||||
|
||||
accountMapper.updateById(accountNew);
|
||||
|
||||
TrialOrder trialOrder = CopyUtil.copyObject(accountNew, TrialOrder.class);
|
||||
@@ -1304,13 +1295,22 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
if (StringUtils.isBlank(accountDesignWorksRegisterDTO.getLanguage())) {
|
||||
account.setLanguage(Language.ENGLISH.name());
|
||||
}
|
||||
account.setIsTrial(0);
|
||||
account.setSystemUser(3);
|
||||
account.setIsTrial(1);
|
||||
account.setCredits(BigDecimal.valueOf(100));
|
||||
account.setValidEndTime(toDayEnd(Instant.now().plus(5, ChronoUnit.DAYS).toEpochMilli()));
|
||||
account.setIsBeginner(1);
|
||||
account.setValidStartTime(Instant.now().toEpochMilli());
|
||||
account.setCreateDate(new Date());
|
||||
account.setCredits(BigDecimal.valueOf(0));
|
||||
account.setInvitationCode(accountDesignWorksRegisterDTO.getInvitationCode());
|
||||
accountMapper.insert(account);
|
||||
|
||||
TrialOrder trialOrder = CopyUtil.copyObject(account, TrialOrder.class);
|
||||
trialOrder.setEmail(account.getUserEmail());
|
||||
trialOrder.setCreateTime(LocalDateTime.now());
|
||||
trialOrder.setStatus(1);
|
||||
trialOrderMapper.insert(trialOrder);
|
||||
|
||||
AccountLoginVO response = CopyUtil.copyObject(account, AccountLoginVO.class);
|
||||
response.setEmail(account.getUserEmail());
|
||||
String token = LocalCacheUtils.getTokenCache(String.valueOf(account.getId()));
|
||||
|
||||
Reference in New Issue
Block a user