zengh
2021-08-19 d180f69b4aac9322576398a193f3a64dcec8a32f
好友
6 files modified
23 files added
1364 ■■■■■ changed files
src/main/java/org/springblade/common/config/BladeConfiguration.java 3 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrecords/controller/ChatRecordsController.java 105 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrecords/entity/ChatRecords.java 74 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrecords/mapper/ChatRecordsMapper.java 32 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrecords/mapper/ChatRecordsMapper.xml 35 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrecords/service/ChatRecordsService.java 45 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrecords/service/impl/ChatRecordsServiceImpl.java 60 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrecords/vo/ChatRecordsVo.java 30 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrg/controller/ChatgroupController.java 162 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrg/dto/ChatgroupDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrg/entity/Chatgroup.java 87 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrg/mapper/ChatgroupMapper.java 44 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrg/mapper/ChatgroupMapper.xml 31 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrg/service/IChatgroupService.java 44 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrg/service/impl/ChatgroupServiceImpl.java 49 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrg/vo/ChatgroupVO.java 36 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrgc/controller/ChatgroupcController.java 135 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrgc/dto/ChatgroupcDTO.java 34 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrgc/entity/Chatgroupc.java 89 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrgc/mapper/ChatgroupcMapper.java 44 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrgc/mapper/ChatgroupcMapper.xml 44 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrgc/service/IChatgroupcService.java 44 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrgc/service/impl/ChatgroupcServiceImpl.java 49 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/chatrgc/vo/ChatgroupcVO.java 36 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/UserMapper.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/IUserService.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java 6 ●●●●● patch | view | raw | blame | history
src/main/resources/application-dev.yml 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/common/config/BladeConfiguration.java
@@ -78,6 +78,9 @@
        secureRegistry.excludePathPatterns("/pushMsg/**");
        secureRegistry.excludePathPatterns("/owner/**");
        secureRegistry.excludePathPatterns("/friend/**");
        secureRegistry.excludePathPatterns("/chat-records/**");
        secureRegistry.excludePathPatterns("/chatgroup/**");
        secureRegistry.excludePathPatterns("/chatgroupc/**");
        return secureRegistry;
    }
src/main/java/org/springblade/modules/chatrecords/controller/ChatRecordsController.java
New file
@@ -0,0 +1,105 @@
package org.springblade.modules.chatrecords.controller;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.modules.chatrecords.entity.ChatRecords;
import org.springblade.modules.chatrecords.service.ChatRecordsService;
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IUserService;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @author zhongrj
 * @time 2021-06-18
 * 聊天消息控制层
 */
@AllArgsConstructor
@RestController
@RequestMapping("/chat-records")
public class ChatRecordsController extends BladeController {
    private final IUserService iUserService;
    private final ChatRecordsService chatRecordsService;
    /**
     * 查询单聊消息记录
     * @param chatRecords 消息记录对象
     * @param response 响应
     * @param query 查询条件,分页
     * @return
     */
    @GetMapping("/getSingleMessagePage")
    public R getSingleMessagePage(@Valid ChatRecords chatRecords, HttpServletResponse response, Query query){
        //跨域设置
        crossDomain(response);
        Map<String, Object> map = new HashMap<>(2);
        //查询单聊人的信息
        List<User> user = Arrays.asList(iUserService.getById(chatRecords.getSenderId()), iUserService.getById(chatRecords.getRecipientId()));
        //查询单聊记录信息
        if (null==query.getCurrent()){
            map.put("chatRecordsIPage",chatRecordsService.selectChatlist(chatRecords));
        }else {
            map.put("chatRecordsIPage",chatRecordsService.selectChatRecordsPage(Condition.getPage(query), chatRecords));
        }
        //封装数据
        map.put("user",user);
        //返回数据
        return R.data(map);
    }
    /**
     * 查询当前用户的聊天列表
     * @param chatRecords 消息记录对象
     * @param response 响应
     * @param query 查询条件,分页
     * @return
     */
    @GetMapping("/getChatListPage")
    public R getChatListPage(@Valid ChatRecords chatRecords, HttpServletResponse response, Query query){
        //跨域设置
        crossDomain(response);
        if(null==query.getCurrent()){
            //不分页
            return R.data(chatRecordsService.getChatList( chatRecords));
        }
        //查询当前人员的聊天列表,并返回数据
        return R.data(chatRecordsService.getChatListPage(Condition.getPage(query), chatRecords));
    }
    /**
     * 单聊消息插入
     * @param chatRecords 消息记录对象
     * @param response 响应
     * @return
     */
    @PostMapping("/insertSingleChat")
    public R insertSingleChat(@Valid @RequestBody ChatRecords chatRecords, HttpServletResponse response){
        //跨域设置
        crossDomain(response);
        //单聊消息插入
        return R.data(chatRecordsService.save(chatRecords));
    }
    /**
     * 配置跨域设置
     * @param response
     */
    private void crossDomain(HttpServletResponse response) {
        response.setHeader("Access-Control-Allow-Origin", "*");
        response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
        response.setHeader("Access-Control-Allow-Credentials","true");
    }
}
src/main/java/org/springblade/modules/chatrecords/entity/ChatRecords.java
New file
@@ -0,0 +1,74 @@
package org.springblade.modules.chatrecords.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
 *
 * @author zhongrj
 * @time 2021-06-18
 * @desc 聊天记录实体类
 *
 */
@Data
@TableName("sys_chat_records")
public class ChatRecords implements Serializable {
    /**
     * 主键id
     */
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;
    /**
     * 发送消息内容
     */
    @TableField("post_message")
    private String postMessage;
    /**
     * 消息类型 0 文本  1 表情  2 图片  3 视频...
     */
    @TableField("message_type")
    private Integer messageType;
    /**
     * 接收状态 0 已接收  1 未接收
     */
    private Integer status;
    /**
     * 发送时间
     */
    @TableField("post_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date postTime;
    /**
     * 发送消息人id
     *
     */
    @NotNull(message = "发送消息人id不能为空")
    @TableField("sender_id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long senderId;
    /**
     * 接收消息人id
     * @NotNull(message = "接收消息人id不能为空")
     */
    @TableField("recipient_id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long recipientId;
}
src/main/java/org/springblade/modules/chatrecords/mapper/ChatRecordsMapper.java
New file
@@ -0,0 +1,32 @@
package org.springblade.modules.chatrecords.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.chatrecords.entity.ChatRecords;
import org.springblade.modules.chatrecords.vo.ChatRecordsVo;
import java.util.List;
/**
 * @author zhongrj
 * mapper 映射层
 */
public interface ChatRecordsMapper extends BaseMapper<ChatRecords> {
    /**
     * 查询单聊消息记录分页信息
     * @param page
     * @param chatRecords 聊天消息对象
     * @return
     */
    List<ChatRecords> selectChatRecordsPage(IPage<ChatRecords> page, ChatRecords chatRecords);
    /**
     * 查询当前用户的聊天列表
     * @param chatRecords 消息记录对象
     * @param page
     * @return
     */
    List<ChatRecordsVo> getChatListPage(IPage<ChatRecordsVo> page, ChatRecords chatRecords);
}
src/main/java/org/springblade/modules/chatrecords/mapper/ChatRecordsMapper.xml
New file
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.springblade.modules.chatrecords.mapper.ChatRecordsMapper">
    <!--查询单聊的消息记录列表-->
    <select id="selectChatRecordsPage" resultType="org.springblade.modules.chatrecords.entity.ChatRecords">
        select * from sys_chat_records  where sender_id = #{chatRecords.senderId} and recipient_id = #{chatRecords.recipientId}
        union
        select * from sys_chat_records  where sender_id = #{chatRecords.recipientId} and recipient_id = #{chatRecords.senderId}
        order by post_time desc
    </select>
    <!--聊天列表-->
    <select id="getChatListPage" resultType="org.springblade.modules.chatrecords.vo.ChatRecordsVo">
        select scrss.*,name recipientNickName,real_name recipientName,avatar from blade_user bu
        right join
        (
            select scr.id,scrs.uid recipientId,post_time postTime,post_message postMessage from sys_chat_records  scr
            right join
            (
                select max(max_id) id,uid from (
                    select recipient_id as uid,max(id) as max_id from sys_chat_records where sender_id = #{chatRecords.senderId} group by recipient_id
                    union all
                    select sender_id as uid,max(id) as max_id from sys_chat_records where recipient_id = #{chatRecords.senderId} group by sender_id
                )t group by uid
            ) scrs
            on
            scr.id = scrs.id
        ) scrss
        on
        bu.id = scrss.recipientId
        order by postTime desc
    </select>
</mapper>
src/main/java/org/springblade/modules/chatrecords/service/ChatRecordsService.java
New file
@@ -0,0 +1,45 @@
package org.springblade.modules.chatrecords.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.chatrecords.entity.ChatRecords;
import org.springblade.modules.chatrecords.vo.ChatRecordsVo;
import java.util.List;
/**
 * @author zhongrj
 * 聊天消息接口层
 */
public interface ChatRecordsService extends IService<ChatRecords> {
    /**
     * 查询聊天消息分页信息
     * @param page
     * @param chatRecords 聊天消息对象
     * @return
     */
    IPage<ChatRecords> selectChatRecordsPage(IPage<ChatRecords> page, ChatRecords chatRecords);
    /**
     * 查询当前用户的聊天列表
     * @param chatRecords 消息记录对象
     * @param page
     * @return
     */
    IPage<ChatRecordsVo> getChatListPage(IPage<ChatRecordsVo> page, ChatRecords chatRecords);
    /**
     * 查询当前用户的聊天列表(不分页)
     * @param chatRecords 消息记录对象
     * @return
     */
    List<ChatRecordsVo> getChatList(ChatRecords chatRecords);
    /**
     * 查询单聊消息记录 (不分页)
     * @param chatRecords 消息记录对象
     * @return
     */
    List<ChatRecords> selectChatlist(ChatRecords chatRecords);
}
src/main/java/org/springblade/modules/chatrecords/service/impl/ChatRecordsServiceImpl.java
New file
@@ -0,0 +1,60 @@
package org.springblade.modules.chatrecords.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.modules.chatrecords.entity.ChatRecords;
import org.springblade.modules.chatrecords.mapper.ChatRecordsMapper;
import org.springblade.modules.chatrecords.service.ChatRecordsService;
import org.springblade.modules.chatrecords.vo.ChatRecordsVo;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * @author zhongrj
 */
@Service
public class ChatRecordsServiceImpl extends ServiceImpl<ChatRecordsMapper, ChatRecords> implements ChatRecordsService {
    /**
     * 查询聊天消息分页信息
     * @param page
     * @param chatRecords 聊天消息对象
     * @return
     */
    @Override
    public IPage<ChatRecords> selectChatRecordsPage(IPage<ChatRecords> page, ChatRecords chatRecords) {
        return page.setRecords(baseMapper.selectChatRecordsPage(page,chatRecords));
    }
    /**
     * 查询当前用户的聊天列表
     * @param chatRecords 消息记录对象
     * @param page
     * @return
     */
    @Override
    public IPage<ChatRecordsVo> getChatListPage(IPage<ChatRecordsVo> page, ChatRecords chatRecords) {
        return page.setRecords(baseMapper.getChatListPage(page,chatRecords));
    }
    /**
     * 查询当前用户的聊天列表(不分页)
     * @param chatRecords 消息记录对象
     * @return
     */
    @Override
    public List<ChatRecordsVo> getChatList(ChatRecords chatRecords) {
        return baseMapper.getChatListPage(null,chatRecords);
    }
    /**
     * 查询单聊消息记录 (不分页)
     * @param chatRecords 消息记录对象
     * @return
     */
    @Override
    public List<ChatRecords> selectChatlist(ChatRecords chatRecords) {
        return baseMapper.selectChatRecordsPage(null,chatRecords);
    }
}
src/main/java/org/springblade/modules/chatrecords/vo/ChatRecordsVo.java
New file
@@ -0,0 +1,30 @@
package org.springblade.modules.chatrecords.vo;
import lombok.Data;
import org.springblade.modules.chatrecords.entity.ChatRecords;
import java.io.Serializable;
/**
 * @author zhongrj
 * @time 2021-06-19
 * @desc 聊天列表vo
 */
@Data
public class ChatRecordsVo extends ChatRecords implements Serializable {
    /**
     * 接收或者发送的昵称
     */
    private String recipientNickName;
    /**
     * 接收或者发送的姓名
     */
    private String recipientName;
    /**
     * 接收或者发送的头像 url
     */
    private String avatar;
}
src/main/java/org/springblade/modules/chatrg/controller/ChatgroupController.java
New file
@@ -0,0 +1,162 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.chatrg.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.chatrg.entity.Chatgroup;
import org.springblade.modules.chatrg.service.IChatgroupService;
import org.springblade.modules.chatrg.vo.ChatgroupVO;
import org.springblade.modules.system.service.IUserService;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * 控制器
 *
 * @author BladeX
 * @since 2021-06-24
 */
@RestController
@AllArgsConstructor
@RequestMapping("/chatgroup")
@Api(value = "", tags = "接口")
public class ChatgroupController extends BladeController {
    private final IChatgroupService chatgroupService;
    private final IUserService iUserService;
    /**
     * 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入chatgroup")
    public R<Chatgroup> detail(Chatgroup chatgroup) {
        Chatgroup detail = chatgroupService.getOne(Condition.getQueryWrapper(chatgroup));
        return R.data(detail);
    }
    /**
     * 分页
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入chatgroup")
    public R<IPage<Chatgroup>> list(Chatgroup chatgroup, Query query) {
        IPage<Chatgroup> pages = chatgroupService.page(Condition.getPage(query), Condition.getQueryWrapper(chatgroup));
        List<Map<String, Object>> list = iUserService.selectUser();
        for (int i = 0; i < pages.getTotal(); i++) {
            StringBuffer deptNameBuiffer = new StringBuffer();
            String groupmember = pages.getRecords().get(i).getGroupmember();
            String[] split = groupmember.split(",");
            List<String> lists = Arrays.asList(split);
            //数据匹配封装
            for (String deptId : lists) {
                for (Map<String, Object> deptVo : list) {
                    if (deptId.equals(deptVo.get("groupmember").toString())) {
                        deptNameBuiffer.append(deptVo.get("rname")).append("/");
                    }
                }
            }
            pages.getRecords().get(i).setGroupmember(deptNameBuiffer.substring(0, deptNameBuiffer.length() - 1));
        }
        return R.data(pages);
    }
    /**
     * 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入chatgroup")
    public R<IPage<ChatgroupVO>> page(ChatgroupVO chatgroup, Query query) {
        IPage<ChatgroupVO> pages = chatgroupService.selectChatgroupPage(Condition.getPage(query), chatgroup);
        return R.data(pages);
    }
    /**
     * 新增
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入chatgroup")
    public R save(@Valid @RequestBody Chatgroup chatgroup) {
        Date dd = new Date();
        SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String end = sim.format(dd);
        chatgroup.setTime(end);
        return R.status(chatgroupService.save(chatgroup));
    }
    /**
     * 修改
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入chatgroup")
    public R update(@Valid @RequestBody Chatgroup chatgroup) {
        return R.status(chatgroupService.updateById(chatgroup));
    }
    /**
     * 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入chatgroup")
    public R submit(@Valid @RequestBody Chatgroup chatgroup) {
        return R.status(chatgroupService.saveOrUpdate(chatgroup));
    }
    /**
     * 删除
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 8)
    @ApiOperation(value = "删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(chatgroupService.removeByIds(Func.toLongList(ids)));
    }
    /**
     * 群列表
     *
     * @return
     */
    @GetMapping("/selectList")
    public R selectList(String id) {
        return R.data(chatgroupService.selectList(id));
    }
}
src/main/java/org/springblade/modules/chatrg/dto/ChatgroupDTO.java
New file
@@ -0,0 +1,34 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.chatrg.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.chatrg.entity.Chatgroup;
/**
 * 数据传输对象实体类
 *
 * @author BladeX
 * @since 2021-06-24
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class ChatgroupDTO extends Chatgroup {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/chatrg/entity/Chatgroup.java
New file
@@ -0,0 +1,87 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.chatrg.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
 * 实体类
 *
 * @author BladeX
 * @since 2021-06-24
 */
@Data
@TableName("sys_chatgroup")
@ApiModel(value = "Chatgroup对象", description = "Chatgroup对象")
public class Chatgroup implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 群名称
     */
    @ApiModelProperty(value = "群名称")
    @TableField("GroupName")
    private String groupname;
    /**
     * 群备注
     */
    @ApiModelProperty(value = "群备注")
    @TableField("GroupRemarks")
    private String groupremarks;
    /**
     * 群介绍
     */
    @ApiModelProperty(value = "群介绍")
    @TableField("GroupContent")
    private String groupcontent;
    /**
     * 群介绍
     */
    @ApiModelProperty(value = "群公告")
    @TableField("GroupNotice")
    private String groupnotice;
    /**
     * 群主id
     */
    @ApiModelProperty(value = "群主id")
    @TableField("GroupId")
    private String groupid;
    /**
     * 群成员id
     */
    @ApiModelProperty(value = "群成员id")
    @TableField("GroupMember")
    private String groupmember;
    /**
     * 群创建时间
     */
    @ApiModelProperty(value = "群创建时间")
    private String time;
}
src/main/java/org/springblade/modules/chatrg/mapper/ChatgroupMapper.java
New file
@@ -0,0 +1,44 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.chatrg.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.chatrg.entity.Chatgroup;
import org.springblade.modules.chatrg.vo.ChatgroupVO;
import java.util.List;
import java.util.Map;
/**
 *  Mapper 接口
 *
 * @author BladeX
 * @since 2021-06-24
 */
public interface ChatgroupMapper extends BaseMapper<Chatgroup> {
    /**
     * 自定义分页
     *
     * @param page
     * @param chatgroup
     * @return
     */
    List<ChatgroupVO> selectChatgroupPage(IPage page, ChatgroupVO chatgroup);
    List<Map<String, Object>> selectList(String id);
}
src/main/java/org/springblade/modules/chatrg/mapper/ChatgroupMapper.xml
New file
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.springblade.modules.chatrg.mapper.ChatgroupMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="chatgroupResultMap" type="org.springblade.modules.chatrg.entity.Chatgroup">
        <id column="id" property="id"/>
        <result column="GroupName" property="groupname"/>
        <result column="GroupRemarks" property="groupremarks"/>
        <result column="GroupContent" property="groupcontent"/>
        <result column="GroupId" property="groupid"/>
        <result column="GroupMember" property="groupmember"/>
        <result column="time" property="time"/>
        <result column="GroupNotice" property="groupnotice"/>
    </resultMap>
    <select id="selectChatgroupPage" resultMap="chatgroupResultMap">
        select * from sys_chatgroup where is_deleted = 0
    </select>
    <select id="selectList" resultType="java.util.HashMap">
        SELECT p.*,u.real_name,u.avatar FROM sys_chatgroup p LEFT JOIN blade_user u ON p.GroupId=u.id
        where
        (p.GroupMember like concat('%',#{id},'%')
        or p.GroupId = #{id}
        )
    </select>
</mapper>
src/main/java/org/springblade/modules/chatrg/service/IChatgroupService.java
New file
@@ -0,0 +1,44 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.chatrg.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.chatrg.entity.Chatgroup;
import org.springblade.modules.chatrg.vo.ChatgroupVO;
import java.util.List;
import java.util.Map;
/**
 *  服务类
 *
 * @author BladeX
 * @since 2021-06-24
 */
public interface IChatgroupService extends IService<Chatgroup> {
    /**
     * 自定义分页
     *
     * @param page
     * @param chatgroup
     * @return
     */
    IPage<ChatgroupVO> selectChatgroupPage(IPage<ChatgroupVO> page, ChatgroupVO chatgroup);
    List<Map<String, Object>> selectList(String id);
}
src/main/java/org/springblade/modules/chatrg/service/impl/ChatgroupServiceImpl.java
New file
@@ -0,0 +1,49 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.chatrg.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.modules.chatrg.entity.Chatgroup;
import org.springblade.modules.chatrg.mapper.ChatgroupMapper;
import org.springblade.modules.chatrg.service.IChatgroupService;
import org.springblade.modules.chatrg.vo.ChatgroupVO;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 *  服务实现类
 *
 * @author BladeX
 * @since 2021-06-24
 */
@Service
public class ChatgroupServiceImpl extends ServiceImpl<ChatgroupMapper, Chatgroup> implements IChatgroupService {
    @Override
    public IPage<ChatgroupVO> selectChatgroupPage(IPage<ChatgroupVO> page, ChatgroupVO chatgroup) {
        return page.setRecords(baseMapper.selectChatgroupPage(page, chatgroup));
    }
    @Override
    public List<Map<String, Object>> selectList(String id) {
        return baseMapper.selectList(id);
    }
}
src/main/java/org/springblade/modules/chatrg/vo/ChatgroupVO.java
New file
@@ -0,0 +1,36 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.chatrg.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.chatrg.entity.Chatgroup;
/**
 * 视图实体类
 *
 * @author BladeX
 * @since 2021-06-24
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "ChatgroupVO对象", description = "ChatgroupVO对象")
public class ChatgroupVO extends Chatgroup {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/chatrgc/controller/ChatgroupcController.java
New file
@@ -0,0 +1,135 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.chatrgc.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.chatrgc.entity.Chatgroupc;
import org.springblade.modules.chatrgc.service.IChatgroupcService;
import org.springblade.modules.chatrgc.vo.ChatgroupcVO;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
 * 聊天记录表 控制器
 *
 * @author BladeX
 * @since 2021-06-24
 */
@RestController
@AllArgsConstructor
@RequestMapping("/chatgroupc")
@Api(value = "聊天记录表", tags = "聊天记录表接口")
public class ChatgroupcController extends BladeController {
    private final IChatgroupcService chatgroupcService;
    /**
     * 详情
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入chatgroupc")
    public R<Chatgroupc> detail(Chatgroupc chatgroupc) {
        Chatgroupc detail = chatgroupcService.getOne(Condition.getQueryWrapper(chatgroupc));
        return R.data(detail);
    }
    /**
     * 分页 聊天记录表
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入chatgroupc")
    public R<IPage<Chatgroupc>> list(Chatgroupc chatgroupc, Query query) {
        IPage<Chatgroupc> pages = chatgroupcService.page(Condition.getPage(query), Condition.getQueryWrapper(chatgroupc));
        return R.data(pages);
    }
    /**
     * 自定义分页 聊天记录表
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入chatgroupc")
    public R<IPage<ChatgroupcVO>> page(ChatgroupcVO chatgroupc, Query query) {
        IPage<ChatgroupcVO> pages = chatgroupcService.selectChatgroupcPage(Condition.getPage(query), chatgroupc);
        return R.data(pages);
    }
    /**
     * 新增 聊天记录表
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入chatgroupc")
    public R save(@Valid @RequestBody Chatgroupc chatgroupc) {
        return R.status(chatgroupcService.save(chatgroupc));
    }
    /**
     * 修改 聊天记录表
     */
    @PostMapping("/update")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "修改", notes = "传入chatgroupc")
    public R update(@Valid @RequestBody Chatgroupc chatgroupc) {
        return R.status(chatgroupcService.updateById(chatgroupc));
    }
    /**
     * 新增或修改 聊天记录表
     */
    @PostMapping("/submit")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "新增或修改", notes = "传入chatgroupc")
    public R submit(@Valid @RequestBody Chatgroupc chatgroupc) {
        return R.status(chatgroupcService.saveOrUpdate(chatgroupc));
    }
    /**
     * 删除 聊天记录表
     */
    @PostMapping("/remove")
    @ApiOperationSupport(order = 8)
    @ApiOperation(value = "删除", notes = "传入ids")
    public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
        return R.status(chatgroupcService.removeByIds(Func.toLongList(ids)));
    }
    /**
     * 群消息
     * @param
     * @return
     */
    @PostMapping("/selectList")
    public R selectList(String gid) {
        return R.data(chatgroupcService.selectList(gid));
    }
}
src/main/java/org/springblade/modules/chatrgc/dto/ChatgroupcDTO.java
New file
@@ -0,0 +1,34 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.chatrgc.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.chatrgc.entity.Chatgroupc;
/**
 * 聊天记录表数据传输对象实体类
 *
 * @author BladeX
 * @since 2021-06-24
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class ChatgroupcDTO extends Chatgroupc {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/chatrgc/entity/Chatgroupc.java
New file
@@ -0,0 +1,89 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.chatrgc.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
 * 聊天记录表实体类
 *
 * @author BladeX
 * @since 2021-06-24
 */
@Data
@TableName("sys_chatgroupc")
@ApiModel(value = "Chatgroupc对象", description = "聊天记录表")
public class Chatgroupc implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 发送消息内容
     */
    @ApiModelProperty(value = "发送消息内容")
    private String postMessage;
    /**
     * 消息类型 0 文本  1 表情  2 图片  3 视频...
     */
    @ApiModelProperty(value = "消息类型 0 文本  1 表情  2 图片  3 视频...")
    private Integer messageType;
    /**
     * 接收状态 0 已接收  1 未接收
     */
    @ApiModelProperty(value = "接收状态 0 已接收  1 未接收")
    private Integer status;
    /**
     * 发送时间
     */
    @ApiModelProperty(value = "发送时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date postTime;
    /**
     * 群主id
     */
    @ApiModelProperty(value = "群主id")
    private Long groupId;
    /**
     * 发送人id
     */
    @ApiModelProperty(value = "发送人id")
    private Long senderId;
    /**
     * 群id
     */
    @ApiModelProperty(value = "群id")
    private Long gid;
}
src/main/java/org/springblade/modules/chatrgc/mapper/ChatgroupcMapper.java
New file
@@ -0,0 +1,44 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.chatrgc.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.chatrgc.entity.Chatgroupc;
import org.springblade.modules.chatrgc.vo.ChatgroupcVO;
import java.util.List;
import java.util.Map;
/**
 * 聊天记录表 Mapper 接口
 *
 * @author BladeX
 * @since 2021-06-24
 */
public interface ChatgroupcMapper extends BaseMapper<Chatgroupc> {
    /**
     * 自定义分页
     *
     * @param page
     * @param chatgroupc
     * @return
     */
    List<ChatgroupcVO> selectChatgroupcPage(IPage page, ChatgroupcVO chatgroupc);
    List<Map<String, Object>> selectList(String gid);
}
src/main/java/org/springblade/modules/chatrgc/mapper/ChatgroupcMapper.xml
New file
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.springblade.modules.chatrgc.mapper.ChatgroupcMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="chatgroupcResultMap" type="org.springblade.modules.chatrgc.entity.Chatgroupc">
        <id column="id" property="id"/>
        <result column="post_message" property="postMessage"/>
        <result column="message_type" property="messageType"/>
        <result column="status" property="status"/>
        <result column="post_time" property="postTime"/>
        <result column="group_id" property="groupId"/>
        <result column="sender_id" property="senderId"/>
        <result column="gid" property="gid"/>
    </resultMap>
    <select id="selectChatgroupcPage" resultMap="chatgroupcResultMap">
        select * from sys_chatgroupc where is_deleted = 0
    </select>
    <!--群消息-->
    <select id="selectList" resultType="java.util.HashMap">
        SELECT
            c.id,
            c.post_message,
            c.message_type,
            c.post_time,
            c.group_id,
            c.sender_id,
            u.real_name,
            u.avatar,
            us.real_name AS groudname,
            us.avatar AS groupavatar
        FROM
            sys_chatgroupc c
                LEFT JOIN blade_user u ON c.sender_id = u.id
                LEFT JOIN blade_user us ON c.group_id = us.id
        WHERE c.gid=#{gid}
        order by c.post_time desc
    </select>
</mapper>
src/main/java/org/springblade/modules/chatrgc/service/IChatgroupcService.java
New file
@@ -0,0 +1,44 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.chatrgc.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.chatrgc.entity.Chatgroupc;
import org.springblade.modules.chatrgc.vo.ChatgroupcVO;
import java.util.List;
import java.util.Map;
/**
 * 聊天记录表 服务类
 *
 * @author BladeX
 * @since 2021-06-24
 */
public interface IChatgroupcService extends IService<Chatgroupc> {
    /**
     * 自定义分页
     *
     * @param page
     * @param chatgroupc
     * @return
     */
    IPage<ChatgroupcVO> selectChatgroupcPage(IPage<ChatgroupcVO> page, ChatgroupcVO chatgroupc);
    List<Map<String, Object>> selectList(String gid);
}
src/main/java/org/springblade/modules/chatrgc/service/impl/ChatgroupcServiceImpl.java
New file
@@ -0,0 +1,49 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.chatrgc.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.modules.chatrgc.entity.Chatgroupc;
import org.springblade.modules.chatrgc.mapper.ChatgroupcMapper;
import org.springblade.modules.chatrgc.service.IChatgroupcService;
import org.springblade.modules.chatrgc.vo.ChatgroupcVO;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * 聊天记录表 服务实现类
 *
 * @author BladeX
 * @since 2021-06-24
 */
@Service
public class ChatgroupcServiceImpl extends ServiceImpl<ChatgroupcMapper, Chatgroupc> implements IChatgroupcService {
    @Override
    public IPage<ChatgroupcVO> selectChatgroupcPage(IPage<ChatgroupcVO> page, ChatgroupcVO chatgroupc) {
        return page.setRecords(baseMapper.selectChatgroupcPage(page, chatgroupc));
    }
    @Override
    public List<Map<String, Object>> selectList(String gid) {
        return baseMapper.selectList(gid);
    }
}
src/main/java/org/springblade/modules/chatrgc/vo/ChatgroupcVO.java
New file
@@ -0,0 +1,36 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.chatrgc.vo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.chatrgc.entity.Chatgroupc;
/**
 * 聊天记录表视图实体类
 *
 * @author BladeX
 * @since 2021-06-24
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "ChatgroupcVO对象", description = "聊天记录表")
public class ChatgroupcVO extends Chatgroupc {
    private static final long serialVersionUID = 1L;
}
src/main/java/org/springblade/modules/system/mapper/UserMapper.java
@@ -129,4 +129,6 @@
     * @return
     */
    UserVO getUserAgeById(@Param("userId") Long userId);
    List<Map<String, Object>> selectUser();
}
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -360,4 +360,10 @@
    <select id="getUserAgeById" resultType="org.springblade.modules.system.vo.UserVO">
        select id,ifnull(TIMESTAMPDIFF(YEAR, birthday, CURDATE()),0) age from blade_user where id = #{userId}
    </select>
    <select id="selectUser" resultType="java.util.HashMap">
        select CAST(id AS CHAR) as groupmember,real_name as rname from blade_user
    </select>
</mapper>
src/main/java/org/springblade/modules/system/service/IUserService.java
@@ -277,4 +277,6 @@
     * @return
     */
    UserVO getUserAgeById(Long userId);
    List<Map<String, Object>> selectUser();
}
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
@@ -518,4 +518,10 @@
    public UserVO getUserAgeById(Long userId) {
        return baseMapper.getUserAgeById(userId);
    }
    @Override
    public List<Map<String, Object>> selectUser() {
        return baseMapper.selectUser();
    }
}
src/main/resources/application-dev.yml
@@ -13,7 +13,7 @@
    #  commandTimeout: 5000
  datasource:
    # MySql
#    url: jdbc:mysql://localhost:3306/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
#    url: jdbc:mysql://localhost:2083/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
#    username: root
#    password: zhba0728