兑换码优化
This commit is contained in:
@@ -2,6 +2,7 @@ package com.czg.controller.user;
|
||||
|
||||
import com.czg.market.dto.MkRedemptionDTO;
|
||||
import com.czg.market.service.MkRedemptionConfigService;
|
||||
import com.czg.market.vo.URedemptionVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import jakarta.annotation.Resource;
|
||||
@@ -17,17 +18,25 @@ import org.springframework.web.bind.annotation.*;
|
||||
@RequestMapping("/user/redemption")
|
||||
public class URedemptionController {
|
||||
@Resource
|
||||
private MkRedemptionConfigService couponRedemptionConfigService;
|
||||
private MkRedemptionConfigService redemptionConfigService;
|
||||
|
||||
/**
|
||||
* 使用券码
|
||||
*/
|
||||
@PostMapping("/exchange")
|
||||
public CzgResult<Boolean> exchange(@Validated @RequestBody MkRedemptionDTO dto) {
|
||||
couponRedemptionConfigService.exchange(StpKit.USER.getLoginIdAsLong(), dto);
|
||||
|
||||
redemptionConfigService.exchange(StpKit.USER.getLoginIdAsLong(), dto);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 兑换码详细信息
|
||||
* @param code 兑换码
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<URedemptionVO> get(@RequestParam String code) {
|
||||
return CzgResult.success(redemptionConfigService.getInfo(code));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user