package cn.pluss.platform.controller.user;

import cn.pluss.platform.BankCardService;
import cn.pluss.platform.api.Result;
import cn.pluss.platform.api.ResultGenerator;
import cn.pluss.platform.vo.BankCardRecordVO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author DJH
 */
@Controller
@RequestMapping("/bankCard")
public class BankCardController {

    @Autowired
    private BankCardService bankCardService;

    @GetMapping("/changeRecord")
    public String index() {
        return "user/bankCardChangeRecord";
    }

    @GetMapping("/pageBankCardRecord")
    public Result<Page<BankCardRecordVO>> pageBankCardRecord(Page<BankCardRecordVO> page, Long userId) {
        Page<BankCardRecordVO> resultData = bankCardService.pageBankCardRecord(page, userId);

        return ResultGenerator.genSuccessResult(resultData);
    }
}