package com.fjhx.mes.controller.border;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.fjhx.common.constant.SourceConstant;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.mes.entity.border.vo.BorderOfLineVo;
import com.fjhx.mes.entity.border.dto.BorderOfLineSelectDto;
import com.fjhx.mes.entity.border.dto.BorderOfLineDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.mes.service.border.BorderOfLineService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 线边管理 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-03-31
 */
//@DS(SourceConstant.MES)
@RestController
@RequestMapping("/borderOfLine")
public class BorderOfLineController {

    @Autowired
    private BorderOfLineService borderOfLineService;

    /**
     * 线边管理分页
     */
    @PostMapping("/page")
    public Page<BorderOfLineVo> page(@RequestBody BorderOfLineSelectDto dto) {
        return borderOfLineService.getPage(dto);
    }

    /**
     * 线边管理明细
     */
    @PostMapping("/detail")
    public BorderOfLineVo detail(@RequestBody BorderOfLineDto dto) {
        return borderOfLineService.detail(dto);
    }

    /**
     * 线边管理新增
     */
    @PostMapping("/add")
    public void add(@RequestBody BorderOfLineDto borderOfLineDto) {
        borderOfLineService.add(borderOfLineDto);
    }

    /**
     * 线边管理编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody BorderOfLineDto borderOfLineDto) {
        borderOfLineService.edit(borderOfLineDto);
    }

    /**
     * 线边管理删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        borderOfLineService.delete(dto.getId());
    }

}
