package com.fjhx.victoriatourist.controller.stock;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.victoriatourist.entity.stock.vo.StockTransferDetailsVo;
import com.fjhx.victoriatourist.entity.stock.dto.StockTransferDetailsSelectDto;
import com.fjhx.victoriatourist.entity.stock.dto.StockTransferDetailsDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.victoriatourist.service.stock.StockTransferDetailsService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 调仓明细 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-04-17
 */
@RestController
@RequestMapping("/stockTransferDetails")
public class StockTransferDetailsController {

    @Autowired
    private StockTransferDetailsService stockTransferDetailsService;

    /**
     * 调仓明细分页
     */
    @PostMapping("/page")
    public Page<StockTransferDetailsVo> page(@RequestBody StockTransferDetailsSelectDto dto) {
        return stockTransferDetailsService.getPage(dto);
    }

    /**
     * 调仓明细明细
     */
    @PostMapping("/detail")
    public StockTransferDetailsVo detail(@RequestBody BaseSelectDto dto) {
        return stockTransferDetailsService.detail(dto.getId());
    }

    /**
     * 调仓明细新增
     */
    @PostMapping("/add")
    public void add(@RequestBody StockTransferDetailsDto stockTransferDetailsDto) {
        stockTransferDetailsService.add(stockTransferDetailsDto);
    }

    /**
     * 调仓明细编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody StockTransferDetailsDto stockTransferDetailsDto) {
        stockTransferDetailsService.edit(stockTransferDetailsDto);
    }

    /**
     * 调仓明细删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        stockTransferDetailsService.delete(dto.getId());
    }

}
