package org.jeecg.modules.dnc.controller; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.modules.dnc.entity.Button; import org.jeecg.modules.dnc.entity.ObjectBase; import org.jeecg.modules.dnc.request.ObjectBaseRequest; import org.jeecg.modules.dnc.response.CommonCode; import org.jeecg.modules.dnc.response.QueryPageResponseResult; import org.jeecg.modules.dnc.response.ResponseResult; import org.jeecg.modules.dnc.service.IObjectService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; @Slf4j @Api(tags = "Dnc对象管理") @RestController @RequestMapping("/ucenter/obj") public class ObjectController { @Autowired private IObjectService objectService; @AutoLog(value = "Dnc对象管理-新增管理对象信息") @ApiOperation(value = "Dnc对象管理-新增管理对象信息", notes = "Dnc对象管理-新增管理对象信息") @PostMapping("/add") public ResponseResult addObject(@RequestBody ObjectBase objectBase) { boolean b = objectService.addObject(objectBase); if(b) { return new ResponseResult(CommonCode.SUCCESS); } return new ResponseResult(CommonCode.FAIL); } @AutoLog(value = "Dnc对象管理-编辑对象") @ApiOperation(value = "Dnc对象管理-编辑对象", notes = "Dnc对象管理-编辑对象") @PutMapping("/edit/{id}") public ResponseResult editObject(@PathVariable("id") String id,@RequestBody ObjectBase objectBase) { boolean b = objectService.editObject(id,objectBase); if(b) { return new ResponseResult(CommonCode.SUCCESS); } return new ResponseResult(CommonCode.FAIL); } @AutoLog(value = "Dnc对象管理-分页查询对象") @ApiOperation(value = "Dnc对象管理-分页查询对象", notes = "Dnc对象管理-分页查询对象") @GetMapping("/find/page/{page}/{size}") public QueryPageResponseResult findByPageList(@PathVariable("page") int page, @PathVariable("size") int size, ObjectBaseRequest objectRequest) { return objectService.findPageList(page,size,objectRequest); } @AutoLog(value = "Dnc对象管理-删除对象") @ApiOperation(value = "Dnc对象管理-删除对象", notes = "Dnc对象管理-删除对象") @DeleteMapping("/delete") public ResponseResult deleteObjectById(@RequestParam("id") String id) { boolean b = objectService.deleteObjectById(id); if(b) { return new ResponseResult(CommonCode.SUCCESS); } return new ResponseResult(CommonCode.FAIL); } @AutoLog(value = "Dnc对象管理-指派对象的操作按钮") @ApiOperation(value = "Dnc对象管理-指派对象的操作按钮", notes = "Dnc对象管理-指派对象的操作按钮") @PostMapping("/assign/button/{objectId}") public ResponseResult assignButton(@PathVariable("objectId") String objectId, @RequestBody List