package com.fdkankan.ucenter.controller;


import com.dtflys.forest.annotation.Post;
import com.fdkankan.common.util.JwtUtil;
import com.fdkankan.ucenter.common.BaseController;
import com.fdkankan.ucenter.common.Result;
import com.fdkankan.ucenter.service.IDownloadOrderService;
import com.fdkankan.ucenter.service.IExpansionOrderService;
import com.fdkankan.ucenter.service.IIncrementOrderService;
import com.fdkankan.ucenter.service.IVirtualOrderService;
import com.fdkankan.ucenter.vo.request.IncrementOrderParam;
import com.fdkankan.ucenter.vo.request.VirtualOrderParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 充值订单表（双目相机点数充值、消费） 前端控制器
 * </p>
 *
 * @author 
 * @since 2022-07-13
 */
@RestController
@RequestMapping("/ucenter/user/virtualOrder")
public class VirtualOrderController extends BaseController {

    @Autowired
    IIncrementOrderService incrementOrderService;
    @Autowired
    IDownloadOrderService downloadOrderService;
    @Autowired
    IVirtualOrderService virtualOrderService;
    @Autowired
    IExpansionOrderService expansionOrderService;


    /**
     * 获取会员权益记录
     */
    @PostMapping("/incrementOrderList")
    public Result incrementOrderList(@RequestBody IncrementOrderParam param){
        param.setUserName(getUserName());
        return Result.success(incrementOrderService.pageList(param));
    }

    /**
     * 获取用户下载订单
     */
    @PostMapping("/downloadOrderList")
    public Result downloadOrderList(@RequestBody IncrementOrderParam param){
        param.setUserName(getUserName());
        return Result.success(downloadOrderService.pageList(param));
    }

    /**
     * 获取用户充值记录
     */
    @PostMapping("/chargeList")
    public Result chargeList(@RequestBody VirtualOrderParam param){
        param.setUserName(getUserName());
        return Result.success(virtualOrderService.pageList(param));
    }

    /**
     * 获取用户扩容记录
     */
    @PostMapping("/expansionList")
    public Result expansionList(@RequestBody VirtualOrderParam param){
        param.setUserName(getUserName());
        return Result.success(expansionOrderService.pageList(param));
    }


}

