75 changed files with 4810 additions and 48 deletions
@ -0,0 +1,27 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" |
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
<parent> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>im-admin</artifactId> |
|||
<version>5.2.3</version> |
|||
</parent> |
|||
|
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-im</artifactId> |
|||
|
|||
<dependencies> |
|||
<dependency> |
|||
<groupId>org.dromara</groupId> |
|||
<artifactId>ruoyi-system</artifactId> |
|||
<version>${revision}</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.alibaba</groupId> |
|||
<artifactId>fastjson</artifactId> |
|||
<version>${fastjson.version}</version> |
|||
</dependency> |
|||
</dependencies> |
|||
</project> |
|||
@ -0,0 +1,14 @@ |
|||
package org.dromara.im.constant; |
|||
|
|||
/** |
|||
* @author: Blue |
|||
* @date: 2024-07-20 |
|||
* @version: 1.0 |
|||
*/ |
|||
public class ImConstant { |
|||
|
|||
/** |
|||
* IM数据源 |
|||
*/ |
|||
public final static String DS_IM_PLATFORM = "platform"; |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
package org.dromara.im.constant; |
|||
|
|||
public class ImRedisKey { |
|||
|
|||
/** |
|||
* 缓存群聊信息 |
|||
*/ |
|||
public static final String IM_CACHE_GROUP = "im:cache:group"; |
|||
/** |
|||
* 用户被封禁处理队列 |
|||
*/ |
|||
public static final String IM_QUEUE_USER_BANNED = "im:queue:user:banned"; |
|||
|
|||
/** |
|||
* 群聊被封禁处理队列 |
|||
*/ |
|||
public static final String IM_QUEUE_GROUP_BANNED = "im:queue:group:banned"; |
|||
|
|||
/** |
|||
* 群聊解封处理队列 |
|||
*/ |
|||
public static final String IM_QUEUE_GROUP_UNBAN = "im:queue:group:unban"; |
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,105 @@ |
|||
package org.dromara.im.controller; |
|||
|
|||
import java.util.List; |
|||
|
|||
import lombok.RequiredArgsConstructor; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import jakarta.validation.constraints.*; |
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.dromara.common.idempotent.annotation.RepeatSubmit; |
|||
import org.dromara.common.log.annotation.Log; |
|||
import org.dromara.common.web.core.BaseController; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import org.dromara.common.core.domain.R; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import org.dromara.common.log.enums.BusinessType; |
|||
import org.dromara.common.excel.utils.ExcelUtil; |
|||
import org.dromara.im.domain.vo.ImGroupVo; |
|||
import org.dromara.im.domain.bo.ImGroupBo; |
|||
import org.dromara.im.service.IImGroupService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 群 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/im/group") |
|||
public class ImGroupController extends BaseController { |
|||
|
|||
private final IImGroupService imGroupService; |
|||
|
|||
/** |
|||
* 查询群列表 |
|||
*/ |
|||
@SaCheckPermission("im:group:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<ImGroupVo> list(ImGroupBo bo, PageQuery pageQuery) { |
|||
return imGroupService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出群列表 |
|||
*/ |
|||
@SaCheckPermission("im:group:export") |
|||
@Log(title = "群", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(ImGroupBo bo, HttpServletResponse response) { |
|||
List<ImGroupVo> list = imGroupService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "群", ImGroupVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取群详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("im:group:query") |
|||
@GetMapping("/{id}") |
|||
public R<ImGroupVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long id) { |
|||
return R.ok(imGroupService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增群 |
|||
*/ |
|||
@SaCheckPermission("im:group:add") |
|||
@Log(title = "群", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ImGroupBo bo) { |
|||
return toAjax(imGroupService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改群 |
|||
*/ |
|||
@SaCheckPermission("im:group:edit") |
|||
@Log(title = "群", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ImGroupBo bo) { |
|||
return toAjax(imGroupService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除群 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("im:group:remove") |
|||
@Log(title = "群", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids) { |
|||
return toAjax(imGroupService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
|||
@ -0,0 +1,105 @@ |
|||
package org.dromara.im.controller; |
|||
|
|||
import java.util.List; |
|||
|
|||
import lombok.RequiredArgsConstructor; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import jakarta.validation.constraints.*; |
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.dromara.common.idempotent.annotation.RepeatSubmit; |
|||
import org.dromara.common.log.annotation.Log; |
|||
import org.dromara.common.web.core.BaseController; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import org.dromara.common.core.domain.R; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import org.dromara.common.log.enums.BusinessType; |
|||
import org.dromara.common.excel.utils.ExcelUtil; |
|||
import org.dromara.im.domain.vo.ImGroupMemberVo; |
|||
import org.dromara.im.domain.bo.ImGroupMemberBo; |
|||
import org.dromara.im.service.IImGroupMemberService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 群成员 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/im/groupMember") |
|||
public class ImGroupMemberController extends BaseController { |
|||
|
|||
private final IImGroupMemberService imGroupMemberService; |
|||
|
|||
/** |
|||
* 查询群成员列表 |
|||
*/ |
|||
@SaCheckPermission("im:groupMember:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<ImGroupMemberVo> list(ImGroupMemberBo bo, PageQuery pageQuery) { |
|||
return imGroupMemberService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出群成员列表 |
|||
*/ |
|||
@SaCheckPermission("im:groupMember:export") |
|||
@Log(title = "群成员", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(ImGroupMemberBo bo, HttpServletResponse response) { |
|||
List<ImGroupMemberVo> list = imGroupMemberService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "群成员", ImGroupMemberVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取群成员详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("im:groupMember:query") |
|||
@GetMapping("/{id}") |
|||
public R<ImGroupMemberVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long id) { |
|||
return R.ok(imGroupMemberService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增群成员 |
|||
*/ |
|||
@SaCheckPermission("im:groupMember:add") |
|||
@Log(title = "群成员", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ImGroupMemberBo bo) { |
|||
return toAjax(imGroupMemberService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改群成员 |
|||
*/ |
|||
@SaCheckPermission("im:groupMember:edit") |
|||
@Log(title = "群成员", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ImGroupMemberBo bo) { |
|||
return toAjax(imGroupMemberService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除群成员 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("im:groupMember:remove") |
|||
@Log(title = "群成员", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids) { |
|||
return toAjax(imGroupMemberService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
|||
@ -0,0 +1,105 @@ |
|||
package org.dromara.im.controller; |
|||
|
|||
import java.util.List; |
|||
|
|||
import lombok.RequiredArgsConstructor; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import jakarta.validation.constraints.*; |
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.dromara.common.idempotent.annotation.RepeatSubmit; |
|||
import org.dromara.common.log.annotation.Log; |
|||
import org.dromara.common.web.core.BaseController; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import org.dromara.common.core.domain.R; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import org.dromara.common.log.enums.BusinessType; |
|||
import org.dromara.common.excel.utils.ExcelUtil; |
|||
import org.dromara.im.domain.vo.ImGroupMessageVo; |
|||
import org.dromara.im.domain.bo.ImGroupMessageBo; |
|||
import org.dromara.im.service.IImGroupMessageService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 群消息 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/im/groupMessage") |
|||
public class ImGroupMessageController extends BaseController { |
|||
|
|||
private final IImGroupMessageService imGroupMessageService; |
|||
|
|||
/** |
|||
* 查询群消息列表 |
|||
*/ |
|||
@SaCheckPermission("im:groupMessage:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<ImGroupMessageVo> list(ImGroupMessageBo bo, PageQuery pageQuery) { |
|||
return imGroupMessageService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出群消息列表 |
|||
*/ |
|||
@SaCheckPermission("im:groupMessage:export") |
|||
@Log(title = "群消息", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(ImGroupMessageBo bo, HttpServletResponse response) { |
|||
List<ImGroupMessageVo> list = imGroupMessageService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "群消息", ImGroupMessageVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取群消息详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("im:groupMessage:query") |
|||
@GetMapping("/{id}") |
|||
public R<ImGroupMessageVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long id) { |
|||
return R.ok(imGroupMessageService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增群消息 |
|||
*/ |
|||
@SaCheckPermission("im:groupMessage:add") |
|||
@Log(title = "群消息", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ImGroupMessageBo bo) { |
|||
return toAjax(imGroupMessageService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改群消息 |
|||
*/ |
|||
@SaCheckPermission("im:groupMessage:edit") |
|||
@Log(title = "群消息", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ImGroupMessageBo bo) { |
|||
return toAjax(imGroupMessageService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除群消息 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("im:groupMessage:remove") |
|||
@Log(title = "群消息", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids) { |
|||
return toAjax(imGroupMessageService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
|||
@ -0,0 +1,105 @@ |
|||
package org.dromara.im.controller; |
|||
|
|||
import java.util.List; |
|||
|
|||
import lombok.RequiredArgsConstructor; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import jakarta.validation.constraints.*; |
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.dromara.common.idempotent.annotation.RepeatSubmit; |
|||
import org.dromara.common.log.annotation.Log; |
|||
import org.dromara.common.web.core.BaseController; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import org.dromara.common.core.domain.R; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import org.dromara.common.log.enums.BusinessType; |
|||
import org.dromara.common.excel.utils.ExcelUtil; |
|||
import org.dromara.im.domain.vo.ImPrivateMessageVo; |
|||
import org.dromara.im.domain.bo.ImPrivateMessageBo; |
|||
import org.dromara.im.service.IImPrivateMessageService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 私聊消息 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/im/privateMessage") |
|||
public class ImPrivateMessageController extends BaseController { |
|||
|
|||
private final IImPrivateMessageService imPrivateMessageService; |
|||
|
|||
/** |
|||
* 查询私聊消息列表 |
|||
*/ |
|||
@SaCheckPermission("im:privateMessage:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<ImPrivateMessageVo> list(ImPrivateMessageBo bo, PageQuery pageQuery) { |
|||
return imPrivateMessageService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出私聊消息列表 |
|||
*/ |
|||
@SaCheckPermission("im:privateMessage:export") |
|||
@Log(title = "私聊消息", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(ImPrivateMessageBo bo, HttpServletResponse response) { |
|||
List<ImPrivateMessageVo> list = imPrivateMessageService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "私聊消息", ImPrivateMessageVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取私聊消息详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("im:privateMessage:query") |
|||
@GetMapping("/{id}") |
|||
public R<ImPrivateMessageVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long id) { |
|||
return R.ok(imPrivateMessageService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增私聊消息 |
|||
*/ |
|||
@SaCheckPermission("im:privateMessage:add") |
|||
@Log(title = "私聊消息", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ImPrivateMessageBo bo) { |
|||
return toAjax(imPrivateMessageService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改私聊消息 |
|||
*/ |
|||
@SaCheckPermission("im:privateMessage:edit") |
|||
@Log(title = "私聊消息", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ImPrivateMessageBo bo) { |
|||
return toAjax(imPrivateMessageService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除私聊消息 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("im:privateMessage:remove") |
|||
@Log(title = "私聊消息", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids) { |
|||
return toAjax(imPrivateMessageService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
|||
@ -0,0 +1,105 @@ |
|||
package org.dromara.im.controller; |
|||
|
|||
import java.util.List; |
|||
|
|||
import lombok.RequiredArgsConstructor; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import jakarta.validation.constraints.*; |
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.dromara.common.idempotent.annotation.RepeatSubmit; |
|||
import org.dromara.common.log.annotation.Log; |
|||
import org.dromara.common.web.core.BaseController; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import org.dromara.common.core.domain.R; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import org.dromara.common.log.enums.BusinessType; |
|||
import org.dromara.common.excel.utils.ExcelUtil; |
|||
import org.dromara.im.domain.vo.ImSensitiveWordVo; |
|||
import org.dromara.im.domain.bo.ImSensitiveWordBo; |
|||
import org.dromara.im.service.IImSensitiveWordService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 敏感词 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/im/sensitiveWord") |
|||
public class ImSensitiveWordController extends BaseController { |
|||
|
|||
private final IImSensitiveWordService imSensitiveWordService; |
|||
|
|||
/** |
|||
* 查询敏感词列表 |
|||
*/ |
|||
@SaCheckPermission("im:sensitiveWord:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<ImSensitiveWordVo> list(ImSensitiveWordBo bo, PageQuery pageQuery) { |
|||
return imSensitiveWordService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出敏感词列表 |
|||
*/ |
|||
@SaCheckPermission("im:sensitiveWord:export") |
|||
@Log(title = "敏感词", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(ImSensitiveWordBo bo, HttpServletResponse response) { |
|||
List<ImSensitiveWordVo> list = imSensitiveWordService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "敏感词", ImSensitiveWordVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取敏感词详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("im:sensitiveWord:query") |
|||
@GetMapping("/{id}") |
|||
public R<ImSensitiveWordVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long id) { |
|||
return R.ok(imSensitiveWordService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增敏感词 |
|||
*/ |
|||
@SaCheckPermission("im:sensitiveWord:add") |
|||
@Log(title = "敏感词", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ImSensitiveWordBo bo) { |
|||
return toAjax(imSensitiveWordService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改敏感词 |
|||
*/ |
|||
@SaCheckPermission("im:sensitiveWord:edit") |
|||
@Log(title = "敏感词", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ImSensitiveWordBo bo) { |
|||
return toAjax(imSensitiveWordService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除敏感词 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("im:sensitiveWord:remove") |
|||
@Log(title = "敏感词", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids) { |
|||
return toAjax(imSensitiveWordService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
|||
@ -0,0 +1,105 @@ |
|||
package org.dromara.im.controller; |
|||
|
|||
import java.util.List; |
|||
|
|||
import lombok.RequiredArgsConstructor; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import jakarta.validation.constraints.*; |
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.dromara.common.idempotent.annotation.RepeatSubmit; |
|||
import org.dromara.common.log.annotation.Log; |
|||
import org.dromara.common.web.core.BaseController; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import org.dromara.common.core.domain.R; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import org.dromara.common.log.enums.BusinessType; |
|||
import org.dromara.common.excel.utils.ExcelUtil; |
|||
import org.dromara.im.domain.vo.ImSmPushTaskVo; |
|||
import org.dromara.im.domain.bo.ImSmPushTaskBo; |
|||
import org.dromara.im.service.IImSmPushTaskService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 系统消息推送任务 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/im/smPushTask") |
|||
public class ImSmPushTaskController extends BaseController { |
|||
|
|||
private final IImSmPushTaskService imSmPushTaskService; |
|||
|
|||
/** |
|||
* 查询系统消息推送任务列表 |
|||
*/ |
|||
@SaCheckPermission("im:smPushTask:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<ImSmPushTaskVo> list(ImSmPushTaskBo bo, PageQuery pageQuery) { |
|||
return imSmPushTaskService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出系统消息推送任务列表 |
|||
*/ |
|||
@SaCheckPermission("im:smPushTask:export") |
|||
@Log(title = "系统消息推送任务", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(ImSmPushTaskBo bo, HttpServletResponse response) { |
|||
List<ImSmPushTaskVo> list = imSmPushTaskService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "系统消息推送任务", ImSmPushTaskVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取系统消息推送任务详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("im:smPushTask:query") |
|||
@GetMapping("/{id}") |
|||
public R<ImSmPushTaskVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long id) { |
|||
return R.ok(imSmPushTaskService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增系统消息推送任务 |
|||
*/ |
|||
@SaCheckPermission("im:smPushTask:add") |
|||
@Log(title = "系统消息推送任务", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ImSmPushTaskBo bo) { |
|||
return toAjax(imSmPushTaskService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改系统消息推送任务 |
|||
*/ |
|||
@SaCheckPermission("im:smPushTask:edit") |
|||
@Log(title = "系统消息推送任务", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ImSmPushTaskBo bo) { |
|||
return toAjax(imSmPushTaskService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除系统消息推送任务 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("im:smPushTask:remove") |
|||
@Log(title = "系统消息推送任务", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids) { |
|||
return toAjax(imSmPushTaskService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
|||
@ -0,0 +1,105 @@ |
|||
package org.dromara.im.controller; |
|||
|
|||
import java.util.List; |
|||
|
|||
import lombok.RequiredArgsConstructor; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import jakarta.validation.constraints.*; |
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.dromara.common.idempotent.annotation.RepeatSubmit; |
|||
import org.dromara.common.log.annotation.Log; |
|||
import org.dromara.common.web.core.BaseController; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import org.dromara.common.core.domain.R; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import org.dromara.common.log.enums.BusinessType; |
|||
import org.dromara.common.excel.utils.ExcelUtil; |
|||
import org.dromara.im.domain.vo.ImSystemMessageVo; |
|||
import org.dromara.im.domain.bo.ImSystemMessageBo; |
|||
import org.dromara.im.service.IImSystemMessageService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 系统消息 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/im/systemMessage") |
|||
public class ImSystemMessageController extends BaseController { |
|||
|
|||
private final IImSystemMessageService imSystemMessageService; |
|||
|
|||
/** |
|||
* 查询系统消息列表 |
|||
*/ |
|||
@SaCheckPermission("im:systemMessage:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<ImSystemMessageVo> list(ImSystemMessageBo bo, PageQuery pageQuery) { |
|||
return imSystemMessageService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出系统消息列表 |
|||
*/ |
|||
@SaCheckPermission("im:systemMessage:export") |
|||
@Log(title = "系统消息", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(ImSystemMessageBo bo, HttpServletResponse response) { |
|||
List<ImSystemMessageVo> list = imSystemMessageService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "系统消息", ImSystemMessageVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取系统消息详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("im:systemMessage:query") |
|||
@GetMapping("/{id}") |
|||
public R<ImSystemMessageVo> getInfo(@NotNull(message = "主键不能为空") |
|||
@PathVariable Long id) { |
|||
return R.ok(imSystemMessageService.queryById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增系统消息 |
|||
*/ |
|||
@SaCheckPermission("im:systemMessage:add") |
|||
@Log(title = "系统消息", businessType = BusinessType.INSERT) |
|||
@RepeatSubmit() |
|||
@PostMapping() |
|||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ImSystemMessageBo bo) { |
|||
return toAjax(imSystemMessageService.insertByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 修改系统消息 |
|||
*/ |
|||
@SaCheckPermission("im:systemMessage:edit") |
|||
@Log(title = "系统消息", businessType = BusinessType.UPDATE) |
|||
@RepeatSubmit() |
|||
@PutMapping() |
|||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ImSystemMessageBo bo) { |
|||
return toAjax(imSystemMessageService.updateByBo(bo)); |
|||
} |
|||
|
|||
/** |
|||
* 删除系统消息 |
|||
* |
|||
* @param ids 主键串 |
|||
*/ |
|||
@SaCheckPermission("im:systemMessage:remove") |
|||
@Log(title = "系统消息", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|||
@PathVariable Long[] ids) { |
|||
return toAjax(imSystemMessageService.deleteWithValidByIds(List.of(ids), true)); |
|||
} |
|||
} |
|||
@ -0,0 +1,89 @@ |
|||
package org.dromara.im.controller; |
|||
|
|||
import java.util.List; |
|||
|
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import jakarta.validation.Valid; |
|||
import lombok.RequiredArgsConstructor; |
|||
import jakarta.servlet.http.HttpServletResponse; |
|||
import jakarta.validation.constraints.*; |
|||
import cn.dev33.satoken.annotation.SaCheckPermission; |
|||
import org.dromara.im.domain.dto.ImUserBanDTO; |
|||
import org.dromara.im.domain.dto.ImUserUnbanDTO; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.dromara.common.idempotent.annotation.RepeatSubmit; |
|||
import org.dromara.common.log.annotation.Log; |
|||
import org.dromara.common.web.core.BaseController; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import org.dromara.common.core.domain.R; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import org.dromara.common.log.enums.BusinessType; |
|||
import org.dromara.common.excel.utils.ExcelUtil; |
|||
import org.dromara.im.domain.vo.ImUserVo; |
|||
import org.dromara.im.domain.bo.ImUserBo; |
|||
import org.dromara.im.service.IImUserService; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 用户 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/im/user") |
|||
public class ImUserController extends BaseController { |
|||
|
|||
private final IImUserService userService; |
|||
|
|||
/** |
|||
* 查询用户列表 |
|||
*/ |
|||
@SaCheckPermission("im:user:list") |
|||
@GetMapping("/list") |
|||
public TableDataInfo<ImUserVo> list(ImUserBo bo, PageQuery pageQuery) { |
|||
return userService.queryPageList(bo, pageQuery); |
|||
} |
|||
|
|||
/** |
|||
* 导出用户列表 |
|||
*/ |
|||
@SaCheckPermission("im:user:export") |
|||
@Log(title = "用户", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(ImUserBo bo, HttpServletResponse response) { |
|||
List<ImUserVo> list = userService.queryList(bo); |
|||
ExcelUtil.exportExcel(list, "用户", ImUserVo.class, response); |
|||
} |
|||
|
|||
/** |
|||
* 获取用户详细信息 |
|||
* |
|||
* @param id 主键 |
|||
*/ |
|||
@SaCheckPermission("im:user:query") |
|||
@GetMapping("/{id}") |
|||
public R<ImUserVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) { |
|||
return R.ok(userService.queryById(id)); |
|||
} |
|||
|
|||
@Operation(summary = "账号封禁") |
|||
@PutMapping("/ban") |
|||
@SaCheckPermission("im:user:ban") |
|||
public void ban(@RequestBody @Valid ImUserBanDTO dto){ |
|||
userService.ban(dto); |
|||
} |
|||
|
|||
|
|||
@Operation(summary = "账号解封") |
|||
@PutMapping("/unban") |
|||
@SaCheckPermission("im:user:ban") |
|||
public void unban(@RequestBody @Valid ImUserUnbanDTO dto){ |
|||
userService.unban(dto); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,84 @@ |
|||
package org.dromara.im.domain; |
|||
|
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import org.dromara.common.translation.annotation.Translation; |
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.dromara.common.translation.constant.TransConstant; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 群对象 im_group |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@TableName("im_group") |
|||
public class ImGroup { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@TableId(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 群名字 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 群主id |
|||
*/ |
|||
private Long ownerId; |
|||
|
|||
/** |
|||
* 群头像 |
|||
*/ |
|||
private String headImage; |
|||
|
|||
/** |
|||
* 群头像缩略图 |
|||
*/ |
|||
private String headImageThumb; |
|||
|
|||
/** |
|||
* 群公告 |
|||
*/ |
|||
private String notice; |
|||
|
|||
/** |
|||
* 群备注 |
|||
*/ |
|||
private String remark; |
|||
|
|||
/** |
|||
* 是否已解散 |
|||
*/ |
|||
private Long dissolve; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 是否被封禁 0:否 1:是 |
|||
*/ |
|||
private Long isBanned; |
|||
|
|||
/** |
|||
* 被封禁原因 |
|||
*/ |
|||
private String reason; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,79 @@ |
|||
package org.dromara.im.domain; |
|||
|
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import org.dromara.common.translation.annotation.Translation; |
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.dromara.common.translation.constant.TransConstant; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 群成员对象 im_group_member |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@TableName("im_group_member") |
|||
public class ImGroupMember { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@TableId(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 群id |
|||
*/ |
|||
private Long groupId; |
|||
|
|||
/** |
|||
* 用户id |
|||
*/ |
|||
private Long userId; |
|||
|
|||
/** |
|||
* 组内显示名称 |
|||
*/ |
|||
private String remarkNickName; |
|||
|
|||
/** |
|||
* 用户头像 |
|||
*/ |
|||
private String headImage; |
|||
|
|||
/** |
|||
* 群名备注 |
|||
*/ |
|||
private String remarkGroupName; |
|||
|
|||
/** |
|||
* 是否已退出 |
|||
*/ |
|||
private Long quit; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 退出时间 |
|||
*/ |
|||
private Date quitTime; |
|||
|
|||
/** |
|||
* 用户昵称 |
|||
*/ |
|||
private String userNickName; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,87 @@ |
|||
package org.dromara.im.domain; |
|||
|
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 群消息对象 im_group_message |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@TableName("im_group_message") |
|||
public class ImGroupMessage { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@TableId(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 群id |
|||
*/ |
|||
private Long groupId; |
|||
|
|||
/** |
|||
* 发送用户id |
|||
*/ |
|||
private Long sendId; |
|||
|
|||
/** |
|||
* 发送用户昵称 |
|||
*/ |
|||
private String sendNickName; |
|||
|
|||
/** |
|||
* 被@用户id列表,逗号分隔 |
|||
*/ |
|||
private String atUserIds; |
|||
|
|||
/** |
|||
* 发送内容 |
|||
*/ |
|||
private String content; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Long status; |
|||
|
|||
/** |
|||
* 消息类型 0:文字 1:图片 2:文件 |
|||
*/ |
|||
private Long type; |
|||
|
|||
/** |
|||
* 发送时间 |
|||
*/ |
|||
private Date sendTime; |
|||
|
|||
/** |
|||
* 回执消息是否完成 |
|||
*/ |
|||
private Long receiptOk; |
|||
|
|||
/** |
|||
* 是否回执消息 |
|||
*/ |
|||
private Long receipt; |
|||
|
|||
/** |
|||
* 接收用户id,逗号分隔,为空表示发给所有成员 |
|||
*/ |
|||
private String recvIds; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,62 @@ |
|||
package org.dromara.im.domain; |
|||
|
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 私聊消息对象 im_private_message |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@TableName("im_private_message") |
|||
public class ImPrivateMessage { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@TableId(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 发送用户id |
|||
*/ |
|||
private Long sendId; |
|||
|
|||
/** |
|||
* 接收用户id |
|||
*/ |
|||
private Long recvId; |
|||
|
|||
/** |
|||
* 发送内容 |
|||
*/ |
|||
private String content; |
|||
|
|||
/** |
|||
* 消息类型 0:文字 1:图片 2:文件 |
|||
*/ |
|||
private Long type; |
|||
|
|||
/** |
|||
* 状态 0:未读 1:已读 |
|||
*/ |
|||
private Long status; |
|||
|
|||
/** |
|||
* 发送时间 |
|||
*/ |
|||
private Date sendTime; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,45 @@ |
|||
package org.dromara.im.domain; |
|||
|
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 敏感词对象 im_sensitive_word |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@TableName("im_sensitive_word") |
|||
public class ImSensitiveWord { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@TableId(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 敏感词内容 |
|||
*/ |
|||
private String content; |
|||
|
|||
/** |
|||
* 是否启用 0:未启用 1:启用 |
|||
*/ |
|||
private Long enabled; |
|||
|
|||
/** |
|||
* 创建者 |
|||
*/ |
|||
private Long creator; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,83 @@ |
|||
package org.dromara.im.domain; |
|||
|
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 系统消息推送任务对象 im_sm_push_task |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@TableName("im_sm_push_task") |
|||
public class ImSmPushTask { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@TableId(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 系统消息id |
|||
*/ |
|||
private Long messageId; |
|||
|
|||
/** |
|||
* 发送序列号 |
|||
*/ |
|||
private Long seqNo; |
|||
|
|||
/** |
|||
* 推送时间 |
|||
*/ |
|||
private Date sendTime; |
|||
|
|||
/** |
|||
* 状态 1:待发送 2:发送中 3:已发送 4:已取消 |
|||
*/ |
|||
private Long status; |
|||
|
|||
/** |
|||
* 是否发送给全体用户 |
|||
*/ |
|||
private Long sendToAll; |
|||
|
|||
/** |
|||
* 接收用户id,逗号分隔,send_to_all为false时有效 |
|||
*/ |
|||
private String recvIds; |
|||
|
|||
/** |
|||
* 版本号 |
|||
*/ |
|||
@Version |
|||
private Long version; |
|||
|
|||
/** |
|||
* 删除标识 0:正常 1:已删除 |
|||
*/ |
|||
private Long deleted; |
|||
|
|||
/** |
|||
* 创建者 |
|||
*/ |
|||
private Long creator; |
|||
|
|||
/** |
|||
* 更新者 |
|||
*/ |
|||
private Long updater; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,82 @@ |
|||
package org.dromara.im.domain; |
|||
|
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 系统消息对象 im_system_message |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("im_system_message") |
|||
public class ImSystemMessage extends BaseEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@TableId(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* 封面 |
|||
*/ |
|||
private String coverUrl; |
|||
|
|||
/** |
|||
* 简介 |
|||
*/ |
|||
private String intro; |
|||
|
|||
/** |
|||
* 内容类型 0:富文本 1:外部链接 |
|||
*/ |
|||
private Long contentType; |
|||
|
|||
/** |
|||
* 富文本内容,base64编码 |
|||
*/ |
|||
private String richText; |
|||
|
|||
/** |
|||
* 外部链接 |
|||
*/ |
|||
private String externLink; |
|||
|
|||
/** |
|||
* 版本号 |
|||
*/ |
|||
@Version |
|||
private Long version; |
|||
|
|||
/** |
|||
* 删除标识 0:正常 1:已删除 |
|||
*/ |
|||
private Long deleted; |
|||
|
|||
/** |
|||
* 创建者 |
|||
*/ |
|||
private Long creator; |
|||
|
|||
/** |
|||
* 更新者 |
|||
*/ |
|||
private Long updater; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,104 @@ |
|||
package org.dromara.im.domain; |
|||
|
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import org.dromara.common.translation.annotation.Translation; |
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.dromara.common.translation.constant.TransConstant; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 用户对象 im_user |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@TableName("im_user") |
|||
public class ImUser { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@TableId(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 用户名 |
|||
*/ |
|||
private String userName; |
|||
|
|||
/** |
|||
* 用户昵称 |
|||
*/ |
|||
private String nickName; |
|||
|
|||
/** |
|||
* 用户头像 |
|||
*/ |
|||
private String headImage; |
|||
|
|||
/** |
|||
* 用户头像缩略图 |
|||
*/ |
|||
private String headImageThumb; |
|||
|
|||
/** |
|||
* 密码(明文) |
|||
*/ |
|||
private String password; |
|||
|
|||
/** |
|||
* 性别 0:男 1::女 |
|||
*/ |
|||
private Long sex; |
|||
|
|||
/** |
|||
* 个性签名 |
|||
*/ |
|||
private String signature; |
|||
|
|||
/** |
|||
* 最后登录时间 |
|||
*/ |
|||
private Date lastLoginTime; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Long type; |
|||
|
|||
/** |
|||
* 是否被封禁 0:否 1:是 |
|||
*/ |
|||
private Boolean isBanned; |
|||
|
|||
/** |
|||
* 被封禁原因 |
|||
*/ |
|||
private String reason; |
|||
|
|||
/** |
|||
* 客户端id,用于uni-push推送 |
|||
*/ |
|||
private String cid; |
|||
|
|||
/** |
|||
* 状态 0:正常 1:已注销 |
|||
*/ |
|||
private Long status; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,94 @@ |
|||
package org.dromara.im.domain.bo; |
|||
|
|||
import org.dromara.im.domain.ImGroup; |
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import jakarta.validation.constraints.*; |
|||
import org.dromara.common.translation.annotation.Translation; |
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.dromara.common.translation.constant.TransConstant; |
|||
|
|||
/** |
|||
* 群业务对象 im_group |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@AutoMapper(target = ImGroup.class, reverseConvertGenerate = false) |
|||
public class ImGroupBo extends BaseEntity { |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@NotNull(message = "id不能为空") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 群名字 |
|||
*/ |
|||
@NotBlank(message = "群名字不能为空") |
|||
private String name; |
|||
|
|||
/** |
|||
* 群主id |
|||
*/ |
|||
@NotNull(message = "群主id不能为空") |
|||
private Long ownerId; |
|||
|
|||
/** |
|||
* 群头像 |
|||
*/ |
|||
@NotBlank(message = "群头像不能为空") |
|||
private String headImage; |
|||
|
|||
/** |
|||
* 群头像缩略图 |
|||
*/ |
|||
@NotBlank(message = "群头像缩略图不能为空") |
|||
private String headImageThumb; |
|||
|
|||
/** |
|||
* 群公告 |
|||
*/ |
|||
@NotBlank(message = "群公告不能为空") |
|||
private String notice; |
|||
|
|||
/** |
|||
* 群备注 |
|||
*/ |
|||
@NotBlank(message = "群备注不能为空") |
|||
private String remark; |
|||
|
|||
/** |
|||
* 是否已解散 |
|||
*/ |
|||
@NotNull(message = "是否已解散不能为空") |
|||
private Long dissolve; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
@NotNull(message = "创建时间不能为空") |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 是否被封禁 0:否 1:是 |
|||
*/ |
|||
@NotNull(message = "是否被封禁") |
|||
private Long isBanned; |
|||
|
|||
/** |
|||
* 被封禁原因 |
|||
*/ |
|||
@NotBlank(message = "被封禁原因不能为空") |
|||
private String reason; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package org.dromara.im.domain.bo; |
|||
|
|||
import org.dromara.im.domain.ImGroupMember; |
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import jakarta.validation.constraints.*; |
|||
import org.dromara.common.translation.annotation.Translation; |
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.dromara.common.translation.constant.TransConstant; |
|||
|
|||
/** |
|||
* 群成员业务对象 im_group_member |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@AutoMapper(target = ImGroupMember.class, reverseConvertGenerate = false) |
|||
public class ImGroupMemberBo extends BaseEntity { |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@NotNull(message = "id不能为空", groups = { EditGroup.class }) |
|||
private Long id; |
|||
|
|||
/** |
|||
* 群id |
|||
*/ |
|||
@NotNull(message = "群id不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long groupId; |
|||
|
|||
/** |
|||
* 用户id |
|||
*/ |
|||
@NotNull(message = "用户id不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long userId; |
|||
|
|||
/** |
|||
* 组内显示名称 |
|||
*/ |
|||
@NotBlank(message = "组内显示名称不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String remarkNickName; |
|||
|
|||
/** |
|||
* 用户头像 |
|||
*/ |
|||
@NotBlank(message = "用户头像不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String headImage; |
|||
|
|||
/** |
|||
* 群名备注 |
|||
*/ |
|||
@NotBlank(message = "群名备注不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String remarkGroupName; |
|||
|
|||
/** |
|||
* 是否已退出 |
|||
*/ |
|||
@NotNull(message = "是否已退出不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long quit; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
@NotNull(message = "创建时间不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 退出时间 |
|||
*/ |
|||
@NotNull(message = "退出时间不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Date quitTime; |
|||
|
|||
/** |
|||
* 用户昵称 |
|||
*/ |
|||
@NotBlank(message = "用户昵称不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String userNickName; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,98 @@ |
|||
package org.dromara.im.domain.bo; |
|||
|
|||
import org.dromara.im.domain.ImGroupMessage; |
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import jakarta.validation.constraints.*; |
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
|
|||
/** |
|||
* 群消息业务对象 im_group_message |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@AutoMapper(target = ImGroupMessage.class, reverseConvertGenerate = false) |
|||
public class ImGroupMessageBo extends BaseEntity { |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@NotNull(message = "id不能为空", groups = { EditGroup.class }) |
|||
private Long id; |
|||
|
|||
/** |
|||
* 群id |
|||
*/ |
|||
@NotNull(message = "群id不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long groupId; |
|||
|
|||
/** |
|||
* 发送用户id |
|||
*/ |
|||
@NotNull(message = "发送用户id不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long sendId; |
|||
|
|||
/** |
|||
* 发送用户昵称 |
|||
*/ |
|||
@NotBlank(message = "发送用户昵称不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String sendNickName; |
|||
|
|||
/** |
|||
* 被@用户id列表,逗号分隔 |
|||
*/ |
|||
@NotBlank(message = "被@用户id列表,逗号分隔不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String atUserIds; |
|||
|
|||
/** |
|||
* 发送内容 |
|||
*/ |
|||
@NotBlank(message = "发送内容不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String content; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long status; |
|||
|
|||
/** |
|||
* 消息类型 0:文字 1:图片 2:文件 |
|||
*/ |
|||
@NotNull(message = "消息类型 0:文字 1:图片 2:文件不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long type; |
|||
|
|||
/** |
|||
* 发送时间 |
|||
*/ |
|||
@NotNull(message = "发送时间不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Date sendTime; |
|||
|
|||
/** |
|||
* 回执消息是否完成 |
|||
*/ |
|||
@NotNull(message = "回执消息是否完成不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long receiptOk; |
|||
|
|||
/** |
|||
* 是否回执消息 |
|||
*/ |
|||
@NotNull(message = "是否回执消息不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long receipt; |
|||
|
|||
/** |
|||
* 接收用户id,逗号分隔,为空表示发给所有成员 |
|||
*/ |
|||
@NotBlank(message = "接收用户id,逗号分隔,为空表示发给所有成员不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String recvIds; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
package org.dromara.im.domain.bo; |
|||
|
|||
import org.dromara.im.domain.ImPrivateMessage; |
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import jakarta.validation.constraints.*; |
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
|
|||
/** |
|||
* 私聊消息业务对象 im_private_message |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@AutoMapper(target = ImPrivateMessage.class, reverseConvertGenerate = false) |
|||
public class ImPrivateMessageBo extends BaseEntity { |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@NotNull(message = "id不能为空", groups = { EditGroup.class }) |
|||
private Long id; |
|||
|
|||
/** |
|||
* 发送用户id |
|||
*/ |
|||
@NotNull(message = "发送用户id不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long sendId; |
|||
|
|||
/** |
|||
* 接收用户id |
|||
*/ |
|||
@NotNull(message = "接收用户id不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long recvId; |
|||
|
|||
/** |
|||
* 发送内容 |
|||
*/ |
|||
@NotBlank(message = "发送内容不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String content; |
|||
|
|||
/** |
|||
* 消息类型 0:文字 1:图片 2:文件 |
|||
*/ |
|||
@NotNull(message = "消息类型 0:文字 1:图片 2:文件不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long type; |
|||
|
|||
/** |
|||
* 状态 0:未读 1:已读 |
|||
*/ |
|||
@NotNull(message = "状态 0:未读 1:已读 不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long status; |
|||
|
|||
/** |
|||
* 发送时间 |
|||
*/ |
|||
@NotNull(message = "发送时间不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Date sendTime; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,48 @@ |
|||
package org.dromara.im.domain.bo; |
|||
|
|||
import org.dromara.im.domain.ImSensitiveWord; |
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import jakarta.validation.constraints.*; |
|||
|
|||
/** |
|||
* 敏感词业务对象 im_sensitive_word |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@AutoMapper(target = ImSensitiveWord.class, reverseConvertGenerate = false) |
|||
public class ImSensitiveWordBo extends BaseEntity { |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@NotNull(message = "id不能为空", groups = { EditGroup.class }) |
|||
private Long id; |
|||
|
|||
/** |
|||
* 敏感词内容 |
|||
*/ |
|||
@NotBlank(message = "敏感词内容不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String content; |
|||
|
|||
/** |
|||
* 是否启用 0:未启用 1:启用 |
|||
*/ |
|||
@NotNull(message = "是否启用 0:未启用 1:启用不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long enabled; |
|||
|
|||
/** |
|||
* 创建者 |
|||
*/ |
|||
@NotNull(message = "创建者不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long creator; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,86 @@ |
|||
package org.dromara.im.domain.bo; |
|||
|
|||
import org.dromara.im.domain.ImSmPushTask; |
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import jakarta.validation.constraints.*; |
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
|
|||
/** |
|||
* 系统消息推送任务业务对象 im_sm_push_task |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@AutoMapper(target = ImSmPushTask.class, reverseConvertGenerate = false) |
|||
public class ImSmPushTaskBo extends BaseEntity { |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@NotNull(message = "id不能为空", groups = { EditGroup.class }) |
|||
private Long id; |
|||
|
|||
/** |
|||
* 系统消息id |
|||
*/ |
|||
@NotNull(message = "系统消息id不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long messageId; |
|||
|
|||
/** |
|||
* 发送序列号 |
|||
*/ |
|||
@NotNull(message = "发送序列号不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long seqNo; |
|||
|
|||
/** |
|||
* 推送时间 |
|||
*/ |
|||
@NotNull(message = "推送时间不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Date sendTime; |
|||
|
|||
/** |
|||
* 状态 1:待发送 2:发送中 3:已发送 4:已取消 |
|||
*/ |
|||
@NotNull(message = "状态 1:待发送 2:发送中 3:已发送 4:已取消不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long status; |
|||
|
|||
/** |
|||
* 是否发送给全体用户 |
|||
*/ |
|||
@NotNull(message = "是否发送给全体用户不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long sendToAll; |
|||
|
|||
/** |
|||
* 接收用户id,逗号分隔,send_to_all为false时有效 |
|||
*/ |
|||
@NotBlank(message = "接收用户id,逗号分隔,send_to_all为false时有效不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String recvIds; |
|||
|
|||
/** |
|||
* 删除标识 0:正常 1:已删除 |
|||
*/ |
|||
@NotNull(message = "删除标识 0:正常 1:已删除不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long deleted; |
|||
|
|||
/** |
|||
* 创建者 |
|||
*/ |
|||
@NotNull(message = "创建者不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long creator; |
|||
|
|||
/** |
|||
* 更新者 |
|||
*/ |
|||
@NotNull(message = "更新者不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long updater; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,84 @@ |
|||
package org.dromara.im.domain.bo; |
|||
|
|||
import org.dromara.im.domain.ImSystemMessage; |
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import jakarta.validation.constraints.*; |
|||
|
|||
/** |
|||
* 系统消息业务对象 im_system_message |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@AutoMapper(target = ImSystemMessage.class, reverseConvertGenerate = false) |
|||
public class ImSystemMessageBo extends BaseEntity { |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@NotNull(message = "id不能为空", groups = { EditGroup.class }) |
|||
private Long id; |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
@NotBlank(message = "标题不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String title; |
|||
|
|||
/** |
|||
* 封面 |
|||
*/ |
|||
@NotBlank(message = "封面不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String coverUrl; |
|||
|
|||
/** |
|||
* 简介 |
|||
*/ |
|||
@NotBlank(message = "简介不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String intro; |
|||
|
|||
/** |
|||
* 内容类型 0:富文本 1:外部链接 |
|||
*/ |
|||
@NotNull(message = "内容类型 0:富文本 1:外部链接不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long contentType; |
|||
|
|||
/** |
|||
* 富文本内容,base64编码 |
|||
*/ |
|||
@NotBlank(message = "富文本内容,base64编码不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String richText; |
|||
|
|||
/** |
|||
* 外部链接 |
|||
*/ |
|||
@NotBlank(message = "外部链接不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private String externLink; |
|||
|
|||
/** |
|||
* 删除标识 0:正常 1:已删除 |
|||
*/ |
|||
@NotNull(message = "删除标识 0:正常 1:已删除不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long deleted; |
|||
|
|||
/** |
|||
* 创建者 |
|||
*/ |
|||
@NotNull(message = "创建者不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long creator; |
|||
|
|||
/** |
|||
* 更新者 |
|||
*/ |
|||
@NotNull(message = "更新者不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long updater; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,102 @@ |
|||
package org.dromara.im.domain.bo; |
|||
|
|||
import org.dromara.im.domain.ImUser; |
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import jakarta.validation.constraints.*; |
|||
import org.dromara.common.translation.annotation.Translation; |
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.dromara.common.translation.constant.TransConstant; |
|||
|
|||
/** |
|||
* 用户业务对象 im_user |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@AutoMapper(target = ImUser.class, reverseConvertGenerate = false) |
|||
public class ImUserBo { |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@NotNull(message = "id不能为空", groups = { EditGroup.class }) |
|||
private Long id; |
|||
|
|||
/** |
|||
* 用户名 |
|||
*/ |
|||
private String userName; |
|||
|
|||
/** |
|||
* 用户昵称 |
|||
*/ |
|||
private String nickName; |
|||
|
|||
/** |
|||
* 用户头像 |
|||
*/ |
|||
private String headImage; |
|||
|
|||
/** |
|||
* 用户头像缩略图 |
|||
*/ |
|||
private String headImageThumb; |
|||
|
|||
/** |
|||
* 密码(明文) |
|||
*/ |
|||
private String password; |
|||
|
|||
/** |
|||
* 性别 0:男 1::女 |
|||
*/ |
|||
private Long sex; |
|||
|
|||
/** |
|||
* 个性签名 |
|||
*/ |
|||
private String signature; |
|||
|
|||
/** |
|||
* 最后登录时间 |
|||
*/ |
|||
private Date lastLoginTime; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Long type; |
|||
|
|||
/** |
|||
* 是否被封禁 |
|||
*/ |
|||
private Boolean isBanned; |
|||
|
|||
/** |
|||
* 被封禁原因 |
|||
*/ |
|||
private String reason; |
|||
|
|||
/** |
|||
* 客户端id,用于uni-push推送 |
|||
*/ |
|||
private String cid; |
|||
|
|||
/** |
|||
* 状态 0:正常 1:已注销 |
|||
*/ |
|||
private Long status; |
|||
|
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
package org.dromara.im.domain.dto; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import jakarta.validation.constraints.NotNull; |
|||
import lombok.Data; |
|||
import org.hibernate.validator.constraints.Length; |
|||
|
|||
/** |
|||
* @author: Blue |
|||
* @date: 2024-07-14 |
|||
* @version: 1.0 |
|||
*/ |
|||
@Data |
|||
@Schema(description = "用户锁定") |
|||
public class ImUserBanDTO { |
|||
|
|||
@NotNull(message = "用户id不可为空") |
|||
@Schema(description = "用户id") |
|||
private Long id; |
|||
|
|||
@Length(max = 128, message = "封禁原因长度不能超过128") |
|||
@Schema(description = "锁定原因") |
|||
private String reason; |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
package org.dromara.im.domain.dto; |
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import jakarta.validation.constraints.NotNull; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author: Blue |
|||
* @date: 2024-07-14 |
|||
* @version: 1.0 |
|||
*/ |
|||
@Data |
|||
@Schema(description = "用户解锁") |
|||
public class ImUserUnbanDTO { |
|||
|
|||
@NotNull(message = "用户id不可为空") |
|||
@Schema(description = "用户id") |
|||
private Long id; |
|||
|
|||
} |
|||
@ -0,0 +1,96 @@ |
|||
package org.dromara.im.domain.vo; |
|||
|
|||
import org.dromara.common.translation.annotation.Translation; |
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.dromara.common.translation.constant.TransConstant; |
|||
import org.dromara.im.domain.ImGroupMember; |
|||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import org.dromara.common.excel.annotation.ExcelDictFormat; |
|||
import org.dromara.common.excel.convert.ExcelDictConvert; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 群成员视图对象 im_group_member |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@ExcelIgnoreUnannotated |
|||
@AutoMapper(target = ImGroupMember.class) |
|||
public class ImGroupMemberVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@ExcelProperty(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 群id |
|||
*/ |
|||
@ExcelProperty(value = "群id") |
|||
private Long groupId; |
|||
|
|||
/** |
|||
* 用户id |
|||
*/ |
|||
@ExcelProperty(value = "用户id") |
|||
private Long userId; |
|||
|
|||
/** |
|||
* 组内显示名称 |
|||
*/ |
|||
@ExcelProperty(value = "组内显示名称") |
|||
private String remarkNickName; |
|||
|
|||
/** |
|||
* 用户头像 |
|||
*/ |
|||
@ExcelProperty(value = "用户头像") |
|||
private String headImage; |
|||
|
|||
/** |
|||
* 群名备注 |
|||
*/ |
|||
@ExcelProperty(value = "群名备注") |
|||
private String remarkGroupName; |
|||
|
|||
/** |
|||
* 是否已退出 |
|||
*/ |
|||
@ExcelProperty(value = "是否已退出") |
|||
private Long quit; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
@ExcelProperty(value = "创建时间") |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 退出时间 |
|||
*/ |
|||
@ExcelProperty(value = "退出时间") |
|||
private Date quitTime; |
|||
|
|||
/** |
|||
* 用户昵称 |
|||
*/ |
|||
@ExcelProperty(value = "用户昵称") |
|||
private String userNickName; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,106 @@ |
|||
package org.dromara.im.domain.vo; |
|||
|
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.dromara.im.domain.ImGroupMessage; |
|||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import org.dromara.common.excel.annotation.ExcelDictFormat; |
|||
import org.dromara.common.excel.convert.ExcelDictConvert; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 群消息视图对象 im_group_message |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@ExcelIgnoreUnannotated |
|||
@AutoMapper(target = ImGroupMessage.class) |
|||
public class ImGroupMessageVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@ExcelProperty(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 群id |
|||
*/ |
|||
@ExcelProperty(value = "群id") |
|||
private Long groupId; |
|||
|
|||
/** |
|||
* 发送用户id |
|||
*/ |
|||
@ExcelProperty(value = "发送用户id") |
|||
private Long sendId; |
|||
|
|||
/** |
|||
* 发送用户昵称 |
|||
*/ |
|||
@ExcelProperty(value = "发送用户昵称") |
|||
private String sendNickName; |
|||
|
|||
/** |
|||
* 被@用户id列表,逗号分隔 |
|||
*/ |
|||
@ExcelProperty(value = "被@用户id列表,逗号分隔") |
|||
private String atUserIds; |
|||
|
|||
/** |
|||
* 发送内容 |
|||
*/ |
|||
@ExcelProperty(value = "发送内容") |
|||
private String content; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@ExcelProperty(value = "") |
|||
private Long status; |
|||
|
|||
/** |
|||
* 消息类型 0:文字 1:图片 2:文件 |
|||
*/ |
|||
@ExcelProperty(value = "消息类型 0:文字 1:图片 2:文件") |
|||
private Long type; |
|||
|
|||
/** |
|||
* 发送时间 |
|||
*/ |
|||
@ExcelProperty(value = "发送时间") |
|||
private Date sendTime; |
|||
|
|||
/** |
|||
* 回执消息是否完成 |
|||
*/ |
|||
@ExcelProperty(value = "回执消息是否完成") |
|||
private Long receiptOk; |
|||
|
|||
/** |
|||
* 是否回执消息 |
|||
*/ |
|||
@ExcelProperty(value = "是否回执消息") |
|||
private Long receipt; |
|||
|
|||
/** |
|||
* 接收用户id,逗号分隔,为空表示发给所有成员 |
|||
*/ |
|||
@ExcelProperty(value = "接收用户id,逗号分隔,为空表示发给所有成员") |
|||
private String recvIds; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,103 @@ |
|||
package org.dromara.im.domain.vo; |
|||
|
|||
import org.dromara.common.translation.annotation.Translation; |
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.dromara.common.translation.constant.TransConstant; |
|||
import org.dromara.im.domain.ImGroup; |
|||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import org.dromara.common.excel.annotation.ExcelDictFormat; |
|||
import org.dromara.common.excel.convert.ExcelDictConvert; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 群视图对象 im_group |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@ExcelIgnoreUnannotated |
|||
@AutoMapper(target = ImGroup.class) |
|||
public class ImGroupVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@ExcelProperty(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 群名字 |
|||
*/ |
|||
@ExcelProperty(value = "群名字") |
|||
private String name; |
|||
|
|||
/** |
|||
* 群主id |
|||
*/ |
|||
@ExcelProperty(value = "群主id") |
|||
private Long ownerId; |
|||
|
|||
/** |
|||
* 群头像 |
|||
*/ |
|||
@ExcelProperty(value = "群头像") |
|||
private String headImage; |
|||
|
|||
|
|||
/** |
|||
* 群头像缩略图 |
|||
*/ |
|||
@ExcelProperty(value = "群头像缩略图") |
|||
private String headImageThumb; |
|||
|
|||
/** |
|||
* 群公告 |
|||
*/ |
|||
@ExcelProperty(value = "群公告") |
|||
private String notice; |
|||
|
|||
/** |
|||
* 群备注 |
|||
*/ |
|||
@ExcelProperty(value = "群备注") |
|||
private String remark; |
|||
|
|||
/** |
|||
* 是否已解散 |
|||
*/ |
|||
@ExcelProperty(value = "是否已解散") |
|||
private Long dissolve; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
@ExcelProperty(value = "创建时间") |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 是否被封禁 0:否 1:是 |
|||
*/ |
|||
@ExcelProperty(value = "是否被封禁 0:否 1:是") |
|||
private Long isBanned; |
|||
|
|||
/** |
|||
* 被封禁原因 |
|||
*/ |
|||
@ExcelProperty(value = "被封禁原因") |
|||
private String reason; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,76 @@ |
|||
package org.dromara.im.domain.vo; |
|||
|
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.dromara.im.domain.ImPrivateMessage; |
|||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import org.dromara.common.excel.annotation.ExcelDictFormat; |
|||
import org.dromara.common.excel.convert.ExcelDictConvert; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 私聊消息视图对象 im_private_message |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@ExcelIgnoreUnannotated |
|||
@AutoMapper(target = ImPrivateMessage.class) |
|||
public class ImPrivateMessageVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@ExcelProperty(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 发送用户id |
|||
*/ |
|||
@ExcelProperty(value = "发送用户id") |
|||
private Long sendId; |
|||
|
|||
/** |
|||
* 接收用户id |
|||
*/ |
|||
@ExcelProperty(value = "接收用户id") |
|||
private Long recvId; |
|||
|
|||
/** |
|||
* 发送内容 |
|||
*/ |
|||
@ExcelProperty(value = "发送内容") |
|||
private String content; |
|||
|
|||
/** |
|||
* 消息类型 0:文字 1:图片 2:文件 |
|||
*/ |
|||
@ExcelProperty(value = "消息类型 0:文字 1:图片 2:文件") |
|||
private Long type; |
|||
|
|||
/** |
|||
* 状态 0:未读 1:已读 |
|||
*/ |
|||
@ExcelProperty(value = "状态 0:未读 1:已读 ") |
|||
private Long status; |
|||
|
|||
/** |
|||
* 发送时间 |
|||
*/ |
|||
@ExcelProperty(value = "发送时间") |
|||
private Date sendTime; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,56 @@ |
|||
package org.dromara.im.domain.vo; |
|||
|
|||
import org.dromara.im.domain.ImSensitiveWord; |
|||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import org.dromara.common.excel.annotation.ExcelDictFormat; |
|||
import org.dromara.common.excel.convert.ExcelDictConvert; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 敏感词视图对象 im_sensitive_word |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@ExcelIgnoreUnannotated |
|||
@AutoMapper(target = ImSensitiveWord.class) |
|||
public class ImSensitiveWordVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@ExcelProperty(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 敏感词内容 |
|||
*/ |
|||
@ExcelProperty(value = "敏感词内容") |
|||
private String content; |
|||
|
|||
/** |
|||
* 是否启用 0:未启用 1:启用 |
|||
*/ |
|||
@ExcelProperty(value = "是否启用 0:未启用 1:启用") |
|||
private Long enabled; |
|||
|
|||
/** |
|||
* 创建者 |
|||
*/ |
|||
@ExcelProperty(value = "创建者") |
|||
private Long creator; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,94 @@ |
|||
package org.dromara.im.domain.vo; |
|||
|
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.dromara.im.domain.ImSmPushTask; |
|||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import org.dromara.common.excel.annotation.ExcelDictFormat; |
|||
import org.dromara.common.excel.convert.ExcelDictConvert; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 系统消息推送任务视图对象 im_sm_push_task |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@ExcelIgnoreUnannotated |
|||
@AutoMapper(target = ImSmPushTask.class) |
|||
public class ImSmPushTaskVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@ExcelProperty(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 系统消息id |
|||
*/ |
|||
@ExcelProperty(value = "系统消息id") |
|||
private Long messageId; |
|||
|
|||
/** |
|||
* 发送序列号 |
|||
*/ |
|||
@ExcelProperty(value = "发送序列号") |
|||
private Long seqNo; |
|||
|
|||
/** |
|||
* 推送时间 |
|||
*/ |
|||
@ExcelProperty(value = "推送时间") |
|||
private Date sendTime; |
|||
|
|||
/** |
|||
* 状态 1:待发送 2:发送中 3:已发送 4:已取消 |
|||
*/ |
|||
@ExcelProperty(value = "状态 1:待发送 2:发送中 3:已发送 4:已取消") |
|||
private Long status; |
|||
|
|||
/** |
|||
* 是否发送给全体用户 |
|||
*/ |
|||
@ExcelProperty(value = "是否发送给全体用户") |
|||
private Long sendToAll; |
|||
|
|||
/** |
|||
* 接收用户id,逗号分隔,send_to_all为false时有效 |
|||
*/ |
|||
@ExcelProperty(value = "接收用户id,逗号分隔,send_to_all为false时有效") |
|||
private String recvIds; |
|||
|
|||
/** |
|||
* 删除标识 0:正常 1:已删除 |
|||
*/ |
|||
@ExcelProperty(value = "删除标识 0:正常 1:已删除") |
|||
private Long deleted; |
|||
|
|||
/** |
|||
* 创建者 |
|||
*/ |
|||
@ExcelProperty(value = "创建者") |
|||
private Long creator; |
|||
|
|||
/** |
|||
* 更新者 |
|||
*/ |
|||
@ExcelProperty(value = "更新者") |
|||
private Long updater; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,92 @@ |
|||
package org.dromara.im.domain.vo; |
|||
|
|||
import org.dromara.im.domain.ImSystemMessage; |
|||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import org.dromara.common.excel.annotation.ExcelDictFormat; |
|||
import org.dromara.common.excel.convert.ExcelDictConvert; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 系统消息视图对象 im_system_message |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@ExcelIgnoreUnannotated |
|||
@AutoMapper(target = ImSystemMessage.class) |
|||
public class ImSystemMessageVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@ExcelProperty(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
@ExcelProperty(value = "标题") |
|||
private String title; |
|||
|
|||
/** |
|||
* 封面 |
|||
*/ |
|||
@ExcelProperty(value = "封面") |
|||
private String coverUrl; |
|||
|
|||
/** |
|||
* 简介 |
|||
*/ |
|||
@ExcelProperty(value = "简介") |
|||
private String intro; |
|||
|
|||
/** |
|||
* 内容类型 0:富文本 1:外部链接 |
|||
*/ |
|||
@ExcelProperty(value = "内容类型 0:富文本 1:外部链接") |
|||
private Long contentType; |
|||
|
|||
/** |
|||
* 富文本内容,base64编码 |
|||
*/ |
|||
@ExcelProperty(value = "富文本内容,base64编码") |
|||
private String richText; |
|||
|
|||
/** |
|||
* 外部链接 |
|||
*/ |
|||
@ExcelProperty(value = "外部链接") |
|||
private String externLink; |
|||
|
|||
/** |
|||
* 删除标识 0:正常 1:已删除 |
|||
*/ |
|||
@ExcelProperty(value = "删除标识 0:正常 1:已删除") |
|||
private Long deleted; |
|||
|
|||
/** |
|||
* 创建者 |
|||
*/ |
|||
@ExcelProperty(value = "创建者") |
|||
private Long creator; |
|||
|
|||
/** |
|||
* 更新者 |
|||
*/ |
|||
@ExcelProperty(value = "更新者") |
|||
private Long updater; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,126 @@ |
|||
package org.dromara.im.domain.vo; |
|||
|
|||
import org.dromara.common.translation.annotation.Translation; |
|||
import java.util.Date; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.dromara.common.translation.constant.TransConstant; |
|||
import org.dromara.im.domain.ImUser; |
|||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import org.dromara.common.excel.annotation.ExcelDictFormat; |
|||
import org.dromara.common.excel.convert.ExcelDictConvert; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 用户视图对象 im_user |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@Data |
|||
@ExcelIgnoreUnannotated |
|||
@AutoMapper(target = ImUser.class) |
|||
public class ImUserVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@ExcelProperty(value = "id") |
|||
private Long id; |
|||
|
|||
/** |
|||
* 用户名 |
|||
*/ |
|||
@ExcelProperty(value = "用户名") |
|||
private String userName; |
|||
|
|||
/** |
|||
* 用户昵称 |
|||
*/ |
|||
@ExcelProperty(value = "用户昵称") |
|||
private String nickName; |
|||
|
|||
/** |
|||
* 用户头像 |
|||
*/ |
|||
@ExcelProperty(value = "用户头像") |
|||
private String headImage; |
|||
|
|||
|
|||
/** |
|||
* 用户头像缩略图 |
|||
*/ |
|||
private String headImageThumb; |
|||
|
|||
/** |
|||
* 密码(明文) |
|||
*/ |
|||
private String password; |
|||
|
|||
/** |
|||
* 性别 0:男 1::女 |
|||
*/ |
|||
@ExcelProperty(value = "性别", converter = ExcelDictConvert.class) |
|||
@ExcelDictFormat(readConverterExp = "0=男,1=女") |
|||
private Long sex; |
|||
|
|||
/** |
|||
* 个性签名 |
|||
*/ |
|||
private String signature; |
|||
|
|||
/** |
|||
* 最后登录时间 |
|||
*/ |
|||
@ExcelProperty(value = "最后登录时间") |
|||
private Date lastLoginTime; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
@ExcelProperty(value = "创建时间") |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 类型 |
|||
*/ |
|||
private Long type; |
|||
|
|||
/** |
|||
* 是否被封禁 0:否 1:是 |
|||
*/ |
|||
@ExcelProperty(value = "是否被封禁", converter = ExcelDictConvert.class) |
|||
@ExcelDictFormat(readConverterExp = "0=否,1=是") |
|||
private Boolean isBanned; |
|||
|
|||
/** |
|||
* 被封禁原因 |
|||
*/ |
|||
@ExcelProperty(value = "被封禁原因") |
|||
private String reason; |
|||
|
|||
/** |
|||
* 客户端id,用于uni-push推送 |
|||
*/ |
|||
@ExcelProperty(value = "客户端id") |
|||
private String cid; |
|||
|
|||
/** |
|||
* 状态 0:正常 1:已注销 |
|||
*/ |
|||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class) |
|||
@ExcelDictFormat(readConverterExp = "0=正常,1=已注销") |
|||
private Long status; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
package org.dromara.im.mapper; |
|||
|
|||
import org.dromara.im.domain.ImGroup; |
|||
import org.dromara.im.domain.vo.ImGroupVo; |
|||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
|||
|
|||
/** |
|||
* 群Mapper接口 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
public interface ImGroupMapper extends BaseMapperPlus<ImGroup, ImGroupVo> { |
|||
|
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
package org.dromara.im.mapper; |
|||
|
|||
import org.dromara.im.domain.ImGroupMember; |
|||
import org.dromara.im.domain.vo.ImGroupMemberVo; |
|||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
|||
|
|||
/** |
|||
* 群成员Mapper接口 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
public interface ImGroupMemberMapper extends BaseMapperPlus<ImGroupMember, ImGroupMemberVo> { |
|||
|
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
package org.dromara.im.mapper; |
|||
|
|||
import org.dromara.im.domain.ImGroupMessage; |
|||
import org.dromara.im.domain.vo.ImGroupMessageVo; |
|||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
|||
|
|||
/** |
|||
* 群消息Mapper接口 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
public interface ImGroupMessageMapper extends BaseMapperPlus<ImGroupMessage, ImGroupMessageVo> { |
|||
|
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
package org.dromara.im.mapper; |
|||
|
|||
import org.dromara.im.domain.ImPrivateMessage; |
|||
import org.dromara.im.domain.vo.ImPrivateMessageVo; |
|||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
|||
|
|||
/** |
|||
* 私聊消息Mapper接口 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
public interface ImPrivateMessageMapper extends BaseMapperPlus<ImPrivateMessage, ImPrivateMessageVo> { |
|||
|
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
package org.dromara.im.mapper; |
|||
|
|||
import org.dromara.im.domain.ImSensitiveWord; |
|||
import org.dromara.im.domain.vo.ImSensitiveWordVo; |
|||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
|||
|
|||
/** |
|||
* 敏感词Mapper接口 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
public interface ImSensitiveWordMapper extends BaseMapperPlus<ImSensitiveWord, ImSensitiveWordVo> { |
|||
|
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
package org.dromara.im.mapper; |
|||
|
|||
import org.dromara.im.domain.ImSmPushTask; |
|||
import org.dromara.im.domain.vo.ImSmPushTaskVo; |
|||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
|||
|
|||
/** |
|||
* 系统消息推送任务Mapper接口 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
public interface ImSmPushTaskMapper extends BaseMapperPlus<ImSmPushTask, ImSmPushTaskVo> { |
|||
|
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
package org.dromara.im.mapper; |
|||
|
|||
import org.dromara.im.domain.ImSystemMessage; |
|||
import org.dromara.im.domain.vo.ImSystemMessageVo; |
|||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
|||
|
|||
/** |
|||
* 系统消息Mapper接口 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
public interface ImSystemMessageMapper extends BaseMapperPlus<ImSystemMessage, ImSystemMessageVo> { |
|||
|
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
package org.dromara.im.mapper; |
|||
|
|||
import org.dromara.im.domain.ImUser; |
|||
import org.dromara.im.domain.vo.ImUserVo; |
|||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
|||
|
|||
/** |
|||
* 用户Mapper接口 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
public interface ImUserMapper extends BaseMapperPlus<ImUser, ImUserVo> { |
|||
|
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
package org.dromara.im.mq; |
|||
|
|||
import com.alibaba.fastjson.support.spring.FastJsonRedisSerializer; |
|||
import org.springframework.context.annotation.Bean; |
|||
import org.springframework.context.annotation.Configuration; |
|||
import org.springframework.data.redis.connection.RedisConnectionFactory; |
|||
import org.springframework.data.redis.serializer.StringRedisSerializer; |
|||
|
|||
@Configuration |
|||
public class ImRedisMQConfig { |
|||
|
|||
@Bean |
|||
public ImRedisMQTemplate redisMQTemplate(RedisConnectionFactory redisConnectionFactory) { |
|||
ImRedisMQTemplate redisMQTemplate = new ImRedisMQTemplate(); |
|||
redisMQTemplate.setConnectionFactory(redisConnectionFactory); |
|||
// 设置值(value)的序列化采用FastJsonRedisSerializer
|
|||
redisMQTemplate.setValueSerializer(fastJsonRedisSerializer()); |
|||
redisMQTemplate.setHashValueSerializer(fastJsonRedisSerializer()); |
|||
// 设置键(key)的序列化采用StringRedisSerializer。
|
|||
redisMQTemplate.setKeySerializer(new StringRedisSerializer()); |
|||
redisMQTemplate.setHashKeySerializer(new StringRedisSerializer()); |
|||
redisMQTemplate.afterPropertiesSet(); |
|||
return redisMQTemplate; |
|||
} |
|||
|
|||
@Bean |
|||
public FastJsonRedisSerializer fastJsonRedisSerializer(){ |
|||
return new FastJsonRedisSerializer<>(Object.class); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
package org.dromara.im.mq; |
|||
|
|||
import org.springframework.data.redis.core.RedisTemplate; |
|||
|
|||
/** |
|||
* @author: Blue |
|||
* @date: 2024-07-16 |
|||
* @version: 1.0 |
|||
*/ |
|||
public class ImRedisMQTemplate extends RedisTemplate<String,Object> { |
|||
|
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
package org.dromara.im.service; |
|||
|
|||
import org.dromara.im.domain.vo.ImGroupMemberVo; |
|||
import org.dromara.im.domain.bo.ImGroupMemberBo; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
|
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 群成员Service接口 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
public interface IImGroupMemberService { |
|||
|
|||
/** |
|||
* 查询群成员 |
|||
* |
|||
* @param id 主键 |
|||
* @return 群成员 |
|||
*/ |
|||
ImGroupMemberVo queryById(Long id); |
|||
|
|||
/** |
|||
* 分页查询群成员列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 群成员分页列表 |
|||
*/ |
|||
TableDataInfo<ImGroupMemberVo> queryPageList(ImGroupMemberBo bo, PageQuery pageQuery); |
|||
|
|||
/** |
|||
* 查询符合条件的群成员列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 群成员列表 |
|||
*/ |
|||
List<ImGroupMemberVo> queryList(ImGroupMemberBo bo); |
|||
|
|||
/** |
|||
* 新增群成员 |
|||
* |
|||
* @param bo 群成员 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
Boolean insertByBo(ImGroupMemberBo bo); |
|||
|
|||
/** |
|||
* 修改群成员 |
|||
* |
|||
* @param bo 群成员 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
Boolean updateByBo(ImGroupMemberBo bo); |
|||
|
|||
/** |
|||
* 校验并批量删除群成员信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
package org.dromara.im.service; |
|||
|
|||
import org.dromara.im.domain.vo.ImGroupMessageVo; |
|||
import org.dromara.im.domain.bo.ImGroupMessageBo; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
|
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 群消息Service接口 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
public interface IImGroupMessageService { |
|||
|
|||
/** |
|||
* 查询群消息 |
|||
* |
|||
* @param id 主键 |
|||
* @return 群消息 |
|||
*/ |
|||
ImGroupMessageVo queryById(Long id); |
|||
|
|||
/** |
|||
* 分页查询群消息列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 群消息分页列表 |
|||
*/ |
|||
TableDataInfo<ImGroupMessageVo> queryPageList(ImGroupMessageBo bo, PageQuery pageQuery); |
|||
|
|||
/** |
|||
* 查询符合条件的群消息列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 群消息列表 |
|||
*/ |
|||
List<ImGroupMessageVo> queryList(ImGroupMessageBo bo); |
|||
|
|||
/** |
|||
* 新增群消息 |
|||
* |
|||
* @param bo 群消息 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
Boolean insertByBo(ImGroupMessageBo bo); |
|||
|
|||
/** |
|||
* 修改群消息 |
|||
* |
|||
* @param bo 群消息 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
Boolean updateByBo(ImGroupMessageBo bo); |
|||
|
|||
/** |
|||
* 校验并批量删除群消息信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
package org.dromara.im.service; |
|||
|
|||
import org.dromara.im.domain.vo.ImGroupVo; |
|||
import org.dromara.im.domain.bo.ImGroupBo; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
|
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 群Service接口 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
public interface IImGroupService { |
|||
|
|||
/** |
|||
* 查询群 |
|||
* |
|||
* @param id 主键 |
|||
* @return 群 |
|||
*/ |
|||
ImGroupVo queryById(Long id); |
|||
|
|||
/** |
|||
* 分页查询群列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 群分页列表 |
|||
*/ |
|||
TableDataInfo<ImGroupVo> queryPageList(ImGroupBo bo, PageQuery pageQuery); |
|||
|
|||
/** |
|||
* 查询符合条件的群列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 群列表 |
|||
*/ |
|||
List<ImGroupVo> queryList(ImGroupBo bo); |
|||
|
|||
/** |
|||
* 新增群 |
|||
* |
|||
* @param bo 群 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
Boolean insertByBo(ImGroupBo bo); |
|||
|
|||
/** |
|||
* 修改群 |
|||
* |
|||
* @param bo 群 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
Boolean updateByBo(ImGroupBo bo); |
|||
|
|||
/** |
|||
* 校验并批量删除群信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
package org.dromara.im.service; |
|||
|
|||
import org.dromara.im.domain.vo.ImPrivateMessageVo; |
|||
import org.dromara.im.domain.bo.ImPrivateMessageBo; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
|
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 私聊消息Service接口 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
public interface IImPrivateMessageService { |
|||
|
|||
/** |
|||
* 查询私聊消息 |
|||
* |
|||
* @param id 主键 |
|||
* @return 私聊消息 |
|||
*/ |
|||
ImPrivateMessageVo queryById(Long id); |
|||
|
|||
/** |
|||
* 分页查询私聊消息列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 私聊消息分页列表 |
|||
*/ |
|||
TableDataInfo<ImPrivateMessageVo> queryPageList(ImPrivateMessageBo bo, PageQuery pageQuery); |
|||
|
|||
/** |
|||
* 查询符合条件的私聊消息列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 私聊消息列表 |
|||
*/ |
|||
List<ImPrivateMessageVo> queryList(ImPrivateMessageBo bo); |
|||
|
|||
/** |
|||
* 新增私聊消息 |
|||
* |
|||
* @param bo 私聊消息 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
Boolean insertByBo(ImPrivateMessageBo bo); |
|||
|
|||
/** |
|||
* 修改私聊消息 |
|||
* |
|||
* @param bo 私聊消息 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
Boolean updateByBo(ImPrivateMessageBo bo); |
|||
|
|||
/** |
|||
* 校验并批量删除私聊消息信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
package org.dromara.im.service; |
|||
|
|||
import org.dromara.im.domain.vo.ImSensitiveWordVo; |
|||
import org.dromara.im.domain.bo.ImSensitiveWordBo; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
|
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 敏感词Service接口 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
public interface IImSensitiveWordService { |
|||
|
|||
/** |
|||
* 查询敏感词 |
|||
* |
|||
* @param id 主键 |
|||
* @return 敏感词 |
|||
*/ |
|||
ImSensitiveWordVo queryById(Long id); |
|||
|
|||
/** |
|||
* 分页查询敏感词列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 敏感词分页列表 |
|||
*/ |
|||
TableDataInfo<ImSensitiveWordVo> queryPageList(ImSensitiveWordBo bo, PageQuery pageQuery); |
|||
|
|||
/** |
|||
* 查询符合条件的敏感词列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 敏感词列表 |
|||
*/ |
|||
List<ImSensitiveWordVo> queryList(ImSensitiveWordBo bo); |
|||
|
|||
/** |
|||
* 新增敏感词 |
|||
* |
|||
* @param bo 敏感词 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
Boolean insertByBo(ImSensitiveWordBo bo); |
|||
|
|||
/** |
|||
* 修改敏感词 |
|||
* |
|||
* @param bo 敏感词 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
Boolean updateByBo(ImSensitiveWordBo bo); |
|||
|
|||
/** |
|||
* 校验并批量删除敏感词信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
package org.dromara.im.service; |
|||
|
|||
import org.dromara.im.domain.vo.ImSmPushTaskVo; |
|||
import org.dromara.im.domain.bo.ImSmPushTaskBo; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
|
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 系统消息推送任务Service接口 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
public interface IImSmPushTaskService { |
|||
|
|||
/** |
|||
* 查询系统消息推送任务 |
|||
* |
|||
* @param id 主键 |
|||
* @return 系统消息推送任务 |
|||
*/ |
|||
ImSmPushTaskVo queryById(Long id); |
|||
|
|||
/** |
|||
* 分页查询系统消息推送任务列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 系统消息推送任务分页列表 |
|||
*/ |
|||
TableDataInfo<ImSmPushTaskVo> queryPageList(ImSmPushTaskBo bo, PageQuery pageQuery); |
|||
|
|||
/** |
|||
* 查询符合条件的系统消息推送任务列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 系统消息推送任务列表 |
|||
*/ |
|||
List<ImSmPushTaskVo> queryList(ImSmPushTaskBo bo); |
|||
|
|||
/** |
|||
* 新增系统消息推送任务 |
|||
* |
|||
* @param bo 系统消息推送任务 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
Boolean insertByBo(ImSmPushTaskBo bo); |
|||
|
|||
/** |
|||
* 修改系统消息推送任务 |
|||
* |
|||
* @param bo 系统消息推送任务 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
Boolean updateByBo(ImSmPushTaskBo bo); |
|||
|
|||
/** |
|||
* 校验并批量删除系统消息推送任务信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
package org.dromara.im.service; |
|||
|
|||
import org.dromara.im.domain.vo.ImSystemMessageVo; |
|||
import org.dromara.im.domain.bo.ImSystemMessageBo; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
|
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 系统消息Service接口 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
public interface IImSystemMessageService { |
|||
|
|||
/** |
|||
* 查询系统消息 |
|||
* |
|||
* @param id 主键 |
|||
* @return 系统消息 |
|||
*/ |
|||
ImSystemMessageVo queryById(Long id); |
|||
|
|||
/** |
|||
* 分页查询系统消息列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 系统消息分页列表 |
|||
*/ |
|||
TableDataInfo<ImSystemMessageVo> queryPageList(ImSystemMessageBo bo, PageQuery pageQuery); |
|||
|
|||
/** |
|||
* 查询符合条件的系统消息列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 系统消息列表 |
|||
*/ |
|||
List<ImSystemMessageVo> queryList(ImSystemMessageBo bo); |
|||
|
|||
/** |
|||
* 新增系统消息 |
|||
* |
|||
* @param bo 系统消息 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
Boolean insertByBo(ImSystemMessageBo bo); |
|||
|
|||
/** |
|||
* 修改系统消息 |
|||
* |
|||
* @param bo 系统消息 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
Boolean updateByBo(ImSystemMessageBo bo); |
|||
|
|||
/** |
|||
* 校验并批量删除系统消息信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
|||
} |
|||
@ -0,0 +1,60 @@ |
|||
package org.dromara.im.service; |
|||
|
|||
import org.dromara.im.domain.dto.ImUserBanDTO; |
|||
import org.dromara.im.domain.dto.ImUserUnbanDTO; |
|||
import org.dromara.im.domain.vo.ImUserVo; |
|||
import org.dromara.im.domain.bo.ImUserBo; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
|
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 用户Service接口 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
public interface IImUserService { |
|||
|
|||
/** |
|||
* 查询用户 |
|||
* |
|||
* @param id 主键 |
|||
* @return 用户 |
|||
*/ |
|||
ImUserVo queryById(Long id); |
|||
|
|||
/** |
|||
* 分页查询用户列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 用户分页列表 |
|||
*/ |
|||
TableDataInfo<ImUserVo> queryPageList(ImUserBo bo, PageQuery pageQuery); |
|||
|
|||
/** |
|||
* 查询符合条件的用户列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 用户列表 |
|||
*/ |
|||
List<ImUserVo> queryList(ImUserBo bo); |
|||
|
|||
/** |
|||
* 封禁用户 |
|||
* |
|||
* @param dto dto |
|||
*/ |
|||
void ban(ImUserBanDTO dto); |
|||
|
|||
/** |
|||
* 解封用户 |
|||
* |
|||
* @param dto dto |
|||
*/ |
|||
void unban(ImUserUnbanDTO dto); |
|||
|
|||
} |
|||
@ -0,0 +1,140 @@ |
|||
package org.dromara.im.service.impl; |
|||
|
|||
import com.baomidou.dynamic.datasource.annotation.DS; |
|||
import org.dromara.common.core.utils.MapstructUtils; |
|||
import org.dromara.common.core.utils.StringUtils; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.dromara.im.constant.ImConstant; |
|||
import org.springframework.stereotype.Service; |
|||
import org.dromara.im.domain.bo.ImGroupMemberBo; |
|||
import org.dromara.im.domain.vo.ImGroupMemberVo; |
|||
import org.dromara.im.domain.ImGroupMember; |
|||
import org.dromara.im.mapper.ImGroupMemberMapper; |
|||
import org.dromara.im.service.IImGroupMemberService; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Collection; |
|||
|
|||
/** |
|||
* 群成员Service业务层处理 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@DS(ImConstant.DS_IM_PLATFORM) |
|||
@RequiredArgsConstructor |
|||
@Service |
|||
public class ImGroupMemberServiceImpl implements IImGroupMemberService { |
|||
|
|||
private final ImGroupMemberMapper baseMapper; |
|||
|
|||
/** |
|||
* 查询群成员 |
|||
* |
|||
* @param id 主键 |
|||
* @return 群成员 |
|||
*/ |
|||
@Override |
|||
public ImGroupMemberVo queryById(Long id){ |
|||
return baseMapper.selectVoById(id); |
|||
} |
|||
|
|||
/** |
|||
* 分页查询群成员列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 群成员分页列表 |
|||
*/ |
|||
@Override |
|||
public TableDataInfo<ImGroupMemberVo> queryPageList(ImGroupMemberBo bo, PageQuery pageQuery) { |
|||
LambdaQueryWrapper<ImGroupMember> lqw = buildQueryWrapper(bo); |
|||
Page<ImGroupMemberVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
|||
return TableDataInfo.build(result); |
|||
} |
|||
|
|||
/** |
|||
* 查询符合条件的群成员列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 群成员列表 |
|||
*/ |
|||
@Override |
|||
public List<ImGroupMemberVo> queryList(ImGroupMemberBo bo) { |
|||
LambdaQueryWrapper<ImGroupMember> lqw = buildQueryWrapper(bo); |
|||
return baseMapper.selectVoList(lqw); |
|||
} |
|||
|
|||
private LambdaQueryWrapper<ImGroupMember> buildQueryWrapper(ImGroupMemberBo bo) { |
|||
Map<String, Object> params = bo.getParams(); |
|||
LambdaQueryWrapper<ImGroupMember> lqw = Wrappers.lambdaQuery(); |
|||
lqw.eq(bo.getGroupId() != null, ImGroupMember::getGroupId, bo.getGroupId()); |
|||
lqw.eq(bo.getUserId() != null, ImGroupMember::getUserId, bo.getUserId()); |
|||
lqw.like(StringUtils.isNotBlank(bo.getRemarkNickName()), ImGroupMember::getRemarkNickName, bo.getRemarkNickName()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getHeadImage()), ImGroupMember::getHeadImage, bo.getHeadImage()); |
|||
lqw.like(StringUtils.isNotBlank(bo.getRemarkGroupName()), ImGroupMember::getRemarkGroupName, bo.getRemarkGroupName()); |
|||
lqw.eq(bo.getQuit() != null, ImGroupMember::getQuit, bo.getQuit()); |
|||
lqw.eq(bo.getCreatedTime() != null, ImGroupMember::getCreatedTime, bo.getCreatedTime()); |
|||
lqw.eq(bo.getQuitTime() != null, ImGroupMember::getQuitTime, bo.getQuitTime()); |
|||
lqw.like(StringUtils.isNotBlank(bo.getUserNickName()), ImGroupMember::getUserNickName, bo.getUserNickName()); |
|||
return lqw; |
|||
} |
|||
|
|||
/** |
|||
* 新增群成员 |
|||
* |
|||
* @param bo 群成员 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
@Override |
|||
public Boolean insertByBo(ImGroupMemberBo bo) { |
|||
ImGroupMember add = MapstructUtils.convert(bo, ImGroupMember.class); |
|||
validEntityBeforeSave(add); |
|||
boolean flag = baseMapper.insert(add) > 0; |
|||
if (flag) { |
|||
bo.setId(add.getId()); |
|||
} |
|||
return flag; |
|||
} |
|||
|
|||
/** |
|||
* 修改群成员 |
|||
* |
|||
* @param bo 群成员 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
@Override |
|||
public Boolean updateByBo(ImGroupMemberBo bo) { |
|||
ImGroupMember update = MapstructUtils.convert(bo, ImGroupMember.class); |
|||
validEntityBeforeSave(update); |
|||
return baseMapper.updateById(update) > 0; |
|||
} |
|||
|
|||
/** |
|||
* 保存前的数据校验 |
|||
*/ |
|||
private void validEntityBeforeSave(ImGroupMember entity){ |
|||
//TODO 做一些数据校验,如唯一约束
|
|||
} |
|||
|
|||
/** |
|||
* 校验并批量删除群成员信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
@Override |
|||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
|||
if(isValid){ |
|||
//TODO 做一些业务上的校验,判断是否需要校验
|
|||
} |
|||
return baseMapper.deleteByIds(ids) > 0; |
|||
} |
|||
} |
|||
@ -0,0 +1,142 @@ |
|||
package org.dromara.im.service.impl; |
|||
|
|||
import com.baomidou.dynamic.datasource.annotation.DS; |
|||
import org.dromara.common.core.utils.MapstructUtils; |
|||
import org.dromara.common.core.utils.StringUtils; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.dromara.im.constant.ImConstant; |
|||
import org.springframework.stereotype.Service; |
|||
import org.dromara.im.domain.bo.ImGroupMessageBo; |
|||
import org.dromara.im.domain.vo.ImGroupMessageVo; |
|||
import org.dromara.im.domain.ImGroupMessage; |
|||
import org.dromara.im.mapper.ImGroupMessageMapper; |
|||
import org.dromara.im.service.IImGroupMessageService; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Collection; |
|||
|
|||
/** |
|||
* 群消息Service业务层处理 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@DS(ImConstant.DS_IM_PLATFORM) |
|||
@RequiredArgsConstructor |
|||
@Service |
|||
public class ImGroupMessageServiceImpl implements IImGroupMessageService { |
|||
|
|||
private final ImGroupMessageMapper baseMapper; |
|||
|
|||
/** |
|||
* 查询群消息 |
|||
* |
|||
* @param id 主键 |
|||
* @return 群消息 |
|||
*/ |
|||
@Override |
|||
public ImGroupMessageVo queryById(Long id){ |
|||
return baseMapper.selectVoById(id); |
|||
} |
|||
|
|||
/** |
|||
* 分页查询群消息列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 群消息分页列表 |
|||
*/ |
|||
@Override |
|||
public TableDataInfo<ImGroupMessageVo> queryPageList(ImGroupMessageBo bo, PageQuery pageQuery) { |
|||
LambdaQueryWrapper<ImGroupMessage> lqw = buildQueryWrapper(bo); |
|||
Page<ImGroupMessageVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
|||
return TableDataInfo.build(result); |
|||
} |
|||
|
|||
/** |
|||
* 查询符合条件的群消息列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 群消息列表 |
|||
*/ |
|||
@Override |
|||
public List<ImGroupMessageVo> queryList(ImGroupMessageBo bo) { |
|||
LambdaQueryWrapper<ImGroupMessage> lqw = buildQueryWrapper(bo); |
|||
return baseMapper.selectVoList(lqw); |
|||
} |
|||
|
|||
private LambdaQueryWrapper<ImGroupMessage> buildQueryWrapper(ImGroupMessageBo bo) { |
|||
Map<String, Object> params = bo.getParams(); |
|||
LambdaQueryWrapper<ImGroupMessage> lqw = Wrappers.lambdaQuery(); |
|||
lqw.eq(bo.getGroupId() != null, ImGroupMessage::getGroupId, bo.getGroupId()); |
|||
lqw.eq(bo.getSendId() != null, ImGroupMessage::getSendId, bo.getSendId()); |
|||
lqw.like(StringUtils.isNotBlank(bo.getSendNickName()), ImGroupMessage::getSendNickName, bo.getSendNickName()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getAtUserIds()), ImGroupMessage::getAtUserIds, bo.getAtUserIds()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getContent()), ImGroupMessage::getContent, bo.getContent()); |
|||
lqw.eq(bo.getStatus() != null, ImGroupMessage::getStatus, bo.getStatus()); |
|||
lqw.eq(bo.getType() != null, ImGroupMessage::getType, bo.getType()); |
|||
lqw.eq(bo.getSendTime() != null, ImGroupMessage::getSendTime, bo.getSendTime()); |
|||
lqw.eq(bo.getReceiptOk() != null, ImGroupMessage::getReceiptOk, bo.getReceiptOk()); |
|||
lqw.eq(bo.getReceipt() != null, ImGroupMessage::getReceipt, bo.getReceipt()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getRecvIds()), ImGroupMessage::getRecvIds, bo.getRecvIds()); |
|||
return lqw; |
|||
} |
|||
|
|||
/** |
|||
* 新增群消息 |
|||
* |
|||
* @param bo 群消息 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
@Override |
|||
public Boolean insertByBo(ImGroupMessageBo bo) { |
|||
ImGroupMessage add = MapstructUtils.convert(bo, ImGroupMessage.class); |
|||
validEntityBeforeSave(add); |
|||
boolean flag = baseMapper.insert(add) > 0; |
|||
if (flag) { |
|||
bo.setId(add.getId()); |
|||
} |
|||
return flag; |
|||
} |
|||
|
|||
/** |
|||
* 修改群消息 |
|||
* |
|||
* @param bo 群消息 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
@Override |
|||
public Boolean updateByBo(ImGroupMessageBo bo) { |
|||
ImGroupMessage update = MapstructUtils.convert(bo, ImGroupMessage.class); |
|||
validEntityBeforeSave(update); |
|||
return baseMapper.updateById(update) > 0; |
|||
} |
|||
|
|||
/** |
|||
* 保存前的数据校验 |
|||
*/ |
|||
private void validEntityBeforeSave(ImGroupMessage entity){ |
|||
//TODO 做一些数据校验,如唯一约束
|
|||
} |
|||
|
|||
/** |
|||
* 校验并批量删除群消息信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
@Override |
|||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
|||
if(isValid){ |
|||
//TODO 做一些业务上的校验,判断是否需要校验
|
|||
} |
|||
return baseMapper.deleteByIds(ids) > 0; |
|||
} |
|||
} |
|||
@ -0,0 +1,140 @@ |
|||
package org.dromara.im.service.impl; |
|||
|
|||
import com.baomidou.dynamic.datasource.annotation.DS; |
|||
import org.dromara.common.core.utils.MapstructUtils; |
|||
import org.dromara.common.core.utils.StringUtils; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.dromara.im.constant.ImConstant; |
|||
import org.springframework.stereotype.Service; |
|||
import org.dromara.im.domain.bo.ImGroupBo; |
|||
import org.dromara.im.domain.vo.ImGroupVo; |
|||
import org.dromara.im.domain.ImGroup; |
|||
import org.dromara.im.mapper.ImGroupMapper; |
|||
import org.dromara.im.service.IImGroupService; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Collection; |
|||
|
|||
/** |
|||
* 群Service业务层处理 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@DS(ImConstant.DS_IM_PLATFORM) |
|||
@RequiredArgsConstructor |
|||
@Service |
|||
public class ImGroupServiceImpl implements IImGroupService { |
|||
|
|||
private final ImGroupMapper baseMapper; |
|||
|
|||
/** |
|||
* 查询群 |
|||
* |
|||
* @param id 主键 |
|||
* @return 群 |
|||
*/ |
|||
@Override |
|||
public ImGroupVo queryById(Long id){ |
|||
return baseMapper.selectVoById(id); |
|||
} |
|||
|
|||
/** |
|||
* 分页查询群列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 群分页列表 |
|||
*/ |
|||
@Override |
|||
public TableDataInfo<ImGroupVo> queryPageList(ImGroupBo bo, PageQuery pageQuery) { |
|||
LambdaQueryWrapper<ImGroup> lqw = buildQueryWrapper(bo); |
|||
Page<ImGroupVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
|||
return TableDataInfo.build(result); |
|||
} |
|||
|
|||
/** |
|||
* 查询符合条件的群列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 群列表 |
|||
*/ |
|||
@Override |
|||
public List<ImGroupVo> queryList(ImGroupBo bo) { |
|||
LambdaQueryWrapper<ImGroup> lqw = buildQueryWrapper(bo); |
|||
return baseMapper.selectVoList(lqw); |
|||
} |
|||
|
|||
private LambdaQueryWrapper<ImGroup> buildQueryWrapper(ImGroupBo bo) { |
|||
Map<String, Object> params = bo.getParams(); |
|||
LambdaQueryWrapper<ImGroup> lqw = Wrappers.lambdaQuery(); |
|||
lqw.like(StringUtils.isNotBlank(bo.getName()), ImGroup::getName, bo.getName()); |
|||
lqw.eq(bo.getOwnerId() != null, ImGroup::getOwnerId, bo.getOwnerId()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getHeadImage()), ImGroup::getHeadImage, bo.getHeadImage()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getHeadImageThumb()), ImGroup::getHeadImageThumb, bo.getHeadImageThumb()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getNotice()), ImGroup::getNotice, bo.getNotice()); |
|||
lqw.eq(bo.getDissolve() != null, ImGroup::getDissolve, bo.getDissolve()); |
|||
lqw.eq(bo.getCreatedTime() != null, ImGroup::getCreatedTime, bo.getCreatedTime()); |
|||
lqw.eq(bo.getIsBanned() != null, ImGroup::getIsBanned, bo.getIsBanned()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getReason()), ImGroup::getReason, bo.getReason()); |
|||
return lqw; |
|||
} |
|||
|
|||
/** |
|||
* 新增群 |
|||
* |
|||
* @param bo 群 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
@Override |
|||
public Boolean insertByBo(ImGroupBo bo) { |
|||
ImGroup add = MapstructUtils.convert(bo, ImGroup.class); |
|||
validEntityBeforeSave(add); |
|||
boolean flag = baseMapper.insert(add) > 0; |
|||
if (flag) { |
|||
bo.setId(add.getId()); |
|||
} |
|||
return flag; |
|||
} |
|||
|
|||
/** |
|||
* 修改群 |
|||
* |
|||
* @param bo 群 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
@Override |
|||
public Boolean updateByBo(ImGroupBo bo) { |
|||
ImGroup update = MapstructUtils.convert(bo, ImGroup.class); |
|||
validEntityBeforeSave(update); |
|||
return baseMapper.updateById(update) > 0; |
|||
} |
|||
|
|||
/** |
|||
* 保存前的数据校验 |
|||
*/ |
|||
private void validEntityBeforeSave(ImGroup entity){ |
|||
//TODO 做一些数据校验,如唯一约束
|
|||
} |
|||
|
|||
/** |
|||
* 校验并批量删除群信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
@Override |
|||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
|||
if(isValid){ |
|||
//TODO 做一些业务上的校验,判断是否需要校验
|
|||
} |
|||
return baseMapper.deleteByIds(ids) > 0; |
|||
} |
|||
} |
|||
@ -0,0 +1,137 @@ |
|||
package org.dromara.im.service.impl; |
|||
|
|||
import com.baomidou.dynamic.datasource.annotation.DS; |
|||
import org.dromara.common.core.utils.MapstructUtils; |
|||
import org.dromara.common.core.utils.StringUtils; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.dromara.im.constant.ImConstant; |
|||
import org.springframework.stereotype.Service; |
|||
import org.dromara.im.domain.bo.ImPrivateMessageBo; |
|||
import org.dromara.im.domain.vo.ImPrivateMessageVo; |
|||
import org.dromara.im.domain.ImPrivateMessage; |
|||
import org.dromara.im.mapper.ImPrivateMessageMapper; |
|||
import org.dromara.im.service.IImPrivateMessageService; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Collection; |
|||
|
|||
/** |
|||
* 私聊消息Service业务层处理 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@DS(ImConstant.DS_IM_PLATFORM) |
|||
@RequiredArgsConstructor |
|||
@Service |
|||
public class ImPrivateMessageServiceImpl implements IImPrivateMessageService { |
|||
|
|||
private final ImPrivateMessageMapper baseMapper; |
|||
|
|||
/** |
|||
* 查询私聊消息 |
|||
* |
|||
* @param id 主键 |
|||
* @return 私聊消息 |
|||
*/ |
|||
@Override |
|||
public ImPrivateMessageVo queryById(Long id){ |
|||
return baseMapper.selectVoById(id); |
|||
} |
|||
|
|||
/** |
|||
* 分页查询私聊消息列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 私聊消息分页列表 |
|||
*/ |
|||
@Override |
|||
public TableDataInfo<ImPrivateMessageVo> queryPageList(ImPrivateMessageBo bo, PageQuery pageQuery) { |
|||
LambdaQueryWrapper<ImPrivateMessage> lqw = buildQueryWrapper(bo); |
|||
Page<ImPrivateMessageVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
|||
return TableDataInfo.build(result); |
|||
} |
|||
|
|||
/** |
|||
* 查询符合条件的私聊消息列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 私聊消息列表 |
|||
*/ |
|||
@Override |
|||
public List<ImPrivateMessageVo> queryList(ImPrivateMessageBo bo) { |
|||
LambdaQueryWrapper<ImPrivateMessage> lqw = buildQueryWrapper(bo); |
|||
return baseMapper.selectVoList(lqw); |
|||
} |
|||
|
|||
private LambdaQueryWrapper<ImPrivateMessage> buildQueryWrapper(ImPrivateMessageBo bo) { |
|||
Map<String, Object> params = bo.getParams(); |
|||
LambdaQueryWrapper<ImPrivateMessage> lqw = Wrappers.lambdaQuery(); |
|||
lqw.eq(bo.getSendId() != null, ImPrivateMessage::getSendId, bo.getSendId()); |
|||
lqw.eq(bo.getRecvId() != null, ImPrivateMessage::getRecvId, bo.getRecvId()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getContent()), ImPrivateMessage::getContent, bo.getContent()); |
|||
lqw.eq(bo.getType() != null, ImPrivateMessage::getType, bo.getType()); |
|||
lqw.eq(bo.getStatus() != null, ImPrivateMessage::getStatus, bo.getStatus()); |
|||
lqw.eq(bo.getSendTime() != null, ImPrivateMessage::getSendTime, bo.getSendTime()); |
|||
return lqw; |
|||
} |
|||
|
|||
/** |
|||
* 新增私聊消息 |
|||
* |
|||
* @param bo 私聊消息 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
@Override |
|||
public Boolean insertByBo(ImPrivateMessageBo bo) { |
|||
ImPrivateMessage add = MapstructUtils.convert(bo, ImPrivateMessage.class); |
|||
validEntityBeforeSave(add); |
|||
boolean flag = baseMapper.insert(add) > 0; |
|||
if (flag) { |
|||
bo.setId(add.getId()); |
|||
} |
|||
return flag; |
|||
} |
|||
|
|||
/** |
|||
* 修改私聊消息 |
|||
* |
|||
* @param bo 私聊消息 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
@Override |
|||
public Boolean updateByBo(ImPrivateMessageBo bo) { |
|||
ImPrivateMessage update = MapstructUtils.convert(bo, ImPrivateMessage.class); |
|||
validEntityBeforeSave(update); |
|||
return baseMapper.updateById(update) > 0; |
|||
} |
|||
|
|||
/** |
|||
* 保存前的数据校验 |
|||
*/ |
|||
private void validEntityBeforeSave(ImPrivateMessage entity){ |
|||
//TODO 做一些数据校验,如唯一约束
|
|||
} |
|||
|
|||
/** |
|||
* 校验并批量删除私聊消息信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
@Override |
|||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
|||
if(isValid){ |
|||
//TODO 做一些业务上的校验,判断是否需要校验
|
|||
} |
|||
return baseMapper.deleteByIds(ids) > 0; |
|||
} |
|||
} |
|||
@ -0,0 +1,134 @@ |
|||
package org.dromara.im.service.impl; |
|||
|
|||
import com.baomidou.dynamic.datasource.annotation.DS; |
|||
import org.dromara.common.core.utils.MapstructUtils; |
|||
import org.dromara.common.core.utils.StringUtils; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.dromara.im.constant.ImConstant; |
|||
import org.springframework.stereotype.Service; |
|||
import org.dromara.im.domain.bo.ImSensitiveWordBo; |
|||
import org.dromara.im.domain.vo.ImSensitiveWordVo; |
|||
import org.dromara.im.domain.ImSensitiveWord; |
|||
import org.dromara.im.mapper.ImSensitiveWordMapper; |
|||
import org.dromara.im.service.IImSensitiveWordService; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Collection; |
|||
|
|||
/** |
|||
* 敏感词Service业务层处理 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@DS(ImConstant.DS_IM_PLATFORM) |
|||
@RequiredArgsConstructor |
|||
@Service |
|||
public class ImSensitiveWordServiceImpl implements IImSensitiveWordService { |
|||
|
|||
private final ImSensitiveWordMapper baseMapper; |
|||
|
|||
/** |
|||
* 查询敏感词 |
|||
* |
|||
* @param id 主键 |
|||
* @return 敏感词 |
|||
*/ |
|||
@Override |
|||
public ImSensitiveWordVo queryById(Long id){ |
|||
return baseMapper.selectVoById(id); |
|||
} |
|||
|
|||
/** |
|||
* 分页查询敏感词列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 敏感词分页列表 |
|||
*/ |
|||
@Override |
|||
public TableDataInfo<ImSensitiveWordVo> queryPageList(ImSensitiveWordBo bo, PageQuery pageQuery) { |
|||
LambdaQueryWrapper<ImSensitiveWord> lqw = buildQueryWrapper(bo); |
|||
Page<ImSensitiveWordVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
|||
return TableDataInfo.build(result); |
|||
} |
|||
|
|||
/** |
|||
* 查询符合条件的敏感词列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 敏感词列表 |
|||
*/ |
|||
@Override |
|||
public List<ImSensitiveWordVo> queryList(ImSensitiveWordBo bo) { |
|||
LambdaQueryWrapper<ImSensitiveWord> lqw = buildQueryWrapper(bo); |
|||
return baseMapper.selectVoList(lqw); |
|||
} |
|||
|
|||
private LambdaQueryWrapper<ImSensitiveWord> buildQueryWrapper(ImSensitiveWordBo bo) { |
|||
Map<String, Object> params = bo.getParams(); |
|||
LambdaQueryWrapper<ImSensitiveWord> lqw = Wrappers.lambdaQuery(); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getContent()), ImSensitiveWord::getContent, bo.getContent()); |
|||
lqw.eq(bo.getEnabled() != null, ImSensitiveWord::getEnabled, bo.getEnabled()); |
|||
lqw.eq(bo.getCreator() != null, ImSensitiveWord::getCreator, bo.getCreator()); |
|||
return lqw; |
|||
} |
|||
|
|||
/** |
|||
* 新增敏感词 |
|||
* |
|||
* @param bo 敏感词 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
@Override |
|||
public Boolean insertByBo(ImSensitiveWordBo bo) { |
|||
ImSensitiveWord add = MapstructUtils.convert(bo, ImSensitiveWord.class); |
|||
validEntityBeforeSave(add); |
|||
boolean flag = baseMapper.insert(add) > 0; |
|||
if (flag) { |
|||
bo.setId(add.getId()); |
|||
} |
|||
return flag; |
|||
} |
|||
|
|||
/** |
|||
* 修改敏感词 |
|||
* |
|||
* @param bo 敏感词 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
@Override |
|||
public Boolean updateByBo(ImSensitiveWordBo bo) { |
|||
ImSensitiveWord update = MapstructUtils.convert(bo, ImSensitiveWord.class); |
|||
validEntityBeforeSave(update); |
|||
return baseMapper.updateById(update) > 0; |
|||
} |
|||
|
|||
/** |
|||
* 保存前的数据校验 |
|||
*/ |
|||
private void validEntityBeforeSave(ImSensitiveWord entity){ |
|||
//TODO 做一些数据校验,如唯一约束
|
|||
} |
|||
|
|||
/** |
|||
* 校验并批量删除敏感词信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
@Override |
|||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
|||
if(isValid){ |
|||
//TODO 做一些业务上的校验,判断是否需要校验
|
|||
} |
|||
return baseMapper.deleteByIds(ids) > 0; |
|||
} |
|||
} |
|||
@ -0,0 +1,140 @@ |
|||
package org.dromara.im.service.impl; |
|||
|
|||
import com.baomidou.dynamic.datasource.annotation.DS; |
|||
import org.dromara.common.core.utils.MapstructUtils; |
|||
import org.dromara.common.core.utils.StringUtils; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.dromara.im.constant.ImConstant; |
|||
import org.springframework.stereotype.Service; |
|||
import org.dromara.im.domain.bo.ImSmPushTaskBo; |
|||
import org.dromara.im.domain.vo.ImSmPushTaskVo; |
|||
import org.dromara.im.domain.ImSmPushTask; |
|||
import org.dromara.im.mapper.ImSmPushTaskMapper; |
|||
import org.dromara.im.service.IImSmPushTaskService; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Collection; |
|||
|
|||
/** |
|||
* 系统消息推送任务Service业务层处理 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@DS(ImConstant.DS_IM_PLATFORM) |
|||
@RequiredArgsConstructor |
|||
@Service |
|||
public class ImSmPushTaskServiceImpl implements IImSmPushTaskService { |
|||
|
|||
private final ImSmPushTaskMapper baseMapper; |
|||
|
|||
/** |
|||
* 查询系统消息推送任务 |
|||
* |
|||
* @param id 主键 |
|||
* @return 系统消息推送任务 |
|||
*/ |
|||
@Override |
|||
public ImSmPushTaskVo queryById(Long id){ |
|||
return baseMapper.selectVoById(id); |
|||
} |
|||
|
|||
/** |
|||
* 分页查询系统消息推送任务列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 系统消息推送任务分页列表 |
|||
*/ |
|||
@Override |
|||
public TableDataInfo<ImSmPushTaskVo> queryPageList(ImSmPushTaskBo bo, PageQuery pageQuery) { |
|||
LambdaQueryWrapper<ImSmPushTask> lqw = buildQueryWrapper(bo); |
|||
Page<ImSmPushTaskVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
|||
return TableDataInfo.build(result); |
|||
} |
|||
|
|||
/** |
|||
* 查询符合条件的系统消息推送任务列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 系统消息推送任务列表 |
|||
*/ |
|||
@Override |
|||
public List<ImSmPushTaskVo> queryList(ImSmPushTaskBo bo) { |
|||
LambdaQueryWrapper<ImSmPushTask> lqw = buildQueryWrapper(bo); |
|||
return baseMapper.selectVoList(lqw); |
|||
} |
|||
|
|||
private LambdaQueryWrapper<ImSmPushTask> buildQueryWrapper(ImSmPushTaskBo bo) { |
|||
Map<String, Object> params = bo.getParams(); |
|||
LambdaQueryWrapper<ImSmPushTask> lqw = Wrappers.lambdaQuery(); |
|||
lqw.eq(bo.getMessageId() != null, ImSmPushTask::getMessageId, bo.getMessageId()); |
|||
lqw.eq(bo.getSeqNo() != null, ImSmPushTask::getSeqNo, bo.getSeqNo()); |
|||
lqw.eq(bo.getSendTime() != null, ImSmPushTask::getSendTime, bo.getSendTime()); |
|||
lqw.eq(bo.getStatus() != null, ImSmPushTask::getStatus, bo.getStatus()); |
|||
lqw.eq(bo.getSendToAll() != null, ImSmPushTask::getSendToAll, bo.getSendToAll()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getRecvIds()), ImSmPushTask::getRecvIds, bo.getRecvIds()); |
|||
lqw.eq(bo.getDeleted() != null, ImSmPushTask::getDeleted, bo.getDeleted()); |
|||
lqw.eq(bo.getCreator() != null, ImSmPushTask::getCreator, bo.getCreator()); |
|||
lqw.eq(bo.getUpdater() != null, ImSmPushTask::getUpdater, bo.getUpdater()); |
|||
return lqw; |
|||
} |
|||
|
|||
/** |
|||
* 新增系统消息推送任务 |
|||
* |
|||
* @param bo 系统消息推送任务 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
@Override |
|||
public Boolean insertByBo(ImSmPushTaskBo bo) { |
|||
ImSmPushTask add = MapstructUtils.convert(bo, ImSmPushTask.class); |
|||
validEntityBeforeSave(add); |
|||
boolean flag = baseMapper.insert(add) > 0; |
|||
if (flag) { |
|||
bo.setId(add.getId()); |
|||
} |
|||
return flag; |
|||
} |
|||
|
|||
/** |
|||
* 修改系统消息推送任务 |
|||
* |
|||
* @param bo 系统消息推送任务 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
@Override |
|||
public Boolean updateByBo(ImSmPushTaskBo bo) { |
|||
ImSmPushTask update = MapstructUtils.convert(bo, ImSmPushTask.class); |
|||
validEntityBeforeSave(update); |
|||
return baseMapper.updateById(update) > 0; |
|||
} |
|||
|
|||
/** |
|||
* 保存前的数据校验 |
|||
*/ |
|||
private void validEntityBeforeSave(ImSmPushTask entity){ |
|||
//TODO 做一些数据校验,如唯一约束
|
|||
} |
|||
|
|||
/** |
|||
* 校验并批量删除系统消息推送任务信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
@Override |
|||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
|||
if(isValid){ |
|||
//TODO 做一些业务上的校验,判断是否需要校验
|
|||
} |
|||
return baseMapper.deleteByIds(ids) > 0; |
|||
} |
|||
} |
|||
@ -0,0 +1,140 @@ |
|||
package org.dromara.im.service.impl; |
|||
|
|||
import com.baomidou.dynamic.datasource.annotation.DS; |
|||
import org.dromara.common.core.utils.MapstructUtils; |
|||
import org.dromara.common.core.utils.StringUtils; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.dromara.im.constant.ImConstant; |
|||
import org.springframework.stereotype.Service; |
|||
import org.dromara.im.domain.bo.ImSystemMessageBo; |
|||
import org.dromara.im.domain.vo.ImSystemMessageVo; |
|||
import org.dromara.im.domain.ImSystemMessage; |
|||
import org.dromara.im.mapper.ImSystemMessageMapper; |
|||
import org.dromara.im.service.IImSystemMessageService; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Collection; |
|||
|
|||
/** |
|||
* 系统消息Service业务层处理 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@DS(ImConstant.DS_IM_PLATFORM) |
|||
@RequiredArgsConstructor |
|||
@Service |
|||
public class ImSystemMessageServiceImpl implements IImSystemMessageService { |
|||
|
|||
private final ImSystemMessageMapper baseMapper; |
|||
|
|||
/** |
|||
* 查询系统消息 |
|||
* |
|||
* @param id 主键 |
|||
* @return 系统消息 |
|||
*/ |
|||
@Override |
|||
public ImSystemMessageVo queryById(Long id){ |
|||
return baseMapper.selectVoById(id); |
|||
} |
|||
|
|||
/** |
|||
* 分页查询系统消息列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 系统消息分页列表 |
|||
*/ |
|||
@Override |
|||
public TableDataInfo<ImSystemMessageVo> queryPageList(ImSystemMessageBo bo, PageQuery pageQuery) { |
|||
LambdaQueryWrapper<ImSystemMessage> lqw = buildQueryWrapper(bo); |
|||
Page<ImSystemMessageVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
|||
return TableDataInfo.build(result); |
|||
} |
|||
|
|||
/** |
|||
* 查询符合条件的系统消息列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 系统消息列表 |
|||
*/ |
|||
@Override |
|||
public List<ImSystemMessageVo> queryList(ImSystemMessageBo bo) { |
|||
LambdaQueryWrapper<ImSystemMessage> lqw = buildQueryWrapper(bo); |
|||
return baseMapper.selectVoList(lqw); |
|||
} |
|||
|
|||
private LambdaQueryWrapper<ImSystemMessage> buildQueryWrapper(ImSystemMessageBo bo) { |
|||
Map<String, Object> params = bo.getParams(); |
|||
LambdaQueryWrapper<ImSystemMessage> lqw = Wrappers.lambdaQuery(); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getTitle()), ImSystemMessage::getTitle, bo.getTitle()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getCoverUrl()), ImSystemMessage::getCoverUrl, bo.getCoverUrl()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getIntro()), ImSystemMessage::getIntro, bo.getIntro()); |
|||
lqw.eq(bo.getContentType() != null, ImSystemMessage::getContentType, bo.getContentType()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getRichText()), ImSystemMessage::getRichText, bo.getRichText()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getExternLink()), ImSystemMessage::getExternLink, bo.getExternLink()); |
|||
lqw.eq(bo.getDeleted() != null, ImSystemMessage::getDeleted, bo.getDeleted()); |
|||
lqw.eq(bo.getCreator() != null, ImSystemMessage::getCreator, bo.getCreator()); |
|||
lqw.eq(bo.getUpdater() != null, ImSystemMessage::getUpdater, bo.getUpdater()); |
|||
return lqw; |
|||
} |
|||
|
|||
/** |
|||
* 新增系统消息 |
|||
* |
|||
* @param bo 系统消息 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
@Override |
|||
public Boolean insertByBo(ImSystemMessageBo bo) { |
|||
ImSystemMessage add = MapstructUtils.convert(bo, ImSystemMessage.class); |
|||
validEntityBeforeSave(add); |
|||
boolean flag = baseMapper.insert(add) > 0; |
|||
if (flag) { |
|||
bo.setId(add.getId()); |
|||
} |
|||
return flag; |
|||
} |
|||
|
|||
/** |
|||
* 修改系统消息 |
|||
* |
|||
* @param bo 系统消息 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
@Override |
|||
public Boolean updateByBo(ImSystemMessageBo bo) { |
|||
ImSystemMessage update = MapstructUtils.convert(bo, ImSystemMessage.class); |
|||
validEntityBeforeSave(update); |
|||
return baseMapper.updateById(update) > 0; |
|||
} |
|||
|
|||
/** |
|||
* 保存前的数据校验 |
|||
*/ |
|||
private void validEntityBeforeSave(ImSystemMessage entity){ |
|||
//TODO 做一些数据校验,如唯一约束
|
|||
} |
|||
|
|||
/** |
|||
* 校验并批量删除系统消息信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
@Override |
|||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
|||
if(isValid){ |
|||
//TODO 做一些业务上的校验,判断是否需要校验
|
|||
} |
|||
return baseMapper.deleteByIds(ids) > 0; |
|||
} |
|||
} |
|||
@ -0,0 +1,109 @@ |
|||
package org.dromara.im.service.impl; |
|||
|
|||
import com.baomidou.dynamic.datasource.annotation.DS; |
|||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|||
import org.apache.logging.log4j.util.Strings; |
|||
import org.dromara.common.core.utils.MapstructUtils; |
|||
import org.dromara.common.core.utils.StringUtils; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.dromara.im.constant.ImConstant; |
|||
import org.dromara.im.constant.ImRedisKey; |
|||
import org.dromara.im.domain.dto.ImUserBanDTO; |
|||
import org.dromara.im.domain.dto.ImUserUnbanDTO; |
|||
import org.dromara.im.mq.ImRedisMQTemplate; |
|||
import org.springframework.stereotype.Service; |
|||
import org.dromara.im.domain.bo.ImUserBo; |
|||
import org.dromara.im.domain.vo.ImUserVo; |
|||
import org.dromara.im.domain.ImUser; |
|||
import org.dromara.im.mapper.ImUserMapper; |
|||
import org.dromara.im.service.IImUserService; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Collection; |
|||
|
|||
/** |
|||
* 用户Service业务层处理 |
|||
* |
|||
* @author Blue |
|||
* @date 2024-12-22 |
|||
*/ |
|||
@DS(ImConstant.DS_IM_PLATFORM) |
|||
@RequiredArgsConstructor |
|||
@Service |
|||
public class ImUserServiceImpl implements IImUserService { |
|||
|
|||
private final ImRedisMQTemplate redisMQTemplate; |
|||
private final ImUserMapper baseMapper; |
|||
|
|||
/** |
|||
* 查询用户 |
|||
* |
|||
* @param id 主键 |
|||
* @return 用户 |
|||
*/ |
|||
@Override |
|||
public ImUserVo queryById(Long id){ |
|||
return baseMapper.selectVoById(id); |
|||
} |
|||
|
|||
/** |
|||
* 分页查询用户列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 用户分页列表 |
|||
*/ |
|||
@Override |
|||
public TableDataInfo<ImUserVo> queryPageList(ImUserBo bo, PageQuery pageQuery) { |
|||
LambdaQueryWrapper<ImUser> lqw = buildQueryWrapper(bo); |
|||
Page<ImUserVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
|||
return TableDataInfo.build(result); |
|||
} |
|||
|
|||
/** |
|||
* 查询符合条件的用户列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 用户列表 |
|||
*/ |
|||
@Override |
|||
public List<ImUserVo> queryList(ImUserBo bo) { |
|||
LambdaQueryWrapper<ImUser> lqw = buildQueryWrapper(bo); |
|||
return baseMapper.selectVoList(lqw); |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public void ban(ImUserBanDTO dto) { |
|||
LambdaUpdateWrapper<ImUser> wrapper = Wrappers.lambdaUpdate(); |
|||
wrapper.eq(ImUser::getId, dto.getId()); |
|||
wrapper.set(ImUser::getIsBanned, true); |
|||
wrapper.set(ImUser::getReason, dto.getReason()); |
|||
baseMapper.update(wrapper); |
|||
// 推送到处理队列,等待im-platfrom处理
|
|||
redisMQTemplate.opsForList().rightPush(ImRedisKey.IM_QUEUE_USER_BANNED, dto); |
|||
} |
|||
|
|||
@Override |
|||
public void unban(ImUserUnbanDTO dto) { |
|||
LambdaUpdateWrapper<ImUser> wrapper = Wrappers.lambdaUpdate(); |
|||
wrapper.eq(ImUser::getId, dto.getId()); |
|||
wrapper.set(ImUser::getIsBanned, false); |
|||
wrapper.set(ImUser::getReason, Strings.EMPTY); |
|||
baseMapper.update(wrapper); |
|||
} |
|||
|
|||
private LambdaQueryWrapper<ImUser> buildQueryWrapper(ImUserBo bo) { |
|||
LambdaQueryWrapper<ImUser> lqw = Wrappers.lambdaQuery(); |
|||
lqw.like(StringUtils.isNotBlank(bo.getUserName()), ImUser::getUserName, bo.getUserName()); |
|||
lqw.like(StringUtils.isNotBlank(bo.getNickName()), ImUser::getNickName, bo.getNickName()); |
|||
return lqw; |
|||
} |
|||
|
|||
} |
|||
@ -1,10 +1,10 @@ |
|||
# 代码生成 |
|||
gen: |
|||
# 作者 |
|||
author: Lion Li |
|||
author: Blue |
|||
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool |
|||
packageName: org.dromara.system |
|||
packageName: org.dromara.im |
|||
# 自动去除表前缀,默认是false |
|||
autoRemovePre: false |
|||
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔) |
|||
tablePrefix: sys_ |
|||
tablePrefix: im_ |
|||
|
|||
Loading…
Reference in new issue