| | |
| | | if(Objects.nonNull(dto.getStartTime()) && Objects.nonNull(dto.getExpectedDuration())){ |
| | | dto.setEndTime(dto.getStartTime().plusMinutes(dto.getExpectedDuration())); |
| | | } |
| | | // 点击次数默认 0,避免后续自增时 NPE |
| | | if (Objects.isNull(dto.getClickCount())) { |
| | | dto.setClickCount(0); |
| | | } |
| | | |
| | | // 创建小鹅通直播 |
| | | // XiaoeLiveDTO xiaoeLiveDTO = new XiaoeLiveDTO(); |
| | |
| | | // if (dto.getStartTime().isBefore(LocalDateTime.now())) { |
| | | // return R.fail("直播已开始,无法编辑"); |
| | | // } |
| | | // 计算结束时间 |
| | | dto.setEndTime(dto.getStartTime().plusMinutes(dto.getExpectedDuration())); |
| | | // 计算结束时间(视频类型没有开始时间和预计时长,必须判空,否则编辑接口会 500) |
| | | if (Objects.nonNull(dto.getStartTime()) && Objects.nonNull(dto.getExpectedDuration())) { |
| | | dto.setEndTime(dto.getStartTime().plusMinutes(dto.getExpectedDuration())); |
| | | } |
| | | |
| | | // 编辑小鹅通直播 |
| | | // XiaoeLiveDTO xiaoeLiveDTO = new XiaoeLiveDTO(); |
| | |
| | | @GetMapping(value = "/getDetailById") |
| | | public R<TSysLive> getDetailById(@RequestParam String id) { |
| | | TSysLive sysLive = sysLiveService.getById(id); |
| | | // 查询次数自增 使用数据库原子更新操作 |
| | | sysLive.setClickCount(sysLive.getClickCount()+1); |
| | | // 查询次数自增(历史数据 click_count 可能为 NULL,需判空) |
| | | sysLive.setClickCount(Objects.isNull(sysLive.getClickCount()) ? 1 : sysLive.getClickCount() + 1); |
| | | sysLiveService.updateById(sysLive); |
| | | // 如果是诊所 |
| | | Integer roleType = tokenService.getLoginUser().getUser().getRoleType(); |