You've already forked FrameTour-BE
refactor(pricing): 重构优惠券管理相关代码
- 替换 Lombok 的 @RequiredArgsConstructor 注解为 Spring 的 @Autowired 和 @Lazy 注解 - 更新 VoucherManagementController、VoucherBatchServiceImpl 和 VoucherCodeServiceImpl 类的依赖注入方式 - 优化代码结构,提高可读性和可维护性
This commit is contained in:
@@ -12,17 +12,21 @@ import com.ycwl.basic.pricing.service.VoucherBatchService;
|
||||
import com.ycwl.basic.pricing.service.VoucherCodeService;
|
||||
import com.ycwl.basic.utils.ApiResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/pricing/voucher")
|
||||
@RequiredArgsConstructor
|
||||
public class VoucherManagementController {
|
||||
|
||||
private final VoucherBatchService voucherBatchService;
|
||||
private final VoucherCodeService voucherCodeService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private VoucherBatchService voucherBatchService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private VoucherCodeService voucherCodeService;
|
||||
|
||||
@PostMapping("/batch/create")
|
||||
public ApiResponse<Long> createBatch(@RequestBody VoucherBatchCreateReq req) {
|
||||
|
Reference in New Issue
Block a user