Browse Source

标签与群组添加

master
La123123 2 days ago
parent
commit
7a21668f33
  1. 22
      im-admin-ui/src/api/im/userLabel/index.ts
  2. 12
      im-admin-ui/src/api/im/userLabel/types.ts
  3. 72
      im-admin-ui/src/views/im/userLabel/index.vue
  4. 46
      im-admin/.gitignore
  5. 20
      im-admin/ruoyi-im/src/main/java/org/dromara/im/controller/ImUserGroupController.java
  6. 48
      im-admin/ruoyi-im/src/main/java/org/dromara/im/controller/ImUserLabelController.java
  7. 12
      im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/ImUserLabel.java
  8. 10
      im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/bo/ImUserLabelBo.java
  9. 23
      im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/vo/ImGroupOptionVo.java
  10. 14
      im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/vo/ImUserLabelVo.java
  11. 15
      im-admin/ruoyi-im/src/main/java/org/dromara/im/mapper/ImUserLabelMapper.java
  12. 15
      im-admin/ruoyi-im/src/main/java/org/dromara/im/mapper/ImUserLableMapper.java
  13. 8
      im-admin/ruoyi-im/src/main/java/org/dromara/im/service/IImUserGroupService.java
  14. 16
      im-admin/ruoyi-im/src/main/java/org/dromara/im/service/IImUserLabelService.java
  15. 10
      im-admin/ruoyi-im/src/main/java/org/dromara/im/service/impl/ImUserGroupServiceImpl.java
  16. 44
      im-admin/ruoyi-im/src/main/java/org/dromara/im/service/impl/ImUserLabelServiceImpl.java
  17. 2
      im-admin/ruoyi-im/src/main/resources/mapper/im/ImUserLabelMapper.xml

22
im-admin-ui/src/api/im/userLable/index.ts → im-admin-ui/src/api/im/userLabel/index.ts

@ -1,6 +1,6 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { UserLableVO, UserLableForm, UserLableQuery } from '@/api/im/userLable/types';
import { UserLabelVO, UserLabelForm, UserLabelQuery } from '@/api/im/userLabel/types';
/**
*
@ -8,9 +8,9 @@ import { UserLableVO, UserLableForm, UserLableQuery } from '@/api/im/userLable/t
* @returns {*}
*/
export const listUserLable = (query?: UserLableQuery): AxiosPromise<UserLableVO[]> => {
export const listUserLabel = (query?: UserLabelQuery): AxiosPromise<UserLabelVO[]> => {
return request({
url: '/im/userLable/list',
url: '/im/userLabel/list',
method: 'get',
params: query
});
@ -20,9 +20,9 @@ export const listUserLable = (query?: UserLableQuery): AxiosPromise<UserLableVO[
*
* @param id
*/
export const getUserLable = (id: string | number): AxiosPromise<UserLableVO> => {
export const getUserLabel = (id: string | number): AxiosPromise<UserLabelVO> => {
return request({
url: '/im/userLable/' + id,
url: '/im/userLabel/' + id,
method: 'get'
});
};
@ -31,9 +31,9 @@ export const getUserLable = (id: string | number): AxiosPromise<UserLableVO> =>
*
* @param data
*/
export const addUserLable = (data: UserLableForm) => {
export const addUserLabel = (data: UserLabelForm) => {
return request({
url: '/im/userLable',
url: '/im/userLabel',
method: 'post',
data: data
});
@ -43,9 +43,9 @@ export const addUserLable = (data: UserLableForm) => {
*
* @param data
*/
export const updateUserLable = (data: UserLableForm) => {
export const updateUserLabel = (data: UserLabelForm) => {
return request({
url: '/im/userLable',
url: '/im/userLabel',
method: 'put',
data: data
});
@ -55,9 +55,9 @@ export const updateUserLable = (data: UserLableForm) => {
*
* @param id
*/
export const delUserLable = (id: string | number | Array<string | number>) => {
export const delUserLabel = (id: string | number | Array<string | number>) => {
return request({
url: '/im/userLable/' + id,
url: '/im/userLabel/' + id,
method: 'delete'
});
};

12
im-admin-ui/src/api/im/userLable/types.ts → im-admin-ui/src/api/im/userLabel/types.ts

@ -1,4 +1,4 @@
export interface UserLableVO {
export interface UserLabelVO {
/**
* id
*/
@ -7,7 +7,7 @@ export interface UserLableVO {
/**
*
*/
lableName: string;
labelName: string;
/**
*
@ -21,7 +21,7 @@ export interface UserLableVO {
}
export interface UserLableForm extends BaseEntity {
export interface UserLabelForm extends BaseEntity {
/**
* id
*/
@ -30,7 +30,7 @@ export interface UserLableForm extends BaseEntity {
/**
*
*/
lableName?: string;
labelName?: string;
/**
*
@ -44,12 +44,12 @@ export interface UserLableForm extends BaseEntity {
}
export interface UserLableQuery extends PageQuery {
export interface UserLabelQuery extends PageQuery {
/**
*
*/
lableName?: string;
labelName?: string;
/**
*

72
im-admin-ui/src/views/im/userLable/index.vue → im-admin-ui/src/views/im/userLabel/index.vue

@ -4,8 +4,8 @@
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form-item label="标签名称" prop="lableName">
<el-input v-model="queryParams.lableName" placeholder="请输入标签名称" clearable @keyup.enter="handleQuery" />
<el-form-item label="标签名称" prop="labelName">
<el-input v-model="queryParams.labelName" placeholder="请输入标签名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="queryParams.sort" placeholder="请输入排序" clearable @keyup.enter="handleQuery" />
@ -23,34 +23,34 @@
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['im:userLable:add']">新增</el-button>
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['im:userLabel:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['im:userLable:edit']">修改</el-button>
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['im:userLabel:edit']">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['im:userLable:remove']">删除</el-button>
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['im:userLabel:remove']">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['im:userLable:export']">导出</el-button>
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['im:userLabel:export']">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="userLableList" @selection-change="handleSelectionChange">
<el-table v-loading="loading" :data="userLabelList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="id" align="center" prop="id" v-if="true" />
<el-table-column label="标签名称" align="center" prop="lableName" />
<el-table-column label="标签名称" align="center" prop="labelName" />
<el-table-column label="排序" align="center" prop="sort" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['im:userLable:edit']"></el-button>
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['im:userLabel:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['im:userLable:remove']"></el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['im:userLabel:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
@ -60,9 +60,9 @@
</el-card>
<!-- 添加或修改用户分组对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="userLableFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="标签名称" prop="lableName">
<el-input v-model="form.lableName" placeholder="请输入标签名称" />
<el-form ref="userLabelFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="标签名称" prop="labelName">
<el-input v-model="form.labelName" placeholder="请输入标签名称" />
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="form.sort" placeholder="请输入排序" />
@ -81,13 +81,13 @@
</div>
</template>
<script setup name="UserLable" lang="ts">
import { listUserLable, getUserLable, delUserLable, addUserLable, updateUserLable } from '@/api/im/userLable';
import { UserLableVO, UserLableQuery, UserLableForm } from '@/api/im/userLable/types';
<script setup name="UserLabel" lang="ts">
import { listUserLabel, getUserLabel, delUserLabel, addUserLabel, updateUserLabel } from '@/api/im/userLabel';
import { UserLabelVO, UserLabelQuery, UserLabelForm } from '@/api/im/userLabel/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const userLableList = ref<UserLableVO[]>([]);
const userLabelList = ref<UserLabelVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
@ -97,25 +97,25 @@ const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const userLableFormRef = ref<ElFormInstance>();
const userLabelFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
const initFormData: UserLableForm = {
const initFormData: UserLabelForm = {
id: undefined,
lableName: undefined,
labelName: undefined,
sort: undefined,
remark: undefined
}
const data = reactive<PageData<UserLableForm, UserLableQuery>>({
const data = reactive<PageData<UserLabelForm, UserLabelQuery>>({
form: {...initFormData},
queryParams: {
pageNum: 1,
pageSize: 10,
lableName: undefined,
labelName: undefined,
sort: undefined,
params: {
}
@ -124,7 +124,7 @@ const data = reactive<PageData<UserLableForm, UserLableQuery>>({
id: [
{ required: true, message: "id不能为空", trigger: "blur" }
],
lableName: [
labelName: [
{ required: true, message: "标签名称不能为空", trigger: "blur" }
],
sort: [
@ -141,8 +141,8 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询用户分组列表 */
const getList = async () => {
loading.value = true;
const res = await listUserLable(queryParams.value);
userLableList.value = res.rows;
const res = await listUserLabel(queryParams.value);
userLabelList.value = res.rows;
total.value = res.total;
loading.value = false;
}
@ -156,7 +156,7 @@ const cancel = () => {
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
userLableFormRef.value?.resetFields();
userLabelFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
@ -172,7 +172,7 @@ const resetQuery = () => {
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: UserLableVO[]) => {
const handleSelectionChange = (selection: UserLabelVO[]) => {
ids.value = selection.map(item => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
@ -186,10 +186,10 @@ const handleAdd = () => {
}
/** 修改按钮操作 */
const handleUpdate = async (row?: UserLableVO) => {
const handleUpdate = async (row?: UserLabelVO) => {
reset();
const _id = row?.id || ids.value[0]
const res = await getUserLable(_id);
const res = await getUserLabel(_id);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = "修改用户分组";
@ -197,13 +197,13 @@ const handleUpdate = async (row?: UserLableVO) => {
/** 提交按钮 */
const submitForm = () => {
userLableFormRef.value?.validate(async (valid: boolean) => {
userLabelFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.id) {
await updateUserLable(form.value).finally(() => buttonLoading.value = false);
await updateUserLabel(form.value).finally(() => buttonLoading.value = false);
} else {
await addUserLable(form.value).finally(() => buttonLoading.value = false);
await addUserLabel(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;
@ -213,19 +213,19 @@ const submitForm = () => {
}
/** 删除按钮操作 */
const handleDelete = async (row?: UserLableVO) => {
const handleDelete = async (row?: UserLabelVO) => {
const _ids = row?.id || ids.value;
await proxy?.$modal.confirm('是否确认删除用户分组编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
await delUserLable(_ids);
await delUserLabel(_ids);
proxy?.$modal.msgSuccess("删除成功");
await getList();
}
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('im/userLable/export', {
proxy?.download('im/userLabel/export', {
...queryParams.value
}, `userLable_${new Date().getTime()}.xlsx`)
}, `userLabel_${new Date().getTime()}.xlsx`)
}
onMounted(() => {

46
im-admin/.gitignore

@ -0,0 +1,46 @@
# Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
# IDE - IntelliJ IDEA
.idea/
*.iml
*.ipr
*.iws
out/
# IDE - Eclipse
.classpath
.project
.settings/
bin/
# Compiled class files
*.class
# Log files
*.log
# Package Files
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# Virtual machine crash logs
hs_err_pid*
# OS generated files
.DS_Store
Thumbs.db

20
im-admin/ruoyi-im/src/main/java/org/dromara/im/controller/ImUserGroupController.java

@ -1,11 +1,14 @@
package org.dromara.im.controller;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.dromara.im.domain.ImUserGroup;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
@ -102,4 +105,21 @@ public class ImUserGroupController extends BaseController {
@PathVariable Long[] ids) {
return toAjax(imUserGroupService.deleteWithValidByIds(List.of(ids), true));
}
/**
* 获取用户分组下拉框数据
*/
@PostMapping("/selectList")
public R<List<Map<String, Object>>> selectList() {
List<ImUserGroup> list = imUserGroupService.queryAllList();
List<Map<String, Object>> result = list.stream()
.map(item -> {
Map<String, Object> map = new java.util.HashMap<>();
map.put("id", item.getId());
map.put("groupName", item.getGroupName());
return map;
})
.collect(Collectors.toList());
return R.ok(result);
}
}

48
im-admin/ruoyi-im/src/main/java/org/dromara/im/controller/ImUserLableController.java → im-admin/ruoyi-im/src/main/java/org/dromara/im/controller/ImUserLabelController.java

@ -17,9 +17,9 @@ 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.ImUserLableVo;
import org.dromara.im.domain.bo.ImUserLableBo;
import org.dromara.im.service.IImUserLableService;
import org.dromara.im.domain.vo.ImUserLabelVo;
import org.dromara.im.domain.bo.ImUserLabelBo;
import org.dromara.im.service.IImUserLabelService;
import org.dromara.common.mybatis.core.page.TableDataInfo;
/**
@ -31,29 +31,29 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/im/userLable")
public class ImUserLableController extends BaseController {
@RequestMapping("/im/userLabel")
public class ImUserLabelController extends BaseController {
private final IImUserLableService imUserLableService;
private final IImUserLabelService imUserLabelService;
/**
* 查询用户分组列表
*/
@SaCheckPermission("im:userLable:list")
@SaCheckPermission("im:userLabel:list")
@GetMapping("/list")
public TableDataInfo<ImUserLableVo> list(ImUserLableBo bo, PageQuery pageQuery) {
return imUserLableService.queryPageList(bo, pageQuery);
public TableDataInfo<ImUserLabelVo> list(ImUserLabelBo bo, PageQuery pageQuery) {
return imUserLabelService.queryPageList(bo, pageQuery);
}
/**
* 导出用户分组列表
*/
@SaCheckPermission("im:userLable:export")
@SaCheckPermission("im:userLabel:export")
@Log(title = "用户分组", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(ImUserLableBo bo, HttpServletResponse response) {
List<ImUserLableVo> list = imUserLableService.queryList(bo);
ExcelUtil.exportExcel(list, "用户分组", ImUserLableVo.class, response);
public void export(ImUserLabelBo bo, HttpServletResponse response) {
List<ImUserLabelVo> list = imUserLabelService.queryList(bo);
ExcelUtil.exportExcel(list, "用户分组", ImUserLabelVo.class, response);
}
/**
@ -61,33 +61,33 @@ public class ImUserLableController extends BaseController {
*
* @param id 主键
*/
@SaCheckPermission("im:userLable:query")
@SaCheckPermission("im:userLabel:query")
@GetMapping("/{id}")
public R<ImUserLableVo> getInfo(@NotNull(message = "主键不能为空")
public R<ImUserLabelVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(imUserLableService.queryById(id));
return R.ok(imUserLabelService.queryById(id));
}
/**
* 新增用户分组
*/
@SaCheckPermission("im:userLable:add")
@SaCheckPermission("im:userLabel:add")
@Log(title = "用户分组", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody ImUserLableBo bo) {
return toAjax(imUserLableService.insertByBo(bo));
public R<Void> add(@Validated(AddGroup.class) @RequestBody ImUserLabelBo bo) {
return toAjax(imUserLabelService.insertByBo(bo));
}
/**
* 修改用户分组
*/
@SaCheckPermission("im:userLable:edit")
@SaCheckPermission("im:userLabel:edit")
@Log(title = "用户分组", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ImUserLableBo bo) {
return toAjax(imUserLableService.updateByBo(bo));
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ImUserLabelBo bo) {
return toAjax(imUserLabelService.updateByBo(bo));
}
/**
@ -95,11 +95,11 @@ public class ImUserLableController extends BaseController {
*
* @param ids 主键串
*/
@SaCheckPermission("im:userLable:remove")
@SaCheckPermission("im:userLabel:remove")
@Log(title = "用户分组", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) {
return toAjax(imUserLableService.deleteWithValidByIds(List.of(ids), true));
return toAjax(imUserLabelService.deleteWithValidByIds(List.of(ids), true));
}
}

12
im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/ImUserLable.java → im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/ImUserLabel.java

@ -1,22 +1,18 @@
package org.dromara.im.domain;
import com.fhs.core.trans.vo.TransPojo;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* 用户分组对象 im_user_lable
* 用户分组对象 im_user_Label
*
* @author Blue
* @date 2026-04-01
*/
@Data
@TableName("im_user_lable")
public class ImUserLable implements TransPojo {
@TableName("im_user_label")
public class ImUserLabel implements TransPojo {
/**
* id
@ -27,7 +23,7 @@ public class ImUserLable implements TransPojo {
/**
* 标签名称
*/
private String lableName;
private String labelName;
/**
* 排序

10
im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/bo/ImUserLableBo.java → im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/bo/ImUserLabelBo.java

@ -1,6 +1,6 @@
package org.dromara.im.domain.bo;
import org.dromara.im.domain.ImUserLable;
import org.dromara.im.domain.ImUserLabel;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
@ -10,15 +10,15 @@ import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
/**
* 用户分组业务对象 im_user_lable
* 用户分组业务对象 im_user_Label
*
* @author Blue
* @date 2026-04-01
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = ImUserLable.class, reverseConvertGenerate = false)
public class ImUserLableBo extends BaseEntity {
@AutoMapper(target = ImUserLabel.class, reverseConvertGenerate = false)
public class ImUserLabelBo extends BaseEntity {
/**
* id
@ -30,7 +30,7 @@ public class ImUserLableBo extends BaseEntity {
* 标签名称
*/
@NotBlank(message = "标签名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String lableName;
private String LabelName;
/**
* 排序

23
im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/vo/ImGroupOptionVo.java

@ -0,0 +1,23 @@
package org.dromara.im.domain.vo;
import lombok.Data;
/**
* 群组下拉框选项
*
* @author Blue
* @date 2026-04-01
*/
@Data
public class ImGroupOptionVo {
/**
* 群组 ID
*/
private Long id;
/**
* 群组名称
*/
private String groupName;
}

14
im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/vo/ImUserLableVo.java → im-admin/ruoyi-im/src/main/java/org/dromara/im/domain/vo/ImUserLabelVo.java

@ -1,29 +1,25 @@
package org.dromara.im.domain.vo;
import org.dromara.im.domain.ImUserLable;
import org.dromara.im.domain.ImUserLabel;
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_lable
* 用户分组视图对象 im_user_Label
*
* @author Blue
* @date 2026-04-01
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = ImUserLable.class)
public class ImUserLableVo implements Serializable {
@AutoMapper(target = ImUserLabel.class)
public class ImUserLabelVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@ -38,7 +34,7 @@ public class ImUserLableVo implements Serializable {
* 标签名称
*/
@ExcelProperty(value = "标签名称")
private String lableName;
private String LabelName;
/**
* 排序

15
im-admin/ruoyi-im/src/main/java/org/dromara/im/mapper/ImUserLabelMapper.java

@ -0,0 +1,15 @@
package org.dromara.im.mapper;
import org.dromara.im.domain.ImUserLabel;
import org.dromara.im.domain.vo.ImUserLabelVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
/**
* 用户分组Mapper接口
*
* @author Blue
* @date 2026-04-01
*/
public interface ImUserLabelMapper extends BaseMapperPlus<ImUserLabel, ImUserLabelVo> {
}

15
im-admin/ruoyi-im/src/main/java/org/dromara/im/mapper/ImUserLableMapper.java

@ -1,15 +0,0 @@
package org.dromara.im.mapper;
import org.dromara.im.domain.ImUserLable;
import org.dromara.im.domain.vo.ImUserLableVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
/**
* 用户分组Mapper接口
*
* @author Blue
* @date 2026-04-01
*/
public interface ImUserLableMapper extends BaseMapperPlus<ImUserLable, ImUserLableVo> {
}

8
im-admin/ruoyi-im/src/main/java/org/dromara/im/service/IImUserGroupService.java

@ -1,5 +1,6 @@
package org.dromara.im.service;
import org.dromara.im.domain.ImUserGroup;
import org.dromara.im.domain.vo.ImUserGroupVo;
import org.dromara.im.domain.bo.ImUserGroupBo;
import org.dromara.common.mybatis.core.page.TableDataInfo;
@ -41,6 +42,13 @@ public interface IImUserGroupService {
*/
List<ImUserGroupVo> queryList(ImUserGroupBo bo);
/**
* 查询所有用户分组列表用于下拉框
*
* @return 用户分组列表
*/
List<ImUserGroup> queryAllList();
/**
* 新增用户分组
*

16
im-admin/ruoyi-im/src/main/java/org/dromara/im/service/IImUserLableService.java → im-admin/ruoyi-im/src/main/java/org/dromara/im/service/IImUserLabelService.java

@ -1,7 +1,7 @@
package org.dromara.im.service;
import org.dromara.im.domain.vo.ImUserLableVo;
import org.dromara.im.domain.bo.ImUserLableBo;
import org.dromara.im.domain.vo.ImUserLabelVo;
import org.dromara.im.domain.bo.ImUserLabelBo;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
@ -14,7 +14,7 @@ import java.util.List;
* @author Blue
* @date 2026-04-01
*/
public interface IImUserLableService {
public interface IImUserLabelService {
/**
* 查询用户分组
@ -22,7 +22,7 @@ public interface IImUserLableService {
* @param id 主键
* @return 用户分组
*/
ImUserLableVo queryById(Long id);
ImUserLabelVo queryById(Long id);
/**
* 分页查询用户分组列表
@ -31,7 +31,7 @@ public interface IImUserLableService {
* @param pageQuery 分页参数
* @return 用户分组分页列表
*/
TableDataInfo<ImUserLableVo> queryPageList(ImUserLableBo bo, PageQuery pageQuery);
TableDataInfo<ImUserLabelVo> queryPageList(ImUserLabelBo bo, PageQuery pageQuery);
/**
* 查询符合条件的用户分组列表
@ -39,7 +39,7 @@ public interface IImUserLableService {
* @param bo 查询条件
* @return 用户分组列表
*/
List<ImUserLableVo> queryList(ImUserLableBo bo);
List<ImUserLabelVo> queryList(ImUserLabelBo bo);
/**
* 新增用户分组
@ -47,7 +47,7 @@ public interface IImUserLableService {
* @param bo 用户分组
* @return 是否新增成功
*/
Boolean insertByBo(ImUserLableBo bo);
Boolean insertByBo(ImUserLabelBo bo);
/**
* 修改用户分组
@ -55,7 +55,7 @@ public interface IImUserLableService {
* @param bo 用户分组
* @return 是否修改成功
*/
Boolean updateByBo(ImUserLableBo bo);
Boolean updateByBo(ImUserLabelBo bo);
/**
* 校验并批量删除用户分组信息

10
im-admin/ruoyi-im/src/main/java/org/dromara/im/service/impl/ImUserGroupServiceImpl.java

@ -71,6 +71,16 @@ public class ImUserGroupServiceImpl implements IImUserGroupService {
return baseMapper.selectVoList(lqw);
}
/**
* 查询所有用户分组列表用于下拉框
*
* @return 用户分组列表
*/
@Override
public List<ImUserGroup> queryAllList() {
return baseMapper.selectList(null);
}
private LambdaQueryWrapper<ImUserGroup> buildQueryWrapper(ImUserGroupBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<ImUserGroup> lqw = Wrappers.lambdaQuery();

44
im-admin/ruoyi-im/src/main/java/org/dromara/im/service/impl/ImUserLableServiceImpl.java → im-admin/ruoyi-im/src/main/java/org/dromara/im/service/impl/ImUserLabelServiceImpl.java

@ -11,11 +11,11 @@ import com.baomidou.dynamic.datasource.annotation.DS;
import lombok.RequiredArgsConstructor;
import org.dromara.im.constant.ImConstant;
import org.springframework.stereotype.Service;
import org.dromara.im.domain.bo.ImUserLableBo;
import org.dromara.im.domain.vo.ImUserLableVo;
import org.dromara.im.domain.ImUserLable;
import org.dromara.im.mapper.ImUserLableMapper;
import org.dromara.im.service.IImUserLableService;
import org.dromara.im.domain.bo.ImUserLabelBo;
import org.dromara.im.domain.vo.ImUserLabelVo;
import org.dromara.im.domain.ImUserLabel;
import org.dromara.im.mapper.ImUserLabelMapper;
import org.dromara.im.service.IImUserLabelService;
import java.util.List;
import java.util.Map;
@ -30,9 +30,9 @@ import java.util.Collection;
@DS(ImConstant.DS_IM_PLATFORM)
@RequiredArgsConstructor
@Service
public class ImUserLableServiceImpl implements IImUserLableService {
public class ImUserLabelServiceImpl implements IImUserLabelService {
private final ImUserLableMapper baseMapper;
private final ImUserLabelMapper baseMapper;
/**
* 查询用户分组
@ -41,7 +41,7 @@ public class ImUserLableServiceImpl implements IImUserLableService {
* @return 用户分组
*/
@Override
public ImUserLableVo queryById(Long id){
public ImUserLabelVo queryById(Long id){
return baseMapper.selectVoById(id);
}
@ -53,9 +53,9 @@ public class ImUserLableServiceImpl implements IImUserLableService {
* @return 用户分组分页列表
*/
@Override
public TableDataInfo<ImUserLableVo> queryPageList(ImUserLableBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<ImUserLable> lqw = buildQueryWrapper(bo);
Page<ImUserLableVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
public TableDataInfo<ImUserLabelVo> queryPageList(ImUserLabelBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<ImUserLabel> lqw = buildQueryWrapper(bo);
Page<ImUserLabelVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
@ -66,16 +66,16 @@ public class ImUserLableServiceImpl implements IImUserLableService {
* @return 用户分组列表
*/
@Override
public List<ImUserLableVo> queryList(ImUserLableBo bo) {
LambdaQueryWrapper<ImUserLable> lqw = buildQueryWrapper(bo);
public List<ImUserLabelVo> queryList(ImUserLabelBo bo) {
LambdaQueryWrapper<ImUserLabel> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<ImUserLable> buildQueryWrapper(ImUserLableBo bo) {
private LambdaQueryWrapper<ImUserLabel> buildQueryWrapper(ImUserLabelBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<ImUserLable> lqw = Wrappers.lambdaQuery();
lqw.like(StringUtils.isNotBlank(bo.getLableName()), ImUserLable::getLableName, bo.getLableName());
lqw.eq(bo.getSort() != null, ImUserLable::getSort, bo.getSort());
LambdaQueryWrapper<ImUserLabel> lqw = Wrappers.lambdaQuery();
lqw.like(StringUtils.isNotBlank(bo.getLabelName()), ImUserLabel::getLabelName, bo.getLabelName());
lqw.eq(bo.getSort() != null, ImUserLabel::getSort, bo.getSort());
return lqw;
}
@ -86,8 +86,8 @@ public class ImUserLableServiceImpl implements IImUserLableService {
* @return 是否新增成功
*/
@Override
public Boolean insertByBo(ImUserLableBo bo) {
ImUserLable add = MapstructUtils.convert(bo, ImUserLable.class);
public Boolean insertByBo(ImUserLabelBo bo) {
ImUserLabel add = MapstructUtils.convert(bo, ImUserLabel.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
@ -103,8 +103,8 @@ public class ImUserLableServiceImpl implements IImUserLableService {
* @return 是否修改成功
*/
@Override
public Boolean updateByBo(ImUserLableBo bo) {
ImUserLable update = MapstructUtils.convert(bo, ImUserLable.class);
public Boolean updateByBo(ImUserLabelBo bo) {
ImUserLabel update = MapstructUtils.convert(bo, ImUserLabel.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
@ -112,7 +112,7 @@ public class ImUserLableServiceImpl implements IImUserLableService {
/**
* 保存前的数据校验
*/
private void validEntityBeforeSave(ImUserLable entity){
private void validEntityBeforeSave(ImUserLabel entity){
//TODO 做一些数据校验,如唯一约束
}

2
im-admin/ruoyi-im/src/main/resources/mapper/im/ImUserLableMapper.xml → im-admin/ruoyi-im/src/main/resources/mapper/im/ImUserLabelMapper.xml

@ -2,6 +2,6 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.dromara.im.mapper.ImUserLableMapper">
<mapper namespace="org.dromara.im.mapper.ImUserLabelMapper">
</mapper>
Loading…
Cancel
Save