package com.xhpc.payment.controller;

import com.xhpc.common.core.web.controller.BaseController;
import com.xhpc.common.core.web.domain.AjaxResult;
import com.xhpc.common.core.web.page.TableDataInfo;
import com.xhpc.payment.service.IXhpcUserAccountStatementService;
import io.swagger.annotations.Api;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/account/statement")
@Api(value = "用户流水接口", tags = "用户流水接口")
public class XhpcUserAccountStatementController extends BaseController {

    @Autowired
    private IXhpcUserAccountStatementService iXhpcUserAccountStatementService;

    /**
     * 用户流水分页列表
     *
     * @return
     */
    @ApiOperation(value = "用户流水分页列表")
    @GetMapping("/page")
    public TableDataInfo page(Long appUserId) {
        startPage();
        List<Map<String, Object>> list = iXhpcUserAccountStatementService.page(appUserId);
        return getDataTable(list);
    }

    /**
     * 用户流水列表
     *
     * @return
     */
    @ApiOperation(value = "用户流水列表")
    @GetMapping("/list")
    public AjaxResult list(HttpServletRequest request) {
        List<Map<String, Object>> list = iXhpcUserAccountStatementService.list(request);
        return AjaxResult.success(list);
    }
}
