mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 10:18:42 +08:00 
			
		
		
		
	MALL-KEFU: 根据代码评审修改相关内容
This commit is contained in:
		| @@ -13,16 +13,17 @@ import java.util.Arrays; | ||||
|  */ | ||||
| @AllArgsConstructor | ||||
| @Getter | ||||
| public enum MessageTypeEnum implements IntArrayValuable { | ||||
| public enum KeFuMessageContentTypeEnum implements IntArrayValuable { | ||||
| 
 | ||||
|     MESSAGE(1, "普通消息"), | ||||
|     PICTURE(2, "图片消息"), | ||||
|     TEXT(1, "文本消息"), | ||||
|     IMAGE(2, "图片消息"), | ||||
|     VOICE(3, "语音消息"), | ||||
|     GOODS(4, "商品消息"), | ||||
|     ORDER(5, "订单消息"), | ||||
|     VIDEO(6, "视频消息"); | ||||
|     VIDEO(4, "视频消息"), | ||||
|     // 和正常消息隔离下 | ||||
|     PRODUCT(10, "商品消息"), | ||||
|     ORDER(11, "订单消息"); | ||||
| 
 | ||||
|     private static final int[] ARRAYS = Arrays.stream(values()).mapToInt(MessageTypeEnum::getType).toArray(); | ||||
|     private static final int[] ARRAYS = Arrays.stream(values()).mapToInt(KeFuMessageContentTypeEnum::getType).toArray(); | ||||
| 
 | ||||
|     /** | ||||
|      * 类型 | ||||
| @@ -0,0 +1,83 @@ | ||||
| package cn.iocoder.yudao.module.promotion.dal.dataobject.kefu; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; | ||||
| import cn.iocoder.yudao.module.promotion.enums.kehu.KeFuMessageContentTypeEnum; | ||||
| import com.baomidou.mybatisplus.annotation.KeySequence; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.*; | ||||
|  | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
| /** | ||||
|  * 客服会话 DO | ||||
|  * | ||||
|  * @author HUIHUI | ||||
|  */ | ||||
| @TableName("promotion_kefu_conversation") | ||||
| @KeySequence("promotion_kefu_conversation_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| @Builder | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class KeFuConversationDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 编号 | ||||
|      */ | ||||
|     @TableId | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 会话所属用户 | ||||
|      * | ||||
|      * 关联 {@link MemberUserRespDTO#getId()} | ||||
|      */ | ||||
|     private Long userId; | ||||
|  | ||||
|     /** | ||||
|      * 最后聊天时间 | ||||
|      */ | ||||
|     private LocalDateTime lastMessageTime; | ||||
|     /** | ||||
|      * 最后聊天内容 | ||||
|      */ | ||||
|     private String lastMessageContent; | ||||
|     /** | ||||
|      * 最后发送的消息类型 | ||||
|      * | ||||
|      * 枚举 {@link KeFuMessageContentTypeEnum} | ||||
|      */ | ||||
|     private Integer lastMessageContentType; | ||||
|  | ||||
|     //======================= 会话操作相关 ======================= | ||||
|  | ||||
|     /** | ||||
|      * 管理端置顶 | ||||
|      */ | ||||
|     private Boolean adminPinned; | ||||
|     /** | ||||
|      * 用户是否可见 | ||||
|      * | ||||
|      * true - 可见,默认值 | ||||
|      * false - 不可见,用户删除时设置为 false | ||||
|      */ | ||||
|     private Boolean userDeleted; | ||||
|     /** | ||||
|      * 管理员是否可见 | ||||
|      * | ||||
|      * true - 可见,默认值 | ||||
|      * false - 不可见,管理员删除时设置为 false | ||||
|      */ | ||||
|     private Boolean adminDeleted; | ||||
|  | ||||
|     /** | ||||
|      * 管理员未读消息数 | ||||
|      * | ||||
|      * 用户发送消息时增加,管理员查看后扣减 | ||||
|      */ | ||||
|     private Integer adminUnreadMessageCount; | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,81 @@ | ||||
| package cn.iocoder.yudao.module.promotion.dal.dataobject.kefu; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import cn.iocoder.yudao.module.promotion.enums.kehu.KeFuMessageContentTypeEnum; | ||||
| import com.baomidou.mybatisplus.annotation.KeySequence; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.*; | ||||
|  | ||||
| /** | ||||
|  * 客服消息 DO | ||||
|  * | ||||
|  * @author HUIHUI | ||||
|  */ | ||||
| @TableName("promotion_kefu_message") | ||||
| @KeySequence("promotion_kefu_message_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| @Builder | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class KeFuMessageDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 编号 | ||||
|      */ | ||||
|     @TableId | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 会话编号 | ||||
|      * | ||||
|      * 关联 {@link KeFuConversationDO#getId()} | ||||
|      */ | ||||
|     private Long conversationId; | ||||
|  | ||||
|     /** | ||||
|      * 发送人编号 | ||||
|      * | ||||
|      * 存储的是用户编号 | ||||
|      */ | ||||
|     private Long senderId; | ||||
|     /** | ||||
|      * 发送人类型 | ||||
|      * | ||||
|      * 枚举,{@link UserTypeEnum} | ||||
|      */ | ||||
|     private Integer senderType; | ||||
|     /** | ||||
|      * 接收人编号 | ||||
|      * | ||||
|      * 存储的是用户编号 | ||||
|      */ | ||||
|     private Long receiverId; | ||||
|     /** | ||||
|      * 接收人类型 | ||||
|      * | ||||
|      * 枚举,{@link UserTypeEnum} | ||||
|      */ | ||||
|     private Integer receiverType; | ||||
|  | ||||
|     /** | ||||
|      * 消息类型 | ||||
|      * | ||||
|      * 枚举 {@link KeFuMessageContentTypeEnum} | ||||
|      */ | ||||
|     private Integer contentType; | ||||
|     /** | ||||
|      * 消息 | ||||
|      */ | ||||
|     private String content; | ||||
|  | ||||
|     //======================= 消息相关状态 ======================= | ||||
|  | ||||
|     /** | ||||
|      * 是/否已读 | ||||
|      */ | ||||
|     private Boolean readStatus; | ||||
|  | ||||
| } | ||||
| @@ -1,72 +0,0 @@ | ||||
| package cn.iocoder.yudao.module.promotion.dal.dataobject.kefu; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import cn.iocoder.yudao.module.promotion.enums.kehu.MessageTypeEnum; | ||||
| import com.baomidou.mybatisplus.annotation.KeySequence; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.*; | ||||
|  | ||||
| /** | ||||
|  * 客户消息 DO | ||||
|  * | ||||
|  * @author HUIHUI | ||||
|  */ | ||||
| @TableName("kehu_message") | ||||
| @KeySequence("kehu_message_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| @Builder | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class KehuMessageDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 编号 | ||||
|      */ | ||||
|     @TableId | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 会话编号 | ||||
|      * | ||||
|      * 关联 {@link KehuTalkDO#getId()} | ||||
|      */ | ||||
|     private Long talkId; | ||||
|  | ||||
|     /** | ||||
|      * 发送者 | ||||
|      */ | ||||
|     private Long fromUserId; | ||||
|     /** | ||||
|      * 发送者用户类型 | ||||
|      */ | ||||
|     private String fromUserType; | ||||
|     /** | ||||
|      * 接收者 | ||||
|      */ | ||||
|     private Long toUserId; | ||||
|     /** | ||||
|      * 接收着用户类型 | ||||
|      */ | ||||
|     private String toUserType; | ||||
|  | ||||
|     /** | ||||
|      * 消息类型 | ||||
|      * | ||||
|      * 枚举 {@link MessageTypeEnum} | ||||
|      */ | ||||
|     private Integer messageType; | ||||
|     /** | ||||
|      * 消息 | ||||
|      */ | ||||
|     private String message; | ||||
|  | ||||
|     //======================= 消息相关状态 ======================= | ||||
|  | ||||
|     /** | ||||
|      * 是/否已读 | ||||
|      */ | ||||
|     private Boolean isRead; | ||||
|  | ||||
| } | ||||
| @@ -1,104 +0,0 @@ | ||||
| package cn.iocoder.yudao.module.promotion.dal.dataobject.kefu; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||||
| import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; | ||||
| import cn.iocoder.yudao.module.promotion.enums.kehu.MessageTypeEnum; | ||||
| import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; | ||||
| import com.baomidou.mybatisplus.annotation.KeySequence; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import lombok.*; | ||||
|  | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
| /** | ||||
|  * 客户会话 DO | ||||
|  * | ||||
|  * @author HUIHUI | ||||
|  */ | ||||
| @TableName("kehu_talk") | ||||
| @KeySequence("kehu_talk_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| @Builder | ||||
| @NoArgsConstructor | ||||
| @AllArgsConstructor | ||||
| public class KehuTalkDO extends BaseDO { | ||||
|  | ||||
|     /** | ||||
|      * 编号 | ||||
|      */ | ||||
|     @TableId | ||||
|     private Long id; | ||||
|     /** | ||||
|      * 会话所属用户 | ||||
|      * | ||||
|      * 关联 {@link MemberUserRespDTO#getId()} | ||||
|      */ | ||||
|     private Long userId; | ||||
|     /** | ||||
|      * 用户名称 | ||||
|      * | ||||
|      * 关联 {@link MemberUserRespDTO#getNickname()} | ||||
|      */ | ||||
|     private String userName; | ||||
|     /** | ||||
|      * 用户头像 | ||||
|      * | ||||
|      * 关联 {@link MemberUserRespDTO#getAvatar()} | ||||
|      */ | ||||
|     private String userFace; | ||||
|     /** | ||||
|      * 管理员名称 | ||||
|      * | ||||
|      * 关联 {@link AdminUserRespDTO#getNickname()} | ||||
|      */ | ||||
|     private String adminName; | ||||
|     /** | ||||
|      * 管理员头像, 管理员搞个默认头像 | ||||
|      */ | ||||
|     private String adminFace; | ||||
|  | ||||
|     /** | ||||
|      * 最后聊天时间 | ||||
|      */ | ||||
|     private LocalDateTime lastTalkTime; | ||||
|     /** | ||||
|      * 最后聊天内容 | ||||
|      */ | ||||
|     private String lastTalkMessage; | ||||
|     /** | ||||
|      * 最后发送的消息类型 | ||||
|      * | ||||
|      * 枚举 {@link MessageTypeEnum} | ||||
|      */ | ||||
|     private Integer lastMessageType; | ||||
|  | ||||
|     //======================= 会话操作相关 ======================= | ||||
|  | ||||
|     /** | ||||
|      * 管理端置顶 | ||||
|      */ | ||||
|     private Boolean adminPinned; | ||||
|     /** | ||||
|      * 用户端不可见,默认为 true | ||||
|      * | ||||
|      * 用户删除此会话时设置为 false | ||||
|      */ | ||||
|     private Boolean userDisable; | ||||
|     /** | ||||
|      * 管理员端不可见,默认为 true | ||||
|      * | ||||
|      * 管理员删除此会话时设置为 false | ||||
|      */ | ||||
|     private Boolean adminDisable; | ||||
|  | ||||
|     /** | ||||
|      * 管理员未读消息数 | ||||
|      * | ||||
|      * 用户发送消息时增加,管理员查看后扣减 | ||||
|      */ | ||||
|     private Integer adminUnreadMessageCount; | ||||
|  | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 puhui999
					puhui999