package beilv.voucher.controller;

import beilv.common.core.controller.BaseController;
import beilv.common.core.domain.AjaxResult;
import beilv.common.core.page.PageDomain;
import beilv.common.core.page.TableDataInfo;
import beilv.common.core.page.TableSupport;
import beilv.site.domain.BeilvSite;
import beilv.voucher.domain.BeilvVoucher;
import beilv.voucher.domain.BeilvVoucherMember;
import beilv.voucher.service.IBeilvVoucherMemberService;
import beilv.voucher.service.IBeilvVoucherService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/app-api/voucher")
public class AppVoucherController extends BaseController {

    @Autowired
    private IBeilvVoucherMemberService beilvVoucherMemberService;

    /**
     * 查询代金券列表
     */
    @GetMapping("/selectAppVoucherList")
    public AjaxResult selectAppVoucherList(BeilvVoucherMember beilvVoucherMember) {
        startPage();
        List<BeilvVoucherMember> list = beilvVoucherMemberService.selectAppVoucherList(beilvVoucherMember);
        return AjaxResult.success(getDataTable(list).getRows());
    }
}
