mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-13 21:53:41 +08:00
feat:单聊群聊表结构,接口定义
This commit is contained in:
77
docs/version/2023-07-17.sql
Normal file
77
docs/version/2023-07-17.sql
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
###单聊群聊功能
|
||||||
|
ALTER TABLE `user` add COLUMN `active_status` INT(11) DEFAULT "2" COMMENT '在线状态 1在线 2离线' AFTER `open_id` ;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `room`;
|
||||||
|
CREATE TABLE `room` (
|
||||||
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||||
|
`name` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '群名称',
|
||||||
|
`avatar` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '群头像',
|
||||||
|
`type` int(11) NOT NULL COMMENT '房间类型 1群聊',
|
||||||
|
`hot_flag` int(11) DEFAULT '0' COMMENT '是否全员展示 0否 1是',
|
||||||
|
`active_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '群最后消息的更新时间(热点群不需要写扩散,更新这里就行)',
|
||||||
|
`ext_json` json DEFAULT NULL COMMENT '额外信息(根据不同类型房间有不同存储的东西)',
|
||||||
|
`create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间',
|
||||||
|
`update_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '修改时间',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
|
KEY `idx_create_time` (`create_time`) USING BTREE,
|
||||||
|
KEY `idx_update_time` (`update_time`) USING BTREE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='房间表';
|
||||||
|
|
||||||
|
CREATE TABLE `user_apply` (
|
||||||
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||||
|
`uid` bigint(20) NOT NULL COMMENT '申请人uid',
|
||||||
|
`type` int(11) NOT NULL COMMENT '申请类型 1加好友',
|
||||||
|
`target_id` bigint(20) NOT NULL COMMENT '接收人uid',
|
||||||
|
`msg` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '申请信息',
|
||||||
|
`status` int(11) NOT NULL COMMENT '申请状态 1待审批 2同意',
|
||||||
|
`read_status` int(11) NOT NULL COMMENT '阅读状态 1未读 2已读',
|
||||||
|
`create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间',
|
||||||
|
`update_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '修改时间',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
|
UNIQUE KEY `uniq_target_id_uid` (`target_id`,`uid`) USING BTREE,
|
||||||
|
KEY `idx_target_id` (`target_id`) USING BTREE,
|
||||||
|
KEY `idx_create_time` (`create_time`) USING BTREE,
|
||||||
|
KEY `idx_update_time` (`update_time`) USING BTREE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户申请表';
|
||||||
|
|
||||||
|
CREATE TABLE `user_friend` (
|
||||||
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||||
|
`uid` bigint(20) NOT NULL COMMENT 'uid',
|
||||||
|
`friend_uid` bigint(20) NOT NULL COMMENT '好友uid',
|
||||||
|
`create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间',
|
||||||
|
`update_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '修改时间',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
|
UNIQUE KEY `uniq_uid_friend_uid` (`uid`,`friend_uid`) USING BTREE,
|
||||||
|
KEY `idx_create_time` (`create_time`) USING BTREE,
|
||||||
|
KEY `idx_update_time` (`update_time`) USING BTREE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户联系人表';
|
||||||
|
|
||||||
|
CREATE TABLE `group_member` (
|
||||||
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||||
|
`room_id` bigint(20) NOT NULL COMMENT '房间id',
|
||||||
|
`uid` bigint(20) NOT NULL COMMENT '成员uid',
|
||||||
|
`type` int(11) NOT NULL COMMENT '成员类型 1群主 2管理员 3普通成员',
|
||||||
|
`create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间',
|
||||||
|
`update_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '修改时间',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
|
KEY `idx_room_id_type` (`room_id`,`type`) USING BTREE,
|
||||||
|
KEY `idx_create_time` (`create_time`) USING BTREE,
|
||||||
|
KEY `idx_update_time` (`update_time`) USING BTREE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='群成员表';
|
||||||
|
|
||||||
|
CREATE TABLE `contact` (
|
||||||
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||||
|
`uid` bigint(20) NOT NULL COMMENT 'uid',
|
||||||
|
`type` int(11) NOT NULL COMMENT '聊天类型 1单聊 2普通群聊',
|
||||||
|
`hot_flag` int(11) DEFAULT '0' COMMENT '是否全员展示 0否 1是',
|
||||||
|
`target_id` bigint(20) NOT NULL COMMENT '聊天对象type=1:uid,type=2:房间id',
|
||||||
|
`read_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '阅读到的时间',
|
||||||
|
`active_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '会话内消息最后更新的时间(只有普通会话需要维护,全员会话不需要维护)',
|
||||||
|
`create_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间',
|
||||||
|
`update_time` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '修改时间',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
|
UNIQUE KEY `uniq_uid_target_id_type` (`uid`,`target_id`,`type`) USING BTREE,
|
||||||
|
KEY `idx_target_id_read_time` (`target_id`,`read_time`) USING BTREE,
|
||||||
|
KEY `idx_create_time` (`create_time`) USING BTREE,
|
||||||
|
KEY `idx_update_time` (`update_time`) USING BTREE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='会话列表';
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.abin.mallchat.common.chat.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 会话列表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/contact")
|
||||||
|
public class ContactController {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.abin.mallchat.common.chat.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 群成员表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/groupMember")
|
||||||
|
public class GroupMemberController {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.abin.mallchat.common.chat.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 房间表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/room")
|
||||||
|
public class RoomController {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.abin.mallchat.common.chat.dao;
|
||||||
|
|
||||||
|
import com.abin.mallchat.common.chat.domain.entity.Contact;
|
||||||
|
import com.abin.mallchat.common.chat.mapper.ContactMapper;
|
||||||
|
import com.abin.mallchat.common.chat.service.IContactService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 会话列表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ContactDao extends ServiceImpl<ContactMapper, Contact> implements IContactService {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.abin.mallchat.common.chat.dao;
|
||||||
|
|
||||||
|
import com.abin.mallchat.common.chat.domain.entity.GroupMember;
|
||||||
|
import com.abin.mallchat.common.chat.mapper.GroupMemberMapper;
|
||||||
|
import com.abin.mallchat.common.chat.service.IGroupMemberService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 群成员表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class GroupMemberDao extends ServiceImpl<GroupMemberMapper, GroupMember> implements IGroupMemberService {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,31 +1,20 @@
|
|||||||
package com.abin.mallchat.common.chat.dao;
|
package com.abin.mallchat.common.chat.dao;
|
||||||
|
|
||||||
import com.abin.mallchat.common.chat.domain.entity.Room;
|
import com.abin.mallchat.common.chat.domain.entity.Room;
|
||||||
import com.abin.mallchat.common.chat.domain.enums.RoomTypeEnum;
|
|
||||||
import com.abin.mallchat.common.chat.mapper.RoomMapper;
|
import com.abin.mallchat.common.chat.mapper.RoomMapper;
|
||||||
import com.abin.mallchat.common.common.domain.vo.request.CursorPageBaseReq;
|
import com.abin.mallchat.common.chat.service.IRoomService;
|
||||||
import com.abin.mallchat.common.common.domain.vo.response.CursorPageBaseResp;
|
|
||||||
import com.abin.mallchat.common.common.utils.CursorUtils;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 会话表 服务实现类
|
* 房间表 服务实现类
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
* @since 2023-03-25
|
* @since 2023-07-16
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class RoomDao extends ServiceImpl<RoomMapper, Room> {
|
public class RoomDao extends ServiceImpl<RoomMapper, Room> implements IRoomService {
|
||||||
@Autowired
|
|
||||||
private CursorUtils cursorUtils;
|
|
||||||
|
|
||||||
public CursorPageBaseResp<Room> getCursorPage(CursorPageBaseReq request) {
|
|
||||||
return cursorUtils.getCursorPageByMysql(this, request, wrapper -> {
|
|
||||||
wrapper.ne(Room::getType, RoomTypeEnum.GROUP.getStatus());
|
|
||||||
}, Room::getActiveTime);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package com.abin.mallchat.common.chat.domain.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 lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 会话列表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("contact")
|
||||||
|
public class Contact implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* uid
|
||||||
|
*/
|
||||||
|
@TableField("uid")
|
||||||
|
private Long uid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 聊天类型 1单聊 2普通群聊
|
||||||
|
*/
|
||||||
|
@TableField("type")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否全员展示 0否 1是
|
||||||
|
*/
|
||||||
|
@TableField("hot_flag")
|
||||||
|
private Integer hotFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 聊天对象type=1:uid,type=2:房间id
|
||||||
|
*/
|
||||||
|
@TableField("target_id")
|
||||||
|
private Long targetId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 阅读到的时间
|
||||||
|
*/
|
||||||
|
@TableField("read_time")
|
||||||
|
private LocalDateTime readTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会话内消息最后更新的时间(只有普通会话需要维护,全员会话不需要维护)
|
||||||
|
*/
|
||||||
|
@TableField("active_time")
|
||||||
|
private LocalDateTime activeTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField("create_time")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@TableField("update_time")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package com.abin.mallchat.common.chat.domain.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 lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 群成员表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("group_member")
|
||||||
|
public class GroupMember implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房间id
|
||||||
|
*/
|
||||||
|
@TableField("room_id")
|
||||||
|
private Long roomId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成员uid
|
||||||
|
*/
|
||||||
|
@TableField("uid")
|
||||||
|
private Long uid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成员类型 1群主 2管理员 3普通成员
|
||||||
|
*/
|
||||||
|
@TableField("type")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField("create_time")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@TableField("update_time")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -8,15 +8,15 @@ import lombok.Data;
|
|||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 会话表
|
* 房间表
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
* @since 2023-03-25
|
* @since 2023-07-16
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@@ -32,36 +32,52 @@ public class Room implements Serializable {
|
|||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会话名
|
* 群名称
|
||||||
*/
|
*/
|
||||||
@TableField("name")
|
@TableField("name")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会话类型 1大群聊 2沸点
|
* 群头像
|
||||||
*
|
*/
|
||||||
* @see com.abin.mallchat.common.chat.domain.enums.RoomTypeEnum
|
@TableField("avatar")
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房间类型 1群聊
|
||||||
*/
|
*/
|
||||||
@TableField("type")
|
@TableField("type")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最后活跃时间-排序
|
* 是否全员展示 0否 1是
|
||||||
|
*/
|
||||||
|
@TableField("hot_flag")
|
||||||
|
private Integer hotFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 群最后消息的更新时间(热点群不需要写扩散,更新这里就行)
|
||||||
*/
|
*/
|
||||||
@TableField("active_time")
|
@TableField("active_time")
|
||||||
private Date activeTime;
|
private LocalDateTime activeTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 额外信息(根据不同类型房间有不同存储的东西)
|
||||||
|
*/
|
||||||
|
@TableField("ext_json")
|
||||||
|
private String extJson;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
@TableField("create_time")
|
@TableField("create_time")
|
||||||
private Date createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改时间
|
* 修改时间
|
||||||
*/
|
*/
|
||||||
@TableField("update_time")
|
@TableField("update_time")
|
||||||
private Date updateTime;
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.abin.mallchat.common.chat.mapper;
|
||||||
|
|
||||||
|
import com.abin.mallchat.common.chat.domain.entity.Contact;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 会话列表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
public interface ContactMapper extends BaseMapper<Contact> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.abin.mallchat.common.chat.mapper;
|
||||||
|
|
||||||
|
import com.abin.mallchat.common.chat.domain.entity.GroupMember;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 群成员表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
public interface GroupMemberMapper extends BaseMapper<GroupMember> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,16 +1,15 @@
|
|||||||
package com.abin.mallchat.common.chat.mapper;
|
package com.abin.mallchat.common.chat.mapper;
|
||||||
|
|
||||||
|
|
||||||
import com.abin.mallchat.common.chat.domain.entity.Room;
|
import com.abin.mallchat.common.chat.domain.entity.Room;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 会话表 Mapper 接口
|
* 房间表 Mapper 接口
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
* @since 2023-03-25
|
* @since 2023-07-16
|
||||||
*/
|
*/
|
||||||
public interface RoomMapper extends BaseMapper<Room> {
|
public interface RoomMapper extends BaseMapper<Room> {
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.abin.mallchat.common.chat.service;
|
||||||
|
|
||||||
|
import com.abin.mallchat.common.chat.domain.entity.Contact;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 会话列表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
public interface IContactService extends IService<Contact> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.abin.mallchat.common.chat.service;
|
||||||
|
|
||||||
|
import com.abin.mallchat.common.chat.domain.entity.GroupMember;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 群成员表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
public interface IGroupMemberService extends IService<GroupMember> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,11 +5,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 会话表 服务类
|
* 房间表 服务类
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
* @since 2023-03-25
|
* @since 2023-07-16
|
||||||
*/
|
*/
|
||||||
public interface IRoomService extends IService<Room> {
|
public interface IRoomService extends IService<Room> {
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.abin.mallchat.common.user.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户申请表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/userApply")
|
||||||
|
public class UserApplyController {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.abin.mallchat.common.user.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户联系人表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/userFriend")
|
||||||
|
public class UserFriendController {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.abin.mallchat.common.user.dao;
|
||||||
|
|
||||||
|
import com.abin.mallchat.common.user.domain.entity.UserApply;
|
||||||
|
import com.abin.mallchat.common.user.mapper.UserApplyMapper;
|
||||||
|
import com.abin.mallchat.common.user.service.IUserApplyService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户申请表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class UserApplyDao extends ServiceImpl<UserApplyMapper, UserApply> implements IUserApplyService {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.abin.mallchat.common.user.dao;
|
||||||
|
|
||||||
|
import com.abin.mallchat.common.user.domain.entity.UserFriend;
|
||||||
|
import com.abin.mallchat.common.user.mapper.UserFriendMapper;
|
||||||
|
import com.abin.mallchat.common.user.service.IUserFriendService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户联系人表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class UserFriendDao extends ServiceImpl<UserFriendMapper, UserFriend> implements IUserFriendService {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -58,6 +58,12 @@ public class User implements Serializable {
|
|||||||
@TableField("open_id")
|
@TableField("open_id")
|
||||||
private String openId;
|
private String openId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上下线状态 1在线 2离线
|
||||||
|
*/
|
||||||
|
@TableField("active_status")
|
||||||
|
private Integer activeStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最后上下线时间
|
* 最后上下线时间
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package com.abin.mallchat.common.user.domain.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 lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户申请表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("user_apply")
|
||||||
|
public class UserApply implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人uid
|
||||||
|
*/
|
||||||
|
@TableField("uid")
|
||||||
|
private Long uid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请类型 1加好友
|
||||||
|
*/
|
||||||
|
@TableField("type")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接收人uid
|
||||||
|
*/
|
||||||
|
@TableField("target_id")
|
||||||
|
private Long targetId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请信息
|
||||||
|
*/
|
||||||
|
@TableField("msg")
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请状态 1待审批 2同意
|
||||||
|
*/
|
||||||
|
@TableField("status")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 阅读状态 1未读 2已读
|
||||||
|
*/
|
||||||
|
@TableField("read_status")
|
||||||
|
private Integer readStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField("create_time")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@TableField("update_time")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.abin.mallchat.common.user.domain.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 lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户联系人表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("user_friend")
|
||||||
|
public class UserFriend implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* uid
|
||||||
|
*/
|
||||||
|
@TableField("uid")
|
||||||
|
private Long uid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 好友uid
|
||||||
|
*/
|
||||||
|
@TableField("friend_uid")
|
||||||
|
private Long friendUid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField("create_time")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@TableField("update_time")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.abin.mallchat.common.user.mapper;
|
||||||
|
|
||||||
|
import com.abin.mallchat.common.user.domain.entity.UserApply;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户申请表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
public interface UserApplyMapper extends BaseMapper<UserApply> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.abin.mallchat.common.user.mapper;
|
||||||
|
|
||||||
|
import com.abin.mallchat.common.user.domain.entity.UserFriend;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户联系人表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
public interface UserFriendMapper extends BaseMapper<UserFriend> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.abin.mallchat.common.user.service;
|
||||||
|
|
||||||
|
import com.abin.mallchat.common.user.domain.entity.UserApply;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户申请表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
public interface IUserApplyService extends IService<UserApply> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.abin.mallchat.common.user.service;
|
||||||
|
|
||||||
|
import com.abin.mallchat.common.user.domain.entity.UserFriend;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 用户联系人表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
public interface IUserFriendService extends IService<UserFriend> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.abin.mallchat.common.chat.mapper.ContactMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.abin.mallchat.common.chat.mapper.GroupMemberMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.abin.mallchat.common.user.mapper.UserApplyMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.abin.mallchat.common.user.mapper.UserFriendMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.abin.mallchat.custom.chat.service.adapter;
|
package com.abin.mallchat.custom.chat.service.adapter;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.abin.mallchat.common.chat.domain.entity.Room;
|
|
||||||
import com.abin.mallchat.custom.chat.domain.vo.response.ChatRoomResp;
|
import com.abin.mallchat.custom.chat.domain.vo.response.ChatRoomResp;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@@ -0,0 +1,94 @@
|
|||||||
|
package com.abin.mallchat.custom.user.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.abin.mallchat.common.common.domain.vo.request.CursorPageBaseReq;
|
||||||
|
import com.abin.mallchat.common.common.domain.vo.request.PageBaseReq;
|
||||||
|
import com.abin.mallchat.common.common.domain.vo.response.ApiResult;
|
||||||
|
import com.abin.mallchat.common.common.domain.vo.response.CursorPageBaseResp;
|
||||||
|
import com.abin.mallchat.common.common.domain.vo.response.PageBaseResp;
|
||||||
|
import com.abin.mallchat.common.common.utils.RequestHolder;
|
||||||
|
import com.abin.mallchat.common.user.service.cache.UserCache;
|
||||||
|
import com.abin.mallchat.custom.chat.domain.vo.response.ChatMemberResp;
|
||||||
|
import com.abin.mallchat.custom.chat.service.ChatService;
|
||||||
|
import com.abin.mallchat.custom.user.domain.vo.request.friend.FriendApplyReq;
|
||||||
|
import com.abin.mallchat.custom.user.domain.vo.request.friend.FriendApproveReq;
|
||||||
|
import com.abin.mallchat.custom.user.domain.vo.request.friend.FriendCheckReq;
|
||||||
|
import com.abin.mallchat.custom.user.domain.vo.request.friend.FriendDeleteReq;
|
||||||
|
import com.abin.mallchat.custom.user.domain.vo.response.friend.FriendApplyResp;
|
||||||
|
import com.abin.mallchat.custom.user.domain.vo.response.friend.FriendCheckResp;
|
||||||
|
import com.abin.mallchat.custom.user.domain.vo.response.friend.FriendUnreadResp;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 好友相关接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* @since 2023-07-16
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/capi/user/friend")
|
||||||
|
@Api(tags = "好友相关接口")
|
||||||
|
@Slf4j
|
||||||
|
public class FriendController {
|
||||||
|
@Autowired
|
||||||
|
private ChatService chatService;
|
||||||
|
@Autowired
|
||||||
|
private UserCache userCache;
|
||||||
|
|
||||||
|
@GetMapping("/check")
|
||||||
|
@ApiOperation("批量判断是否是自己好友")
|
||||||
|
public ApiResult<FriendCheckResp> check(@Valid FriendCheckReq request) {//todo
|
||||||
|
return ApiResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/apply")
|
||||||
|
@ApiOperation("申请好友")
|
||||||
|
public ApiResult<Void> apply(@Valid @RequestBody FriendApplyReq request) {//todo
|
||||||
|
Long uid = RequestHolder.get().getUid();
|
||||||
|
return ApiResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping()
|
||||||
|
@ApiOperation("删除好友")
|
||||||
|
public ApiResult<Void> delete(@Valid @RequestBody FriendDeleteReq request) {//todo
|
||||||
|
Long uid = RequestHolder.get().getUid();
|
||||||
|
return ApiResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/apply/page")
|
||||||
|
@ApiOperation("好友申请列表")
|
||||||
|
public ApiResult<PageBaseResp<FriendApplyResp>> page(@Valid PageBaseReq request) {//todo
|
||||||
|
Long uid = RequestHolder.get().getUid();
|
||||||
|
return ApiResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/apply/unread")
|
||||||
|
@ApiOperation("申请未读数")
|
||||||
|
public ApiResult<FriendUnreadResp> unread() {//todo
|
||||||
|
Long uid = RequestHolder.get().getUid();
|
||||||
|
return ApiResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/apply")
|
||||||
|
@ApiOperation("申请审批")
|
||||||
|
public ApiResult<Void> applyApprove(@Valid @RequestBody FriendApproveReq request) {//todo
|
||||||
|
Long uid = RequestHolder.get().getUid();
|
||||||
|
return ApiResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/page")
|
||||||
|
@ApiOperation("联系人列表")
|
||||||
|
public ApiResult<CursorPageBaseResp<ChatMemberResp>> applyApprove(@Valid CursorPageBaseReq request) {//todo
|
||||||
|
Long uid = RequestHolder.get().getUid();
|
||||||
|
return ApiResult.success();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.abin.mallchat.custom.user.domain.vo.request.friend;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description: 申请好友信息
|
||||||
|
* Author: <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* Date: 2023-03-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class FriendApplyReq {
|
||||||
|
|
||||||
|
@NotBlank
|
||||||
|
@ApiModelProperty("申请信息")
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
@NotBlank
|
||||||
|
@ApiModelProperty("好友uid")
|
||||||
|
private Long targetUid;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.abin.mallchat.custom.user.domain.vo.request.friend;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description: 申请好友信息
|
||||||
|
* Author: <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* Date: 2023-03-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class FriendApproveReq {
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@ApiModelProperty("审批动作 2同意")
|
||||||
|
private Integer approveStatus;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.abin.mallchat.custom.user.domain.vo.request.friend;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description: 好友校验
|
||||||
|
* Author: <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* Date: 2023-03-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class FriendCheckReq {
|
||||||
|
|
||||||
|
@NotEmpty
|
||||||
|
@Size(max = 50)
|
||||||
|
@ApiModelProperty("校验好友的uid")
|
||||||
|
private List<Long> uidList;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.abin.mallchat.custom.user.domain.vo.request.friend;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description: 申请好友信息
|
||||||
|
* Author: <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* Date: 2023-03-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class FriendDeleteReq {
|
||||||
|
|
||||||
|
@NotBlank
|
||||||
|
@ApiModelProperty("好友uid")
|
||||||
|
private Long targetUid;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.abin.mallchat.custom.user.domain.vo.response.friend;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description: 好友校验
|
||||||
|
* Author: <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* Date: 2023-03-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class FriendApplyResp {
|
||||||
|
|
||||||
|
@ApiModelProperty("申请人uid")
|
||||||
|
private Long uid;
|
||||||
|
|
||||||
|
@ApiModelProperty("申请类型 1加好友")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty("申请信息")
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
@ApiModelProperty("申请状态 1待审批 2同意")//todo 自己去加枚举
|
||||||
|
private Integer status;
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.abin.mallchat.custom.user.domain.vo.response.friend;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description: 好友校验
|
||||||
|
* Author: <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* Date: 2023-03-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class FriendCheckResp {
|
||||||
|
|
||||||
|
@ApiModelProperty("校验结果")
|
||||||
|
private List<FriendCheck> checkedList;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class FriendCheck {
|
||||||
|
private Long uid;
|
||||||
|
private Boolean isFriend;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.abin.mallchat.custom.user.domain.vo.response.friend;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description: 好友校验
|
||||||
|
* Author: <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* Date: 2023-03-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class FriendResp {
|
||||||
|
|
||||||
|
@ApiModelProperty("申请列表的未读数")
|
||||||
|
private Integer unReadCount;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.abin.mallchat.custom.user.domain.vo.response.friend;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description: 好友校验
|
||||||
|
* Author: <a href="https://github.com/zongzibinbin">abin</a>
|
||||||
|
* Date: 2023-03-23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class FriendUnreadResp {
|
||||||
|
|
||||||
|
@ApiModelProperty("申请列表的未读数")
|
||||||
|
private Integer unReadCount;
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user