package cn.stylefeng.guns.modular.cm.plcInteractiveData.controller; import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo; import cn.stylefeng.guns.modular.cm.plcInteractiveData.entity.PlcInteractiveData; import cn.stylefeng.guns.modular.cm.plcInteractiveData.model.params.PlcInteractiveDataParam; import cn.stylefeng.guns.modular.cm.plcInteractiveData.service.PlcInteractiveDataService; import cn.stylefeng.roses.core.base.controller.BaseController; import cn.stylefeng.roses.kernel.model.response.ResponseData; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; /** * plc交互数据控制器 * * @author ruimin * @Date 2023-10-25 16:18:23 */ @Controller @RequestMapping("/plcInteractiveData") public class PlcInteractiveDataController extends BaseController { private String PREFIX = "modular/cm/plcInteractiveData"; @Autowired private PlcInteractiveDataService plcInteractiveDataService; /** * 跳转到主页面 * * @author ruimin * @Date 2023-10-25 */ @RequestMapping("") public String index() { return PREFIX + "/plcInteractiveData.html"; } /** * 新增页面 * * @author ruimin * @Date 2023-10-25 */ @RequestMapping("/add") public String add() { return PREFIX + "/plcInteractiveData_add.html"; } /** * 编辑页面 * * @author ruimin * @Date 2023-10-25 */ @RequestMapping("/edit") public String edit() { return PREFIX + "/plcInteractiveData_edit.html"; } /** * 新增接口 * * @author ruimin * @Date 2023-10-25 */ @RequestMapping("/addItem") @ResponseBody public ResponseData addItem(PlcInteractiveDataParam plcInteractiveDataParam) { this.plcInteractiveDataService.add(plcInteractiveDataParam); return ResponseData.success(); } /** * 编辑接口 * * @author ruimin * @Date 2023-10-25 */ @RequestMapping("/editItem") @ResponseBody public ResponseData editItem(PlcInteractiveDataParam plcInteractiveDataParam) { this.plcInteractiveDataService.update(plcInteractiveDataParam); return ResponseData.success(); } /** * 删除接口 * * @author ruimin * @Date 2023-10-25 */ @RequestMapping("/delete") @ResponseBody public ResponseData delete(PlcInteractiveDataParam plcInteractiveDataParam) { this.plcInteractiveDataService.delete(plcInteractiveDataParam); return ResponseData.success(); } /** * 查看详情接口 * * @author ruimin * @Date 2023-10-25 */ @RequestMapping("/detail") @ResponseBody public ResponseData detail(PlcInteractiveDataParam plcInteractiveDataParam) { PlcInteractiveData detail = this.plcInteractiveDataService.getById(plcInteractiveDataParam.getId()); return ResponseData.success(detail); } /** * 查询列表 * * @author ruimin * @Date 2023-10-25 */ @ResponseBody @RequestMapping("/list") public LayuiPageInfo list(PlcInteractiveDataParam plcInteractiveDataParam) { return this.plcInteractiveDataService.findPageBySpec(plcInteractiveDataParam); } }