package com.fjhx.mes.controller.border;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.mes.entity.border.vo.BorderOfLineJournalVo;
import com.fjhx.mes.entity.border.dto.BorderOfLineJournalSelectDto;
import com.fjhx.mes.entity.border.dto.BorderOfLineJournalDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.mes.service.border.BorderOfLineJournalService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 线边流水记录 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-03-31
 */
@RestController
@RequestMapping("/borderOfLineJournal")
public class BorderOfLineJournalController {

    @Autowired
    private BorderOfLineJournalService borderOfLineJournalService;

    /**
     * 线边流水记录分页
     */
    @PostMapping("/page")
    public Page<BorderOfLineJournalVo> page(@RequestBody BorderOfLineJournalSelectDto dto) {
        return borderOfLineJournalService.getPage(dto);
    }

    /**
     * 线边流水记录明细
     */
    @PostMapping("/detail")
    public BorderOfLineJournalVo detail(@RequestBody BaseSelectDto dto) {
        return borderOfLineJournalService.detail(dto.getId());
    }

    /**
     * 线边流水记录新增
     */
    @PostMapping("/add")
    public void add(@RequestBody BorderOfLineJournalDto borderOfLineJournalDto) {
        borderOfLineJournalService.add(borderOfLineJournalDto);
    }

    /**
     * 线边流水记录编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody BorderOfLineJournalDto borderOfLineJournalDto) {
        borderOfLineJournalService.edit(borderOfLineJournalDto);
    }

    /**
     * 线边流水记录删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        borderOfLineJournalService.delete(dto.getId());
    }

}
