| | |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.modules.desk.entity.Notice; |
| | | import org.springblade.modules.remote.wrapper.RemoteWrapper; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | return R.data(pages); |
| | | } |
| | | |
| | | @GetMapping("/getSensings") |
| | | public R getSensing(String type){ |
| | | return R.data(remoteService.getRemoteList(type)); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入remote") |
| | | public R submit(@Valid @RequestBody Remote remote) { |
| | | if (remote.getReType().equals("0")) {//判断是否修改为展示 |
| | | //查找当前类型默认展示的数量 |
| | | List<Remote> remoteList = remoteService.findByType(remote); |
| | | if (remoteList.size() > 0) { |
| | | throw new org.springblade.core.log.exception.ServiceException(StringUtil.format("该类型已有默认展示,请先取消默认展示")); |
| | | } |
| | | } |
| | | return R.status(remoteService.saveOrUpdate(remote)); |
| | | } |
| | | |