| 对比新文件 |
| | |
| | | package com.ruoyi.call.compare; |
| | | |
| | | import com.ruoyi.call.domain.ArdCallSessionUser; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Comparator; |
| | | import java.util.Date; |
| | | @Component |
| | | public class ArdCallSessionUserComparator implements Comparator<ArdCallSessionUser> { |
| | | |
| | | @Override |
| | | public int compare(ArdCallSessionUser o1, ArdCallSessionUser o2) { |
| | | Date createTime1 = o1.getArdCallHistory().getCreateTime(); |
| | | Date createTime2 = o2.getArdCallHistory().getCreateTime(); |
| | | // 根据 createTime 进行比较 |
| | | return createTime2.compareTo(createTime1); |
| | | } |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.controller; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.ruoyi.common.annotation.Anonymous; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.call.domain.ArdCallGroup; |
| | | import com.ruoyi.call.service.IArdCallGroupService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * 会话群组Controller |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-03 |
| | | */ |
| | | @Api(tags = "群聊-群组接口") |
| | | @RestController |
| | | @RequestMapping("/call/group") |
| | | @Anonymous |
| | | public class ArdCallGroupController extends BaseController { |
| | | @Autowired |
| | | private IArdCallGroupService ardCallGroupService; |
| | | |
| | | /** |
| | | * 查询群组列表 |
| | | */ |
| | | @ApiOperation("查询群组列表") |
| | | @ApiOperationSupport(ignoreParameters = {"ardCallGroupUsers","userIds","params"}) |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ArdCallGroup ardCallGroup) { |
| | | startPage(); |
| | | List<ArdCallGroup> list = ardCallGroupService.selectArdCallGroupList(ardCallGroup); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取群组详细信息 |
| | | */ |
| | | @ApiOperation("获取群组详细信息") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") String id) { |
| | | return success(ardCallGroupService.selectArdCallGroupById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增群组 |
| | | */ |
| | | @ApiOperation("新增群组") |
| | | @ApiOperationSupport(includeParameters = {"param.userIds","param.name"}) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ArdCallGroup ardCallGroup) { |
| | | return success(ardCallGroupService.insertArdCallGroup(ardCallGroup)); |
| | | } |
| | | |
| | | /** |
| | | * 修改群组 |
| | | */ |
| | | @ApiOperation("修改群组") |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ArdCallGroup ardCallGroup) { |
| | | return toAjax(ardCallGroupService.updateArdCallGroup(ardCallGroup)); |
| | | } |
| | | |
| | | /** |
| | | * 删除群组 |
| | | */ |
| | | @ApiOperation("删除群组") |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable String[] ids) { |
| | | return toAjax(ardCallGroupService.deleteArdCallGroupByIds(ids)); |
| | | } |
| | | |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.controller; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.ruoyi.common.annotation.Anonymous; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.call.domain.ArdCallGroupUser; |
| | | import com.ruoyi.call.service.IArdCallGroupUserService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * 群组用户中间Controller |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-03 |
| | | */ |
| | | @Api(tags = "群聊-群组用户接口") |
| | | @RestController |
| | | @RequestMapping("/call/groupuser") |
| | | @Anonymous |
| | | public class ArdCallGroupUserController extends BaseController { |
| | | @Autowired |
| | | private IArdCallGroupUserService ardCallGroupUserService; |
| | | |
| | | /** |
| | | * 查询群组用户中间列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ArdCallGroupUser ardCallGroupUser) { |
| | | startPage(); |
| | | List<ArdCallGroupUser> list = ardCallGroupUserService.selectArdCallGroupUserList(ardCallGroupUser); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取群组用户中间详细信息 |
| | | */ |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") String id) { |
| | | return success(ardCallGroupUserService.selectArdCallGroupUserById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增群组用户中间 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('call:groupuser:add')") |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ArdCallGroupUser ardCallGroupUser) { |
| | | return toAjax(ardCallGroupUserService.insertArdCallGroupUser(ardCallGroupUser)); |
| | | } |
| | | |
| | | /** |
| | | * 修改群组用户中间 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('call:groupuser:edit')") |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ArdCallGroupUser ardCallGroupUser) { |
| | | return toAjax(ardCallGroupUserService.updateArdCallGroupUser(ardCallGroupUser)); |
| | | } |
| | | |
| | | /** |
| | | * 删除群组用户中间 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('call:groupuser:remove')") |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable String[] ids) { |
| | | return toAjax(ardCallGroupUserService.deleteArdCallGroupUserByIds(ids)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询用户所在群组 |
| | | */ |
| | | @ApiOperation("查询用户所在群组") |
| | | @GetMapping(value = "/getGroupListByUserId/{userId}") |
| | | public AjaxResult getGroupListByUserId(@PathVariable("userId") String userId) { |
| | | return success(ardCallGroupUserService.getGroupListByUserId(userId)); |
| | | } |
| | | /** |
| | | * 不在群组的人员列表 |
| | | */ |
| | | @ApiOperation("不在群组的人员列表") |
| | | @GetMapping(value = "/notInGroupUsers/{groupId}") |
| | | public AjaxResult notInGroupUsers (@PathVariable("groupId") String groupId) { |
| | | return success(ardCallGroupUserService.notInGroupUsers(groupId)); |
| | | } |
| | | |
| | | /** |
| | | * 邀请群组成员 |
| | | */ |
| | | @ApiOperation("邀请群组成员") |
| | | @PostMapping("/addGroupUser") |
| | | public AjaxResult addGroupUser(String groupId, String[] userIds) { |
| | | return toAjax(ardCallGroupUserService.addGroupUser(groupId, userIds)); |
| | | } |
| | | /** |
| | | * 移除群组成员 |
| | | */ |
| | | @ApiOperation("移除群组成员") |
| | | @PostMapping("/removeGroupUser") |
| | | public AjaxResult removeGroupUser(String groupId, String[] userIds) { |
| | | return toAjax(ardCallGroupUserService.removeGroupUser(groupId, userIds)); |
| | | } |
| | | |
| | | |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.controller; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.ruoyi.common.annotation.Anonymous; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.call.domain.ArdCallHistory; |
| | | import com.ruoyi.call.service.IArdCallHistoryService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * 会话历史Controller |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-03 |
| | | */ |
| | | @Api(tags = "群聊-历史消息接口") |
| | | @RestController |
| | | @RequestMapping("/call/history") |
| | | @Anonymous |
| | | public class ArdCallHistoryController extends BaseController { |
| | | @Autowired |
| | | private IArdCallHistoryService ardCallHistoryService; |
| | | |
| | | /** |
| | | * 查询会话消息列表 |
| | | */ |
| | | @ApiOperation("查询会话消息列表") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ArdCallHistory ardCallHistory) { |
| | | startPage(); |
| | | List<ArdCallHistory> list = ardCallHistoryService.selectArdCallHistoryList(ardCallHistory); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取会话历史详细信息 |
| | | */ |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") String id) { |
| | | return success(ardCallHistoryService.selectArdCallHistoryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增会话消息 |
| | | */ |
| | | @ApiOperation("新增会话消息") |
| | | @ApiOperationSupport(includeParameters = {"param.userId","param.targetId", "param.sessionId", "param.content", "param.type"}) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ArdCallHistory ardCallHistory) { |
| | | return toAjax(ardCallHistoryService.insertArdCallHistory(ardCallHistory)); |
| | | } |
| | | |
| | | /** |
| | | * 修改会话消息 |
| | | */ |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ArdCallHistory ardCallHistory) { |
| | | return toAjax(ardCallHistoryService.updateArdCallHistory(ardCallHistory)); |
| | | } |
| | | |
| | | /** |
| | | * 删除会话消息 |
| | | */ |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable String[] ids) { |
| | | return toAjax(ardCallHistoryService.deleteArdCallHistoryByIds(ids)); |
| | | } |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.controller; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.ruoyi.common.annotation.Anonymous; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.call.domain.ArdCallSession; |
| | | import com.ruoyi.call.service.IArdCallSessionService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * 视频会话Controller |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-03 |
| | | */ |
| | | @Api(tags = "群聊-会话接口") |
| | | @RestController |
| | | @RequestMapping("/call/session") |
| | | @Anonymous |
| | | public class ArdCallSessionController extends BaseController { |
| | | @Autowired |
| | | private IArdCallSessionService ardCallSessionService; |
| | | |
| | | /** |
| | | * 查询会话列表 |
| | | */ |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ArdCallSession ardCallSession) { |
| | | startPage(); |
| | | List<ArdCallSession> list = ardCallSessionService.selectArdCallSessionList(ardCallSession); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取会话详细信息 |
| | | */ |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") String id) { |
| | | return success(ardCallSessionService.selectArdCallSessionById(id)); |
| | | } |
| | | /** |
| | | * 获取会话 |
| | | */ |
| | | @ApiOperation("获取会话") |
| | | @GetMapping(value = "/getSession") |
| | | public AjaxResult getSession(String type,String userId, String targetId) { |
| | | return success(ardCallSessionService.getSession(type,userId,targetId)); |
| | | } |
| | | /** |
| | | * 新增会话 |
| | | */ |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ArdCallSession ardCallSession) { |
| | | return success(ardCallSessionService.insertArdCallSession(ardCallSession)); |
| | | } |
| | | |
| | | /** |
| | | * 修改会话 |
| | | */ |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ArdCallSession ardCallSession) { |
| | | return toAjax(ardCallSessionService.updateArdCallSession(ardCallSession)); |
| | | } |
| | | |
| | | /** |
| | | * 删除会话 |
| | | */ |
| | | @ApiOperation("删除会话") |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable String[] ids) { |
| | | return toAjax(ardCallSessionService.deleteArdCallSessionByIds(ids)); |
| | | } |
| | | |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.controller; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.ruoyi.call.service.IArdCallUnreadMessagesService; |
| | | import com.ruoyi.common.annotation.Anonymous; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.call.domain.ArdCallSessionUser; |
| | | import com.ruoyi.call.service.IArdCallSessionUserService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * 会话用户中间表Controller |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-04 |
| | | */ |
| | | @Api(tags = "群聊-会话接口") |
| | | @RestController |
| | | @RequestMapping("/call/sessionuser") |
| | | @Anonymous |
| | | public class ArdCallSessionUserController extends BaseController { |
| | | @Autowired |
| | | private IArdCallSessionUserService ardCallSessionUserService; |
| | | @Autowired |
| | | private IArdCallUnreadMessagesService ardCallUnreadMessagesService; |
| | | /** |
| | | * 获取会话列表 |
| | | */ |
| | | @ApiOperation("获取会话列表") |
| | | @ApiOperationSupport(ignoreParameters = {"id","unReadCount","sessionId","targetId","type","params","ardCallHistory"}) |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ArdCallSessionUser ardCallSessionUser) { |
| | | startPage(); |
| | | List<ArdCallSessionUser> list = ardCallSessionUserService.selectArdCallSessionUserList(ardCallSessionUser); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 获取会话用户中间表详细信息 |
| | | */ |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") String id) { |
| | | return success(ardCallSessionUserService.selectArdCallSessionUserById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增会话用户中间表 |
| | | */ |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ArdCallSessionUser ardCallSessionUser) { |
| | | return toAjax(ardCallSessionUserService.insertArdCallSessionUser(ardCallSessionUser)); |
| | | } |
| | | |
| | | /** |
| | | * 修改会话用户中间表 |
| | | */ |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ArdCallSessionUser ardCallSessionUser) { |
| | | return toAjax(ardCallSessionUserService.updateArdCallSessionUser(ardCallSessionUser)); |
| | | } |
| | | |
| | | /** |
| | | * 删除会话用户中间表 |
| | | */ |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable String[] ids) { |
| | | return toAjax(ardCallSessionUserService.deleteArdCallSessionUserByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | | * 清除会话未读数量 |
| | | */ |
| | | @ApiOperation("清除会话未读数量") |
| | | @PostMapping("/clearUnReadCount") |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "sessionId", value = "会话id", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "userId", value = "用户id", required = true, dataType = "String")}) |
| | | public AjaxResult clearUnReadCount(String sessionId, String userId) { |
| | | return toAjax(ardCallUnreadMessagesService.clearUnReadCount(sessionId, userId)); |
| | | } |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.domain; |
| | | |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 会话群组对象 ard_call_group |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-03 |
| | | */ |
| | | public class ArdCallGroup extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private String id; |
| | | |
| | | /** |
| | | * 群名称 |
| | | */ |
| | | @Excel(name = "群名称") |
| | | private String name; |
| | | /** |
| | | * 群成员列表 |
| | | */ |
| | | private List<ArdCallGroupUser> ArdCallGroupUsers; |
| | | |
| | | /** |
| | | * 群成员id列表 |
| | | */ |
| | | private List<String> userIds; |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public List<ArdCallGroupUser> getArdCallGroupUsers() { |
| | | return ArdCallGroupUsers; |
| | | } |
| | | |
| | | public void setArdCallGroupUsers(List<ArdCallGroupUser> ardCallGroupUsers) { |
| | | ArdCallGroupUsers = ardCallGroupUsers; |
| | | } |
| | | |
| | | public List<String> getUserIds() { |
| | | return userIds; |
| | | } |
| | | |
| | | public void setUserIds(List<String> userIds) { |
| | | this.userIds = userIds; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("id", getId()) |
| | | .append("name", getName()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .toString(); |
| | | } |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.domain; |
| | | |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * 群组用户中间对象 ard_call_group_user |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-03 |
| | | */ |
| | | public class ArdCallGroupUser extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 主键 */ |
| | | private String id; |
| | | |
| | | /** 群组ID */ |
| | | @Excel(name = "群组ID") |
| | | private String groupId; |
| | | |
| | | /** 用户ID */ |
| | | @Excel(name = "用户ID") |
| | | private String userId; |
| | | |
| | | private SysUser sysUser; // 嵌套的 SysUser 对象 |
| | | |
| | | public void setId(String id) |
| | | { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getId() |
| | | { |
| | | return id; |
| | | } |
| | | public void setGroupId(String groupId) |
| | | { |
| | | this.groupId = groupId; |
| | | } |
| | | |
| | | public String getGroupId() |
| | | { |
| | | return groupId; |
| | | } |
| | | public void setUserId(String userId) |
| | | { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public String getUserId() |
| | | { |
| | | return userId; |
| | | } |
| | | |
| | | public SysUser getSysUser() { |
| | | return sysUser; |
| | | } |
| | | |
| | | public void setSysUser(SysUser sysUser) { |
| | | this.sysUser = sysUser; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("id", getId()) |
| | | .append("groupId", getGroupId()) |
| | | .append("userId", getUserId()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .toString(); |
| | | } |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.domain; |
| | | |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * 会话历史对象 ard_call_history |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-03 |
| | | */ |
| | | public class ArdCallHistory extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 主键 */ |
| | | private String id; |
| | | |
| | | /** 会话ID */ |
| | | @Excel(name = "会话ID") |
| | | private String sessionId; |
| | | /** 用户ID */ |
| | | @Excel(name = "用户ID") |
| | | private String userId; |
| | | /** 消息类型 */ |
| | | @Excel(name = "消息类型") |
| | | private String type; |
| | | |
| | | /** 消息内容 */ |
| | | @Excel(name = "消息内容") |
| | | private String content; |
| | | |
| | | /** 目标ID */ |
| | | @Excel(name = "目标ID") |
| | | private String targetId; |
| | | |
| | | public void setId(String id) |
| | | { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getId() |
| | | { |
| | | return id; |
| | | } |
| | | public void setType(String type) |
| | | { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getType() |
| | | { |
| | | return type; |
| | | } |
| | | public void setContent(String content) |
| | | { |
| | | this.content = content; |
| | | } |
| | | |
| | | public String getContent() |
| | | { |
| | | return content; |
| | | } |
| | | |
| | | public String getSessionId() { |
| | | return sessionId; |
| | | } |
| | | |
| | | public void setSessionId(String sessionId) { |
| | | this.sessionId = sessionId; |
| | | } |
| | | |
| | | public String getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | |
| | | public String getTargetId() { |
| | | return targetId; |
| | | } |
| | | |
| | | public void setTargetId(String targetId) { |
| | | this.targetId = targetId; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("id", getId()) |
| | | .append("type", getType()) |
| | | .append("content", getContent()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .toString(); |
| | | } |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.domain; |
| | | |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 视频会话对象 ard_call_session |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-03 |
| | | */ |
| | | public class ArdCallSession extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private String id; |
| | | |
| | | /** |
| | | * 会话类型 |
| | | */ |
| | | @Excel(name = "会话类型") |
| | | private String type; |
| | | |
| | | /** |
| | | * userId |
| | | */ |
| | | @Excel(name = "用户Id") |
| | | private String userId; |
| | | |
| | | /** |
| | | * 会话用户列表 |
| | | */ |
| | | private List<String> targetIds; |
| | | |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public String getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | |
| | | public List<String> getTargetIds() { |
| | | return targetIds; |
| | | } |
| | | |
| | | public void setTargetIds(List<String> targetIds) { |
| | | this.targetIds = targetIds; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("id", getId()) |
| | | .append("type", getType()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .toString(); |
| | | } |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.domain; |
| | | |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * 会话用户中间表对象 ard_call_session_user |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-04 |
| | | */ |
| | | public class ArdCallSessionUser extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 主键 */ |
| | | private String id; |
| | | |
| | | /** 会话id */ |
| | | @Excel(name = "会话id") |
| | | private String sessionId; |
| | | |
| | | /** 会话类型 */ |
| | | @Excel(name = "会话类型") |
| | | private String type; |
| | | |
| | | |
| | | /** 当前成员id */ |
| | | @Excel(name = "当前成员id") |
| | | private String userId; |
| | | |
| | | /** 目标成员id */ |
| | | @Excel(name = "目标成员id") |
| | | private String targetId; |
| | | |
| | | /** |
| | | * 最后一条消息 |
| | | */ |
| | | private ArdCallHistory ardCallHistory; |
| | | /** |
| | | * 未读消息数据量 |
| | | */ |
| | | private Integer unReadCount; |
| | | |
| | | |
| | | public ArdCallHistory getArdCallHistory() { |
| | | return ardCallHistory; |
| | | } |
| | | |
| | | public void setArdCallHistory(ArdCallHistory ardCallHistory) { |
| | | this.ardCallHistory = ardCallHistory; |
| | | } |
| | | |
| | | public Integer getUnReadCount() { |
| | | return unReadCount; |
| | | } |
| | | |
| | | public void setUnReadCount(Integer unReadCount) { |
| | | this.unReadCount = unReadCount; |
| | | } |
| | | |
| | | public void setId(String id) |
| | | { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getId() |
| | | { |
| | | return id; |
| | | } |
| | | public void setSessionId(String sessionId) |
| | | { |
| | | this.sessionId = sessionId; |
| | | } |
| | | |
| | | public String getSessionId() |
| | | { |
| | | return sessionId; |
| | | } |
| | | public void setType(String type) |
| | | { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getType() |
| | | { |
| | | return type; |
| | | } |
| | | |
| | | public String getTargetId() { |
| | | return targetId; |
| | | } |
| | | |
| | | public void setTargetId(String targetId) { |
| | | this.targetId = targetId; |
| | | } |
| | | |
| | | public String getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | this.userId = userId; |
| | | } |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.domain; |
| | | |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * 未读消息对象 ard_call_unread_messages |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-06 |
| | | */ |
| | | public class ArdCallUnreadMessages extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 用户id */ |
| | | @Excel(name = "用户id") |
| | | private String userId ; |
| | | |
| | | /** 会话id */ |
| | | @Excel(name = "会话id") |
| | | private String sessionId; |
| | | |
| | | /** 未读数量 */ |
| | | @Excel(name = "未读数量") |
| | | private Integer unreadCount; |
| | | |
| | | public void setUserId (String userId ) |
| | | { |
| | | this.userId = userId ; |
| | | } |
| | | |
| | | public String getUserId () |
| | | { |
| | | return userId ; |
| | | } |
| | | public void setSessionId(String sessionId) |
| | | { |
| | | this.sessionId = sessionId; |
| | | } |
| | | |
| | | public String getSessionId() |
| | | { |
| | | return sessionId; |
| | | } |
| | | public void setUnreadCount(Integer unreadCount) |
| | | { |
| | | this.unreadCount = unreadCount; |
| | | } |
| | | |
| | | public Integer getUnreadCount() |
| | | { |
| | | return unreadCount; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("userId ", getUserId ()) |
| | | .append("sessionId", getSessionId()) |
| | | .append("unreadCount", getUnreadCount()) |
| | | .toString(); |
| | | } |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.call.domain.ArdCallGroup; |
| | | |
| | | /** |
| | | * 会话群组Mapper接口 |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-03 |
| | | */ |
| | | public interface ArdCallGroupMapper |
| | | { |
| | | /** |
| | | * 查询会话群组 |
| | | * |
| | | * @param id 会话群组主键 |
| | | * @return 会话群组 |
| | | */ |
| | | public ArdCallGroup selectArdCallGroupById(String id); |
| | | |
| | | /** |
| | | * 查询会话群组列表 |
| | | * |
| | | * @param ardCallGroup 会话群组 |
| | | * @return 会话群组集合 |
| | | */ |
| | | public List<ArdCallGroup> selectArdCallGroupList(ArdCallGroup ardCallGroup); |
| | | |
| | | /** |
| | | * 新增会话群组 |
| | | * |
| | | * @param ardCallGroup 会话群组 |
| | | * @return 结果 |
| | | */ |
| | | public int insertArdCallGroup(ArdCallGroup ardCallGroup); |
| | | |
| | | /** |
| | | * 修改会话群组 |
| | | * |
| | | * @param ardCallGroup 会话群组 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdCallGroup(ArdCallGroup ardCallGroup); |
| | | |
| | | /** |
| | | * 删除会话群组 |
| | | * |
| | | * @param id 会话群组主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallGroupById(String id); |
| | | |
| | | /** |
| | | * 批量删除会话群组 |
| | | * |
| | | * @param ids 需要删除的数据主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallGroupByIds(String[] ids); |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.call.domain.ArdCallGroup; |
| | | import com.ruoyi.call.domain.ArdCallGroupUser; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 群组用户中间Mapper接口 |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-03 |
| | | */ |
| | | public interface ArdCallGroupUserMapper { |
| | | /** |
| | | * 查询群组用户中间 |
| | | * |
| | | * @param id 群组用户中间主键 |
| | | * @return 群组用户中间 |
| | | */ |
| | | public ArdCallGroupUser selectArdCallGroupUserById(String id); |
| | | |
| | | /** |
| | | * 查询群组用户中间列表 |
| | | * |
| | | * @param ardCallGroupUser 群组用户中间 |
| | | * @return 群组用户中间集合 |
| | | */ |
| | | public List<ArdCallGroupUser> selectArdCallGroupUserList(ArdCallGroupUser ardCallGroupUser); |
| | | |
| | | /** |
| | | * 新增群组用户中间 |
| | | * |
| | | * @param ardCallGroupUser 群组用户中间 |
| | | * @return 结果 |
| | | */ |
| | | public int insertArdCallGroupUser(ArdCallGroupUser ardCallGroupUser); |
| | | |
| | | /** |
| | | * 修改群组用户中间 |
| | | * |
| | | * @param ardCallGroupUser 群组用户中间 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdCallGroupUser(ArdCallGroupUser ardCallGroupUser); |
| | | |
| | | /** |
| | | * 删除群组用户中间 |
| | | * |
| | | * @param id 群组用户中间主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallGroupUserById(String id); |
| | | |
| | | /** |
| | | * 批量删除群组用户中间 |
| | | * |
| | | * @param ids 需要删除的数据主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallGroupUserByIds(String[] ids); |
| | | |
| | | /** |
| | | * 删除群组关联用户 |
| | | * |
| | | * @param groupId 群组主键 |
| | | * @return 结果 |
| | | */ |
| | | public int clearArdCallGroupUsers(String groupId); |
| | | |
| | | /** |
| | | * 移除群组用户 |
| | | * |
| | | * @param groupId 群组主键 |
| | | * @param userIds 群组用户数组集合 |
| | | * @return 结果 |
| | | */ |
| | | public int removeGroupUser(@Param("groupId") String groupId, @Param("userIds") String[] userIds); |
| | | |
| | | public List<ArdCallGroup> getGroupListByUserId(String userId); |
| | | |
| | | |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.call.domain.ArdCallHistory; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 会话历史Mapper接口 |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-03 |
| | | */ |
| | | public interface ArdCallHistoryMapper { |
| | | /** |
| | | * 查询会话历史 |
| | | * |
| | | * @param id 会话历史主键 |
| | | * @return 会话历史 |
| | | */ |
| | | public ArdCallHistory selectArdCallHistoryById(String id); |
| | | |
| | | /** |
| | | * 查询会话历史列表 |
| | | * |
| | | * @param ardCallHistory 会话历史 |
| | | * @return 会话历史集合 |
| | | */ |
| | | public List<ArdCallHistory> selectArdCallHistoryList(ArdCallHistory ardCallHistory); |
| | | |
| | | /** |
| | | * 新增会话历史 |
| | | * |
| | | * @param ardCallHistory 会话历史 |
| | | * @return 结果 |
| | | */ |
| | | public int insertArdCallHistory(ArdCallHistory ardCallHistory); |
| | | |
| | | /** |
| | | * 修改会话历史 |
| | | * |
| | | * @param ardCallHistory 会话历史 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdCallHistory(ArdCallHistory ardCallHistory); |
| | | |
| | | /** |
| | | * 删除会话历史 |
| | | * |
| | | * @param id 会话历史主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallHistoryById(String id); |
| | | |
| | | /** |
| | | * 批量删除会话历史 |
| | | * |
| | | * @param ids 需要删除的数据主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallHistoryByIds(String[] ids); |
| | | |
| | | |
| | | /** |
| | | * 获取最后一条会话历史 |
| | | * |
| | | * @param sessionId 会话id |
| | | * @return 结果 |
| | | */ |
| | | public ArdCallHistory selectLastArdCallHistory(@Param("sessionId") String sessionId); |
| | | |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.call.domain.ArdCallSession; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 视频会话Mapper接口 |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-03 |
| | | */ |
| | | public interface ArdCallSessionMapper { |
| | | /** |
| | | * 查询视频会话 |
| | | * |
| | | * @param id 视频会话主键 |
| | | * @return 视频会话 |
| | | */ |
| | | public ArdCallSession selectArdCallSessionById(String id); |
| | | |
| | | /** |
| | | * 查询视频会话列表 |
| | | * |
| | | * @param ardCallSession 视频会话 |
| | | * @return 视频会话集合 |
| | | */ |
| | | public List<ArdCallSession> selectArdCallSessionList(ArdCallSession ardCallSession); |
| | | |
| | | /** |
| | | * 新增视频会话 |
| | | * |
| | | * @param ardCallSession 视频会话 |
| | | * @return 结果 |
| | | */ |
| | | public int insertArdCallSession(ArdCallSession ardCallSession); |
| | | |
| | | /** |
| | | * 修改视频会话 |
| | | * |
| | | * @param ardCallSession 视频会话 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdCallSession(ArdCallSession ardCallSession); |
| | | |
| | | /** |
| | | * 删除视频会话 |
| | | * |
| | | * @param id 视频会话主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallSessionById(String id); |
| | | |
| | | /** |
| | | * 批量删除视频会话 |
| | | * |
| | | * @param ids 需要删除的数据主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallSessionByIds(String[] ids); |
| | | |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.call.domain.ArdCallSessionUser; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 会话用户中间表Mapper接口 |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-04 |
| | | */ |
| | | public interface ArdCallSessionUserMapper { |
| | | /** |
| | | * 查询会话用户中间表 |
| | | * |
| | | * @param id 会话用户中间表主键 |
| | | * @return 会话用户中间表 |
| | | */ |
| | | public ArdCallSessionUser selectArdCallSessionUserById(String id); |
| | | |
| | | /** |
| | | * 查询会话用户中间表列表 |
| | | * |
| | | * @param ardCallSessionUser 会话用户中间表 |
| | | * @return 会话用户中间表集合 |
| | | */ |
| | | public List<ArdCallSessionUser> selectArdCallSessionUserList(ArdCallSessionUser ardCallSessionUser); |
| | | |
| | | /** |
| | | * 新增会话用户中间表 |
| | | * |
| | | * @param ardCallSessionUser 会话用户中间表 |
| | | * @return 结果 |
| | | */ |
| | | public int insertArdCallSessionUser(ArdCallSessionUser ardCallSessionUser); |
| | | |
| | | /** |
| | | * 修改会话用户中间表 |
| | | * |
| | | * @param ardCallSessionUser 会话用户中间表 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdCallSessionUser(ArdCallSessionUser ardCallSessionUser); |
| | | |
| | | /** |
| | | * 删除会话用户中间表 |
| | | * |
| | | * @param id 会话用户中间表主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallSessionUserById(String id); |
| | | |
| | | /** |
| | | * 批量删除会话用户中间表 |
| | | * |
| | | * @param ids 需要删除的数据主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallSessionUserByIds(String[] ids); |
| | | |
| | | public String getSessionId(@Param("type") String type, @Param("userId") String userId, @Param("targetId") String targetId); |
| | | public String getGroupSessionId(@Param("type") String type, @Param("targetId") String targetId); |
| | | public int deleteArdCallSessionUserBySessionId(@Param("sessionId") String sessionId); |
| | | |
| | | |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.call.domain.ArdCallUnreadMessages; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | /** |
| | | * 未读消息Mapper接口 |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-06 |
| | | */ |
| | | public interface ArdCallUnreadMessagesMapper { |
| | | /** |
| | | * 查询未读消息 |
| | | * |
| | | * @param userId 未读消息主键 |
| | | * @return 未读消息 |
| | | */ |
| | | public ArdCallUnreadMessages selectArdCallUnreadMessagesByUserId(String userId); |
| | | |
| | | /** |
| | | * 查询未读消息列表 |
| | | * |
| | | * @param ardCallUnreadMessages 未读消息 |
| | | * @return 未读消息集合 |
| | | */ |
| | | public List<ArdCallUnreadMessages> selectArdCallUnreadMessagesList(ArdCallUnreadMessages ardCallUnreadMessages); |
| | | |
| | | /** |
| | | * 新增未读消息 |
| | | * |
| | | * @param ardCallUnreadMessages 未读消息 |
| | | * @return 结果 |
| | | */ |
| | | public int insertArdCallUnreadMessages(ArdCallUnreadMessages ardCallUnreadMessages); |
| | | |
| | | /** |
| | | * 修改未读消息 |
| | | * |
| | | * @param ardCallUnreadMessages 未读消息 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdCallUnreadMessages(ArdCallUnreadMessages ardCallUnreadMessages); |
| | | |
| | | /** |
| | | * 删除未读消息 |
| | | * |
| | | * @param userId 未读消息主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallUnreadMessagesByUserId(String userId); |
| | | |
| | | /** |
| | | * 批量删除未读消息 |
| | | * |
| | | * @param userId s 需要删除的数据主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallUnreadMessagesByUserId(String[] userId); |
| | | |
| | | @Select("select count(*) from ard_call_unread_messages where session_id=#{sessionId} and target_id=#{targetId}") |
| | | int countBySessionIdAnduserId(String sessionId, String userId); |
| | | |
| | | public ArdCallUnreadMessages getUnreadMessage(@Param("sessionId") String sessionId, @Param("targetId")String targetId); |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.service; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.call.domain.ArdCallGroup; |
| | | |
| | | /** |
| | | * 会话群组Service接口 |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-03 |
| | | */ |
| | | public interface IArdCallGroupService |
| | | { |
| | | /** |
| | | * 查询会话群组 |
| | | * |
| | | * @param id 会话群组主键 |
| | | * @return 会话群组 |
| | | */ |
| | | public ArdCallGroup selectArdCallGroupById(String id); |
| | | |
| | | /** |
| | | * 查询会话群组列表 |
| | | * |
| | | * @param ardCallGroup 会话群组 |
| | | * @return 会话群组集合 |
| | | */ |
| | | public List<ArdCallGroup> selectArdCallGroupList(ArdCallGroup ardCallGroup); |
| | | |
| | | /** |
| | | * 新增会话群组 |
| | | * |
| | | * @param ardCallGroup 会话群组 |
| | | * @return 结果 |
| | | */ |
| | | public String insertArdCallGroup(ArdCallGroup ardCallGroup); |
| | | |
| | | /** |
| | | * 修改会话群组 |
| | | * |
| | | * @param ardCallGroup 会话群组 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdCallGroup(ArdCallGroup ardCallGroup); |
| | | |
| | | /** |
| | | * 批量删除会话群组 |
| | | * |
| | | * @param ids 需要删除的会话群组主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallGroupByIds(String[] ids); |
| | | |
| | | /** |
| | | * 删除会话群组信息 |
| | | * |
| | | * @param id 会话群组主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallGroupById(String id); |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.service; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.call.domain.ArdCallGroup; |
| | | import com.ruoyi.call.domain.ArdCallGroupUser; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | |
| | | /** |
| | | * 群组用户中间Service接口 |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-03 |
| | | */ |
| | | public interface IArdCallGroupUserService { |
| | | /** |
| | | * 查询群组用户中间 |
| | | * |
| | | * @param id 群组用户中间主键 |
| | | * @return 群组用户中间 |
| | | */ |
| | | public ArdCallGroupUser selectArdCallGroupUserById(String id); |
| | | |
| | | /** |
| | | * 查询群组用户中间列表 |
| | | * |
| | | * @param ardCallGroupUser 群组用户中间 |
| | | * @return 群组用户中间集合 |
| | | */ |
| | | public List<ArdCallGroupUser> selectArdCallGroupUserList(ArdCallGroupUser ardCallGroupUser); |
| | | |
| | | /** |
| | | * 新增群组用户中间 |
| | | * |
| | | * @param ardCallGroupUser 群组用户中间 |
| | | * @return 结果 |
| | | */ |
| | | public int insertArdCallGroupUser(ArdCallGroupUser ardCallGroupUser); |
| | | |
| | | /** |
| | | * 修改群组用户中间 |
| | | * |
| | | * @param ardCallGroupUser 群组用户中间 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdCallGroupUser(ArdCallGroupUser ardCallGroupUser); |
| | | |
| | | /** |
| | | * 批量删除群组用户中间 |
| | | * |
| | | * @param ids 需要删除的群组用户中间主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallGroupUserByIds(String[] ids); |
| | | |
| | | /** |
| | | * 删除群组用户中间信息 |
| | | * |
| | | * @param id 群组用户中间主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallGroupUserById(String id); |
| | | |
| | | /** |
| | | * 查询用户所在群组 |
| | | * |
| | | * @param userId 群组用户 |
| | | * @return 结果 |
| | | */ |
| | | List<ArdCallGroup> getGroupListByUserId(String userId); |
| | | |
| | | /** |
| | | * 邀请群组用户 |
| | | * |
| | | * @param id 群组主键 |
| | | * @param userIds 群组用户数组集合 |
| | | * @return 结果 |
| | | */ |
| | | public int addGroupUser(String id, String[] userIds); |
| | | |
| | | /** |
| | | * 移除群组用户 |
| | | * |
| | | * @param id 群组主键 |
| | | * @param userIds 群组用户数组集合 |
| | | * @return 结果 |
| | | */ |
| | | public int removeGroupUser(String id, String[] userIds); |
| | | |
| | | /** |
| | | * 不在群组的人员列表 |
| | | * |
| | | * @param groupId 群组主键 |
| | | * @return 结果 |
| | | */ |
| | | List<SysUser> notInGroupUsers(String groupId); |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.service; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.call.domain.ArdCallHistory; |
| | | |
| | | /** |
| | | * 会话历史Service接口 |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-03 |
| | | */ |
| | | public interface IArdCallHistoryService |
| | | { |
| | | /** |
| | | * 查询会话历史 |
| | | * |
| | | * @param id 会话历史主键 |
| | | * @return 会话历史 |
| | | */ |
| | | public ArdCallHistory selectArdCallHistoryById(String id); |
| | | |
| | | /** |
| | | * 查询会话历史列表 |
| | | * |
| | | * @param ardCallHistory 会话历史 |
| | | * @return 会话历史集合 |
| | | */ |
| | | public List<ArdCallHistory> selectArdCallHistoryList(ArdCallHistory ardCallHistory); |
| | | |
| | | /** |
| | | * 新增会话历史 |
| | | * |
| | | * @param ardCallHistory 会话历史 |
| | | * @return 结果 |
| | | */ |
| | | public int insertArdCallHistory(ArdCallHistory ardCallHistory); |
| | | |
| | | /** |
| | | * 修改会话历史 |
| | | * |
| | | * @param ardCallHistory 会话历史 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdCallHistory(ArdCallHistory ardCallHistory); |
| | | |
| | | /** |
| | | * 批量删除会话历史 |
| | | * |
| | | * @param ids 需要删除的会话历史主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallHistoryByIds(String[] ids); |
| | | |
| | | /** |
| | | * 删除会话历史信息 |
| | | * |
| | | * @param id 会话历史主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallHistoryById(String id); |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.service; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.call.domain.ArdCallSession; |
| | | |
| | | /** |
| | | * 视频会话Service接口 |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-03 |
| | | */ |
| | | public interface IArdCallSessionService { |
| | | /** |
| | | * 查询视频会话 |
| | | * |
| | | * @param id 视频会话主键 |
| | | * @return 视频会话 |
| | | */ |
| | | public ArdCallSession selectArdCallSessionById(String id); |
| | | |
| | | /** |
| | | * 查询视频会话列表 |
| | | * |
| | | * @param ardCallSession 视频会话 |
| | | * @return 视频会话集合 |
| | | */ |
| | | public List<ArdCallSession> selectArdCallSessionList(ArdCallSession ardCallSession); |
| | | |
| | | /** |
| | | * 新增视频会话 |
| | | * |
| | | * @param ardCallSession 视频会话 |
| | | * @return 结果 |
| | | */ |
| | | public String insertArdCallSession(ArdCallSession ardCallSession); |
| | | |
| | | /** |
| | | * 修改视频会话 |
| | | * |
| | | * @param ardCallSession 视频会话 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdCallSession(ArdCallSession ardCallSession); |
| | | |
| | | /** |
| | | * 批量删除视频会话 |
| | | * |
| | | * @param ids 需要删除的视频会话主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallSessionByIds(String[] ids); |
| | | |
| | | /** |
| | | * 删除视频会话信息 |
| | | * |
| | | * @param id 视频会话主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallSessionById(String id); |
| | | |
| | | |
| | | /** |
| | | * 获取会话 |
| | | * |
| | | * @param type 会话类型 0单聊1群聊 |
| | | * @param userId 会话发送方 |
| | | * @param targetId 会话接收方 |
| | | * @return 结果 |
| | | */ |
| | | public String getSession(String type, String userId, String targetId); |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.service; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.call.domain.ArdCallSessionUser; |
| | | |
| | | /** |
| | | * 会话用户中间表Service接口 |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-04 |
| | | */ |
| | | public interface IArdCallSessionUserService { |
| | | /** |
| | | * 查询会话用户中间表 |
| | | * |
| | | * @param id 会话用户中间表主键 |
| | | * @return 会话用户中间表 |
| | | */ |
| | | public ArdCallSessionUser selectArdCallSessionUserById(String id); |
| | | |
| | | /** |
| | | * 查询会话用户中间表列表 |
| | | * |
| | | * @param ardCallSessionUser 会话用户中间表 |
| | | * @return 会话用户中间表集合 |
| | | */ |
| | | public List<ArdCallSessionUser> selectArdCallSessionUserList(ArdCallSessionUser ardCallSessionUser); |
| | | |
| | | /** |
| | | * 新增会话用户中间表 |
| | | * |
| | | * @param ardCallSessionUser 会话用户中间表 |
| | | * @return 结果 |
| | | */ |
| | | public int insertArdCallSessionUser(ArdCallSessionUser ardCallSessionUser); |
| | | |
| | | /** |
| | | * 修改会话用户中间表 |
| | | * |
| | | * @param ardCallSessionUser 会话用户中间表 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdCallSessionUser(ArdCallSessionUser ardCallSessionUser); |
| | | |
| | | /** |
| | | * 批量删除会话用户中间表 |
| | | * |
| | | * @param ids 需要删除的会话用户中间表主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallSessionUserByIds(String[] ids); |
| | | |
| | | /** |
| | | * 删除会话用户中间表信息 |
| | | * |
| | | * @param id 会话用户中间表主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallSessionUserById(String id); |
| | | |
| | | |
| | | /** |
| | | * 获取会话 |
| | | * |
| | | * @param type 会话类型 |
| | | * @param userId 用户id |
| | | * @param targetId 目标id |
| | | * @return 结果 |
| | | */ |
| | | public String getSessionId(String type, String userId, String targetId); |
| | | public String getGroupSessionId(String type,String targetId); |
| | | /** |
| | | * 通过sessionId删除关联用户 |
| | | * |
| | | * @param sessionId 目标id |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallSessionUserBySessionId(String sessionId); |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.service; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.call.domain.ArdCallUnreadMessages; |
| | | |
| | | /** |
| | | * 未读消息Service接口 |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-06 |
| | | */ |
| | | public interface IArdCallUnreadMessagesService |
| | | { |
| | | /** |
| | | * 查询未读消息 |
| | | * |
| | | * @param userId 未读消息主键 |
| | | * @return 未读消息 |
| | | */ |
| | | public ArdCallUnreadMessages selectArdCallUnreadMessagesByUserId (String userId ); |
| | | |
| | | /** |
| | | * 查询未读消息列表 |
| | | * |
| | | * @param ardCallUnreadMessages 未读消息 |
| | | * @return 未读消息集合 |
| | | */ |
| | | public List<ArdCallUnreadMessages> selectArdCallUnreadMessagesList(ArdCallUnreadMessages ardCallUnreadMessages); |
| | | |
| | | /** |
| | | * 新增未读消息 |
| | | * |
| | | * @param ardCallUnreadMessages 未读消息 |
| | | * @return 结果 |
| | | */ |
| | | public int insertArdCallUnreadMessages(ArdCallUnreadMessages ardCallUnreadMessages); |
| | | |
| | | /** |
| | | * 修改未读消息 |
| | | * |
| | | * @param ardCallUnreadMessages 未读消息 |
| | | * @return 结果 |
| | | */ |
| | | public int updateArdCallUnreadMessages(ArdCallUnreadMessages ardCallUnreadMessages); |
| | | |
| | | /** |
| | | * 批量删除未读消息 |
| | | * |
| | | * @param userId s 需要删除的未读消息主键集合 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallUnreadMessagesByUserId(String[] userId); |
| | | |
| | | /** |
| | | * 删除未读消息信息 |
| | | * |
| | | * @param userId 未读消息主键 |
| | | * @return 结果 |
| | | */ |
| | | public int deleteArdCallUnreadMessagesByUserId (String userId ); |
| | | |
| | | /** |
| | | * 清除会话未读数量 |
| | | * |
| | | * @param sessionId 会话id |
| | | * @param userId 用户id |
| | | * @return 结果 |
| | | */ |
| | | public int clearUnReadCount(String sessionId,String userId); |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.service.impl; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.call.domain.ArdCallGroupUser; |
| | | import com.ruoyi.call.mapper.ArdCallGroupUserMapper; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.call.mapper.ArdCallGroupMapper; |
| | | import com.ruoyi.call.domain.ArdCallGroup; |
| | | import com.ruoyi.call.service.IArdCallGroupService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 会话群组Service业务层处理 |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-03 |
| | | */ |
| | | @Service |
| | | public class ArdCallGroupServiceImpl implements IArdCallGroupService { |
| | | @Resource |
| | | private ArdCallGroupMapper ardCallGroupMapper; |
| | | @Resource |
| | | private ArdCallGroupUserMapper ardCallGroupUserMapper; |
| | | |
| | | /** |
| | | * 查询会话群组 |
| | | * |
| | | * @param id 会话群组主键 |
| | | * @return 会话群组 |
| | | */ |
| | | @Override |
| | | public ArdCallGroup selectArdCallGroupById(String id) { |
| | | return ardCallGroupMapper.selectArdCallGroupById(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询会话群组列表 |
| | | * |
| | | * @param ardCallGroup 会话群组 |
| | | * @return 会话群组 |
| | | */ |
| | | @Override |
| | | public List<ArdCallGroup> selectArdCallGroupList(ArdCallGroup ardCallGroup) { |
| | | return ardCallGroupMapper.selectArdCallGroupList(ardCallGroup); |
| | | } |
| | | |
| | | /** |
| | | * 新增会话群组 |
| | | * |
| | | * @param ardCallGroup 会话群组 |
| | | * @return 结果 |
| | | */ |
| | | @Transactional |
| | | @Override |
| | | public String insertArdCallGroup(ArdCallGroup ardCallGroup) { |
| | | ardCallGroup.setId(IdUtils.simpleUUID()); |
| | | ardCallGroup.setCreateTime(DateUtils.getNowDate()); |
| | | ardCallGroup.getUserIds().stream().forEach(userId -> { |
| | | ArdCallGroupUser groupUser = new ArdCallGroupUser(); |
| | | groupUser.setId(IdUtils.simpleUUID()); |
| | | groupUser.setGroupId(ardCallGroup.getId()); |
| | | groupUser.setUserId(userId); |
| | | groupUser.setCreateTime(DateUtils.getNowDate()); |
| | | ardCallGroupUserMapper.insertArdCallGroupUser(groupUser); |
| | | }); |
| | | ardCallGroupMapper.insertArdCallGroup(ardCallGroup); |
| | | return ardCallGroup.getId(); |
| | | } |
| | | |
| | | /** |
| | | * 修改会话群组 |
| | | * |
| | | * @param ardCallGroup 会话群组 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateArdCallGroup(ArdCallGroup ardCallGroup) { |
| | | ardCallGroup.setUpdateBy(SecurityUtils.getUsername()); |
| | | ardCallGroup.setUpdateTime(DateUtils.getNowDate()); |
| | | return ardCallGroupMapper.updateArdCallGroup(ardCallGroup); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除会话群组 |
| | | * |
| | | * @param ids 需要删除的会话群组主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteArdCallGroupByIds(String[] ids) { |
| | | Arrays.stream(ids).forEach(id -> { |
| | | ardCallGroupUserMapper.clearArdCallGroupUsers(id); |
| | | }); |
| | | return ardCallGroupMapper.deleteArdCallGroupByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * 删除会话群组信息 |
| | | * |
| | | * @param id 会话群组主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteArdCallGroupById(String id) { |
| | | ardCallGroupUserMapper.clearArdCallGroupUsers(id); |
| | | return ardCallGroupMapper.deleteArdCallGroupById(id); |
| | | } |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.service.impl; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.call.domain.ArdCallGroup; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.call.mapper.ArdCallGroupUserMapper; |
| | | import com.ruoyi.call.domain.ArdCallGroupUser; |
| | | import com.ruoyi.call.service.IArdCallGroupUserService; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 群组用户中间Service业务层处理 |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-03 |
| | | */ |
| | | @Service |
| | | public class ArdCallGroupUserServiceImpl implements IArdCallGroupUserService { |
| | | @Resource |
| | | private ArdCallGroupUserMapper ardCallGroupUserMapper; |
| | | @Resource |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | /** |
| | | * 查询群组用户中间 |
| | | * |
| | | * @param id 群组用户中间主键 |
| | | * @return 群组用户中间 |
| | | */ |
| | | @Override |
| | | public ArdCallGroupUser selectArdCallGroupUserById(String id) { |
| | | return ardCallGroupUserMapper.selectArdCallGroupUserById(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询群组用户中间列表 |
| | | * |
| | | * @param ardCallGroupUser 群组用户中间 |
| | | * @return 群组用户中间 |
| | | */ |
| | | @Override |
| | | public List<ArdCallGroupUser> selectArdCallGroupUserList(ArdCallGroupUser ardCallGroupUser) { |
| | | return ardCallGroupUserMapper.selectArdCallGroupUserList(ardCallGroupUser); |
| | | } |
| | | |
| | | /** |
| | | * 新增群组用户中间 |
| | | * |
| | | * @param ardCallGroupUser 群组用户中间 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertArdCallGroupUser(ArdCallGroupUser ardCallGroupUser) { |
| | | ardCallGroupUser.setId(IdUtils.simpleUUID()); |
| | | ardCallGroupUser.setUserId(SecurityUtils.getUserId()); |
| | | ardCallGroupUser.setCreateBy(SecurityUtils.getUsername()); |
| | | ardCallGroupUser.setCreateTime(DateUtils.getNowDate()); |
| | | return ardCallGroupUserMapper.insertArdCallGroupUser(ardCallGroupUser); |
| | | } |
| | | |
| | | /** |
| | | * 修改群组用户中间 |
| | | * |
| | | * @param ardCallGroupUser 群组用户中间 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateArdCallGroupUser(ArdCallGroupUser ardCallGroupUser) { |
| | | ardCallGroupUser.setUpdateBy(SecurityUtils.getUsername()); |
| | | ardCallGroupUser.setUpdateTime(DateUtils.getNowDate()); |
| | | return ardCallGroupUserMapper.updateArdCallGroupUser(ardCallGroupUser); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除群组用户中间 |
| | | * |
| | | * @param ids 需要删除的群组用户中间主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteArdCallGroupUserByIds(String[] ids) { |
| | | return ardCallGroupUserMapper.deleteArdCallGroupUserByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * 删除群组用户中间信息 |
| | | * |
| | | * @param id 群组用户中间主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteArdCallGroupUserById(String id) { |
| | | return ardCallGroupUserMapper.deleteArdCallGroupUserById(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<ArdCallGroup> getGroupListByUserId(String userId) { |
| | | return ardCallGroupUserMapper.getGroupListByUserId(userId); |
| | | } |
| | | |
| | | /** |
| | | * 邀请群组用户 |
| | | * |
| | | * @param id 群组主键 |
| | | * @param userIds 群组用户数组集合 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int addGroupUser(String id, String[] userIds) { |
| | | ArdCallGroupUser ardCallGroupUser = new ArdCallGroupUser(); |
| | | ardCallGroupUser.setGroupId(id); |
| | | Arrays.stream(userIds).forEach(userId -> { |
| | | ardCallGroupUser.setId(IdUtils.simpleUUID()); |
| | | ardCallGroupUser.setCreateTime(DateUtils.getNowDate()); |
| | | ardCallGroupUser.setUserId(userId); |
| | | ardCallGroupUserMapper.insertArdCallGroupUser(ardCallGroupUser); |
| | | }); |
| | | return userIds.length; |
| | | } |
| | | |
| | | /** |
| | | * 移除群组用户 |
| | | * |
| | | * @param id 群组主键 |
| | | * @param userIds 群组用户数组集合 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int removeGroupUser(String id, String[] userIds) { |
| | | return ardCallGroupUserMapper.removeGroupUser(id, userIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<SysUser> notInGroupUsers(String groupId) { |
| | | //获取平台所有用户 |
| | | List<SysUser> userList = sysUserMapper.selectUserList(new SysUser()); |
| | | //获取群组内用户 |
| | | ArdCallGroupUser ardCallGroupUser=new ArdCallGroupUser(); |
| | | ardCallGroupUser.setGroupId(groupId); |
| | | List<ArdCallGroupUser> ardCallGroupUsers = ardCallGroupUserMapper.selectArdCallGroupUserList(ardCallGroupUser); |
| | | // 提取groupList中的userId到一个Set中 |
| | | Set<String> groupUserIds = ardCallGroupUsers.stream() |
| | | .map(ArdCallGroupUser::getUserId) |
| | | .collect(Collectors.toSet()); |
| | | // 过滤userList,只保留那些userId不在groupUserIds中的User对象 |
| | | List<SysUser> filteredUserList = userList.stream() |
| | | .filter(user -> !groupUserIds.contains(user.getUserId())) |
| | | .collect(Collectors.toList()); |
| | | return filteredUserList; |
| | | } |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.service.impl; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.call.domain.*; |
| | | import com.ruoyi.call.mapper.*; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | |
| | | import com.ruoyi.common.utils.MessageUtils; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.utils.websocket.util.WebSocketUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.call.service.IArdCallHistoryService; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import static com.ruoyi.utils.websocket.util.WebSocketUtils.ONLINE_USER_SESSIONS; |
| | | |
| | | /** |
| | | * 会话历史Service业务层处理 |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-03 |
| | | */ |
| | | @Service |
| | | public class ArdCallHistoryServiceImpl implements IArdCallHistoryService { |
| | | @Resource |
| | | private ArdCallHistoryMapper ardCallHistoryMapper; |
| | | @Resource |
| | | private ArdCallSessionMapper ardCallSessionMapper; |
| | | @Resource |
| | | private ArdCallUnreadMessagesMapper ardCallUnreadMessagesMapper; |
| | | @Resource |
| | | private ArdCallGroupUserMapper ardCallGroupUserMapper; |
| | | |
| | | /** |
| | | * 查询会话历史 |
| | | * |
| | | * @param id 会话历史主键 |
| | | * @return 会话历史 |
| | | */ |
| | | @Override |
| | | public ArdCallHistory selectArdCallHistoryById(String id) { |
| | | return ardCallHistoryMapper.selectArdCallHistoryById(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询会话历史列表 |
| | | * |
| | | * @param ardCallHistory 会话历史 |
| | | * @return 会话历史 |
| | | */ |
| | | @Override |
| | | public List<ArdCallHistory> selectArdCallHistoryList(ArdCallHistory ardCallHistory) { |
| | | return ardCallHistoryMapper.selectArdCallHistoryList(ardCallHistory); |
| | | } |
| | | |
| | | /** |
| | | * 新增会话历史 |
| | | * |
| | | * @param ardCallHistory 会话历史 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertArdCallHistory(ArdCallHistory ardCallHistory) { |
| | | ardCallHistory.setId(IdUtils.simpleUUID()); |
| | | ardCallHistory.setCreateTime(DateUtils.getNowDate()); |
| | | ArdCallSession ardCallSession = ardCallSessionMapper.selectArdCallSessionById(ardCallHistory.getSessionId()); |
| | | if (ardCallSession.getType().equals("0")) { |
| | | //更新单聊用户未读消息计数 |
| | | ArdCallUnreadMessages ardCallUnreadMessages = ardCallUnreadMessagesMapper.getUnreadMessage(ardCallHistory.getSessionId(), ardCallHistory.getTargetId()); |
| | | if (ardCallUnreadMessages == null) { |
| | | ardCallUnreadMessages = new ArdCallUnreadMessages(); |
| | | ardCallUnreadMessages.setUserId(ardCallHistory.getTargetId()); |
| | | ardCallUnreadMessages.setSessionId(ardCallHistory.getSessionId()); |
| | | ardCallUnreadMessages.setUnreadCount(1); |
| | | ardCallUnreadMessagesMapper.insertArdCallUnreadMessages(ardCallUnreadMessages); |
| | | } else { |
| | | ardCallUnreadMessages.setUnreadCount(ardCallUnreadMessages.getUnreadCount() + 1); |
| | | ardCallUnreadMessagesMapper.updateArdCallUnreadMessages(ardCallUnreadMessages); |
| | | } |
| | | //websocket发送给targetId |
| | | WebSocketUtils.sendMessage(ONLINE_USER_SESSIONS.get(ardCallHistory.getTargetId()),ardCallHistory.getContent()); |
| | | } else { |
| | | //更新群聊用户未读消息计数 |
| | | ArdCallGroupUser ardCallGroupUser = new ArdCallGroupUser(); |
| | | ardCallGroupUser.setGroupId(ardCallHistory.getTargetId()); |
| | | List<ArdCallGroupUser> ardCallGroupUsers = ardCallGroupUserMapper.selectArdCallGroupUserList(ardCallGroupUser); |
| | | ardCallGroupUsers.stream().forEach(groupUser -> { |
| | | if (!ardCallHistory.getUserId().equals(groupUser.getUserId())) { |
| | | //对群里除了自己外其他用户更新未读消息 |
| | | ArdCallUnreadMessages ardCallUnreadMessages = ardCallUnreadMessagesMapper.getUnreadMessage(ardCallHistory.getSessionId(), groupUser.getUserId()); |
| | | if (ardCallUnreadMessages == null) { |
| | | ardCallUnreadMessages = new ArdCallUnreadMessages(); |
| | | ardCallUnreadMessages.setUserId(groupUser.getUserId()); |
| | | ardCallUnreadMessages.setSessionId(ardCallHistory.getSessionId()); |
| | | ardCallUnreadMessages.setUnreadCount(1); |
| | | ardCallUnreadMessagesMapper.insertArdCallUnreadMessages(ardCallUnreadMessages); |
| | | } else { |
| | | ardCallUnreadMessages.setUnreadCount(ardCallUnreadMessages.getUnreadCount() + 1); |
| | | ardCallUnreadMessagesMapper.updateArdCallUnreadMessages(ardCallUnreadMessages); |
| | | } |
| | | } |
| | | //websocket发送给targetId |
| | | WebSocketUtils.sendMessage(ONLINE_USER_SESSIONS.get(groupUser.getUserId()),ardCallHistory.getContent()); |
| | | }); |
| | | |
| | | } |
| | | return ardCallHistoryMapper.insertArdCallHistory(ardCallHistory); |
| | | } |
| | | |
| | | /** |
| | | * 修改会话历史 |
| | | * |
| | | * @param ardCallHistory 会话历史 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateArdCallHistory(ArdCallHistory ardCallHistory) { |
| | | ardCallHistory.setUpdateBy(SecurityUtils.getUsername()); |
| | | ardCallHistory.setUpdateTime(DateUtils.getNowDate()); |
| | | return ardCallHistoryMapper.updateArdCallHistory(ardCallHistory); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除会话历史 |
| | | * |
| | | * @param ids 需要删除的会话历史主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteArdCallHistoryByIds(String[] ids) { |
| | | return ardCallHistoryMapper.deleteArdCallHistoryByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * 删除会话历史信息 |
| | | * |
| | | * @param id 会话历史主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteArdCallHistoryById(String id) { |
| | | return ardCallHistoryMapper.deleteArdCallHistoryById(id); |
| | | } |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.service.impl; |
| | | |
| | | import com.ruoyi.call.domain.ArdCallGroup; |
| | | import com.ruoyi.call.domain.ArdCallSession; |
| | | import com.ruoyi.call.domain.ArdCallSessionUser; |
| | | import com.ruoyi.call.mapper.ArdCallSessionMapper; |
| | | import com.ruoyi.call.service.IArdCallGroupService; |
| | | import com.ruoyi.call.service.IArdCallGroupUserService; |
| | | import com.ruoyi.call.service.IArdCallSessionService; |
| | | import com.ruoyi.call.service.IArdCallSessionUserService; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 视频会话Service业务层处理 |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-03 |
| | | */ |
| | | @Service |
| | | public class ArdCallSessionServiceImpl implements IArdCallSessionService { |
| | | @Resource |
| | | private ArdCallSessionMapper ardCallSessionMapper; |
| | | @Resource |
| | | private IArdCallSessionUserService ardCallSessionUserService; |
| | | @Resource |
| | | private IArdCallGroupService ardCallGroupService; |
| | | |
| | | /** |
| | | * 查询视频会话 |
| | | * |
| | | * @param id 视频会话主键 |
| | | * @return 视频会话 |
| | | */ |
| | | @Override |
| | | public ArdCallSession selectArdCallSessionById(String id) { |
| | | return ardCallSessionMapper.selectArdCallSessionById(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询视频会话列表 |
| | | * |
| | | * @param ardCallSession 视频会话 |
| | | * @return 视频会话 |
| | | */ |
| | | @Override |
| | | public List<ArdCallSession> selectArdCallSessionList(ArdCallSession ardCallSession) { |
| | | List<ArdCallSession> ardCallSessions = ardCallSessionMapper.selectArdCallSessionList(ardCallSession); |
| | | return ardCallSessions; |
| | | } |
| | | |
| | | /** |
| | | * 新增视频会话 |
| | | * |
| | | * @param ardCallSession 视频会话 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public String insertArdCallSession(ArdCallSession ardCallSession) { |
| | | ardCallSession.setId(IdUtils.simpleUUID()); |
| | | ardCallSession.setCreateTime(DateUtils.getNowDate()); |
| | | ardCallSessionMapper.insertArdCallSession(ardCallSession); |
| | | return ardCallSession.getId(); |
| | | } |
| | | |
| | | /** |
| | | * 修改视频会话 |
| | | * |
| | | * @param ardCallSession 视频会话 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateArdCallSession(ArdCallSession ardCallSession) { |
| | | ardCallSession.setUpdateBy(SecurityUtils.getUsername()); |
| | | ardCallSession.setUpdateTime(DateUtils.getNowDate()); |
| | | return ardCallSessionMapper.updateArdCallSession(ardCallSession); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除视频会话 |
| | | * |
| | | * @param ids 需要删除的视频会话主键 |
| | | * @return 结果 |
| | | */ |
| | | @Transactional |
| | | @Override |
| | | public int |
| | | deleteArdCallSessionByIds(String[] ids) { |
| | | Arrays.stream(ids).forEach(id -> { |
| | | ardCallSessionUserService.deleteArdCallSessionUserBySessionId(id); |
| | | }); |
| | | return ardCallSessionMapper.deleteArdCallSessionByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * 删除视频会话信息 |
| | | * |
| | | * @param id 视频会话主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteArdCallSessionById(String id) { |
| | | return ardCallSessionMapper.deleteArdCallSessionById(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取会话 |
| | | * |
| | | * @param type 会话类型 |
| | | * @param userId 会话发起方 |
| | | * @param targetId 会话接收方 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public String getSession(String type, String userId, String targetId) { |
| | | String sessionId = ""; |
| | | if (type.equals("0")) { |
| | | //单聊 |
| | | sessionId = ardCallSessionUserService.getSessionId(type, userId, targetId); |
| | | if (StringUtils.isEmpty(sessionId)) { |
| | | //创建单聊双方的会话 |
| | | ArdCallSession ardCallSession = new ArdCallSession(); |
| | | ardCallSession.setType(type); |
| | | sessionId = insertArdCallSession(ardCallSession); |
| | | ArdCallSessionUser ardCallSessionUser = new ArdCallSessionUser(); |
| | | ardCallSessionUser.setSessionId(sessionId); |
| | | ardCallSessionUser.setUserId(userId); |
| | | ardCallSessionUser.setTargetId(targetId); |
| | | ardCallSessionUser.setType(type); |
| | | ardCallSessionUserService.insertArdCallSessionUser(ardCallSessionUser);//创建主叫关联 |
| | | ardCallSessionUser.setUserId(targetId); |
| | | ardCallSessionUser.setTargetId(userId); |
| | | ardCallSessionUserService.insertArdCallSessionUser(ardCallSessionUser);//创建被叫关联 |
| | | } |
| | | } else { |
| | | //群聊 |
| | | sessionId = ardCallSessionUserService.getGroupSessionId(type, targetId); |
| | | if (StringUtils.isEmpty(sessionId)) { |
| | | //若不存在群聊session直接则分别创建所有群用户的session |
| | | ArdCallSession ardCallSession = new ArdCallSession(); |
| | | ardCallSession.setType(type); |
| | | sessionId = insertArdCallSession(ardCallSession); |
| | | |
| | | //获取群用户列表 |
| | | ArdCallGroup ardCallGroup = ardCallGroupService.selectArdCallGroupById(targetId); |
| | | if(ardCallGroup!=null) |
| | | { |
| | | String finalSessionId = sessionId; |
| | | ardCallGroup.getArdCallGroupUsers().stream().forEach(groupUser -> { |
| | | ArdCallSessionUser ardCallSessionUser = new ArdCallSessionUser(); |
| | | ardCallSessionUser.setSessionId(finalSessionId); |
| | | ardCallSessionUser.setType(type); |
| | | ardCallSessionUser.setUserId(groupUser.getUserId()); |
| | | ardCallSessionUser.setTargetId(targetId); |
| | | ardCallSessionUserService.insertArdCallSessionUser(ardCallSessionUser); |
| | | }); |
| | | } |
| | | } else { |
| | | //获取自己的session |
| | | sessionId = ardCallSessionUserService.getSessionId(type, userId, targetId); |
| | | } |
| | | } |
| | | return sessionId; |
| | | } |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.service.impl; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.call.compare.ArdCallSessionUserComparator; |
| | | import com.ruoyi.call.domain.ArdCallGroupUser; |
| | | import com.ruoyi.call.domain.ArdCallHistory; |
| | | import com.ruoyi.call.domain.ArdCallUnreadMessages; |
| | | import com.ruoyi.call.mapper.ArdCallGroupUserMapper; |
| | | import com.ruoyi.call.mapper.ArdCallHistoryMapper; |
| | | import com.ruoyi.call.mapper.ArdCallUnreadMessagesMapper; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.call.mapper.ArdCallSessionUserMapper; |
| | | import com.ruoyi.call.domain.ArdCallSessionUser; |
| | | import com.ruoyi.call.service.IArdCallSessionUserService; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 会话用户中间表Service业务层处理 |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-04 |
| | | */ |
| | | @Service |
| | | public class ArdCallSessionUserServiceImpl implements IArdCallSessionUserService { |
| | | @Resource |
| | | private ArdCallSessionUserMapper ardCallSessionUserMapper; |
| | | @Resource |
| | | private ArdCallHistoryMapper ardCallHistoryMapper; |
| | | @Resource |
| | | private ArdCallSessionUserComparator ardCallSessionUserComparator; |
| | | @Resource |
| | | private ArdCallUnreadMessagesMapper ardCallUnreadMessagesMapper; |
| | | |
| | | /** |
| | | * 查询会话用户中间表 |
| | | * |
| | | * @param id 会话用户中间表主键 |
| | | * @return 会话用户中间表 |
| | | */ |
| | | @Override |
| | | public ArdCallSessionUser selectArdCallSessionUserById(String id) { |
| | | return ardCallSessionUserMapper.selectArdCallSessionUserById(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询会话用户中间表列表 |
| | | * |
| | | * @param ardCallSessionUser 会话用户中间表 |
| | | * @return 会话用户中间表 |
| | | */ |
| | | @Override |
| | | public List<ArdCallSessionUser> selectArdCallSessionUserList(ArdCallSessionUser ardCallSessionUser) { |
| | | //获取用户的会话/未读消息数量/最后一条消息 |
| | | List<ArdCallSessionUser> ardCallSessionUsers = ardCallSessionUserMapper.selectArdCallSessionUserList(ardCallSessionUser); |
| | | ardCallSessionUsers.stream().forEach(callSessionUser -> { |
| | | ArdCallUnreadMessages ardCallUnreadMessages = ardCallUnreadMessagesMapper.getUnreadMessage(callSessionUser.getSessionId(), ardCallSessionUser.getUserId()); |
| | | if (ardCallUnreadMessages != null) { |
| | | callSessionUser.setUnReadCount(ardCallUnreadMessages.getUnreadCount()); |
| | | } else { |
| | | callSessionUser.setUnReadCount(0); |
| | | } |
| | | //获取最后一条消息实体 |
| | | ArdCallHistory ardCallHistory = ardCallHistoryMapper.selectLastArdCallHistory(callSessionUser.getSessionId()); |
| | | callSessionUser.setArdCallHistory(ardCallHistory); |
| | | }); |
| | | //过滤掉没有历史记录的会话 |
| | | ardCallSessionUsers = ardCallSessionUsers.stream().filter(obj -> obj.getArdCallHistory() != null).collect(Collectors.toList()); |
| | | // 使用定义的 ardCallSessionUserComparator 进行排序 |
| | | Collections.sort(ardCallSessionUsers, ardCallSessionUserComparator); |
| | | return ardCallSessionUsers; |
| | | } |
| | | |
| | | /** |
| | | * 新增会话用户中间表 |
| | | * |
| | | * @param ardCallSessionUser 会话用户中间表 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertArdCallSessionUser(ArdCallSessionUser ardCallSessionUser) { |
| | | ardCallSessionUser.setId(IdUtils.simpleUUID()); |
| | | ardCallSessionUser.setCreateTime(DateUtils.getNowDate()); |
| | | return ardCallSessionUserMapper.insertArdCallSessionUser(ardCallSessionUser); |
| | | } |
| | | |
| | | /** |
| | | * 修改会话用户中间表 |
| | | * |
| | | * @param ardCallSessionUser 会话用户中间表 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateArdCallSessionUser(ArdCallSessionUser ardCallSessionUser) { |
| | | return ardCallSessionUserMapper.updateArdCallSessionUser(ardCallSessionUser); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除会话用户中间表 |
| | | * |
| | | * @param ids 需要删除的会话用户中间表主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteArdCallSessionUserByIds(String[] ids) { |
| | | return ardCallSessionUserMapper.deleteArdCallSessionUserByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * 删除会话用户中间表信息 |
| | | * |
| | | * @param id 会话用户中间表主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteArdCallSessionUserById(String id) { |
| | | return ardCallSessionUserMapper.deleteArdCallSessionUserById(id); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String getSessionId(String type, String userId, String targetId) { |
| | | return ardCallSessionUserMapper.getSessionId(type, userId, targetId); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteArdCallSessionUserBySessionId(String sessionId) { |
| | | return ardCallSessionUserMapper.deleteArdCallSessionUserBySessionId(sessionId); |
| | | } |
| | | |
| | | @Override |
| | | public String getGroupSessionId(String type, String targetId) { |
| | | return ardCallSessionUserMapper.getGroupSessionId(type, targetId); |
| | | } |
| | | |
| | | } |
| 对比新文件 |
| | |
| | | package com.ruoyi.call.service.impl; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import java.util.ArrayList; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.call.mapper.ArdCallUnreadMessagesMapper; |
| | | import com.ruoyi.call.domain.ArdCallUnreadMessages; |
| | | import com.ruoyi.call.service.IArdCallUnreadMessagesService; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 未读消息Service业务层处理 |
| | | * |
| | | * @author ard |
| | | * @date 2024-07-06 |
| | | */ |
| | | @Service |
| | | public class ArdCallUnreadMessagesServiceImpl implements IArdCallUnreadMessagesService { |
| | | @Resource |
| | | private ArdCallUnreadMessagesMapper ardCallUnreadMessagesMapper; |
| | | |
| | | /** |
| | | * 查询未读消息 |
| | | * |
| | | * @param userId 未读消息主键 |
| | | * @return 未读消息 |
| | | */ |
| | | @Override |
| | | public ArdCallUnreadMessages selectArdCallUnreadMessagesByUserId (String userId ) { |
| | | return ardCallUnreadMessagesMapper.selectArdCallUnreadMessagesByUserId (userId ); |
| | | } |
| | | |
| | | /** |
| | | * 查询未读消息列表 |
| | | * |
| | | * @param ardCallUnreadMessages 未读消息 |
| | | * @return 未读消息 |
| | | */ |
| | | @Override |
| | | public List<ArdCallUnreadMessages> selectArdCallUnreadMessagesList(ArdCallUnreadMessages ardCallUnreadMessages) { |
| | | return ardCallUnreadMessagesMapper.selectArdCallUnreadMessagesList(ardCallUnreadMessages); |
| | | } |
| | | |
| | | /** |
| | | * 新增未读消息 |
| | | * |
| | | * @param ardCallUnreadMessages 未读消息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertArdCallUnreadMessages(ArdCallUnreadMessages ardCallUnreadMessages) { |
| | | return ardCallUnreadMessagesMapper.insertArdCallUnreadMessages(ardCallUnreadMessages); |
| | | } |
| | | |
| | | /** |
| | | * 修改未读消息 |
| | | * |
| | | * @param ardCallUnreadMessages 未读消息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateArdCallUnreadMessages(ArdCallUnreadMessages ardCallUnreadMessages) { |
| | | return ardCallUnreadMessagesMapper.updateArdCallUnreadMessages(ardCallUnreadMessages); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除未读消息 |
| | | * |
| | | * @param userId s 需要删除的未读消息主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteArdCallUnreadMessagesByUserId(String[] userId) { |
| | | return ardCallUnreadMessagesMapper.deleteArdCallUnreadMessagesByUserId(userId); |
| | | } |
| | | |
| | | /** |
| | | * 删除未读消息信息 |
| | | * |
| | | * @param userId 未读消息主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteArdCallUnreadMessagesByUserId (String userId ) { |
| | | return ardCallUnreadMessagesMapper.deleteArdCallUnreadMessagesByUserId (userId ); |
| | | } |
| | | /** |
| | | * 清除未读消息 |
| | | * |
| | | * @param userId 清除未读消息 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int clearUnReadCount(String sessionId, String userId) { |
| | | ArdCallUnreadMessages ardCallUnreadMessages = ardCallUnreadMessagesMapper.getUnreadMessage(sessionId,userId); |
| | | if (ardCallUnreadMessages != null) { |
| | | ardCallUnreadMessages.setUnreadCount(0); |
| | | ardCallUnreadMessagesMapper.updateArdCallUnreadMessages(ardCallUnreadMessages); |
| | | } |
| | | return 1; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.utils.websocket.service; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ruoyi.app.position.domain.ArdAppPosition; |
| | | import com.ruoyi.app.position.service.IArdAppPositionService; |
| | | import com.ruoyi.app.position.service.impl.AppPositionPush; |
| | | import com.ruoyi.app.position.service.impl.AppPositionPushService; |
| | | import com.ruoyi.app.position.service.impl.ArdAppPositionServiceImpl; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.spring.SpringUtils; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.utils.websocket.util.WebSocketUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.websocket.*; |
| | | import javax.websocket.server.PathParam; |
| | | import javax.websocket.server.ServerEndpoint; |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @ClassName ChatServerEndpoint |
| | |
| | | String message = "用户[" + userId + "] 成功连接!"; |
| | | log.info("用户登录:" + message); |
| | | WebSocketUtils.sendMessage(session, message); |
| | | //region 旧方法 |
| | | // //每个用户连接时,启动初始所有app用户位置发送 |
| | | // AppPositionPush.initDataMap.put(userId,AppPositionPush.getAppPositionList()); |
| | | // AppPositionPush.initPushTask(userId,session,3000); |
| | | //endregion |
| | | } |
| | | |
| | | @OnMessage |
| | |
| | | log.info("收到消息:" + message); |
| | | Session session = WebSocketUtils.ONLINE_USER_SESSIONS.get(userId); |
| | | WebSocketUtils.sendMessage(session, message); |
| | | // sendMessageAll("用户[" + userid + "] : " + message); |
| | | //sendMessageAll("用户[" + userid + "] : " + message); |
| | | // 根据用户新的频率重新调整定时任务 |
| | | AppPositionPushService.messageHandler(userId,message); |
| | | } |
| 对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.call.mapper.ArdCallGroupMapper"> |
| | | |
| | | <resultMap type="ArdCallGroup" id="ArdCallGroupResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="name" column="name" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <collection property="ardCallGroupUsers" ofType="ArdCallGroupUser"> |
| | | <result property="id" column="id" /> |
| | | <result property="groupId" column="group_id" /> |
| | | <result property="userId" column="user_id" /> |
| | | <association property="sysUser" column="user_id" select="com.ruoyi.system.mapper.SysUserMapper.selectUserById"/> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="selectArdCallGroupVo"> |
| | | select acg.*,acgu.* from ard_call_group acg |
| | | left join ard_call_group_user acgu on acg.id = acgu.group_id |
| | | </sql> |
| | | |
| | | <select id="selectArdCallGroupList" parameterType="ArdCallGroup" resultMap="ArdCallGroupResult"> |
| | | <include refid="selectArdCallGroupVo"/> |
| | | <where> |
| | | <if test="name != null and name != ''"> and name like '%'||#{name}||'%'</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectArdCallGroupById" parameterType="String" resultMap="ArdCallGroupResult"> |
| | | <include refid="selectArdCallGroupVo"/> |
| | | where acg.id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertArdCallGroup" parameterType="ArdCallGroup"> |
| | | insert into ard_call_group |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="name != null">name,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="name != null">#{name},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateArdCallGroup" parameterType="ArdCallGroup"> |
| | | update ard_call_group |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="name != null">name = #{name},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteArdCallGroupById" parameterType="String"> |
| | | delete from ard_call_group where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteArdCallGroupByIds" parameterType="String"> |
| | | delete from ard_call_group where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
| 对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.call.mapper.ArdCallGroupUserMapper"> |
| | | |
| | | <resultMap type="ArdCallGroupUser" id="ArdCallGroupUserResult"> |
| | | <result property="id" column="id"/> |
| | | <result property="groupId" column="group_id"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="createBy" column="create_by"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | <resultMap type="ArdCallGroup" id="ArdCallGroupResult"> |
| | | <result property="id" column="id"/> |
| | | <result property="name" column="name"/> |
| | | <result property="createBy" column="create_by"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | <sql id="selectArdCallGroupUserVo"> |
| | | select id, group_id, user_id, create_by, create_time, update_by, update_time |
| | | from ard_call_group_user |
| | | </sql> |
| | | |
| | | <select id="selectArdCallGroupUserList" parameterType="ArdCallGroupUser" resultMap="ArdCallGroupUserResult"> |
| | | <include refid="selectArdCallGroupUserVo"/> |
| | | <where> |
| | | <if test="groupId != null and groupId != ''">and group_id = #{groupId}</if> |
| | | <if test="userId != null and userId != ''">and user_id = #{userId}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectArdCallGroupUserById" parameterType="String" resultMap="ArdCallGroupUserResult"> |
| | | <include refid="selectArdCallGroupUserVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertArdCallGroupUser" parameterType="ArdCallGroupUser"> |
| | | insert into ard_call_group_user |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="groupId != null">group_id,</if> |
| | | <if test="userId != null">user_id,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="groupId != null">#{groupId},</if> |
| | | <if test="userId != null">#{userId},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateArdCallGroupUser" parameterType="ArdCallGroupUser"> |
| | | update ard_call_group_user |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="groupId != null">group_id = #{groupId},</if> |
| | | <if test="userId != null">user_id = #{userId},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteArdCallGroupUserById" parameterType="String"> |
| | | delete |
| | | from ard_call_group_user |
| | | where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteArdCallGroupUserByIds" parameterType="String"> |
| | | delete from ard_call_group_user where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | <delete id="clearArdCallGroupUsers" parameterType="String"> |
| | | delete |
| | | from ard_call_group_user |
| | | where group_id = #{groupId} |
| | | </delete> |
| | | |
| | | <delete id="removeGroupUser"> |
| | | delete from ard_call_group_user where group_id = #{groupId} and user_id in |
| | | <foreach item="userId" collection="userIds" open="(" separator="," close=")"> |
| | | #{userId} |
| | | </foreach> |
| | | </delete> |
| | | <select id="getGroupListByUserId" resultMap="ArdCallGroupResult"> |
| | | select acg.* |
| | | from ard_call_group_user acgu |
| | | left join ard_call_group acg on acg.id = acgu.group_id |
| | | where acgu.user_id = #{userId} |
| | | </select> |
| | | |
| | | </mapper> |
| 对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.call.mapper.ArdCallHistoryMapper"> |
| | | |
| | | <resultMap type="ArdCallHistory" id="ArdCallHistoryResult"> |
| | | <result property="id" column="id"/> |
| | | <result property="type" column="type"/> |
| | | <result property="content" column="content"/> |
| | | <result property="sessionId" column="session_id"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="targetId" column="target_id"/> |
| | | <result property="createBy" column="create_by"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdCallHistoryVo"> |
| | | select id, |
| | | type, |
| | | content, |
| | | session_id, |
| | | user_id, |
| | | target_id, |
| | | create_by, |
| | | create_time, |
| | | update_by, |
| | | update_time |
| | | from ard_call_history |
| | | </sql> |
| | | |
| | | <select id="selectArdCallHistoryList" parameterType="ArdCallHistory" resultMap="ArdCallHistoryResult"> |
| | | <include refid="selectArdCallHistoryVo"/> |
| | | <where> |
| | | <if test="sessionId != null and sessionId != ''">and session_id= #{sessionId}</if> |
| | | <if test="userId != null and userId != ''">and user_id = #{userId}</if> |
| | | <if test="targetId != null and targetId != ''">and target_id = #{targetId}</if> |
| | | <if test="type != null and type != ''">and type = #{type}</if> |
| | | <if test="content != null and content != ''">and content = #{content}</if> |
| | | </where> |
| | | order by create_time desc |
| | | </select> |
| | | |
| | | <select id="selectArdCallHistoryById" parameterType="String" resultMap="ArdCallHistoryResult"> |
| | | <include refid="selectArdCallHistoryVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertArdCallHistory" parameterType="ArdCallHistory"> |
| | | insert into ard_call_history |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="type != null">type,</if> |
| | | <if test="content != null">content,</if> |
| | | <if test="sessionId != null">session_id,</if> |
| | | <if test="userId != null">user_id,</if> |
| | | <if test="targetId != null">target_id,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="type != null">#{type},</if> |
| | | <if test="content != null">#{content},</if> |
| | | <if test="sessionId != null">#{sessionId},</if> |
| | | <if test="userId != null">#{userId},</if> |
| | | <if test="targetId != null">#{targetId},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateArdCallHistory" parameterType="ArdCallHistory"> |
| | | update ard_call_history |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="type != null">type = #{type},</if> |
| | | <if test="content != null">content = #{content},</if> |
| | | <if test="sessionId != null">session_id = #{sessionId},</if> |
| | | <if test="userId != null">user_id = #{userId},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteArdCallHistoryById" parameterType="String"> |
| | | delete |
| | | from ard_call_history |
| | | where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteArdCallHistoryByIds" parameterType="String"> |
| | | delete from ard_call_history where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <select id="selectLastArdCallHistory" parameterType="String" resultType="ArdCallHistory"> |
| | | select * |
| | | from ard_call_history |
| | | where session_id = #{sessionId} |
| | | order by create_time desc limit 1 |
| | | </select> |
| | | |
| | | </mapper> |
| 对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.call.mapper.ArdCallSessionMapper"> |
| | | |
| | | <resultMap type="ArdCallSession" id="ArdCallSessionResult"> |
| | | <result property="id" column="id"/> |
| | | <result property="type" column="type"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="createBy" column="create_by"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="updateBy" column="update_by"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdCallSessionVo"> |
| | | select id, type, user_id, create_by, create_time, update_by, update_time |
| | | from ard_call_session |
| | | </sql> |
| | | |
| | | <select id="selectArdCallSessionList" parameterType="ArdCallSession" resultMap="ArdCallSessionResult"> |
| | | <include refid="selectArdCallSessionVo"/> |
| | | <where> |
| | | <if test="type != null and type != ''">and type = #{type}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectArdCallSessionById" parameterType="String" resultMap="ArdCallSessionResult"> |
| | | <include refid="selectArdCallSessionVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertArdCallSession" parameterType="ArdCallSession"> |
| | | insert into ard_call_session |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="type != null">type,</if> |
| | | <if test="userId != null">user_id,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="type != null">#{type},</if> |
| | | <if test="userId != null">#{userId},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateArdCallSession" parameterType="ArdCallSession"> |
| | | update ard_call_session |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="type != null">type = #{type},</if> |
| | | <if test="userId != null">user_id = #{userId},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteArdCallSessionById" parameterType="String"> |
| | | delete |
| | | from ard_call_session |
| | | where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteArdCallSessionByIds" parameterType="String"> |
| | | delete from ard_call_session where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
| 对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.call.mapper.ArdCallSessionUserMapper"> |
| | | |
| | | <resultMap type="ArdCallSessionUser" id="ArdCallSessionUserResult"> |
| | | <result property="id" column="id"/> |
| | | <result property="sessionId" column="session_id"/> |
| | | <result property="type" column="type"/> |
| | | <result property="userId" column="user_id"/> |
| | | <result property="targetId" column="target_id"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdCallSessionUserVo"> |
| | | select id, session_id, type, user_id,target_id |
| | | from ard_call_session_user |
| | | </sql> |
| | | |
| | | <select id="selectArdCallSessionUserList" parameterType="ArdCallSessionUser" resultMap="ArdCallSessionUserResult"> |
| | | <include refid="selectArdCallSessionUserVo"/> |
| | | <where> |
| | | <if test="sessionId != null and sessionId != ''">and session_id = #{sessionId}</if> |
| | | <if test="type != null and type != ''">and type = #{type}</if> |
| | | <if test="userId != null and userId != ''">and user_id = #{userId}</if> |
| | | <if test="targetId != null and targetId != ''">and target_id = #{targetId}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectArdCallSessionUserById" parameterType="String" resultMap="ArdCallSessionUserResult"> |
| | | <include refid="selectArdCallSessionUserVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertArdCallSessionUser" parameterType="ArdCallSessionUser"> |
| | | insert into ard_call_session_user |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="sessionId != null">session_id,</if> |
| | | <if test="type != null">type,</if> |
| | | <if test="userId != null">user_id,</if> |
| | | <if test="targetId != null">target_id,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="sessionId != null">#{sessionId},</if> |
| | | <if test="type != null">#{type},</if> |
| | | <if test="userId != null">#{userId},</if> |
| | | <if test="targetId != null">#{targetId},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateArdCallSessionUser" parameterType="ArdCallSessionUser"> |
| | | update ard_call_session_user |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="sessionId != null">session_id = #{sessionId},</if> |
| | | <if test="type != null">type = #{type},</if> |
| | | <if test="userId != null">user_id = #{userId},</if> |
| | | <if test="targetId != null">target_id = #{targetId},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteArdCallSessionUserById" parameterType="String"> |
| | | delete |
| | | from ard_call_session_user |
| | | where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteArdCallSessionUserByIds" parameterType="String"> |
| | | delete from ard_call_session_user where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | <select id="getSessionId" parameterType="String" resultType="String"> |
| | | select session_id |
| | | from ard_call_session_user |
| | | where user_id = #{userId} |
| | | and target_id = #{targetId} |
| | | and type = #{type} |
| | | </select> |
| | | <select id="getGroupSessionId" parameterType="String" resultType="String"> |
| | | select session_id |
| | | from ard_call_session_user |
| | | where target_id = #{targetId} |
| | | limit 1 |
| | | </select> |
| | | <delete id="deleteArdCallSessionUserBySessionId" parameterType="String"> |
| | | delete |
| | | from ard_call_session_user |
| | | where session_id = #{sessionId} |
| | | </delete> |
| | | </mapper> |
| 对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.call.mapper.ArdCallUnreadMessagesMapper"> |
| | | |
| | | <resultMap type="ArdCallUnreadMessages" id="ArdCallUnreadMessagesResult"> |
| | | <result property="userId" column="user_id "/> |
| | | <result property="sessionId" column="session_id"/> |
| | | <result property="unreadCount" column="unread_count"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectArdCallUnreadMessagesVo"> |
| | | select user_id, session_id, unread_count |
| | | from ard_call_unread_messages |
| | | </sql> |
| | | |
| | | <select id="selectArdCallUnreadMessagesList" parameterType="ArdCallUnreadMessages" |
| | | resultMap="ArdCallUnreadMessagesResult"> |
| | | <include refid="selectArdCallUnreadMessagesVo"/> |
| | | <where> |
| | | <if test="userId != null and userId != ''">and user_id = #{userId }</if> |
| | | <if test="sessionId != null and sessionId != ''">and session_id = #{sessionId}</if> |
| | | <if test="unreadCount != null and unreadCount != ''">and unread_count = #{unreadCount}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectArdCallUnreadMessagesByUserId" parameterType="String" resultMap="ArdCallUnreadMessagesResult"> |
| | | <include refid="selectArdCallUnreadMessagesVo"/> |
| | | where user_id = #{userId } |
| | | </select> |
| | | |
| | | <insert id="insertArdCallUnreadMessages" parameterType="ArdCallUnreadMessages"> |
| | | insert into ard_call_unread_messages |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="userId != null">user_id ,</if> |
| | | <if test="sessionId != null">session_id,</if> |
| | | <if test="unreadCount != null">unread_count,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="userId != null">#{userId },</if> |
| | | <if test="sessionId != null">#{sessionId},</if> |
| | | <if test="unreadCount != null">#{unreadCount},</if> |
| | | </trim> |
| | | ON CONFLICT (session_id, user_id) DO NOTHING |
| | | </insert> |
| | | |
| | | <update id="updateArdCallUnreadMessages" parameterType="ArdCallUnreadMessages"> |
| | | update ard_call_unread_messages |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="unreadCount != null">unread_count = #{unreadCount},</if> |
| | | </trim> |
| | | where user_id = #{userId } and session_id = #{sessionId} |
| | | </update> |
| | | |
| | | <delete id="deleteArdCallUnreadMessagesByUserId " parameterType="String"> |
| | | delete |
| | | from ard_call_unread_messages |
| | | where user_id = #{userId } |
| | | </delete> |
| | | |
| | | <delete id="deleteArdCallUnreadMessagesByUserId" parameterType="String"> |
| | | delete from ard_call_unread_messages where user_id in |
| | | <foreach item="userId" collection="array" open="(" separator="," close=")"> |
| | | #{userId } |
| | | </foreach> |
| | | </delete> |
| | | <select id="getUnreadMessage" resultType="ArdCallUnreadMessages"> |
| | | select * |
| | | from ard_call_unread_messages |
| | | where user_id = #{targetId} |
| | | and session_id = #{sessionId} |
| | | </select> |
| | | </mapper> |
| | |
| | | /** |
| | | * 创建API |
| | | */ |
| | | @Bean |
| | | @Bean("baseApi") |
| | | public Docket createRestApi() |
| | | { |
| | | return new Docket(DocumentationType.SWAGGER_2) |
| | | // 是否启用Swagger |
| | | .enable(true) |
| | | //分组名称 |
| | | .groupName("baseApi") |
| | | // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息) |
| | | .apiInfo(apiInfo()) |
| | | // 设置哪些接口暴露给Swagger展示 |
| | |
| | | .securityContexts(securityContexts()) |
| | | .pathMapping("/"); |
| | | } |
| | | |
| | | /** |
| | | * 创建API-VideoCall |
| | | */ |
| | | @Bean("VideoCallApi") |
| | | public Docket createRestApiVideoCall() |
| | | { |
| | | return new Docket(DocumentationType.SWAGGER_2) |
| | | // 是否启用Swagger |
| | | .enable(true) |
| | | //分组名称 |
| | | .groupName("VideoCallApi") |
| | | // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息) |
| | | .apiInfo(apiInfo()) |
| | | // 设置哪些接口暴露给Swagger展示 |
| | | .select() |
| | | // 扫描所有有注解的api,用这种方式更灵活 |
| | | .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) |
| | | // 扫描指定包中的swagger注解 |
| | | .apis(RequestHandlerSelectors.basePackage("com.ruoyi.call.controller")) |
| | | // 扫描所有 .apis(RequestHandlerSelectors.any()) |
| | | .paths(PathSelectors.any()) |
| | | .build() |
| | | /* 设置安全模式,swagger可以设置访问token */ |
| | | .securitySchemes(securitySchemes()) |
| | | .securityContexts(securityContexts()) |
| | | .pathMapping("/"); |
| | | } |
| | | /** |
| | | * 安全模式,这里指定token通过Authorization头请求头传递 |
| | | */ |