mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-14 14:13:42 +08:00
feat: 增加显示群主和管理员的功能
This commit is contained in:
@@ -5,10 +5,14 @@ import com.abin.mallchat.common.chat.domain.enums.GroupRoleEnum;
|
||||
import com.abin.mallchat.common.chat.mapper.GroupMemberMapper;
|
||||
import com.abin.mallchat.common.chat.service.cache.GroupMemberCache;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -23,6 +27,7 @@ import java.util.stream.Collectors;
|
||||
public class GroupMemberDao extends ServiceImpl<GroupMemberMapper, GroupMember> {
|
||||
|
||||
@Autowired
|
||||
@Lazy
|
||||
private GroupMemberCache groupMemberCache;
|
||||
|
||||
public List<Long> getMemberUidList(Long groupId) {
|
||||
@@ -42,6 +47,22 @@ public class GroupMemberDao extends ServiceImpl<GroupMemberMapper, GroupMember>
|
||||
return list.stream().map(GroupMember::getUid).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量获取成员群角色
|
||||
*
|
||||
* @param groupId 群ID
|
||||
* @param uidList 用户列表
|
||||
* @return 成员群角色列表
|
||||
*/
|
||||
public Map<Long, Integer> getMemberMapRole(Long groupId, List<Long> uidList) {
|
||||
List<GroupMember> list = lambdaQuery()
|
||||
.eq(GroupMember::getGroupId, groupId)
|
||||
.in(GroupMember::getUid, uidList)
|
||||
.select(GroupMember::getUid, GroupMember::getRole)
|
||||
.list();
|
||||
return list.stream().collect(Collectors.toMap(GroupMember::getUid, GroupMember::getRole));
|
||||
}
|
||||
|
||||
public GroupMember getMember(Long groupId, Long uid) {
|
||||
return lambdaQuery()
|
||||
.eq(GroupMember::getGroupId, groupId)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.abin.mallchat.common.user.domain.vo.response.ws;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -17,6 +18,7 @@ import java.util.Date;
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class ChatMemberResp {
|
||||
@ApiModelProperty("uid")
|
||||
private Long uid;
|
||||
@@ -25,6 +27,12 @@ public class ChatMemberResp {
|
||||
*/
|
||||
@ApiModelProperty("在线状态 1在线 2离线")
|
||||
private Integer activeStatus;
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private Integer roleId;
|
||||
|
||||
@ApiModelProperty("最后一次上下线时间")
|
||||
private Date lastOptTime;
|
||||
}
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
#todo 记得把这些配置信息补充了
|
||||
##################mysql配置##################
|
||||
#todo ????????????
|
||||
##################mysql??##################
|
||||
mallchat.mysql.ip=127.0.0.1
|
||||
mallchat.mysql.port=3306
|
||||
mallchat.mysql.db=mallchat
|
||||
mallchat.mysql.username=root
|
||||
mallchat.mysql.password=123456
|
||||
##################redis配置##################
|
||||
##################redis??##################
|
||||
mallchat.redis.host=127.0.0.1
|
||||
mallchat.redis.port=6379
|
||||
mallchat.redis.password=123456
|
||||
##################jwt##################
|
||||
mallchat.jwt.secret=dsfsdfsdfsdfsd
|
||||
##################微信公众号信息##################
|
||||
##################???????##################
|
||||
mallchat.wx.callback=http://limeng-test.nat300.top/
|
||||
mallchat.wx.appId=wx6cb0974bff30cce0
|
||||
mallchat.wx.secret=072c615d9704d2e9bf0a048407928258
|
||||
# 接口配置里的Token值
|
||||
# ??????Token?
|
||||
mallchat.wx.token=sdfsf
|
||||
# 接口配置里的EncodingAESKey值
|
||||
# ??????EncodingAESKey?
|
||||
mallchat.wx.aesKey=sha1
|
||||
##################OSS配置##################
|
||||
##################OSS??##################
|
||||
oss.enabled=true
|
||||
oss.type=minio
|
||||
oss.endpoint=http://localhost:9000
|
||||
@@ -30,11 +30,11 @@ oss.bucketName=default
|
||||
rocketmq.name-server=127.0.0.1:9876
|
||||
rocketmq.access-key=root
|
||||
rocketmq.secret-key=123456
|
||||
##################gpt配置##################
|
||||
##################gpt??##################
|
||||
mallchat.chatgpt.use=false
|
||||
mallchat.chatgpt.uid=10001
|
||||
mallchat.chatgpt.key=sk-wvWM0xGcxFfsddfsgxixbXK5tHovM
|
||||
mallchat.chatgpt.proxyUrl=https://123.cc
|
||||
mallchat.chatglm2.use=false
|
||||
mallchat.chatglm2.url=http://v32134.cc
|
||||
mallchat.chatglm2.uid=10002
|
||||
mallchat.chatglm2.uid=10002
|
||||
|
||||
@@ -11,7 +11,7 @@ mybatis-plus:
|
||||
spring:
|
||||
profiles:
|
||||
#运行的环境
|
||||
active: my-prod
|
||||
active: test
|
||||
application:
|
||||
name: mallchat
|
||||
datasource:
|
||||
|
||||
Reference in New Issue
Block a user