package com.mes.md.controller;
|
|
|
import com.mes.md.entity.Machine;
|
import com.mes.md.entity.Tasking;
|
import com.mes.md.service.MachineService;
|
import com.mes.utils.Result;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
/**
|
* <p>
|
* 前端控制器
|
* </p>
|
*
|
* @author yanzhixin
|
* @since 2024-09-13
|
*/
|
@RestController
|
@RequestMapping("/machine")
|
public class MachineController {
|
|
@Autowired
|
MachineService machineService;
|
|
@ApiOperation("修改当前设备 【开工/暂停】")
|
@PostMapping("/updateMachineState")
|
@ResponseBody
|
public Result updateMachineState(@RequestBody Machine machine) {
|
int count =machineService.openOrCloseMachine(machine);
|
return Result.build(200,"修改成功:"+count,count);
|
}
|
|
@ApiOperation("当前设备切换模式 【定制/标准】")
|
@PostMapping("/toggleModeMachine")
|
@ResponseBody
|
public Result toggleModeMachine(@RequestBody Machine machine) {
|
int count =machineService.toggleModeMachine(machine);
|
return Result.build(200,"修改成功:"+count,count);
|
}
|
}
|