package com.kym.admin.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.kym.common.R;
import com.kym.service.ParkingCouponRecordService;
import org.springframework.web.bind.annotation.*;

/**
 * 停车券发放记录 前端控制器
 *
 * @author skyline
 * @since 2026-06-12
 */
@RestController
@RequestMapping("/parking-coupon-record")
public class ParkingCouponRecordController {

    private final ParkingCouponRecordService parkingCouponRecordService;

    public ParkingCouponRecordController(ParkingCouponRecordService parkingCouponRecordService) {
        this.parkingCouponRecordService = parkingCouponRecordService;
    }

    @SaCheckPermission("parkingCouponRecord.list")
    @GetMapping("/page")
    public R<?> page(@RequestParam(defaultValue = "1") Integer pageNum,
                     @RequestParam(defaultValue = "10") Integer pageSize,
                     @RequestParam(required = false) Long userId,
                     @RequestParam(required = false) String stationId,
                     @RequestParam(required = false) Integer status) {
        return R.success(parkingCouponRecordService.page(pageNum, pageSize, userId, stationId, status));
    }
}
