package com.fdkankan.platform.order.controller.manager;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fdkankan.common.controller.BaseController;
import com.fdkankan.platform.order.service.IVirtualOrderService;
import com.fdkankan.platform.user.request.RequestTrade;
import com.fdkankan.platform.user.vo.ResponseVirtualOrder;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 后台管理-增值服务
 */
@Log4j2
@RestController
@RequestMapping("/service/platform/manager/virtualOrder")
public class ManagerVirtualOrderController extends BaseController {

    @Autowired
    private IVirtualOrderService virtualOrderService;

    /**
     * 查看增值记录-充值记录\消费记录
     * startDate        开始时间
     * endDate          结束时间
     * searchKey        关键词
     * type             1充值，2消费
     * pageNum          分页
     * pageSize         每页大小
     */
    @RequestMapping(value = {"/list"}, method = RequestMethod.POST)
    public Page<ResponseVirtualOrder> list(@RequestBody RequestTrade param) throws Exception {
        return virtualOrderService.getPageVoByParam(param);
    }
}
