package io.renren.controller;

import javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import io.renren.common.utils.Result;
import io.renren.common.vo.acctserial.AcctserialDetailQueryResp;
import io.renren.common.vo.acctserial.AcctserialQueryPageReq;
import io.renren.common.vo.acctserial.AcctserialQueryPageResp;
import io.renren.service.AcctserialService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/api/acctserial")
@Api(tags="资金流水")
public class AcctserialController {
	
	@Autowired
	private AcctserialService acctserialService;

    @GetMapping("/queryAcctserial")
    @ApiOperation("资金流水列表")
    public Result<AcctserialQueryPageResp> queryAcctserial(@Valid @RequestBody AcctserialQueryPageReq params) throws Exception{
    	return new Result<AcctserialQueryPageResp>().ok(acctserialService.queryAcctserial(params));
    }

    @GetMapping("/queryAcctserialDetail")
    @ApiOperation("资金流水详情")
    public Result<AcctserialDetailQueryResp> queryAcctserialDetail(@RequestParam("userId") String userId,@RequestParam("jnoAcct") String jnoAcct) throws Exception{
    	return new Result<AcctserialDetailQueryResp>().ok(acctserialService.queryAcctserialDetail(userId, jnoAcct));
    }
    
}