package com.copy.trade.controller;

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 com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.copy.trade.entity.form.ClosePositionForm;
import com.copy.trade.entity.vo.ClosePositionVo;
import com.copy.trade.service.IClosePositionService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
 * <p>
 * 平仓记录 前端控制器
 * </p>
 *
 * @author wz
 * @since 2022-11-22
 */
@Api(value = "平仓记录", tags = "平仓记录")
@RestController
@RequestMapping("/close-position")
public class ClosePositionController {

	IClosePositionService closePositionServiceImpl;

	/**
	 * 推荐使用构造器注入
	 * @param closePositionServiceImpl
	 */	
	@Autowired
	ClosePositionController(IClosePositionService closePositionServiceImpl) {
		this.closePositionServiceImpl = closePositionServiceImpl;
	}
	

	@ApiOperation(value = "平仓记录列表")
	@PostMapping("/list")
	public Page<ClosePositionVo> list(@RequestBody ClosePositionForm closePositionForm){
		return closePositionServiceImpl.list(closePositionForm);
	}

}
