用户端兑换相关
This commit is contained in:
@@ -58,9 +58,8 @@ public class CouponRedemptionController {
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "couponRedemption:detail", name = "券兑换码列表")
|
||||
@GetMapping
|
||||
public CzgResult<MkCouponRedemptionConfigVO> detail(@RequestParam Integer id) {
|
||||
return CzgResult.success(configService.getOneAs(new QueryWrapper().eq(MkCouponRedemptionConfig::getId, id)
|
||||
.eq(MkCouponRedemptionConfig::getMainShopId, StpKit.USER.getMainShopId()), MkCouponRedemptionConfigVO.class));
|
||||
public CzgResult<MkCouponRedemptionConfigVO> detail(@RequestParam Long id) {
|
||||
return CzgResult.success(configService.detail(StpKit.USER.getMainShopId(), id));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.czg.controller.user;
|
||||
|
||||
import com.czg.market.dto.MkRedemptionDTO;
|
||||
import com.czg.market.service.MkCouponRedemptionConfigService;
|
||||
import com.czg.market.service.MkEnableConfigService;
|
||||
import com.czg.market.service.MkRechargeRedemptionConfigService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* 兑换码相关
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user/redemption")
|
||||
public class URedemptionController {
|
||||
@Resource
|
||||
private MkRechargeRedemptionConfigService rechargeRedemptionConfigService;
|
||||
@Resource
|
||||
private MkCouponRedemptionConfigService couponRedemptionConfigService;
|
||||
|
||||
/**
|
||||
* 使用券码
|
||||
*/
|
||||
@PostMapping("/exchange")
|
||||
public CzgResult<Boolean> exchange(@Validated @RequestBody MkRedemptionDTO dto) {
|
||||
if ("recharge".equals(dto.getType())) {
|
||||
rechargeRedemptionConfigService.exchange(StpKit.USER.getLoginIdAsLong(), dto);
|
||||
}else {
|
||||
couponRedemptionConfigService.exchange(StpKit.USER.getLoginIdAsLong(), dto);
|
||||
}
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user