From 72db87651dd2e22ea1045a65a2662e8d51cbde9c Mon Sep 17 00:00:00 2001 From: "xie.bx" Date: Mon, 31 Oct 2022 22:35:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BE=A4=E5=8F=91=E6=B6=88=E6=81=AF-=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lx/implatform/entity/Friends.java | 2 +- .../java/com/lx/implatform/entity/Group.java | 3 +- .../com/lx/implatform/entity/GroupMember.java | 8 ++-- .../lx/implatform/entity/GroupMessage.java | 2 +- .../entity/GroupMessageReadPos.java | 2 +- .../lx/implatform/entity/SingleMessage.java | 2 +- .../java/com/lx/implatform/entity/User.java | 2 +- .../service/impl/GroupServiceImpl.java | 6 +-- im-platform/src/main/resources/db/db.sql | 22 +++++------ im-ui/src/router/index.js | 5 +++ im-ui/src/store/friendsStore.js | 2 +- im-ui/src/view/Friends.vue | 37 ++++++++++--------- im-ui/src/view/Home.vue | 6 +++ 13 files changed, 56 insertions(+), 43 deletions(-) diff --git a/im-platform/src/main/java/com/lx/implatform/entity/Friends.java b/im-platform/src/main/java/com/lx/implatform/entity/Friends.java index 63cc307..d75cc9a3 100644 --- a/im-platform/src/main/java/com/lx/implatform/entity/Friends.java +++ b/im-platform/src/main/java/com/lx/implatform/entity/Friends.java @@ -21,7 +21,7 @@ import java.util.Date; */ @Data @EqualsAndHashCode(callSuper = false) -@TableName("friends") +@TableName("im_friends") public class Friends extends Model { private static final long serialVersionUID=1L; diff --git a/im-platform/src/main/java/com/lx/implatform/entity/Group.java b/im-platform/src/main/java/com/lx/implatform/entity/Group.java index 40bd11c..d1e77cc 100644 --- a/im-platform/src/main/java/com/lx/implatform/entity/Group.java +++ b/im-platform/src/main/java/com/lx/implatform/entity/Group.java @@ -22,7 +22,7 @@ import lombok.EqualsAndHashCode; */ @Data @EqualsAndHashCode(callSuper = false) -@TableName("group") +@TableName("im_group") public class Group extends Model { private static final long serialVersionUID = 1L; @@ -36,6 +36,7 @@ public class Group extends Model { /** * 群名字 */ + @TableField("name") private String name; /** diff --git a/im-platform/src/main/java/com/lx/implatform/entity/GroupMember.java b/im-platform/src/main/java/com/lx/implatform/entity/GroupMember.java index 0e173e3..8ea3360 100644 --- a/im-platform/src/main/java/com/lx/implatform/entity/GroupMember.java +++ b/im-platform/src/main/java/com/lx/implatform/entity/GroupMember.java @@ -25,7 +25,7 @@ import lombok.EqualsAndHashCode; */ @Data @EqualsAndHashCode(callSuper = false) -@TableName("group_member") +@TableName("im_group_member") public class GroupMember extends Model { private static final long serialVersionUID = 1L; @@ -51,7 +51,7 @@ public class GroupMember extends Model { /** * 群内显示名称 */ - @TableField("user_id") + @TableField("alias_name") private String aliasName; /** @@ -65,8 +65,8 @@ public class GroupMember extends Model { /** * 备注 */ - @TableField("remarks") - private String remarks; + @TableField("remark") + private String remark; /** * 创建时间 diff --git a/im-platform/src/main/java/com/lx/implatform/entity/GroupMessage.java b/im-platform/src/main/java/com/lx/implatform/entity/GroupMessage.java index b7efe85..ccb8ffd 100644 --- a/im-platform/src/main/java/com/lx/implatform/entity/GroupMessage.java +++ b/im-platform/src/main/java/com/lx/implatform/entity/GroupMessage.java @@ -25,7 +25,7 @@ import lombok.EqualsAndHashCode; */ @Data @EqualsAndHashCode(callSuper = false) -@TableName("group_message") +@TableName("im_group_message") public class GroupMessage extends Model { private static final long serialVersionUID = 1L; diff --git a/im-platform/src/main/java/com/lx/implatform/entity/GroupMessageReadPos.java b/im-platform/src/main/java/com/lx/implatform/entity/GroupMessageReadPos.java index d984d5a..8133d59 100644 --- a/im-platform/src/main/java/com/lx/implatform/entity/GroupMessageReadPos.java +++ b/im-platform/src/main/java/com/lx/implatform/entity/GroupMessageReadPos.java @@ -25,7 +25,7 @@ import lombok.EqualsAndHashCode; */ @Data @EqualsAndHashCode(callSuper = false) -@TableName("group_message_read_pos") +@TableName("im_group_message_read_pos") public class GroupMessageReadPos extends Model { private static final long serialVersionUID = 1L; diff --git a/im-platform/src/main/java/com/lx/implatform/entity/SingleMessage.java b/im-platform/src/main/java/com/lx/implatform/entity/SingleMessage.java index ddf5e38..7096400 100644 --- a/im-platform/src/main/java/com/lx/implatform/entity/SingleMessage.java +++ b/im-platform/src/main/java/com/lx/implatform/entity/SingleMessage.java @@ -21,7 +21,7 @@ import java.util.Date; */ @Data @EqualsAndHashCode(callSuper = false) -@TableName("single_message") +@TableName("im_single_message") public class SingleMessage extends Model { private static final long serialVersionUID=1L; diff --git a/im-platform/src/main/java/com/lx/implatform/entity/User.java b/im-platform/src/main/java/com/lx/implatform/entity/User.java index 5a8f613..7f934c7 100644 --- a/im-platform/src/main/java/com/lx/implatform/entity/User.java +++ b/im-platform/src/main/java/com/lx/implatform/entity/User.java @@ -21,7 +21,7 @@ import java.util.Date; */ @Data @EqualsAndHashCode(callSuper = false) -@TableName("user") +@TableName("im_user") public class User extends Model { private static final long serialVersionUID=1L; diff --git a/im-platform/src/main/java/com/lx/implatform/service/impl/GroupServiceImpl.java b/im-platform/src/main/java/com/lx/implatform/service/impl/GroupServiceImpl.java index 051c7c3..e263250 100644 --- a/im-platform/src/main/java/com/lx/implatform/service/impl/GroupServiceImpl.java +++ b/im-platform/src/main/java/com/lx/implatform/service/impl/GroupServiceImpl.java @@ -70,7 +70,7 @@ public class GroupServiceImpl extends ServiceImpl implements /** * 修改群聊信息 * - * @Param GroupVO 群聊信息 + * @Param GroupVO 群聊信息 * @return GroupVO **/ @Override @@ -91,7 +91,7 @@ public class GroupServiceImpl extends ServiceImpl implements * 删除群聊 * * @Param groupId 群聊id - * @return void + * @return **/ @Transactional @Override @@ -140,8 +140,8 @@ public class GroupServiceImpl extends ServiceImpl implements /** * 邀请好友进群 * - * @return * @Param GroupInviteVO 群id、好友id列表 + * @return **/ @Override public void invite(GroupInviteVO vo) { diff --git a/im-platform/src/main/resources/db/db.sql b/im-platform/src/main/resources/db/db.sql index d724bc0..d8c2c9c 100644 --- a/im-platform/src/main/resources/db/db.sql +++ b/im-platform/src/main/resources/db/db.sql @@ -1,5 +1,5 @@ use `lx-im`; -create table `user`( +create table `im_user`( `id` bigint not null auto_increment primary key comment 'id', `user_name` varchar(255) not null comment '用户名', `nick_name` varchar(255) not null comment '用户昵称', @@ -14,7 +14,7 @@ create table `user`( key `idx_nick_name`(nick_name) ) ENGINE=InnoDB CHARSET=utf8mb3 comment '用户'; -create table `friends`( +create table `im_friends`( `id` bigint not null auto_increment primary key comment 'id', `user_id` bigint not null comment '用户id', `friend_id` bigint not null comment '好友id', @@ -25,7 +25,7 @@ create table `friends`( key `idx_friend_id` (`friend_id`) ) ENGINE=InnoDB CHARSET=utf8mb3 comment '好友'; -create table `single_message`( +create table `im_single_message`( `id` bigint not null auto_increment primary key comment 'id', `send_user_id` bigint not null comment '发送用户id', `recv_user_id` bigint not null comment '接收用户id', @@ -37,30 +37,30 @@ create table `single_message`( )ENGINE=InnoDB CHARSET=utf8mb3 comment '私聊消息'; -create table `group`( +create table `im_group`( `id` bigint not null auto_increment primary key comment 'id', `name` varchar(255) not null comment '群名字', `owner_id` bigint not null comment '群主id', `head_image` varchar(255) default '' comment '群头像', `head_image_thumb` varchar(255) default '' comment '群头像缩略图', - `notice` text comment '群公告', + `notice` varchar(1024) default '' comment '群公告', `remark` varchar(255) default '' comment '群备注', `created_time` datetime DEFAULT CURRENT_TIMESTAMP comment '创建时间' -)ENGINE=InnoDB comment '群'; +)ENGINE=InnoDB CHARSET=utf8mb3 comment '群'; -create table `group_member`( +create table `im_group_member`( `id` bigint not null auto_increment primary key comment 'id', `group_id` bigint not null comment '群id', `user_id` bigint not null comment '用户id', `alias_name` varchar(255) DEFAULT '' comment '组内显示名称', `head_image` varchar(255) default '' comment '用户头像', - `remarks` varchar(255) DEFAULT '' comment '备注', + `remark` varchar(255) DEFAULT '' comment '备注', `created_time` datetime DEFAULT CURRENT_TIMESTAMP comment '创建时间', key `idx_group_id`(`group_id`), key `idx_user_id`(`user_id`) -)ENGINE=InnoDB comment '群成员'; +)ENGINE=InnoDB CHARSET=utf8mb3 comment '群成员'; -create table `group_message`( +create table `im_group_message`( `id` bigint not null auto_increment primary key comment 'id', `group_id` bigint not null comment '群id', `send_user_id` bigint not null comment '发送用户id', @@ -71,7 +71,7 @@ create table `group_message`( )ENGINE=InnoDB CHARSET=utf8mb3 comment '群消息'; -create table `group_message_read_pos`( +create table `im_group_message_read_pos`( `id` bigint not null auto_increment primary key comment 'id', `group_id` bigint not null comment '群id', `user_id` bigint not null comment '用户id', diff --git a/im-ui/src/router/index.js b/im-ui/src/router/index.js index 4edb017..da1917a 100644 --- a/im-ui/src/router/index.js +++ b/im-ui/src/router/index.js @@ -36,6 +36,11 @@ export default new VueRouter({ name: "Friends", path: "/home/friends", component: () => import("../view/Friends"), + }, + { + name: "Friends", + path: "/home/group", + component: () => import("../view/Group"), } ] } diff --git a/im-ui/src/store/friendsStore.js b/im-ui/src/store/friendsStore.js index 8215ce0..80f4b30 100644 --- a/im-ui/src/store/friendsStore.js +++ b/im-ui/src/store/friendsStore.js @@ -8,7 +8,7 @@ export default { timer: null }, mutations: { - initFriendsStore(state, userInfo) { + initFriendsStore(state) { httpRequest({ url: '/api/friends/list', method: 'get' diff --git a/im-ui/src/view/Friends.vue b/im-ui/src/view/Friends.vue index 5199121..3f19260 100644 --- a/im-ui/src/view/Friends.vue +++ b/im-ui/src/view/Friends.vue @@ -1,18 +1,14 @@