package com.ym.mec.student.controller;

import com.ym.mec.biz.dal.dto.CashAccountDetail;
import com.ym.mec.biz.dal.dto.WithdrawDto;
import com.ym.mec.biz.service.StudentWithdrawService;
import com.ym.mec.common.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: mec
 * @description: 提现
 * @author: xw
 * @create: 2019-09-23 17:12
 */
@RestController
@RequestMapping("withdraw")
@Api(tags = "提现服务")
public class WithdrawController extends BaseController {

    @Autowired
    private StudentWithdrawService withdrawService;

    @PostMapping("confirm")
    @ApiOperation(value = "确认提现")
    public Object confirmWithdraw(@RequestBody WithdrawDto withdrawDto) {
        withdrawService.confirmWithdraw(withdrawDto);
        return succeed();
    }

    @PostMapping("page")
    @ApiOperation(value = "学员提现详情")
    public Object getInfo(@RequestBody CashAccountDetail cashAccountDetail) {
        return succeed(withdrawService.queryWithdrawPage(cashAccountDetail));
    }
}
