package com.fdkankan.platform.user.controller.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fdkankan.platform.order.service.IVirtualOrderService;
import com.fdkankan.platform.order.vo.ResponseExpansionOrder;
import com.fdkankan.platform.user.request.RequestCamera;
import com.fdkankan.platform.user.request.RequestDownloadOrder;
import com.fdkankan.platform.user.request.RequestIncrementOrder;
import com.fdkankan.platform.user.request.RequestVirtualOrder;
import com.fdkankan.platform.user.vo.ResponseDownloadOrder;
import com.fdkankan.platform.user.vo.ResponseIncrementOrder;
import com.fdkankan.platform.user.vo.ResponseVirtualOrder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 个人中心-我的虚拟订单
 */
@RestController
@RequestMapping("/service/platform/user/virtualOrder")
public class UserVirtualOrderController {

    private static Logger log = LoggerFactory.getLogger("programLog");

    @Autowired
    private IVirtualOrderService virtualOrderService;


    /**
     * 获取用户充值记录
     * status     状态，-1表示支出，1表示充值，0表示系统赠送，-2表示系统退充值
     * childName     设备id
     */
    @RequestMapping(value = "/chargeList", method = RequestMethod.POST)
    public Page<ResponseVirtualOrder> chargeList(@RequestBody RequestVirtualOrder param, @RequestHeader String token) throws Exception {
        return virtualOrderService.chargeList(param,token);
    }
    /**
     * 获取用户扩容记录
     * childName     设备id
     */
    @RequestMapping(value = "/expansionList", method = RequestMethod.POST)
    public Page<ResponseExpansionOrder> expansionList(@RequestBody RequestCamera param, @RequestHeader String token) throws Exception {
        return virtualOrderService.expansionList(param,token);
    }
    /**
     * 获取会员权益记录
     * snCode     相机sn编码
     */
    @RequestMapping(value = "/incrementOrderList", method = RequestMethod.POST)
    public Page<ResponseIncrementOrder> incrementOrderList(@RequestBody RequestIncrementOrder param, @RequestHeader String token) throws Exception {
        return virtualOrderService.incrementOrderList(param,token);
    }
    /**
     * 获取用户下载订单
     * snCode     相机sn编码
     */
    @RequestMapping(value = "/downloadOrderList", method = RequestMethod.POST)
    public Page<ResponseDownloadOrder> downloadOrderList(@RequestBody RequestDownloadOrder param, @RequestHeader String token) throws Exception {
        return virtualOrderService.downloadOrderList(param,token);
    }


}
