Commit 020f3a9a12b715c8d648ae620160c67bdc113600
1 parent
ae493e66
MALL-KEHU: 新增客服相关实体类
Showing
3 changed files
with
218 additions
and
0 deletions
yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/kehu/MessageTypeEnum.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.enums.kehu; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.core.IntArrayValuable; | ||
| 4 | +import lombok.AllArgsConstructor; | ||
| 5 | +import lombok.Getter; | ||
| 6 | + | ||
| 7 | +import java.util.Arrays; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * 消息类型枚举 | ||
| 11 | + * | ||
| 12 | + * @author HUIHUI | ||
| 13 | + */ | ||
| 14 | +@AllArgsConstructor | ||
| 15 | +@Getter | ||
| 16 | +public enum MessageTypeEnum implements IntArrayValuable { | ||
| 17 | + | ||
| 18 | + MESSAGE(1, "普通消息"), | ||
| 19 | + PICTURE(2, "图片消息"), | ||
| 20 | + VOICE(3, "语音消息"), | ||
| 21 | + GOODS(4, "商品消息"), | ||
| 22 | + ORDER(5, "订单消息"), | ||
| 23 | + VIDEO(6, "视频消息"); | ||
| 24 | + | ||
| 25 | + private static final int[] ARRAYS = Arrays.stream(values()).mapToInt(MessageTypeEnum::getType).toArray(); | ||
| 26 | + | ||
| 27 | + /** | ||
| 28 | + * 类型 | ||
| 29 | + */ | ||
| 30 | + private final Integer type; | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * 名称 | ||
| 34 | + */ | ||
| 35 | + private final String name; | ||
| 36 | + | ||
| 37 | + @Override | ||
| 38 | + public int[] array() { | ||
| 39 | + return ARRAYS; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | +} |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/kefu/KehuMessageDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.dal.dataobject.kefu; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||
| 4 | +import cn.iocoder.yudao.module.promotion.enums.kehu.MessageTypeEnum; | ||
| 5 | +import com.baomidou.mybatisplus.annotation.KeySequence; | ||
| 6 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
| 7 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
| 8 | +import lombok.*; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * 客户消息 DO | ||
| 12 | + * | ||
| 13 | + * @author HUIHUI | ||
| 14 | + */ | ||
| 15 | +@TableName("kehu_message") | ||
| 16 | +@KeySequence("kehu_message_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | ||
| 17 | +@Data | ||
| 18 | +@EqualsAndHashCode(callSuper = true) | ||
| 19 | +@ToString(callSuper = true) | ||
| 20 | +@Builder | ||
| 21 | +@NoArgsConstructor | ||
| 22 | +@AllArgsConstructor | ||
| 23 | +public class KehuMessageDO extends BaseDO { | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * 编号 | ||
| 27 | + */ | ||
| 28 | + @TableId | ||
| 29 | + private Long id; | ||
| 30 | + /** | ||
| 31 | + * 会话编号 | ||
| 32 | + * | ||
| 33 | + * 关联 {@link KehuTalkDO#getId()} | ||
| 34 | + */ | ||
| 35 | + private Long talkId; | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 发送者 | ||
| 39 | + */ | ||
| 40 | + private Long fromUserId; | ||
| 41 | + /** | ||
| 42 | + * 发送者用户类型 | ||
| 43 | + */ | ||
| 44 | + private String fromUserType; | ||
| 45 | + /** | ||
| 46 | + * 接收者 | ||
| 47 | + */ | ||
| 48 | + private Long toUserId; | ||
| 49 | + /** | ||
| 50 | + * 接收着用户类型 | ||
| 51 | + */ | ||
| 52 | + private String toUserType; | ||
| 53 | + | ||
| 54 | + /** | ||
| 55 | + * 消息类型 | ||
| 56 | + * | ||
| 57 | + * 枚举 {@link MessageTypeEnum} | ||
| 58 | + */ | ||
| 59 | + private Integer messageType; | ||
| 60 | + /** | ||
| 61 | + * 消息 | ||
| 62 | + */ | ||
| 63 | + private String message; | ||
| 64 | + | ||
| 65 | + //======================= 消息相关状态 ======================= | ||
| 66 | + | ||
| 67 | + /** | ||
| 68 | + * 是/否已读 | ||
| 69 | + */ | ||
| 70 | + private Boolean isRead; | ||
| 71 | + | ||
| 72 | +} |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/kefu/KehuTalkDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.dal.dataobject.kefu; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||
| 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; | ||
| 7 | +import com.baomidou.mybatisplus.annotation.KeySequence; | ||
| 8 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
| 9 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
| 10 | +import lombok.*; | ||
| 11 | + | ||
| 12 | +import java.time.LocalDateTime; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 客户会话 DO | ||
| 16 | + * | ||
| 17 | + * @author HUIHUI | ||
| 18 | + */ | ||
| 19 | +@TableName("kehu_talk") | ||
| 20 | +@KeySequence("kehu_talk_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | ||
| 21 | +@Data | ||
| 22 | +@EqualsAndHashCode(callSuper = true) | ||
| 23 | +@ToString(callSuper = true) | ||
| 24 | +@Builder | ||
| 25 | +@NoArgsConstructor | ||
| 26 | +@AllArgsConstructor | ||
| 27 | +public class KehuTalkDO extends BaseDO { | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * 编号 | ||
| 31 | + */ | ||
| 32 | + @TableId | ||
| 33 | + private Long id; | ||
| 34 | + /** | ||
| 35 | + * 会话所属用户 | ||
| 36 | + * | ||
| 37 | + * 关联 {@link MemberUserRespDTO#getId()} | ||
| 38 | + */ | ||
| 39 | + 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 | + | ||
| 63 | + /** | ||
| 64 | + * 最后聊天时间 | ||
| 65 | + */ | ||
| 66 | + private LocalDateTime lastTalkTime; | ||
| 67 | + /** | ||
| 68 | + * 最后聊天内容 | ||
| 69 | + */ | ||
| 70 | + private String lastTalkMessage; | ||
| 71 | + /** | ||
| 72 | + * 最后发送的消息类型 | ||
| 73 | + * | ||
| 74 | + * 枚举 {@link MessageTypeEnum} | ||
| 75 | + */ | ||
| 76 | + private Integer lastMessageType; | ||
| 77 | + | ||
| 78 | + //======================= 会话操作相关 ======================= | ||
| 79 | + | ||
| 80 | + /** | ||
| 81 | + * 管理端置顶 | ||
| 82 | + */ | ||
| 83 | + private Boolean adminPinned; | ||
| 84 | + /** | ||
| 85 | + * 用户端不可见,默认为 true | ||
| 86 | + * | ||
| 87 | + * 用户删除此会话时设置为 false | ||
| 88 | + */ | ||
| 89 | + private Boolean userDisable; | ||
| 90 | + /** | ||
| 91 | + * 管理员端不可见,默认为 true | ||
| 92 | + * | ||
| 93 | + * 管理员删除此会话时设置为 false | ||
| 94 | + */ | ||
| 95 | + private Boolean adminDisable; | ||
| 96 | + | ||
| 97 | + /** | ||
| 98 | + * 管理员未读消息数 | ||
| 99 | + * | ||
| 100 | + * 用户发送消息时增加,管理员查看后扣减 | ||
| 101 | + */ | ||
| 102 | + private Integer adminUnreadMessageCount; | ||
| 103 | + | ||
| 104 | +} |