package com.miaxis.app.controller.wx;

import com.miaxis.common.constant.Constants;
import com.miaxis.common.core.controller.BaseController;
import com.miaxis.common.core.page.ResponsePageInfo;
import com.miaxis.common.utils.SecurityUtils;
import com.miaxis.wx.domain.WxExtractBank;
import com.miaxis.wx.service.IWxExtractBankService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 【微信提现银行卡】Controller
 *
 * @author miaxis
 * @date 2022-03-07
 */
@RestController
@RequestMapping(Constants.STUDENT_PREFIX +"/wx/bank")
@Api(tags={"【H5-微信提现银行卡】"})
public class WxExtractBankController extends BaseController{
    @Autowired
    private IWxExtractBankService wxExtractBankService;

    /**
     * 查询微信提现银行卡列表
     */
    @ApiOperation("查询微信提现银行卡列表")
        @ApiImplicitParams({
            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
    })
    @GetMapping("/list")
    public ResponsePageInfo<WxExtractBank> list(){
        startPage();
        WxExtractBank wxExtractBank = new WxExtractBank();
        wxExtractBank.setOpenid(SecurityUtils.getLoginUser().getStudent().getOpenid());
        List<WxExtractBank> list = wxExtractBankService.selectWxExtractBankList(wxExtractBank);
        return toResponsePageInfo(list);
    }


}
