Forráskód Böngészése

修复推广码推广失败问题

codingliang 7 hónapja
szülő
commit
c76d99aa99

+ 4 - 8
src/main/java/com/sqx/modules/member/controller/app/AppVipController.java

@@ -6,14 +6,10 @@ import com.sqx.modules.app.annotation.Login;
 import com.sqx.modules.member.service.VipService;
 import com.sqx.modules.member.vo.VipReduceVO;
 import com.sqx.modules.pay.vo.PayTransactionsVO;
+import icu.xuyijie.secureapi.annotation.DecryptParam;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestAttribute;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * @author codingliang
@@ -37,7 +33,7 @@ public class AppVipController {
     @Login
     @ApiOperation(value = "获取购买vip支付参数", notes = "promoCode 为推荐码")
     @GetMapping(value = "get-pay-param")
-    public Result getPayParam(@RequestAttribute("userId") Long userId, @RequestParam(value = "promoCode") String promoCode){
+    public Result getPayParam(@RequestAttribute("userId") Long userId, @DecryptParam(value = "promoCode") String promoCode){
         PayTransactionsVO payParamVO = vipService.getPayParam(userId, promoCode);
 
         return Result.success(BeanUtil.beanToMap(payParamVO, false, true));
@@ -46,7 +42,7 @@ public class AppVipController {
     @Login
     @ApiOperation(value = "余额购买vip", notes = "promoCode 为推荐码")
     @GetMapping(value = "balance-pay")
-    public Result balancePay(@RequestAttribute("userId") Long userId, @RequestParam(value = "promoCode") String promoCode){
+    public Result balancePay(@RequestAttribute("userId") Long userId, @DecryptParam(value = "promoCode") String promoCode){
         vipService.balancePay(userId, promoCode);
         return Result.success();
     }

+ 3 - 0
src/main/java/com/sqx/modules/member/vo/VipPromoRecordVO.java

@@ -24,6 +24,9 @@ public class VipPromoRecordVO implements Serializable {
     @ApiModelProperty(value = "推广码id")
     private Long promoCodeId;
 
+    @ApiModelProperty(value = "推广码")
+    private String promoCode;
+
     @ApiModelProperty(value = "用户id")
     private Long userId;
     

+ 2 - 0
src/main/resources/mapper/member/VipPromoRecordMapper.xml

@@ -6,6 +6,7 @@
         select
             vpr.id,
             vpr.promo_code_id,
+            vpc.promo_code,
             vpr.user_id,
             vpr.user_name,
             vpr.user_phone,
@@ -16,6 +17,7 @@
             t.vip_expiration_time expire_time
         from
             vip_promo_record vpr
+            left join vip_promo_code vpc on vpc.id = vpr.promo_code_id
             left join tb_user t on vpr.user_id = t.user_id
         <where>
             and vpr.del_flag = 0