修改提示为英语

This commit is contained in:
wuchunlei
2025-01-09 17:53:35 +08:00
parent cb3b539a83
commit f7d554a39e
5 changed files with 62 additions and 60 deletions

View File

@@ -133,7 +133,7 @@ public class MyUserController {
public R update(@RequestBody MyUserEntity user){ public R update(@RequestBody MyUserEntity user){
boolean b = userService.checkUserTelOrEmail(user); boolean b = userService.checkUserTelOrEmail(user);
if(!b){ if(!b){
return R.error("电话或邮箱已存在"); return R.error("Already exists");
} }
userService.updateById(user); userService.updateById(user);
return R.ok(); return R.ok();
@@ -148,7 +148,7 @@ public class MyUserController {
public R updateUserPassword(@RequestBody MyUserEntity user){ public R updateUserPassword(@RequestBody MyUserEntity user){
String password = user.getPassword(); String password = user.getPassword();
if(password.equals(null)){ if(password.equals(null)){
return R.error("密码不能为空"); return R.error("Password cannot be empty");
} }
String saltMD5 = MD5Utils.getSaltMD5(password); String saltMD5 = MD5Utils.getSaltMD5(password);
user.setPassword(saltMD5); user.setPassword(saltMD5);
@@ -168,7 +168,7 @@ public class MyUserController {
if (b){ if (b){
return R.ok(); return R.ok();
}else { }else {
return R.error("鉴权失败"); return R.error("Authentication failed");
} }
} }
@@ -202,7 +202,7 @@ public class MyUserController {
long l = Long.parseLong(redisCode.split("_")[1]); long l = Long.parseLong(redisCode.split("_")[1]);
if (System.currentTimeMillis() - l < 60000) { if (System.currentTimeMillis() - l < 60000) {
//60s 内不能再发 //60s 内不能再发
return R.error(500,"短信验证码频率过高,请稍后再试!"); return R.error(500,"The verification code frequency is too high, please try again later!");
} }
} }
@@ -236,7 +236,7 @@ public class MyUserController {
long l = Long.parseLong(redisCode.split("_")[1]); long l = Long.parseLong(redisCode.split("_")[1]);
if (System.currentTimeMillis() - l < 60000) { if (System.currentTimeMillis() - l < 60000) {
//60s 内不能再发 //60s 内不能再发
return R.error(500,"验证码频率过高,请稍后再试!"); return R.error(500,"The verification code frequency is too high, please try again later!");
} }
} }
//生成随机六位数 //生成随机六位数
@@ -251,7 +251,7 @@ public class MyUserController {
//redis 缓存验证码 //redis 缓存验证码
redisTemplate.opsForValue().set("RegistCode"+email,timeCode,5, TimeUnit.MINUTES); redisTemplate.opsForValue().set("RegistCode"+email,timeCode,5, TimeUnit.MINUTES);
//发送 //发送
return MailUtil.sendMail("疯子读书邮箱验证码",code,email); return MailUtil.sendMail("Amazing Reading APPEmail verification code",code,email);
} }
/** /**
@@ -265,11 +265,11 @@ public class MyUserController {
Integer id = Integer.valueOf(map.get("id").toString()); Integer id = Integer.valueOf(map.get("id").toString());
String redisCode = redisTemplate.opsForValue().get("RegistCode"+phone); String redisCode = redisTemplate.opsForValue().get("RegistCode"+phone);
if(StringUtils.isEmpty(redisCode)){ if(StringUtils.isEmpty(redisCode)){
return R.error("验证码已过期,请重试"); return R.error("The verification code has expired, please try again");
} }
String lcode = redisCode.split("_")[0]; String lcode = redisCode.split("_")[0];
if (!lcode.equals(code)) { if (!lcode.equals(code)) {
return R.error("短信验证码不符!"); return R.error("The verification code does not match!");
} }
MyUserEntity userInfo = userService.getById(id); MyUserEntity userInfo = userService.getById(id);
userInfo.setTel(phone); userInfo.setTel(phone);
@@ -293,18 +293,18 @@ public class MyUserController {
if (userEntity == null) { if (userEntity == null) {
String redisCode = redisTemplate.opsForValue().get("RegistCode"+email); String redisCode = redisTemplate.opsForValue().get("RegistCode"+email);
if(StringUtils.isEmpty(redisCode)){ if(StringUtils.isEmpty(redisCode)){
return R.error("验证码已过期,请重试"); return R.error("The verification code has expired, please try again");
} }
String lcode = redisCode.split("_")[0]; String lcode = redisCode.split("_")[0];
if (!lcode.equals(code)) { if (!lcode.equals(code)) {
return R.error("短信验证码不符"); return R.error("Verification code does not match");
} }
MyUserEntity userInfo = userService.getById(id); MyUserEntity userInfo = userService.getById(id);
userInfo.setEmail(email); userInfo.setEmail(email);
userService.updateById(userInfo); userService.updateById(userInfo);
return R.ok(); return R.ok();
}else { }else {
return R.error("邮箱已被绑定"); return R.error("Email has been bound");
} }
} }
@@ -316,18 +316,18 @@ public class MyUserController {
if (StringUtils.isEmpty(redisCode)){ if (StringUtils.isEmpty(redisCode)){
return R.error(500,"短信验证码已过期,请重试"); return R.error(500,"The verification code has expired, please try again");
} }
String lcode = redisCode.split("_")[0]; String lcode = redisCode.split("_")[0];
if (!lcode.equals(code)) { if (!lcode.equals(code)) {
return R.error(500,"短信验证码不符!"); return R.error(500,"The verification code does not match!");
} }
MyUserEntity user = userService.getBaseMapper().selectOne(new QueryWrapper<MyUserEntity>().eq("tel", tel)); MyUserEntity user = userService.getBaseMapper().selectOne(new QueryWrapper<MyUserEntity>().eq("tel", tel));
if(!ObjectUtil.isEmpty(user)){ if(!ObjectUtil.isEmpty(user)){
return R.error(500,"该手机号已经注册!"); return R.error(500,"This phone number has already been registered!");
} }
String saltMD5 = MD5Utils.getSaltMD5(password); String saltMD5 = MD5Utils.getSaltMD5(password);
MyUserEntity myUserEntity = new MyUserEntity(); MyUserEntity myUserEntity = new MyUserEntity();
@@ -347,11 +347,11 @@ public class MyUserController {
String redisCode = redisTemplate.opsForValue().get("RegistCode" + tel); String redisCode = redisTemplate.opsForValue().get("RegistCode" + tel);
System.out.println(redisCode); System.out.println(redisCode);
if (StringUtils.isEmpty(redisCode)){ if (StringUtils.isEmpty(redisCode)){
return R.error(500,"验证码已过期,请重试"); return R.error(500,"The verification code has expired, please try again");
} }
String lcode = redisCode.split("_")[0]; String lcode = redisCode.split("_")[0];
if (!lcode.equals(code)) { if (!lcode.equals(code)) {
return R.error(500,"验证码不符!"); return R.error(500,"The verification code does not match!");
} }
//校验邀请码 //校验邀请码
MyUserEntity inviteUser = null; MyUserEntity inviteUser = null;
@@ -359,7 +359,7 @@ public class MyUserController {
inviteUser = userService.getOne(new LambdaQueryWrapper<MyUserEntity>() inviteUser = userService.getOne(new LambdaQueryWrapper<MyUserEntity>()
.eq(MyUserEntity::getInviteCode, inviteCode)); .eq(MyUserEntity::getInviteCode, inviteCode));
if (inviteUser == null) { if (inviteUser == null) {
return R.error("邀请码有误"); return R.error("The invitation code is incorrect!");
} }
} }
//查询是否存在当前用户手机号 //查询是否存在当前用户手机号
@@ -393,10 +393,10 @@ public class MyUserController {
inviteRegisterService.checkInviteRegisterCount(inviteUser.getId()); inviteRegisterService.checkInviteRegisterCount(inviteUser.getId());
} }
R r = sysUserTokenService.createToken(myUserEntity.getId()); R r = sysUserTokenService.createToken(myUserEntity.getId());
return R.ok("注册成功").put("userInfo",myUserEntity).put("token",r); return R.ok("successfully registered").put("userInfo",myUserEntity).put("token",r);
}else { }else {
R r = sysUserTokenService.createToken(userList.get(0).getId()); R r = sysUserTokenService.createToken(userList.get(0).getId());
return R.ok("登录成功!").put("userInfo",userList.get(0)).put("token",r); return R.ok("Login succeeded").put("userInfo",userList.get(0)).put("token",r);
} }
} }
@@ -416,7 +416,7 @@ public class MyUserController {
//防止多账号报错 //防止多账号报错
List<MyUserEntity> userList = userService.getBaseMapper().selectList(wrapper); List<MyUserEntity> userList = userService.getBaseMapper().selectList(wrapper);
if (userList == null || userList.size() == 0) { if (userList == null || userList.size() == 0) {
return R.error(500,"用户不存在!"); return R.error(500,"The user does not exist!");
}else { }else {
int flag = 0; int flag = 0;
for (MyUserEntity user : userList) { for (MyUserEntity user : userList) {
@@ -426,13 +426,13 @@ public class MyUserController {
} }
if (MD5Utils.getSaltverifyMD5(password,user.getPassword())){ if (MD5Utils.getSaltverifyMD5(password,user.getPassword())){
R r = sysUserTokenService.createToken(user.getId()); R r = sysUserTokenService.createToken(user.getId());
return R.ok("登陆成功").put("userInfo",user).put("token",r); return R.ok("Login successful").put("userInfo",user).put("token",r);
} }
} }
if (flag>0){ if (flag>0){
return R.error(500,"当前未设置密码,请使用验证码登录"); return R.error(500,"Currently, no password has been set. Please use the verification code to log in");
} }
return R.error(500,"密码不正确,请重试"); return R.error(500,"The password is incorrect, please try again");
} }
} }
@@ -446,11 +446,11 @@ public class MyUserController {
String redisCode = redisTemplate.opsForValue().get("RegistCode" + phone); String redisCode = redisTemplate.opsForValue().get("RegistCode" + phone);
System.out.println(redisCode); System.out.println(redisCode);
if (StringUtils.isEmpty(redisCode)){ if (StringUtils.isEmpty(redisCode)){
return R.error(500,"验证码已过期,请重试"); return R.error(500,"The verification code has expired, please try again");
} }
String lcode = redisCode.split("_")[0]; String lcode = redisCode.split("_")[0];
if (!lcode.equals(code)) { if (!lcode.equals(code)) {
return R.error(500,"验证码不符"); return R.error(500,"Verification code does not match");
} }
//查询是否存在当前用户手机号 //查询是否存在当前用户手机号
LambdaQueryWrapper<MyUserEntity> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<MyUserEntity> wrapper = new LambdaQueryWrapper<>();
@@ -461,12 +461,12 @@ public class MyUserController {
} }
MyUserEntity userEntity = userService.getBaseMapper().selectOne(wrapper); MyUserEntity userEntity = userService.getBaseMapper().selectOne(wrapper);
if (userEntity == null) { if (userEntity == null) {
return R.error(500,"当前用户不存在"); return R.error(500,"The current user does not exist");
} }
String saltMD5 = MD5Utils.getSaltMD5(password); String saltMD5 = MD5Utils.getSaltMD5(password);
userEntity.setPassword(saltMD5); userEntity.setPassword(saltMD5);
userService.updateById(userEntity); userService.updateById(userEntity);
return R.ok("成功"); return R.ok("success");
} }
@@ -487,7 +487,7 @@ public class MyUserController {
//将结果转成json 取值 //将结果转成json 取值
JSONObject jsonObject = JSON.parseObject(s); JSONObject jsonObject = JSON.parseObject(s);
if (jsonObject.getString("msg").equals("登录名或密码错误")) { if (jsonObject.getString("msg").equals("Login name or password incorrect")) {
return R.error(404,jsonObject.getString("msg")); return R.error(404,jsonObject.getString("msg"));
} }

View File

@@ -98,7 +98,7 @@ public class BookAbroadController {
.eq(BookAbroadCommentLike::getCommentId,commentLike.getCommentId()) .eq(BookAbroadCommentLike::getCommentId,commentLike.getCommentId())
.eq(BookAbroadCommentLike::getUserId,ShiroUtils.getUId())); .eq(BookAbroadCommentLike::getUserId,ShiroUtils.getUId()));
if (count > 0) { if (count > 0) {
return R.error("已点赞"); return R.error("Already liked");
} }
commentLike.setUserId(ShiroUtils.getUId()); commentLike.setUserId(ShiroUtils.getUId());
bookAbroadCommentLikeService.save(commentLike); bookAbroadCommentLikeService.save(commentLike);

View File

@@ -50,7 +50,7 @@ public class OrderController {
.eq(UserEbookBuyEntity::getUserId,ShiroUtils.getUId()) .eq(UserEbookBuyEntity::getUserId,ShiroUtils.getUId())
.eq(UserEbookBuyEntity::getBookId,buyOrder.getAbroadBookId())); .eq(UserEbookBuyEntity::getBookId,buyOrder.getAbroadBookId()));
if (count>0){ if (count>0){
return R.error("已购买"); return R.error("Purchased");
} }
buyOrder.setUserId(ShiroUtils.getUId()); buyOrder.setUserId(ShiroUtils.getUId());
buyOrder.setCome(3);//3 海外读书 buyOrder.setCome(3);//3 海外读书
@@ -58,15 +58,15 @@ public class OrderController {
BigDecimal totalPrice = buyOrder.getOrderMoney(); BigDecimal totalPrice = buyOrder.getOrderMoney();
//校验价格 //校验价格
if (totalPrice.compareTo(new BigDecimal(0))<=0){ if (totalPrice.compareTo(new BigDecimal(0))<=0){
return R.error("订单价格不能为0"); return R.error("The order price cannot be 0");
} }
if (Constants.PAYMENT_METHOD_VIRTUAL.equals(buyOrder.getPaymentMethod())) { if (Constants.PAYMENT_METHOD_VIRTUAL.equals(buyOrder.getPaymentMethod())) {
if (totalPrice.compareTo(bookEntity.getAbroadPrice().multiply(new BigDecimal(10)))!=0){ if (totalPrice.compareTo(bookEntity.getAbroadPrice().multiply(new BigDecimal(10)))!=0){
return R.error("订单价格异常"); return R.error("Abnormal order price");
} }
}else { }else {
if (totalPrice.compareTo(bookEntity.getAbroadPrice())!=0){ if (totalPrice.compareTo(bookEntity.getAbroadPrice())!=0){
return R.error("订单价格异常"); return R.error("Abnormal order price");
} }
} }
buyOrder.setRealMoney(totalPrice); buyOrder.setRealMoney(totalPrice);
@@ -90,7 +90,7 @@ public class OrderController {
//开通电子书权限 //开通电子书权限
userEbookBuyService.addBookForUser(user.getId(), Arrays.asList(buyOrder.getAbroadBookId())); userEbookBuyService.addBookForUser(user.getId(), Arrays.asList(buyOrder.getAbroadBookId()));
}else { }else {
return R.error(500, "天医币余额不足"); return R.error(500, "Insufficient Balance");
} }
} }
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();

View File

@@ -65,7 +65,7 @@ public class UserController {
long l = Long.parseLong(redisCode.split("_")[1]); long l = Long.parseLong(redisCode.split("_")[1]);
if (System.currentTimeMillis() - l < 60000) { if (System.currentTimeMillis() - l < 60000) {
//60s 内不能再发 //60s 内不能再发
return R.error(500,"短信验证码频率过高,请稍后再试!"); return R.error(500,"The verification code frequency is too high, please try again later!");
} }
} }
//生成随机六位数 //生成随机六位数
@@ -95,7 +95,7 @@ public class UserController {
long l = Long.parseLong(redisCode.split("_")[1]); long l = Long.parseLong(redisCode.split("_")[1]);
if (System.currentTimeMillis() - l < 60000) { if (System.currentTimeMillis() - l < 60000) {
//60s 内不能再发 //60s 内不能再发
return R.error(500,"验证码频率过高,请稍后再试!"); return R.error(500,"The verification code frequency is too high, please try again later!");
} }
} }
//生成随机六位数 //生成随机六位数
@@ -110,7 +110,7 @@ public class UserController {
//redis 缓存验证码 //redis 缓存验证码
redisTemplate.opsForValue().set("RegistCode"+email,timeCode,5, TimeUnit.MINUTES); redisTemplate.opsForValue().set("RegistCode"+email,timeCode,5, TimeUnit.MINUTES);
//发送 //发送
return MailUtil.sendMail("疯子读书邮箱验证码",code,email); return MailUtil.sendMail("Amazing Reading APPEmail verification code",code,email);
} }
@RequestMapping("/getUserInfo") @RequestMapping("/getUserInfo")
@@ -143,18 +143,18 @@ public class UserController {
if (userEntity == null) { if (userEntity == null) {
String redisCode = redisTemplate.opsForValue().get("RegistCode"+phone); String redisCode = redisTemplate.opsForValue().get("RegistCode"+phone);
if(StringUtils.isEmpty(redisCode)){ if(StringUtils.isEmpty(redisCode)){
return R.error("验证码已过期,请重试"); return R.error("The verification code has expired, please try again");
} }
String lcode = redisCode.split("_")[0]; String lcode = redisCode.split("_")[0];
if (!lcode.equals(code)) { if (!lcode.equals(code)) {
return R.error("短信验证码不符!"); return R.error("The SMS verification code does not match!");
} }
MyUserEntity userInfo = userService.getById(id); MyUserEntity userInfo = userService.getById(id);
userInfo.setTel(phone); userInfo.setTel(phone);
userService.updateById(userInfo); userService.updateById(userInfo);
return R.ok(); return R.ok();
}else { }else {
return R.error("手机号已被绑定!"); return R.error("The phone number has been bound!");
} }
} }
@@ -174,18 +174,18 @@ public class UserController {
if (userEntity == null) { if (userEntity == null) {
String redisCode = redisTemplate.opsForValue().get("RegistCode"+email); String redisCode = redisTemplate.opsForValue().get("RegistCode"+email);
if(StringUtils.isEmpty(redisCode)){ if(StringUtils.isEmpty(redisCode)){
return R.error("验证码已过期,请重试"); return R.error("The verification code has expired, please try again");
} }
String lcode = redisCode.split("_")[0]; String lcode = redisCode.split("_")[0];
if (!lcode.equals(code)) { if (!lcode.equals(code)) {
return R.error("验证码不符!"); return R.error("The verification code does not match!");
} }
MyUserEntity userInfo = userService.getById(id); MyUserEntity userInfo = userService.getById(id);
userInfo.setEmail(email); userInfo.setEmail(email);
userService.updateById(userInfo); userService.updateById(userInfo);
return R.ok(); return R.ok();
}else { }else {
return R.error("邮箱已被绑定!"); return R.error("Email has been bound!");
} }
} }
@@ -207,11 +207,11 @@ public class UserController {
String redisCode = redisTemplate.opsForValue().get("RegistCode" + tel); String redisCode = redisTemplate.opsForValue().get("RegistCode" + tel);
System.out.println(redisCode); System.out.println(redisCode);
if (StringUtils.isEmpty(redisCode)){ if (StringUtils.isEmpty(redisCode)){
return R.error(500,"验证码已过期,请重试"); return R.error(500,"The verification code has expired, please try again");
} }
String lcode = redisCode.split("_")[0]; String lcode = redisCode.split("_")[0];
if (!lcode.equals(code)) { if (!lcode.equals(code)) {
return R.error(500,"验证码不符!"); return R.error(500,"The verification code does not match!");
} }
//校验邀请码 //校验邀请码
MyUserEntity inviteUser = null; MyUserEntity inviteUser = null;
@@ -219,7 +219,7 @@ public class UserController {
inviteUser = userService.getOne(new LambdaQueryWrapper<MyUserEntity>() inviteUser = userService.getOne(new LambdaQueryWrapper<MyUserEntity>()
.eq(MyUserEntity::getInviteCode, inviteCode)); .eq(MyUserEntity::getInviteCode, inviteCode));
if (inviteUser == null) { if (inviteUser == null) {
return R.error("邀请码有误"); return R.error("The invitation code is incorrect!");
} }
} }
//查询是否存在当前用户 //查询是否存在当前用户
@@ -250,10 +250,10 @@ public class UserController {
inviteRegisterService.checkInviteRegisterCount(inviteUser.getId()); inviteRegisterService.checkInviteRegisterCount(inviteUser.getId());
} }
R r = sysUserTokenService.createToken(myUserEntity.getId()); R r = sysUserTokenService.createToken(myUserEntity.getId());
return R.ok("注册成功").put("userInfo",myUserEntity).put("token",r); return R.ok("successfully registered").put("userInfo",myUserEntity).put("token",r);
}else { }else {
R r = sysUserTokenService.createToken(userEntity.getId()); R r = sysUserTokenService.createToken(userEntity.getId());
return R.ok("登录成功!").put("userInfo",userEntity).put("token",r); return R.ok("Login succeeded").put("userInfo",userEntity).put("token",r);
} }
} }
@@ -272,16 +272,16 @@ public class UserController {
//防止多账号报错 //防止多账号报错
MyUserEntity userEntity = userService.getOne(wrapper); MyUserEntity userEntity = userService.getOne(wrapper);
if (userEntity == null) { if (userEntity == null) {
return R.error(500,"用户不存在!"); return R.error(500,"The user does not exist!");
}else { }else {
if (userEntity.getPassword() == null|| userEntity.getPassword().equals("")) { if (userEntity.getPassword() == null|| userEntity.getPassword().equals("")) {
return R.error(500,"当前未设置密码,请使用验证码登录!"); return R.error(500,"Currently, no password has been set. Please use the verification code to log in!");
}else { }else {
if (MD5Utils.getSaltverifyMD5(password,userEntity.getPassword())){ if (MD5Utils.getSaltverifyMD5(password,userEntity.getPassword())){
R r = sysUserTokenService.createToken(userEntity.getId()); R r = sysUserTokenService.createToken(userEntity.getId());
return R.ok("登陆成功!").put("userInfo",userEntity).put("token",r); return R.ok("Login successful!").put("userInfo",userEntity).put("token",r);
}else { }else {
return R.error(500,"密码不正确,请重试!"); return R.error(500,"The password is incorrect, please try again!");
} }
} }
} }
@@ -297,11 +297,11 @@ public class UserController {
String redisCode = redisTemplate.opsForValue().get("RegistCode" + phone); String redisCode = redisTemplate.opsForValue().get("RegistCode" + phone);
System.out.println(redisCode); System.out.println(redisCode);
if (StringUtils.isEmpty(redisCode)){ if (StringUtils.isEmpty(redisCode)){
return R.error(500,"验证码已过期,请重试"); return R.error(500,"The verification code has expired, please try again");
} }
String lcode = redisCode.split("_")[0]; String lcode = redisCode.split("_")[0];
if (!lcode.equals(code)) { if (!lcode.equals(code)) {
return R.error(500,"验证码不符!"); return R.error(500,"The verification code does not match!");
} }
//查询是否存在当前用户 //查询是否存在当前用户
LambdaQueryWrapper<MyUserEntity> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<MyUserEntity> wrapper = new LambdaQueryWrapper<>();
@@ -312,12 +312,12 @@ public class UserController {
} }
MyUserEntity userEntity = userService.getOne(wrapper); MyUserEntity userEntity = userService.getOne(wrapper);
if (userEntity == null) { if (userEntity == null) {
return R.error(500,"当前用户不存在!"); return R.error(500,"The current user does not exist!");
} }
String saltMD5 = MD5Utils.getSaltMD5(password); String saltMD5 = MD5Utils.getSaltMD5(password);
userEntity.setPassword(saltMD5); userEntity.setPassword(saltMD5);
userService.updateById(userEntity); userService.updateById(userEntity);
return R.ok("成功"); return R.ok("success");
} }
/** /**
@@ -327,12 +327,12 @@ public class UserController {
public R setPassword(@RequestParam("id") String id,@RequestParam("password") String password) { public R setPassword(@RequestParam("id") String id,@RequestParam("password") String password) {
MyUserEntity userEntity = userService.getById(id); MyUserEntity userEntity = userService.getById(id);
if (userEntity == null) { if (userEntity == null) {
return R.error(500,"当前用户不存在!"); return R.error(500,"The current user does not exist!");
} }
String saltMD5 = MD5Utils.getSaltMD5(password); String saltMD5 = MD5Utils.getSaltMD5(password);
userEntity.setPassword(saltMD5); userEntity.setPassword(saltMD5);
userService.updateById(userEntity); userService.updateById(userEntity);
return R.ok("成功"); return R.ok("success");
} }

View File

@@ -48,7 +48,7 @@ public class PaypalController {
BuyOrder buyOrder = buyOrderService.getOne(new LambdaQueryWrapper<BuyOrder>() BuyOrder buyOrder = buyOrderService.getOne(new LambdaQueryWrapper<BuyOrder>()
.eq(BuyOrder::getOrderSn,params.get("orderSn"))); .eq(BuyOrder::getOrderSn,params.get("orderSn")));
if ("3".equals(buyOrder.getOrderStatus())){ if ("3".equals(buyOrder.getOrderStatus())){
return R.error("订单已完成"); return R.error("Order completed");
} }
if ("point".equals(buyOrder.getOrderType())){ if ("point".equals(buyOrder.getOrderType())){
buyOrder.setRemark("Recharge Virtual Coin"); buyOrder.setRemark("Recharge Virtual Coin");
@@ -74,6 +74,8 @@ public class PaypalController {
return R.ok().put("id",res.get("id").toString()).put("url",url); return R.ok().put("id",res.get("id").toString()).put("url",url);
} }
}else {
return R.error(res.get("message").toString());
} }
return R.error(res.get("error").toString()); return R.error(res.get("error").toString());
} }
@@ -121,7 +123,7 @@ public class PaypalController {
return R.ok(); return R.ok();
} }
} }
return R.error("执行扣款失败"); return R.error("failed");
} }
@RequestMapping("/refund") @RequestMapping("/refund")