package com.fjhx.controller.working;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springblade.core.tool.api.R;
import com.fjhx.entity.working.WorkingRouteProcedure;
import com.fjhx.params.working.WorkingRouteProcedureVo;
import com.fjhx.service.working.WorkingRouteProcedureService;
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 java.util.Map;

/**
 * <p>
 * 工艺路线工序关联表 前端控制器
 * </p>
 *
 * @author ${author}
 * @since 2022-07-14
 */
@RestController
@RequestMapping("/workingRouteProcedure")
public class WorkingRouteProcedureController {

    @Autowired
    private WorkingRouteProcedureService workingRouteProcedureService;

    @PostMapping("/page")
    public R page(@RequestBody Map<String, String> condition){
        Page<WorkingRouteProcedure> result = workingRouteProcedureService.getPage(condition);
        return R.success(result);
    }

    @PostMapping("/add")
    public R add(@RequestBody WorkingRouteProcedureVo workingRouteProcedureVo){
        workingRouteProcedureService.add(workingRouteProcedureVo);
        return R.success();
    }

    @PostMapping("/edit")
    public R edit(@RequestBody WorkingRouteProcedureVo workingRouteProcedureVo){
        workingRouteProcedureService.edit(workingRouteProcedureVo);
        return R.success();
    }

    @PostMapping("/delete")
    public R delete(@RequestBody WorkingRouteProcedureVo workingRouteProcedureVo){
        workingRouteProcedureService.delete(workingRouteProcedureVo);
        return R.success();
    }

}

