Переглянути джерело

1.删除 content-service 中 im 模块的 UserContactMapper 和 UserContactRecordMapper
2.将表名前缀由 im_ 修改为 chat_

reghao 1 рік тому
батько
коміт
a8578d2ac6
16 змінених файлів з 48 додано та 213 видалено
  1. 0 21
      content/content-service/src/main/java/cn/reghao/tnb/content/app/im/db/mapper/UserContactMapper.java
  2. 0 23
      content/content-service/src/main/java/cn/reghao/tnb/content/app/im/db/mapper/UserContactRecordMapper.java
  3. 0 12
      content/content-service/src/main/java/cn/reghao/tnb/content/app/im/model/dto/contact/ContactInfo.java
  4. 0 21
      content/content-service/src/main/java/cn/reghao/tnb/content/app/im/model/po/contact/UserContactRecord.java
  5. 6 8
      content/content-service/src/main/java/cn/reghao/tnb/content/app/im/service/GroupMemberService.java
  6. 11 11
      content/content-service/src/main/resources/mapper/im/ChatDialogMapper.xml
  7. 5 5
      content/content-service/src/main/resources/mapper/im/ChatRecordMapper.xml
  8. 2 2
      content/content-service/src/main/resources/mapper/im/CodeBlockMessageMapper.xml
  9. 2 2
      content/content-service/src/main/resources/mapper/im/FileMessageMapper.xml
  10. 6 6
      content/content-service/src/main/resources/mapper/im/GroupInfoMapper.xml
  11. 7 7
      content/content-service/src/main/resources/mapper/im/GroupMemberMapper.xml
  12. 5 5
      content/content-service/src/main/resources/mapper/im/GroupNoticeMapper.xml
  13. 2 2
      content/content-service/src/main/resources/mapper/im/SettingMapper.xml
  14. 2 2
      content/content-service/src/main/resources/mapper/im/TextMessageMapper.xml
  15. 0 47
      content/content-service/src/main/resources/mapper/im/UserContactMapper.xml
  16. 0 39
      content/content-service/src/main/resources/mapper/im/UserContactRecordMapper.xml

+ 0 - 21
content/content-service/src/main/java/cn/reghao/tnb/content/app/im/db/mapper/UserContactMapper.java

@@ -1,21 +0,0 @@
-package cn.reghao.tnb.content.app.im.db.mapper;
-
-import cn.reghao.jutil.jdk.db.BaseMapper;
-import cn.reghao.tnb.content.app.im.model.po.contact.UserContact;
-import org.apache.ibatis.annotations.Mapper;
-
-import java.util.List;
-
-/**
- * @author reghao
- * @date 2022-04-18 11:01:04
- */
-@Mapper
-public interface UserContactMapper extends BaseMapper<UserContact> {
-    void updateOnline(long userId, boolean online);
-
-    List<UserContact> findByUserId(long userId);
-    List<UserContact> findByUserId1(long userId);
-    UserContact findByUserIdAndFriendId1(long userId, long friendId);
-    List<UserContact> findFriendsByNotInGroup(long userId, long groupId);
-}

+ 0 - 23
content/content-service/src/main/java/cn/reghao/tnb/content/app/im/db/mapper/UserContactRecordMapper.java

@@ -1,23 +0,0 @@
-package cn.reghao.tnb.content.app.im.db.mapper;
-
-import cn.reghao.jutil.jdk.db.BaseMapper;
-import cn.reghao.tnb.content.app.im.model.dto.contact.ContactApplyInfo;
-import cn.reghao.tnb.content.app.im.model.po.contact.UserContactRecord;
-import org.apache.ibatis.annotations.Mapper;
-
-import java.util.List;
-
-/**
- * @author reghao
- * @date 2022-04-18 15:32:55
- */
-@Mapper
-public interface UserContactRecordMapper extends BaseMapper<UserContactRecord> {
-    void updateContactApply(int applyId, long appliedUser, int applyStatus);
-
-    UserContactRecord findByUserIdAndFriendId(long applyUser, long appliedUser);
-
-    UserContactRecord findByApplyId(int applyId, long appliedUser);
-    int countNewApply(long appliedUser);
-    List<ContactApplyInfo> findByNewApply(long appliedUser);
-}

+ 0 - 12
content/content-service/src/main/java/cn/reghao/tnb/content/app/im/model/dto/contact/ContactInfo.java

@@ -1,7 +1,5 @@
 package cn.reghao.tnb.content.app.im.model.dto.contact;
 
-import cn.reghao.tnb.content.app.im.model.po.contact.UserContact;
-import cn.reghao.tnb.user.api.dto.UserInfo;
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
@@ -21,14 +19,4 @@ public class ContactInfo {
     private String avatar;
     private String friendRemark;
     private boolean isOnline;
-
-    public ContactInfo(UserInfo userInfo, UserContact userContact) {
-        this.id = userInfo.getUserId();
-        this.nickname = userInfo.getScreenName();
-        this.gender = userInfo.getGender();
-        this.motto = userInfo.getSignature();
-        this.avatar = userInfo.getAvatarUrl();
-        this.friendRemark = userContact.getRemark();
-        this.isOnline = true;
-    }
 }

+ 0 - 21
content/content-service/src/main/java/cn/reghao/tnb/content/app/im/model/po/contact/UserContactRecord.java

@@ -1,21 +0,0 @@
-package cn.reghao.tnb.content.app.im.model.po.contact;
-
-import cn.reghao.jutil.jdk.db.BaseObject;
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * @author reghao
- * @date 2022-04-18 15:31:53
- */
-@Getter
-@Setter
-public class UserContactRecord extends BaseObject<Integer> {
-    private Long applyUser;
-    private Long appliedUser;
-    // 1- 非好友, 2 - 已是好友
-    private int friendStatus;
-    // 0 - 添加联系人, 1 - 已发送添加申请, 2 - 已通过添加申请
-    private int applyStatus;
-    private String remark;
-}

+ 6 - 8
content/content-service/src/main/java/cn/reghao/tnb/content/app/im/service/GroupMemberService.java

@@ -4,7 +4,6 @@ import cn.reghao.tnb.common.auth.UserContext;
 import cn.reghao.tnb.content.app.im.db.mapper.ChatDialogMapper;
 import cn.reghao.tnb.content.app.im.db.mapper.GroupInfoMapper;
 import cn.reghao.tnb.content.app.im.db.mapper.GroupMemberMapper;
-import cn.reghao.tnb.content.app.im.db.mapper.UserContactMapper;
 import cn.reghao.tnb.content.app.im.model.dto.contact.ContactInfo;
 import cn.reghao.tnb.content.app.im.model.dto.group.*;
 import cn.reghao.tnb.content.app.im.model.po.contact.UserContact;
@@ -16,6 +15,7 @@ import cn.reghao.tnb.user.api.iface.UserContactService;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -31,14 +31,12 @@ public class GroupMemberService {
 
     private final GroupMemberMapper groupMemberMapper;
     private final GroupInfoMapper groupInfoMapper;
-    private final UserContactMapper userContactMapper;
     private final ChatDialogMapper chatDialogMapper;
 
     public GroupMemberService(GroupMemberMapper groupMemberMapper, GroupInfoMapper groupInfoMapper,
-                              UserContactMapper userContactMapper, ChatDialogMapper chatDialogMapper) {
+                              ChatDialogMapper chatDialogMapper) {
         this.groupMemberMapper = groupMemberMapper;
         this.groupInfoMapper = groupInfoMapper;
-        this.userContactMapper = userContactMapper;
         this.chatDialogMapper = chatDialogMapper;
     }
 
@@ -92,17 +90,17 @@ public class GroupMemberService {
 
     public List<ContactInfo> getInvitedUsers(long groupId) {
         long loginUser = UserContext.getUser();;
-        List<UserContact> list;
-        if (groupId == 0) {
+        List<UserContact> list = new ArrayList<>();
+        /*if (groupId == 0) {
             list = userContactMapper.findByUserId(loginUser);
         } else {
             list = userContactMapper.findFriendsByNotInGroup(loginUser, groupId);
-        }
+        }*/
 
         List<ContactInfo> list1 = list.stream().map(userContact -> {
             long friendId = userContact.getFriendId();
             UserInfo userInfo = contactService.getUserInfo(friendId);
-            return new ContactInfo(userInfo, userContact);
+            return new ContactInfo();
         }).collect(Collectors.toList());
 
         return list1;

+ 11 - 11
content/content-service/src/main/resources/mapper/im/ChatDialogMapper.xml

@@ -3,13 +3,13 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.im.db.mapper.ChatDialogMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into im_chat_dialog
+        insert into chat_chat_dialog
         (`chat_id`,`chat_type`,`receiver_id`,`disturb`,`robot`,`top`,`display`,`user_id`,`unread_num`)
         values 
         (#{chatId},#{chatType},#{receiverId},#{disturb},#{robot},#{top},#{display},#{userId},#{unreadNum})
     </insert>
     <insert id="saveAll" useGeneratedKeys="true" keyProperty="id">
-        insert into im_chat_dialog
+        insert into chat_chat_dialog
         (`chat_id`,`chat_type`,`receiver_id`,`disturb`,`robot`,`top`,`display`,`user_id`,`unread_num`)
         values
         <foreach collection="list" item="item" index="index" separator=",">
@@ -18,28 +18,28 @@
     </insert>
 
     <update id="updateSetDisturb">
-        update im_chat_dialog set update_time=now(),disturb=#{disturb}
+        update chat_chat_dialog set update_time=now(),disturb=#{disturb}
         where id=#{dialogId} and user_id=#{userId}
     </update>
     <update id="updateSetTop">
-        update im_chat_dialog set update_time=now(),top=#{top}
+        update chat_chat_dialog set update_time=now(),top=#{top}
         where id=#{dialogId} and user_id=#{userId}
     </update>
     <update id="updateSetDisplay">
-        update im_chat_dialog set update_time=now(),display=#{display}
+        update chat_chat_dialog set update_time=now(),display=#{display}
         where id=#{dialogId} and user_id=#{userId}
     </update>
     <update id="updateSetClearUnread">
-        update im_chat_dialog set update_time=now(),unread_num=unread_num+1
+        update chat_chat_dialog set update_time=now(),unread_num=unread_num+1
         where receiver_id=#{receiverId} and user_id=#{userId}
     </update>
     <update id="updateSetIncreaseUnread">
-        update im_chat_dialog set update_time=now(),unread_num=0
+        update chat_chat_dialog set update_time=now(),unread_num=0
         where receiver_id=#{receiverId} and user_id=#{userId}
     </update>
 
     <delete id="deleteGroupChatDialog">
-        delete from im_chat_dialog
+        delete from chat_chat_dialog
         where receiver_id=#{groupId} and user_id in
         <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
             #{item}
@@ -47,15 +47,15 @@
     </delete>
 
     <select id="findByReceiverAndUserId" resultType="cn.reghao.tnb.content.app.im.model.po.chat.ChatDialog">
-        select * from im_chat_dialog where receiver_id=#{receiverId} and user_id=#{userId}
+        select * from chat_chat_dialog where receiver_id=#{receiverId} and user_id=#{userId}
     </select>
     <select id="findChatDialog" resultType="cn.reghao.tnb.content.app.im.model.po.chat.ChatDialog">
-        select * from im_chat_dialog
+        select * from chat_chat_dialog
         where chat_type=#{chatType} and receiver_id=#{receiverId} and user_id=#{userId}
     </select>
     <select id="findChatDialogsByUserId" resultType="cn.reghao.tnb.content.app.im.model.po.chat.ChatDialog">
         select *
-        from im_chat_dialog
+        from chat_chat_dialog
         where display is true and user_id=#{userId}
     </select>
 </mapper>

+ 5 - 5
content/content-service/src/main/resources/mapper/im/ChatRecordMapper.xml

@@ -3,14 +3,14 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.im.db.mapper.ChatRecordMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
-        insert into im_chat_record
+        insert into chat_chat_record
         (`record_id`,`chat_id`,`chat_type`,`sender_id`,`receiver_id`,`msg_type`,`read`,`revoke`)
         values 
         (#{recordId},#{chatId},#{chatType},#{senderId},#{receiverId},#{msgType},#{read},#{revoke})
     </insert>
 
     <update id="updateSetRevoke">
-        update im_chat_record
+        update chat_chat_record
         set `revoke`=1
         where id=#{recordId}
     </update>
@@ -19,7 +19,7 @@
         select chatRecord.record_id, chatRecord.chat_type as talkType,chatRecord.receiver_id,chatRecord.read as isRead,chatRecord.revoke as isRevoke,
         chatRecord.msg_type,date_format(chatRecord.create_time,'%Y-%m-%d %H:%i:%s') as createdAt,
         chatRecord.sender_id as user_id
-        from im_chat_record chatRecord
+        from chat_chat_record chatRecord
         <!--and chatRecord.revoke is false-->
         where chatRecord.chat_id=(select chat_id from chat_dialog where receiver_id=#{receiverId} and user_id=#{userId}) and chatRecord.record_id > #{lastRecordId}
         order by chatRecord.create_time desc
@@ -29,7 +29,7 @@
         select chatRecord.record_id, chatRecord.chat_type as talkType,chatRecord.receiver_id,chatRecord.read as isRead,chatRecord.revoke as isRevoke,
         chatRecord.msg_type,date_format(chatRecord.create_time,'%Y-%m-%d %H:%i:%s') as createdAt,
         chatRecord.sender_id as user_id
-        from im_chat_record chatRecord
+        from chat_chat_record chatRecord
         <!--and chatRecord.revoke is false-->
         where chatRecord.msg_type=#{msgType}
         and chatRecord.chat_id=(select chat_id from chat_dialog where receiver_id=#{receiverId} and user_id=#{userId}) and chatRecord.record_id > #{lastRecordId}
@@ -37,6 +37,6 @@
         limit #{limit}
     </select>
     <select id="findByRecordId" resultType="cn.reghao.tnb.content.app.im.model.po.chat.ChatRecord">
-        select * from im_chat_record where record_id=#{recordId}
+        select * from chat_chat_record where record_id=#{recordId}
     </select>
 </mapper>

+ 2 - 2
content/content-service/src/main/resources/mapper/im/CodeBlockMessageMapper.xml

@@ -3,13 +3,13 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.im.db.mapper.CodeBlockMessageMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into im_code_block_message
+        insert into chat_code_block_message
         (`id`,`deleted`,`create_time`,`update_time`,`record_id`,`lang`,`code`)
         values 
         (#{id},#{deleted},#{createTime},#{updateTime},#{recordId},#{lang},#{code})
     </insert>
 
     <select id="findByRecordId" resultType="cn.reghao.tnb.content.app.im.model.po.message.CodeBlockMessage">
-        select * from im_code_block_message where record_id=#{recordId}
+        select * from chat_code_block_message where record_id=#{recordId}
     </select>
 </mapper>

+ 2 - 2
content/content-service/src/main/resources/mapper/im/FileMessageMapper.xml

@@ -3,7 +3,7 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.im.db.mapper.FileMessageMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into im_file_message
+        insert into chat_file_message
         (`file_type`,`record_id`,`upload_id`,`channel_id`,`filename`,`width`,`height`)
         values 
         (#{fileType},#{recordId},#{uploadId},#{channelId},#{filename},#{width},#{height})
@@ -11,7 +11,7 @@
 
     <select id="findByRecordId" resultType="cn.reghao.tnb.content.app.im.model.po.message.FileMessage">
         select *
-        from im_file_message
+        from chat_file_message
         where record_id=#{recordId}
     </select>
 </mapper>

+ 6 - 6
content/content-service/src/main/resources/mapper/im/GroupInfoMapper.xml

@@ -3,36 +3,36 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.im.db.mapper.GroupInfoMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into im_group_info
+        insert into chat_group_info
         (`id`,`deleted`,`create_time`,`update_time`,`group_id`,`name`,`avatar`,`profile`,`owner_id`)
         values 
         (#{id},#{deleted},#{createTime},#{updateTime},#{groupId},#{name},#{avatar},#{profile},#{ownerId})
     </insert>
 
     <update id="updateGroupInfo">
-        update im_group_info set update_time=now(),name=#{name},avatar=#{avatar},profile=#{profile}
+        update chat_group_info set update_time=now(),name=#{name},avatar=#{avatar},profile=#{profile}
         where group_id=#{groupId}
     </update>
 
     <select id="findByGroupId" resultType="cn.reghao.tnb.content.app.im.model.po.group.GroupInfo">
-        select * from im_group_info where id=#{groupId}
+        select * from chat_group_info where id=#{groupId}
     </select>
     <select id="findDetailByGroupId" resultType="cn.reghao.tnb.content.app.im.model.dto.group.GroupDetailRet">
         select groupInfo.id as groupId,groupInfo.name as groupName,groupInfo.avatar,groupInfo.profile,
         groupInfo.owner_id as ownerId,date_format(groupInfo.create_time,'%Y-%m-%d %H:%i:%s') as createdAt
-        from im_group_info groupInfo
+        from chat_group_info groupInfo
         where groupInfo.id=#{groupId}
     </select>
     <select id="findGroupsByUserId" resultType="cn.reghao.tnb.content.app.im.model.dto.group.GroupInfoRet">
         select groupInfo.id,groupInfo.name as groupName,groupInfo.profile as groupProfile,groupInfo.avatar,
         groupMember.owner,groupMember.disturb
-        from im_group_info groupInfo
+        from chat_group_info groupInfo
         inner join group_member groupMember
         on groupInfo.id=groupMember.group_id and groupMember.user_id=#{userId}
     </select>
     <select id="findDialogGroupInfo" resultType="cn.reghao.tnb.content.app.im.model.dto.chat.ChatUserInfo">
         select group_id as receiverId,`name`,avatar
-        from im_group_info
+        from chat_group_info
         where group_id=#{groupId}
     </select>
 </mapper>

+ 7 - 7
content/content-service/src/main/resources/mapper/im/GroupMemberMapper.xml

@@ -3,13 +3,13 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.im.db.mapper.GroupMemberMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into im_group_member
+        insert into chat_group_member
         (`id`,`deleted`,`create_time`,`update_time`,`group_id`,`user_id`,`nickname`,`owner`,`disturb`)
         values 
         (#{id},#{deleted},#{createTime},#{updateTime},#{groupId},#{userId},#{nickname},#{owner},#{disturb})
     </insert>
     <insert id="saveAll" useGeneratedKeys="true" keyProperty="id">
-        insert ignore into im_group_member
+        insert ignore into chat_group_member
         (`id`,`deleted`,`create_time`,`update_time`,`group_id`,`user_id`,`nickname`,`owner`,`disturb`)
         values
         <foreach collection="list" item="item" index="index" separator=",">
@@ -18,12 +18,12 @@
     </insert>
 
     <update id="updateSetMemberRemark">
-        update im_group_member set update_time=now(),nickname=#{nickname}
+        update chat_group_member set update_time=now(),nickname=#{nickname}
         where group_id=#{groupId} and user_id=#{userId}
     </update>
 
     <delete id="deleteGroupMembers">
-        delete from im_group_member
+        delete from chat_group_member
         where group_id=#{groupId} and user_id in
         <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
             #{item}
@@ -31,14 +31,14 @@
     </delete>
 
     <select id="findUserIdsByGroupId" resultType="java.lang.Long">
-        select user_id from im_group_member where group_id=#{groupId}
+        select user_id from chat_group_member where group_id=#{groupId}
     </select>
     <select id="findByGroupAndUserId" resultType="cn.reghao.tnb.content.app.im.model.po.group.GroupMember">
-        select * from im_group_member where group_id=#{groupId} and user_id=#{userId}
+        select * from chat_group_member where group_id=#{groupId} and user_id=#{userId}
     </select>
     <select id="findByGroupId" resultType="cn.reghao.tnb.content.app.im.model.dto.group.GroupMemberRet">
         select groupMember.id,groupMember.nickname as userCard,groupMember.owner
-        from im_group_member groupMember
+        from chat_group_member groupMember
         where groupMember.group_id=#{groupId}
     </select>
 </mapper>

+ 5 - 5
content/content-service/src/main/resources/mapper/im/GroupNoticeMapper.xml

@@ -3,32 +3,32 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.im.db.mapper.GroupNoticeMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into im_group_notice
+        insert into chat_group_notice
         (`id`,`deleted`,`create_time`,`update_time`,`notice_id`,`group_id`,`title`,`content`,`top`,`confirmed`,`create_by`)
         values 
         (#{id},#{deleted},#{createTime},#{updateTime},#{noticeId},#{groupId},#{title},#{content},#{top},#{confirmed},#{createBy})
     </insert>
 
     <update id="updateSetNotice">
-        update im_group_notice set update_time=now(),title=#{title},content=#{content}
+        update chat_group_notice set update_time=now(),title=#{title},content=#{content}
         where id=#{noticeId}
     </update>
 
     <select id="findByNoticeId" resultType="cn.reghao.tnb.content.app.im.model.po.group.GroupNotice">
-        select * from im_group_notice where id=#{noticeId}
+        select * from chat_group_notice where id=#{noticeId}
     </select>
     <select id="findByGroupId" resultType="cn.reghao.tnb.content.app.im.model.dto.group.NoticeRet">
         select groupNotice.id,groupNotice.title,groupNotice.content,groupNotice.confirmed as isConfirm,groupNotice.top as isTop,
         date_format(groupNotice.create_time,'%Y-%m-%d %H:%i:%s') as createdAt,
         date_format(groupNotice.update_time,'%Y-%m-%d %H:%i:%s') as updatedAt
-        from im_group_notice groupNotice
+        from chat_group_notice groupNotice
         where groupNotice.group_id=#{groupId}
     </select>
     <select id="findByLatest" resultType="cn.reghao.tnb.content.app.im.model.dto.group.NoticeRet">
         select groupNotice.id,groupNotice.title,groupNotice.content,groupNotice.confirmed as isConfirm,groupNotice.top as isTop,
         date_format(groupNotice.create_time,'%Y-%m-%d %H:%i:%s') as createdAt,
         date_format(groupNotice.update_time,'%Y-%m-%d %H:%i:%s') as updatedAt
-        from im_group_notice groupNotice
+        from chat_group_notice groupNotice
         where groupNotice.group_id=#{groupId}
         order by groupNotice.create_time desc
         limit 1

+ 2 - 2
content/content-service/src/main/resources/mapper/im/SettingMapper.xml

@@ -3,13 +3,13 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.im.db.mapper.SettingMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into im_setting
+        insert into chat_setting
         (`id`,`deleted`,`create_time`,`update_time`,`user_id`,`keyboard_event_notify`,`notify_cue_tone`,`theme_bag_img`,`theme_color`,`theme_mode`)
         values 
         (#{id},#{deleted},#{createTime},#{updateTime},#{userId},#{keyboardEventNotify},#{notifyCueTone},#{themeBagImg},#{themeColor},#{themeMode})
     </insert>
 
     <select id="findByUserId" resultType="cn.reghao.tnb.content.app.im.model.po.Setting">
-        select * from im_setting where user_id=#{userId}
+        select * from chat_setting where user_id=#{userId}
     </select>
 </mapper>

+ 2 - 2
content/content-service/src/main/resources/mapper/im/TextMessageMapper.xml

@@ -3,7 +3,7 @@
 
 <mapper namespace="cn.reghao.tnb.content.app.im.db.mapper.TextMessageMapper">
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into im_text_message
+        insert into chat_text_message
         (`id`,`deleted`,`create_time`,`update_time`,`record_id`,`content`)
         values 
         (#{id},#{deleted},#{createTime},#{updateTime},#{recordId},#{content})
@@ -11,7 +11,7 @@
 
     <select id="findByRecordId" resultType="cn.reghao.tnb.content.app.im.model.po.message.TextMessage">
         select *
-        from im_text_message
+        from chat_text_message
         where record_id=#{recordId}
     </select>
 </mapper>

+ 0 - 47
content/content-service/src/main/resources/mapper/im/UserContactMapper.xml

@@ -1,47 +0,0 @@
-<?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="cn.reghao.tnb.content.app.im.db.mapper.UserContactMapper">
-    <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into im_user_contact
-        (`user_id`,`friend_id`,`remark`,`status`,`online`)
-        values 
-        (#{userId},#{friendId},#{remark},#{status},#{online})
-    </insert>
-    <insert id="saveAll" useGeneratedKeys="true" keyProperty="id">
-        insert into im_user_contact
-        (`user_id`,`friend_id`,`remark`,`status`,`online`)
-        values
-        <foreach collection="list" item="item" index="index" separator=",">
-            (#{item.userId},#{item.friendId},#{item.remark},#{item.status},#{item.online})
-        </foreach>
-    </insert>
-
-    <update id="updateOnline">
-        update im_user_contact
-        set update_time=now(),`online`=#{online}
-        where friend_id=#{userId}
-    </update>
-    
-    <select id="findByUserId" resultType="cn.reghao.tnb.content.app.im.model.po.contact.UserContact">
-        select *
-        from im_user_contact contact
-        where contact.user_id=#{userId}
-    </select>
-    <select id="findByUserId1" resultType="cn.reghao.tnb.content.app.im.model.po.contact.UserContact">
-        select *
-        from im_user_contact
-        where user_id=#{userId}
-    </select>
-    <select id="findByUserIdAndFriendId1" resultType="cn.reghao.tnb.content.app.im.model.po.contact.UserContact">
-        select *
-        from im_user_contact
-        where user_id=#{userId} and friend_id=#{friendId}
-    </select>
-    <select id="findFriendsByNotInGroup" resultType="cn.reghao.tnb.content.app.im.model.po.contact.UserContact">
-        select *
-        from im_user_contact contact
-        where contact.user_id=#{userId} and contact.friend_id not in
-        (select user_id from group_member where group_id=#{groupId} and user_id!=#{userId})
-    </select>
-</mapper>

+ 0 - 39
content/content-service/src/main/resources/mapper/im/UserContactRecordMapper.xml

@@ -1,39 +0,0 @@
-<?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="cn.reghao.tnb.content.app.im.db.mapper.UserContactRecordMapper">
-    <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into im_user_contact_record
-        (`apply_user`,`applied_user`,`apply_status`,`remark`)
-        values 
-        (#{applyUser},#{appliedUser},#{applyStatus},#{remark})
-    </insert>
-
-    <update id="updateContactApply">
-        update im_user_contact_record
-        set update_time=now(),apply_status=#{applyStatus}
-        where id=#{applyId} and applied_user=#{appliedUser}
-    </update>
-
-    <select id="findByUserIdAndFriendId" resultType="cn.reghao.tnb.content.app.im.model.po.contact.UserContactRecord">
-        select *
-        from im_user_contact_record
-        where apply_status=1 and apply_user=#{applyUser} and applied_user=#{appliedUser}
-    </select>
-
-    <select id="findByApplyId" resultType="cn.reghao.tnb.content.app.im.model.po.contact.UserContactRecord">
-        select *
-        from im_user_contact_record
-        where id=#{applyId} and applied_user=#{appliedUser}
-    </select>
-    <select id="countNewApply" resultType="java.lang.Integer">
-        select count(*)
-        from im_user_contact_record
-        where apply_status=1 and applied_user=#{userId}
-    </select>
-    <select id="findByNewApply" resultType="cn.reghao.tnb.content.app.im.model.dto.contact.ContactApplyInfo">
-        select id,apply_user as user_id,remark,date_format(create_time, '%Y-%m-%d %H:%i:%s') as createdAt
-        from im_user_contact_record addRequest
-        where apply_status=1 and applied_user=#{userId}
-    </select>
-</mapper>