充值改造
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package com.czg.controller.user;
|
||||
|
||||
import com.czg.market.service.MkShopRechargeService;
|
||||
import com.czg.market.vo.MemberDetailVO;
|
||||
import com.czg.market.vo.MemberListVO;
|
||||
import com.czg.market.vo.MkShopRechargeVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员相关
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user/recharge")
|
||||
public class URechargeController {
|
||||
@Resource
|
||||
private MkShopRechargeService shopRechargeService;
|
||||
|
||||
/**
|
||||
* 获取充值配置
|
||||
* @param shopId 店铺id
|
||||
*/
|
||||
@GetMapping("/config")
|
||||
public CzgResult<MkShopRechargeVO> getConfig(@RequestParam Long shopId) {
|
||||
return CzgResult.success(shopRechargeService.detail(shopId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,8 @@ import com.czg.annotation.SaStaffCheckPermission;
|
||||
import com.czg.entity.resp.CzgBaseResp;
|
||||
import com.czg.order.entity.OrderInfo;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.order.dto.RechargeDTO;
|
||||
import com.czg.service.order.dto.VipMemberPayParamDTO;
|
||||
import com.czg.service.order.dto.VipPayParamDTO;
|
||||
import com.czg.service.order.dto.VipRefundDTO;
|
||||
@@ -70,6 +72,22 @@ public class VipPayController {
|
||||
return payService.ltPayVip(ServletUtil.getClientIP(request), payParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值
|
||||
* @param request
|
||||
* @param rechargeDTO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/recharge")
|
||||
@Debounce(value = "#payParam.shopUserId")
|
||||
public CzgResult<Map<String, Object>> recharge(HttpServletRequest request, @Validated @RequestBody RechargeDTO rechargeDTO) {
|
||||
if (rechargeDTO.getRechargeDetailId() == null && rechargeDTO.getMoney() == null) {
|
||||
return CzgResult.failure("充值失败 未指定充值金额");
|
||||
}
|
||||
rechargeDTO.setPlatformType(ServletUtil.getHeaderIgnoreCase(ServletUtil.getRequest(), "platformType"));
|
||||
return payService.recharge(ServletUtil.getClientIP(request), rechargeDTO, StpKit.USER.getLoginIdAsLong());
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员购买支付
|
||||
* @param request
|
||||
|
||||
Reference in New Issue
Block a user