package io.renren.controller;

import javax.validation.Valid;

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

import io.renren.common.utils.Result;
import io.renren.common.vo.trans.TransferMorepyeeReq;
import io.renren.common.vo.trans.TransferMorepyeeResp;
import io.renren.common.vo.trans.TransferReq;
import io.renren.common.vo.trans.TransferResp;
import io.renren.service.TransService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/api/acctserial")
@Api(tags="交易管理")
public class TransController {
	
	@Autowired
	private TransService transService;

	@PostMapping("/transferMorepyee")
    @ApiOperation("内部代发")
    public Result<TransferMorepyeeResp> transferMorepyee(@Valid @RequestBody TransferMorepyeeReq req) throws Exception{
    	return new Result<TransferMorepyeeResp>().ok(transService.transferMorepyee(req));
    }

    @PostMapping("/transfer")
    @ApiOperation("外部代发")
    public Result<TransferResp> transfer(@Valid @RequestBody TransferReq req) throws Exception{
    	return new Result<TransferResp>().ok(transService.transfer(req));
    }
	
}