Commit bd635577 by Future

多人音视频邀请逻辑

parent 5d05869f
...@@ -32,6 +32,7 @@ import io.geekidea.springbootplus.framework.common.exception.BusinessException; ...@@ -32,6 +32,7 @@ import io.geekidea.springbootplus.framework.common.exception.BusinessException;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/** /**
* @Author wenzhida * @Author wenzhida
...@@ -58,6 +59,7 @@ public class MultiMeetServiceImpl implements MultiMeetService { ...@@ -58,6 +59,7 @@ public class MultiMeetServiceImpl implements MultiMeetService {
private ImMultiRtcRoomMemberService imMultiRtcRoomMemberService; private ImMultiRtcRoomMemberService imMultiRtcRoomMemberService;
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void invite(InviteToMultiMeetParam param) { public void invite(InviteToMultiMeetParam param) {
ImClient currentClient = imClientService.getCurrentClient(); ImClient currentClient = imClientService.getCurrentClient();
// 判断发起方必须在线 // 判断发起方必须在线
...@@ -93,18 +95,30 @@ public class MultiMeetServiceImpl implements MultiMeetService { ...@@ -93,18 +95,30 @@ public class MultiMeetServiceImpl implements MultiMeetService {
members.add(roomMemberDto); members.add(roomMemberDto);
} }
} }
List<ImMultiRtcRoomMember> roomMembersToSave = Lists.newArrayList();
for (String toClientId : param.getToClients()) { for (String toClientId : param.getToClients()) {
ImClient toClient = imClientService.getCacheImClient(currentClient.getFkAppid(), toClientId); ImClient toClient = imClientService.getCacheImClient(currentClient.getFkAppid(), toClientId);
if (toClient == null) { if (toClient == null) {
log.info("查无接收人信息 {}", toClientId); log.info("查无接收人信息 {}", toClientId);
continue; continue;
} }
ImMultiRtcRoomMember roomMember = new ImMultiRtcRoomMember();
roomMember.setId(SnowflakeUtil.getId());
roomMember.setFkRtcRoomId(rtcRoom.getId());
roomMember.setFkClientId(toClient.getId());
roomMember.setClientId(toClient.getClientId());
roomMember.setState(MultiRtcMemberStateEnum.CALLING.getCode());
roomMember.setCreateTime(new Date());
roomMember.setUpdateTime(new Date());
roomMembersToSave.add(roomMember);
RoomMemberDto roomMemberDto = new RoomMemberDto(); RoomMemberDto roomMemberDto = new RoomMemberDto();
roomMemberDto.setFkClientId(toClient.getId()); roomMemberDto.setFkClientId(toClient.getId());
roomMemberDto.setClientId(toClient.getClientId()); roomMemberDto.setClientId(toClient.getClientId());
roomMemberDto.setState(MultiRtcMemberStateEnum.CALLING.getCode()); roomMemberDto.setState(MultiRtcMemberStateEnum.CALLING.getCode());
members.add(roomMemberDto); members.add(roomMemberDto);
} }
imMultiRtcRoomMemberService.saveBatch(roomMembersToSave);
for (RoomMemberDto member : members) { for (RoomMemberDto member : members) {
// ws向接收方发送通知 // ws向接收方发送通知
MultiMeetInviteResponse multiMeetInviteResponse = new MultiMeetInviteResponse(); MultiMeetInviteResponse multiMeetInviteResponse = new MultiMeetInviteResponse();
......
...@@ -57,12 +57,6 @@ public class SysOperationLogServiceImpl extends BaseServiceImpl<SysOperationLogM ...@@ -57,12 +57,6 @@ public class SysOperationLogServiceImpl extends BaseServiceImpl<SysOperationLogM
return super.updateById(sysOperationLog); return super.updateById(sysOperationLog);
} }
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteSysOperationLog(Long id) throws Exception {
return super.removeById(id);
}
@Override @Override
public Paging<SysOperationLog> getSysOperationLogPageList(SysOperationLogPageParam sysOperationLogPageParam) throws Exception { public Paging<SysOperationLog> getSysOperationLogPageList(SysOperationLogPageParam sysOperationLogPageParam) throws Exception {
Page<SysOperationLog> page = new PageInfo<>(sysOperationLogPageParam, OrderItem.desc(getLambdaColumn(SysOperationLog::getCreateTime))); Page<SysOperationLog> page = new PageInfo<>(sysOperationLogPageParam, OrderItem.desc(getLambdaColumn(SysOperationLog::getCreateTime)));
...@@ -71,4 +65,10 @@ public class SysOperationLogServiceImpl extends BaseServiceImpl<SysOperationLogM ...@@ -71,4 +65,10 @@ public class SysOperationLogServiceImpl extends BaseServiceImpl<SysOperationLogM
return new Paging<SysOperationLog>(iPage); return new Paging<SysOperationLog>(iPage);
} }
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteSysOperationLog(Long id) throws Exception {
return super.removeById(id);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment