严智鑫
2024-04-19 0707d2b4e8ddc0d62a2b6381484e0d8d455b1441
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/controller/EdgStorageCageController.java
@@ -1,9 +1,14 @@
package com.mes.edgstoragecage.controller;
import com.mes.edgstoragecage.entity.EdgStorageCage;
import com.mes.edgstoragecage.service.EdgStorageCageService;
import com.mes.utils.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
 * <p>
@@ -17,11 +22,37 @@
@RequestMapping("/edgStorageCage")
public class EdgStorageCageController {
        //todo: 实例代码 待删除
    @ApiOperation("测试")
    @GetMapping("/index")
    public String index() {
        return "hello world";
    @Autowired
    private EdgStorageCageService edgStorageCageService;
    @ApiOperation("查询磨边缓存理片笼内详情")
    @PostMapping("/selectEdgStorageCage")
    @ResponseBody
    public Result selectEdgStorageCage () {
        List<Map> list=edgStorageCageService.selectEdgStorageCages();
        return Result.build(200,"成功",list);
    }
    @ApiOperation("添加磨边缓存理片笼信息 功能:笼内绑定玻璃")
    @PostMapping("/insertEdgStorageCage")
    @ResponseBody
    public Result insertEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) {
        boolean isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage);
        return Result.build(200,"添加成功",1);
    }
    @ApiOperation("修改磨边缓存理片笼信息   功能:对笼内栅格进行【启用/禁用】/ 【更换】笼内栅格玻璃信息")
    @PostMapping("/updateEdgStorageCage")
    @ResponseBody
    public Result updateEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) {
        boolean isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage);
        return Result.build(200,"更换成功",1);
    }
    @ApiOperation("删除磨边缓存理片笼信息   功能:对笼内栅格玻璃进行【清除】")
    @PostMapping("/deleteEdgStorageCage")
    @ResponseBody
    public Result deleteEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) {
        boolean isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage);
        return Result.build(200,"删除成功",1);
    }
}