package com.copy.trade.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.copy.trade.entity.form.CopiedTradeForm;
import com.copy.trade.entity.form.PositionForm;
import com.copy.trade.entity.vo.CopiedTradeVo;
import com.copy.trade.entity.vo.PositionStatisticsVo;
import com.copy.trade.entity.vo.PositionVo;
import com.copy.trade.service.IPositionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

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;
/**
 * <p>
 * 跟单持仓表 前端控制器
 * </p>
 *
 * @author wz
 * @since 2022-11-17
 */
@Api(value = "跟单持仓表", tags = "跟单持仓表")
@RestController
@RequestMapping("/position")
public class PositionController {

	IPositionService positionServiceImpl;

	/**
	 * 推荐使用构造器注入
	 * @param positionServiceImpl
	 */	
	@Autowired
	PositionController(IPositionService positionServiceImpl) {
		this.positionServiceImpl = positionServiceImpl;
	}
	
	@ApiOperation(value = "跟单仓位列表")
	@PostMapping("/list")
	public Page<PositionVo> list(@RequestBody PositionForm positionForm){
		return positionServiceImpl.list(positionForm);
	}
	
	@ApiOperation(value = "仓位统计数据")
	@PostMapping("/position-statistics")
	public PositionStatisticsVo positionStatistics(){
		return positionServiceImpl.getPositionStatistics();
	}

}
