update 卖家删除钱包,修改钱包。删除店铺修改店铺均加了谷歌验证码
This commit is contained in:
@@ -7,7 +7,7 @@ import com.m2pool.lease.service.LeaseShopService;
|
||||
import com.m2pool.lease.vo.BaseVo;
|
||||
import com.m2pool.lease.vo.ShopConfigVo;
|
||||
import com.m2pool.lease.vo.ShopVo;
|
||||
import com.m2pool.lease.vo.v2.WalletIdAndCodeVo;
|
||||
import com.m2pool.lease.vo.v2.GoogleCodeVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -97,7 +97,7 @@ public class LeaseShopController {
|
||||
*/
|
||||
@ApiOperation("删除店铺")
|
||||
@PostMapping("/deleteShop")
|
||||
public Result<String> deleteShop(@RequestBody BaseVo baseVo) {
|
||||
public Result<String> deleteShop(@RequestBody GoogleCodeVo baseVo) {
|
||||
return leaseShopService.deleteShop(baseVo);
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ public class LeaseShopController {
|
||||
*/
|
||||
@ApiOperation("钱包配置----根据配置id 删除商铺收款钱包配置")
|
||||
@PostMapping("/deleteShopConfig")
|
||||
public Result<String> deleteShopConfig(@RequestBody WalletIdAndCodeVo baseVo) {
|
||||
public Result<String> deleteShopConfig(@RequestBody GoogleCodeVo baseVo) {
|
||||
return leaseShopService.deleteShopConfig(baseVo);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.m2pool.lease.dto.v2.ShopWalletInfoDto;
|
||||
import com.m2pool.lease.entity.LeaseShop;
|
||||
import com.m2pool.lease.vo.*;
|
||||
import com.m2pool.lease.vo.v2.ShopWalletInfoVo;
|
||||
import com.m2pool.lease.vo.v2.WalletIdAndCodeVo;
|
||||
import com.m2pool.lease.vo.v2.GoogleCodeVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -64,7 +64,7 @@ public interface LeaseShopService extends IService<LeaseShop> {
|
||||
* @param baseVo
|
||||
* @return
|
||||
*/
|
||||
Result<String> deleteShop(BaseVo baseVo);
|
||||
Result<String> deleteShop(GoogleCodeVo baseVo);
|
||||
|
||||
|
||||
/**
|
||||
@@ -101,7 +101,7 @@ public interface LeaseShopService extends IService<LeaseShop> {
|
||||
* @param baseVo
|
||||
* @return
|
||||
*/
|
||||
Result<String> deleteShopConfig(WalletIdAndCodeVo baseVo);
|
||||
Result<String> deleteShopConfig(GoogleCodeVo baseVo);
|
||||
|
||||
/**
|
||||
* 获取链和链列表
|
||||
|
||||
@@ -19,8 +19,8 @@ import com.m2pool.lease.service.LeaseShopConfigService;
|
||||
import com.m2pool.lease.service.LeaseShopService;
|
||||
import com.m2pool.lease.utils.*;
|
||||
import com.m2pool.lease.vo.*;
|
||||
import com.m2pool.lease.vo.v2.GoogleCodeVo;
|
||||
import com.m2pool.lease.vo.v2.ShopWalletInfoVo;
|
||||
import com.m2pool.lease.vo.v2.WalletIdAndCodeVo;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -113,9 +113,19 @@ public class LeaseShopServiceImpl extends ServiceImpl<LeaseShopMapper, LeaseShop
|
||||
@Override
|
||||
public Result<String> updateShop(ShopVo shopVo) {
|
||||
|
||||
String userEmail = SecurityUtils.getUsername();
|
||||
|
||||
if (shopVo.getId() == null || shopVo.getId() == 0){
|
||||
return Result.fail("id不能为空或0");
|
||||
}
|
||||
GoogleInfo googleInfo = leaseUserMapper.getGoogleInfoByEmail(userEmail);
|
||||
if(googleInfo == null || StringUtils.isBlank(googleInfo.getSecret())){
|
||||
//未绑定定谷歌验证器
|
||||
return Result.fail("您的账号未开启双重验证,请先开启验证!");
|
||||
}
|
||||
if(!GoogleAuthenticator.checkCode(googleInfo.getSecret(), shopVo.getGCode(), System.currentTimeMillis())){
|
||||
return Result.fail("谷歌验证码错误");
|
||||
}
|
||||
|
||||
LeaseShop leaseShop = LeaseShop.builder()
|
||||
.id(shopVo.getId())
|
||||
@@ -205,11 +215,23 @@ public class LeaseShopServiceImpl extends ServiceImpl<LeaseShopMapper, LeaseShop
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Result<String> deleteShop(BaseVo baseVo) {
|
||||
public Result<String> deleteShop(GoogleCodeVo baseVo) {
|
||||
LeaseShop byId = getById(baseVo.getId());
|
||||
String userEmail = SecurityUtils.getUsername();
|
||||
GoogleInfo googleInfo = leaseUserMapper.getGoogleInfoByEmail(userEmail);
|
||||
if (byId.getDel()){
|
||||
return Result.fail("删除店铺失败,店铺已删除,请刷新页面");
|
||||
}
|
||||
//校验谷歌验证码
|
||||
//1.1谷歌验证
|
||||
if(googleInfo == null || StringUtils.isBlank(googleInfo.getSecret())){
|
||||
//未绑定定谷歌验证器
|
||||
return Result.fail("您的账号未开启双重验证,请先开启验证!");
|
||||
}
|
||||
if(!GoogleAuthenticator.checkCode(googleInfo.getSecret(), baseVo.getGCode(), System.currentTimeMillis())){
|
||||
return Result.fail("谷歌验证码错误");
|
||||
}
|
||||
|
||||
updateMachineInfoV1(baseVo.getId());
|
||||
updateMachineInfoV2(baseVo.getId());
|
||||
boolean b = updateById(LeaseShop.builder().id(baseVo.getId()).del(true).build());
|
||||
@@ -473,7 +495,7 @@ public class LeaseShopServiceImpl extends ServiceImpl<LeaseShopMapper, LeaseShop
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<String> deleteShopConfig(WalletIdAndCodeVo baseVo) {
|
||||
public Result<String> deleteShopConfig(GoogleCodeVo baseVo) {
|
||||
String userEmail = SecurityUtils.getUsername();
|
||||
//1.根据id找到要删除的钱包配置
|
||||
LeaseShopConfig config = leaseShopConfigMapper.selectById(baseVo.getId());
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.m2pool.lease.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.nacos.common.utils.StringUtils;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
@@ -31,10 +30,7 @@ import com.m2pool.lease.utils.email.EmailTemplateEntity;
|
||||
import com.m2pool.lease.utils.text.Convert;
|
||||
import com.m2pool.lease.utils.uuid.IdUtils;
|
||||
import com.m2pool.lease.vo.*;
|
||||
import com.m2pool.lease.vo.v2.CloseAccountVo;
|
||||
import com.m2pool.lease.vo.v2.GoogleBindVo;
|
||||
import com.m2pool.lease.vo.v2.GoogleCloseVo;
|
||||
import com.m2pool.lease.vo.v2.UserGoogleAuthInfo;
|
||||
import com.m2pool.lease.vo.v2.*;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -42,7 +38,6 @@ import org.springframework.mail.javamail.JavaMailSenderImpl;
|
||||
import org.springframework.mail.javamail.MimeMessageHelper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.thymeleaf.TemplateEngine;
|
||||
import org.thymeleaf.context.Context;
|
||||
|
||||
@@ -51,7 +46,6 @@ import javax.mail.MessagingException;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
@@ -382,7 +376,6 @@ public class LeaseUserServiceImpl extends ServiceImpl<LeaseUserMapper, LeaseUser
|
||||
@Transactional
|
||||
public Result<String> closeAccount(CloseAccountVo closeAccountVo) {
|
||||
String userEmail = SecurityUtils.getUsername();
|
||||
//1.
|
||||
GoogleInfo googleInfo = leaseUserMapper.getGoogleInfoByEmail(userEmail);
|
||||
//1.1谷歌验证
|
||||
if(googleInfo == null || StringUtils.isBlank(googleInfo.getSecret())){
|
||||
@@ -409,9 +402,10 @@ public class LeaseUserServiceImpl extends ServiceImpl<LeaseUserMapper, LeaseUser
|
||||
leaseShoppingCartInfoMapper.delete(new LambdaQueryWrapper<LeaseShoppingCartInfo>()
|
||||
.eq(LeaseShoppingCartInfo::getUserId, userEmail));
|
||||
//删除用户店铺,矿机,店铺配置(钱包)相关信息
|
||||
BaseVo baseVo = new BaseVo();
|
||||
baseVo.setId(leaseShop.getId());
|
||||
Result<String> stringResult = leaseShopService.deleteShop(baseVo);
|
||||
GoogleCodeVo googleCodeVo = new GoogleCodeVo();
|
||||
googleCodeVo.setId(leaseShop.getId());
|
||||
googleCodeVo.setGCode(closeAccountVo.getGCode());
|
||||
Result<String> stringResult = leaseShopService.deleteShop(googleCodeVo);
|
||||
//删除钱包
|
||||
leaseUserWalletDataMapper.update(LeaseUserWalletData.builder().del(true).build(),
|
||||
new LambdaUpdateWrapper<LeaseUserWalletData>()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.m2pool.lease.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.m2pool.lease.annotation.EncryptedField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@@ -47,7 +48,10 @@ public class ShopConfigVo extends BaseVo {
|
||||
* 卖方对应收款钱包
|
||||
*/
|
||||
@ApiModelProperty(value = "卖方对应收款钱包",example = "nexa:nqtsq5g50jkkmklvjyaflg46c4nwuy46z9gzswqe3l0csc7g")
|
||||
|
||||
private String payAddress;
|
||||
|
||||
@ApiModelProperty(value = "谷歌验证码")
|
||||
@JsonProperty("gCode")
|
||||
private Long gCode;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.m2pool.lease.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -58,4 +59,7 @@ public class ShopVo extends BaseVo{
|
||||
//@ApiModelProperty(value = "逻辑删除字段",example = "false")
|
||||
//private Boolean del;
|
||||
|
||||
@ApiModelProperty(value = "谷歌验证码")
|
||||
@JsonProperty("gCode")
|
||||
private Long gCode;
|
||||
}
|
||||
|
||||
@@ -4,10 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.m2pool.lease.vo.BaseVo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* @Description 支付订单请求对象
|
||||
@@ -18,8 +15,8 @@ import lombok.NoArgsConstructor;
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "卖家钱包id 和 谷歌验证码请求对象",value = "WalletIdAndCodeVo" )
|
||||
public class WalletIdAndCodeVo extends BaseVo{
|
||||
@ApiModel(description = "卖家钱包id 和 谷歌验证码请求对象",value = "GoogleCodeVo" )
|
||||
public class GoogleCodeVo extends BaseVo{
|
||||
|
||||
@ApiModelProperty(value = "谷歌验证码")
|
||||
@JsonProperty("gCode")
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.m2pool.lease.vo.v2;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.m2pool.lease.annotation.EncryptedField;
|
||||
import com.m2pool.lease.vo.BaseVo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
@@ -36,6 +37,6 @@ public class ShopWalletInfoVo {
|
||||
private String payAddress;
|
||||
|
||||
@ApiModelProperty(value = "谷歌验证码",example = "123456")
|
||||
@JsonProperty("gCode")
|
||||
private Long gCode;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user