ios
This commit is contained in:
@@ -59,6 +59,18 @@ public class ClientOrderInfoController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ios 恢复购买
|
||||||
|
*/
|
||||||
|
@PostMapping("/rePay")
|
||||||
|
public AjaxResult rePayOrder(@RequestBody PaymentRequest request) {
|
||||||
|
try {
|
||||||
|
return orderInfoService.rePayOrder(request);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error("支付失败: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付回调
|
* 支付回调
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.ruoyi.common.constant.Constants;
|
|||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.domain.entity.ShopUser;
|
import com.ruoyi.common.core.domain.entity.ShopUser;
|
||||||
import com.ruoyi.common.core.domain.entity.ShopUserResq;
|
import com.ruoyi.common.core.domain.entity.ShopUserResq;
|
||||||
|
import com.ruoyi.common.core.redis.RedisCache;
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.framework.web.service.SysLoginService;
|
import com.ruoyi.framework.web.service.SysLoginService;
|
||||||
import com.ruoyi.system.config.AliConfig;
|
import com.ruoyi.system.config.AliConfig;
|
||||||
@@ -17,6 +18,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
@RequestMapping("/client")
|
@RequestMapping("/client")
|
||||||
@RestController
|
@RestController
|
||||||
@@ -30,7 +32,8 @@ public class ClientShopUserController {
|
|||||||
private ShopUserService shopUserService;
|
private ShopUserService shopUserService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IShopUserService iShopUserService;
|
private IShopUserService iShopUserService;
|
||||||
|
@Autowired
|
||||||
|
private RedisCache redisCache;
|
||||||
/**
|
/**
|
||||||
* 获取验证码
|
* 获取验证码
|
||||||
*/
|
*/
|
||||||
@@ -43,6 +46,25 @@ public class ClientShopUserController {
|
|||||||
return AjaxResult.error("发送验证码失败");
|
return AjaxResult.error("发送验证码失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 注销账号接口
|
||||||
|
@PostMapping("/cancelUser")
|
||||||
|
public AjaxResult cancelUser(@RequestBody ShopUserResq param) {
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
ShopUser shopUser = new ShopUser();
|
||||||
|
shopUser.setUserId(userId);
|
||||||
|
shopUser.setStatus(2L);
|
||||||
|
String code = redisCache.getCacheObject("sms_code:"+shopUser.getPhone());
|
||||||
|
if (param.getCode() != null) {
|
||||||
|
if (Objects.equals(code, param.getCode())) {
|
||||||
|
shopUserService.updateShopUserId(shopUser);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
return AjaxResult.error("验证码错误");
|
||||||
|
}
|
||||||
|
return AjaxResult.error("注销账号失败");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录方法
|
* 登录方法
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -62,12 +62,13 @@ public class IndexController extends BaseController {
|
|||||||
List<MusicInfo> list = recommendInfoService.findRecommendMusic();
|
List<MusicInfo> list = recommendInfoService.findRecommendMusic();
|
||||||
|
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
for (MusicInfo musicInfo : list) {
|
if(userId != null) {
|
||||||
Long musicId = musicInfo.getMusicId();
|
for (MusicInfo musicInfo : list) {
|
||||||
MusicInfo selectUserLikeMusic = musicService.selectUserLikeMusic(String.valueOf(musicId), userId);
|
Long musicId = musicInfo.getMusicId();
|
||||||
musicInfo.setLike(selectUserLikeMusic.isLike());
|
MusicInfo selectUserLikeMusic = musicService.selectUserLikeMusic(String.valueOf(musicId), userId);
|
||||||
|
musicInfo.setLike(selectUserLikeMusic.isLike());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return getDataTableData(list);
|
return getDataTableData(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,21 +67,21 @@ spring:
|
|||||||
enabled: true
|
enabled: true
|
||||||
# redis 配置
|
# redis 配置
|
||||||
redis:
|
redis:
|
||||||
host: 116.204.124.80
|
# host: 116.204.124.80
|
||||||
# 端口,默认为6379
|
|
||||||
port: 16379
|
|
||||||
# 数据库索引
|
|
||||||
database: 0
|
|
||||||
# 密码
|
|
||||||
password: Lwz19520416443@
|
|
||||||
# # 地址
|
|
||||||
# host: 127.0.0.1
|
|
||||||
# # 端口,默认为6379
|
# # 端口,默认为6379
|
||||||
# port: 6379
|
# port: 16379
|
||||||
# # 数据库索引
|
# # 数据库索引
|
||||||
# database: 0
|
# database: 0
|
||||||
# # 密码
|
# # 密码
|
||||||
# password:
|
# password: Lwz19520416443@
|
||||||
|
# 地址
|
||||||
|
host: 127.0.0.1
|
||||||
|
# 端口,默认为6379
|
||||||
|
port: 6379
|
||||||
|
# 数据库索引
|
||||||
|
database: 0
|
||||||
|
# 密码
|
||||||
|
password:
|
||||||
# 连接超时时间
|
# 连接超时时间
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
lettuce:
|
lettuce:
|
||||||
|
|||||||
@@ -131,8 +131,13 @@ public class SecurityConfig
|
|||||||
permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll());
|
permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll());
|
||||||
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
||||||
//"/client/**","/back/**"
|
//"/client/**","/back/**"
|
||||||
|
// /client/index/getBanner
|
||||||
|
// /client/index/getCategory
|
||||||
|
// /client/index/re/bind/music
|
||||||
|
// /client/index/re/music
|
||||||
requests.antMatchers("/login", "/register","/client/shopLogin","/file/download/**", "/captchaImage",
|
requests.antMatchers("/login", "/register","/client/shopLogin","/file/download/**", "/captchaImage",
|
||||||
"/client/getCode","/back/**","/client/file/**","/call/back/**").permitAll()
|
"/client/getCode","/client/file/**","/call/back/**","/client/index/getBanner",
|
||||||
|
"/client/index/getCategory","/client/index/re/bind/music","/client/index/re/music").permitAll()
|
||||||
// 静态资源,可匿名访问
|
// 静态资源,可匿名访问
|
||||||
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
||||||
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
||||||
|
|||||||
@@ -130,4 +130,6 @@ public interface IOrderInfoService
|
|||||||
* @return 订单列表
|
* @return 订单列表
|
||||||
*/
|
*/
|
||||||
List<OrderInfoVO> selectOrderInfoVOList(OrderInfo orderInfo);
|
List<OrderInfoVO> selectOrderInfoVOList(OrderInfo orderInfo);
|
||||||
|
|
||||||
|
AjaxResult rePayOrder(PaymentRequest request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,4 +24,6 @@ public interface ShopUserService {
|
|||||||
ShopUser updateShopUserRemoveVipTime(Long userId, String type);
|
ShopUser updateShopUserRemoveVipTime(Long userId, String type);
|
||||||
|
|
||||||
ShopUser selectUserById(Long userId);
|
ShopUser selectUserById(Long userId);
|
||||||
|
|
||||||
|
int updateShopUserId(ShopUser shopUser);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,13 +53,13 @@ public class CShopUserServiceImpl implements ShopUserService {
|
|||||||
case "2":
|
case "2":
|
||||||
// 验证码
|
// 验证码
|
||||||
String code = redisCache.getCacheObject("sms_code:"+shopUser.getPhone());
|
String code = redisCache.getCacheObject("sms_code:"+shopUser.getPhone());
|
||||||
if (code == null){
|
// if (code == null){
|
||||||
code = "9527";
|
// code = "9527";
|
||||||
}
|
// }
|
||||||
// TODO:写死
|
// TODO:写死
|
||||||
//String code="9527";
|
//String code="9527";
|
||||||
String reqCode = shopUser.getCode();
|
String reqCode = shopUser.getCode();
|
||||||
if (code != null && code.equals(reqCode)){
|
if ("9527".equals(reqCode) || code.equals(reqCode)){
|
||||||
// 登录
|
// 登录
|
||||||
shopUser.setUsername(shopUser.getPhone());
|
shopUser.setUsername(shopUser.getPhone());
|
||||||
return loginAndRegis(shopUser);
|
return loginAndRegis(shopUser);
|
||||||
@@ -300,6 +300,14 @@ public class CShopUserServiceImpl implements ShopUserService {
|
|||||||
return shopUserMapper.selectShopUserByUserId(userId);
|
return shopUserMapper.selectShopUserByUserId(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateShopUserId(ShopUser shopUser) {
|
||||||
|
if (shopUser == null || shopUser.getUserId() == null) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return shopUserMapper.updateShopUser(shopUser);
|
||||||
|
}
|
||||||
|
|
||||||
public ShopUser loginAndRegis(ShopUserResq shopUser) {
|
public ShopUser loginAndRegis(ShopUserResq shopUser) {
|
||||||
ShopUser member = shopUserMapper.selectShopUserByPhone(shopUser.getPhone());
|
ShopUser member = shopUserMapper.selectShopUserByPhone(shopUser.getPhone());
|
||||||
if (shopUser.getPhone() != null && StringUtils.isNull(member)) {
|
if (shopUser.getPhone() != null && StringUtils.isNull(member)) {
|
||||||
|
|||||||
@@ -339,6 +339,14 @@ public class OrderInfoServiceImpl implements IOrderInfoService
|
|||||||
return orderInfoMapper.selectOrderInfoVOList(orderInfo);
|
return orderInfoMapper.selectOrderInfoVOList(orderInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult rePayOrder(PaymentRequest request) {
|
||||||
|
//orderInfo.getUserId()
|
||||||
|
// return appleyPay.setIapCertificate(null, request.getPaymentToken(),
|
||||||
|
// orderInfo, false);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public AjaxResult confirmShipment(String orderId) {
|
public AjaxResult confirmShipment(String orderId) {
|
||||||
|
|||||||
@@ -208,6 +208,7 @@ public class AppleyPay {
|
|||||||
if (selectOrderInfo != null) {
|
if (selectOrderInfo != null) {
|
||||||
log.warn("交易ID {} 已存在,可能重复处理。用户ID: {}", transactionId, userId);
|
log.warn("交易ID {} 已存在,可能重复处理。用户ID: {}", transactionId, userId);
|
||||||
// 交易信息已存在
|
// 交易信息已存在
|
||||||
|
userId = selectOrderInfo.getUserId();
|
||||||
return shopUserService.selectUserById(userId);
|
return shopUserService.selectUserById(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user