| | |
| | | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.sxkj.fw.common.GenericConverter; |
| | | import org.sxkj.fw.device.dto.FwDevicePerShareDTO; |
| | | import org.sxkj.fw.device.entity.FwDevicePerShareEntity; |
| | | import org.sxkj.fw.device.vo.FwDevicePerShareVO; |
| | |
| | | import org.sxkj.fw.device.service.IFwDevicePerShareService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 设备权限分享表 控制器 |
| | |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入fwDevicePerShare") |
| | | public R save(@Valid @RequestBody FwDevicePerShareDTO fwDevicePerShare) { |
| | | FwDevicePerShareEntity fwDevicePerShareEntity = Objects.requireNonNull(BeanUtil.copy(fwDevicePerShare, FwDevicePerShareEntity.class)); |
| | | return R.status(fwDevicePerShareService.save(fwDevicePerShareEntity)); |
| | | public R save(@Valid @RequestBody List<FwDevicePerShareDTO> fwDevicePerShare) { |
| | | List<FwDevicePerShareEntity> collect = fwDevicePerShare.stream() |
| | | .map(entity -> GenericConverter.convert(entity, FwDevicePerShareEntity.class)) |
| | | .collect(Collectors.toList()); |
| | | return R.status(fwDevicePerShareService.saveBatch(collect)); |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 设备权限分享表 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(fwDevicePerShareService.deleteLogic(Func.toLongList(ids))); |
| | | } |
| | | // @PostMapping("/remove") |
| | | // @ApiOperationSupport(order = 7) |
| | | // @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | // public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | // return R.status(fwDevicePerShareService.deleteLogic(Func.toLongList(ids))); |
| | | // } |
| | | |
| | | } |