Commit 0be9c67aa6b534e872b25b9e82e4a32e7fc7e331

Authored by puhui999
1 parent 020f3a9a

MALL-KEFU: 根据代码评审修改相关内容

yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/kehu/MessageTypeEnum.java renamed to yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/kehu/KeFuMessageContentTypeEnum.java
@@ -13,16 +13,17 @@ import java.util.Arrays; @@ -13,16 +13,17 @@ import java.util.Arrays;
13 */ 13 */
14 @AllArgsConstructor 14 @AllArgsConstructor
15 @Getter 15 @Getter
16 -public enum MessageTypeEnum implements IntArrayValuable { 16 +public enum KeFuMessageContentTypeEnum implements IntArrayValuable {
17 17
18 - MESSAGE(1, "普通消息"),  
19 - PICTURE(2, "图片消息"), 18 + TEXT(1, "文本消息"),
  19 + IMAGE(2, "图片消息"),
20 VOICE(3, "语音消息"), 20 VOICE(3, "语音消息"),
21 - GOODS(4, "商品消息"),  
22 - ORDER(5, "订单消息"),  
23 - VIDEO(6, "视频消息"); 21 + VIDEO(4, "视频消息"),
  22 + // 和正常消息隔离下
  23 + PRODUCT(10, "商品消息"),
  24 + ORDER(11, "订单消息");
24 25
25 - private static final int[] ARRAYS = Arrays.stream(values()).mapToInt(MessageTypeEnum::getType).toArray(); 26 + private static final int[] ARRAYS = Arrays.stream(values()).mapToInt(KeFuMessageContentTypeEnum::getType).toArray();
26 27
27 /** 28 /**
28 * 类型 29 * 类型
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/kefu/KehuTalkDO.java renamed to yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/kefu/KeFuConversationDO.java
@@ -2,8 +2,7 @@ package cn.iocoder.yudao.module.promotion.dal.dataobject.kefu; @@ -2,8 +2,7 @@ package cn.iocoder.yudao.module.promotion.dal.dataobject.kefu;
2 2
3 import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; 3 import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
4 import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; 4 import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
5 -import cn.iocoder.yudao.module.promotion.enums.kehu.MessageTypeEnum;  
6 -import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; 5 +import cn.iocoder.yudao.module.promotion.enums.kehu.KeFuMessageContentTypeEnum;
7 import com.baomidou.mybatisplus.annotation.KeySequence; 6 import com.baomidou.mybatisplus.annotation.KeySequence;
8 import com.baomidou.mybatisplus.annotation.TableId; 7 import com.baomidou.mybatisplus.annotation.TableId;
9 import com.baomidou.mybatisplus.annotation.TableName; 8 import com.baomidou.mybatisplus.annotation.TableName;
@@ -12,19 +11,19 @@ import lombok.*; @@ -12,19 +11,19 @@ import lombok.*;
12 import java.time.LocalDateTime; 11 import java.time.LocalDateTime;
13 12
14 /** 13 /**
15 - * 客户会话 DO 14 + * 客服会话 DO
16 * 15 *
17 * @author HUIHUI 16 * @author HUIHUI
18 */ 17 */
19 -@TableName("kehu_talk")  
20 -@KeySequence("kehu_talk_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 18 +@TableName("promotion_kefu_conversation")
  19 +@KeySequence("promotion_kefu_conversation_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
21 @Data 20 @Data
22 @EqualsAndHashCode(callSuper = true) 21 @EqualsAndHashCode(callSuper = true)
23 @ToString(callSuper = true) 22 @ToString(callSuper = true)
24 @Builder 23 @Builder
25 @NoArgsConstructor 24 @NoArgsConstructor
26 @AllArgsConstructor 25 @AllArgsConstructor
27 -public class KehuTalkDO extends BaseDO { 26 +public class KeFuConversationDO extends BaseDO {
28 27
29 /** 28 /**
30 * 编号 29 * 编号
@@ -37,43 +36,21 @@ public class KehuTalkDO extends BaseDO { @@ -37,43 +36,21 @@ public class KehuTalkDO extends BaseDO {
37 * 关联 {@link MemberUserRespDTO#getId()} 36 * 关联 {@link MemberUserRespDTO#getId()}
38 */ 37 */
39 private Long userId; 38 private Long userId;
40 - /**  
41 - * 用户名称  
42 - *  
43 - * 关联 {@link MemberUserRespDTO#getNickname()}  
44 - */  
45 - private String userName;  
46 - /**  
47 - * 用户头像  
48 - *  
49 - * 关联 {@link MemberUserRespDTO#getAvatar()}  
50 - */  
51 - private String userFace;  
52 - /**  
53 - * 管理员名称  
54 - *  
55 - * 关联 {@link AdminUserRespDTO#getNickname()}  
56 - */  
57 - private String adminName;  
58 - /**  
59 - * 管理员头像, 管理员搞个默认头像  
60 - */  
61 - private String adminFace;  
62 39
63 /** 40 /**
64 * 最后聊天时间 41 * 最后聊天时间
65 */ 42 */
66 - private LocalDateTime lastTalkTime; 43 + private LocalDateTime lastMessageTime;
67 /** 44 /**
68 * 最后聊天内容 45 * 最后聊天内容
69 */ 46 */
70 - private String lastTalkMessage; 47 + private String lastMessageContent;
71 /** 48 /**
72 * 最后发送的消息类型 49 * 最后发送的消息类型
73 * 50 *
74 - * 枚举 {@link MessageTypeEnum} 51 + * 枚举 {@link KeFuMessageContentTypeEnum}
75 */ 52 */
76 - private Integer lastMessageType; 53 + private Integer lastMessageContentType;
77 54
78 //======================= 会话操作相关 ======================= 55 //======================= 会话操作相关 =======================
79 56
@@ -82,17 +59,19 @@ public class KehuTalkDO extends BaseDO { @@ -82,17 +59,19 @@ public class KehuTalkDO extends BaseDO {
82 */ 59 */
83 private Boolean adminPinned; 60 private Boolean adminPinned;
84 /** 61 /**
85 - * 用户端不可见,默认为 true 62 + * 用户是否可见
86 * 63 *
87 - * 用户删除此会话时设置为 false 64 + * true - 可见,默认值
  65 + * false - 不可见,用户删除时设置为 false
88 */ 66 */
89 - private Boolean userDisable; 67 + private Boolean userDeleted;
90 /** 68 /**
91 - * 管理员端不可见,默认为 true 69 + * 管理员是否可见
92 * 70 *
93 - * 管理员删除此会话时设置为 false 71 + * true - 可见,默认值
  72 + * false - 不可见,管理员删除时设置为 false
94 */ 73 */
95 - private Boolean adminDisable; 74 + private Boolean adminDeleted;
96 75
97 /** 76 /**
98 * 管理员未读消息数 77 * 管理员未读消息数
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/kefu/KehuMessageDO.java renamed to yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/kefu/KeFuMessageDO.java
1 package cn.iocoder.yudao.module.promotion.dal.dataobject.kefu; 1 package cn.iocoder.yudao.module.promotion.dal.dataobject.kefu;
2 2
  3 +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
3 import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; 4 import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
4 -import cn.iocoder.yudao.module.promotion.enums.kehu.MessageTypeEnum; 5 +import cn.iocoder.yudao.module.promotion.enums.kehu.KeFuMessageContentTypeEnum;
5 import com.baomidou.mybatisplus.annotation.KeySequence; 6 import com.baomidou.mybatisplus.annotation.KeySequence;
6 import com.baomidou.mybatisplus.annotation.TableId; 7 import com.baomidou.mybatisplus.annotation.TableId;
7 import com.baomidou.mybatisplus.annotation.TableName; 8 import com.baomidou.mybatisplus.annotation.TableName;
8 import lombok.*; 9 import lombok.*;
9 10
10 /** 11 /**
11 - * 客户消息 DO 12 + * 客服消息 DO
12 * 13 *
13 * @author HUIHUI 14 * @author HUIHUI
14 */ 15 */
15 -@TableName("kehu_message")  
16 -@KeySequence("kehu_message_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 16 +@TableName("promotion_kefu_message")
  17 +@KeySequence("promotion_kefu_message_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
17 @Data 18 @Data
18 @EqualsAndHashCode(callSuper = true) 19 @EqualsAndHashCode(callSuper = true)
19 @ToString(callSuper = true) 20 @ToString(callSuper = true)
20 @Builder 21 @Builder
21 @NoArgsConstructor 22 @NoArgsConstructor
22 @AllArgsConstructor 23 @AllArgsConstructor
23 -public class KehuMessageDO extends BaseDO { 24 +public class KeFuMessageDO extends BaseDO {
24 25
25 /** 26 /**
26 * 编号 27 * 编号
@@ -30,43 +31,51 @@ public class KehuMessageDO extends BaseDO { @@ -30,43 +31,51 @@ public class KehuMessageDO extends BaseDO {
30 /** 31 /**
31 * 会话编号 32 * 会话编号
32 * 33 *
33 - * 关联 {@link KehuTalkDO#getId()} 34 + * 关联 {@link KeFuConversationDO#getId()}
34 */ 35 */
35 - private Long talkId; 36 + private Long conversationId;
36 37
37 /** 38 /**
38 - * 发送者 39 + * 发送人编号
  40 + *
  41 + * 存储的是用户编号
39 */ 42 */
40 - private Long fromUserId; 43 + private Long senderId;
41 /** 44 /**
42 - * 发送者用户类型 45 + * 发送人类型
  46 + *
  47 + * 枚举,{@link UserTypeEnum}
43 */ 48 */
44 - private String fromUserType; 49 + private Integer senderType;
45 /** 50 /**
46 - * 接收者 51 + * 接收人编号
  52 + *
  53 + * 存储的是用户编号
47 */ 54 */
48 - private Long toUserId; 55 + private Long receiverId;
49 /** 56 /**
50 - * 接收着用户类型 57 + * 接收人类型
  58 + *
  59 + * 枚举,{@link UserTypeEnum}
51 */ 60 */
52 - private String toUserType; 61 + private Integer receiverType;
53 62
54 /** 63 /**
55 * 消息类型 64 * 消息类型
56 * 65 *
57 - * 枚举 {@link MessageTypeEnum} 66 + * 枚举 {@link KeFuMessageContentTypeEnum}
58 */ 67 */
59 - private Integer messageType; 68 + private Integer contentType;
60 /** 69 /**
61 * 消息 70 * 消息
62 */ 71 */
63 - private String message; 72 + private String content;
64 73
65 //======================= 消息相关状态 ======================= 74 //======================= 消息相关状态 =======================
66 75
67 /** 76 /**
68 * 是/否已读 77 * 是/否已读
69 */ 78 */
70 - private Boolean isRead; 79 + private Boolean readStatus;
71 80
72 } 81 }