Skip to content

Commit

Permalink
服务端保存会话消息
Browse files Browse the repository at this point in the history
  • Loading branch information
imalasong committed Jun 17, 2023
1 parent 4e138f1 commit 86a81f8
Show file tree
Hide file tree
Showing 73 changed files with 601 additions and 262 deletions.
2 changes: 1 addition & 1 deletion im-admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<version>1.0</version>
</parent>

<groupId>io.xiaochangbai.sensitive</groupId>
<groupId>io.pisceshub.muchat</groupId>
<artifactId>im-admin</artifactId>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion im-admin/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spring:
host: 127.0.0.1
port: 6379
database: 1
password: lilishop
password: root
main:
allow-circular-references: true
allow-bean-definition-overriding: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.xiaochangbai.muchat.common.core.enums;
package io.pisceshub.muchat.common.core.enums;

import lombok.Getter;

Expand Down
2 changes: 1 addition & 1 deletion im-connector/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spring:
host: 127.0.0.1
port: 6379
database: 1
password: lilishop
password: root

app:
ip: 127.0.0.1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package io.pisceshub.muchat.server.common.dto;

import io.pisceshub.muchat.common.core.enums.ChatType;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
* @author xiaochangbai
* @date 2023-06-17 16:34
*/
@Data
public class ChatSessionInfoDto implements Serializable {

@NotNull(message = "对方id不能为空")
private Long targetId;

@NotNull(message = "聊天类型不能为空")
private ChatType chatType;

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.pisceshub.muchat.server.entity;
package io.pisceshub.muchat.server.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.pisceshub.muchat.server.entity;
package io.pisceshub.muchat.server.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.pisceshub.muchat.server.entity;
package io.pisceshub.muchat.server.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.pisceshub.muchat.server.entity;
package io.pisceshub.muchat.server.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.pisceshub.muchat.server.entity;
package io.pisceshub.muchat.server.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.pisceshub.muchat.server.entity;
package io.pisceshub.muchat.server.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package io.pisceshub.muchat.server.common;


/**
* vo:接收前端参数,与响应前端结果
* xxxReq请求参数、xxxResp响应结果
* dto:业务之间传输
* entity:数据库表字段
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package io.pisceshub.muchat.server.common.vo.common;

import lombok.Data;

/**
* @author xiaochangbai
* @date 2023-06-17 16:40
*/
@Data
public class PageReq {

/**
* 页码
*/
private Long page = 1L;

/**
* 每页大小
*/
private Long size = 15L;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package io.pisceshub.muchat.server.common.vo.common;

import lombok.Data;

import java.util.List;

/**
* @author xiaochangbai
* @date 2023-06-17 16:40
*/
@Data
public class PageResp<T> {

/**
* 当前页码
*/
private Long page;

/**
* 总数量
*/
private Long total;


/**
* 数据集
*/
private List<T> list;
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.pisceshub.muchat.server.vo;
package io.pisceshub.muchat.server.common.vo.common;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel("图片上传VO")
public class UploadImageVO {
public class UploadImageResp {

@ApiModelProperty(value = "原图")
private String originUrl;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.pisceshub.muchat.server.vo;
package io.pisceshub.muchat.server.common.vo.connector;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
Expand All @@ -10,7 +10,7 @@
* @description Good Good Study,Day Day Up.
*/
@Data
public class NodeInfoVo {
public class NodeInfoResp {

@ApiModelProperty("协议,ws,wss,mqtt等等")
private String protocol;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.pisceshub.muchat.server.vo;
package io.pisceshub.muchat.server.common.vo.message;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
Expand All @@ -10,7 +10,7 @@

@Data
@ApiModel("群聊消息VO")
public class GroupMessageVO {
public class GroupMessageSendReq {

@NotNull(message="群聊id不可为空")
@ApiModelProperty(value = "群聊id")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.pisceshub.muchat.server.vo;
package io.pisceshub.muchat.server.common.vo.message;


import io.swagger.annotations.ApiModel;
Expand All @@ -11,7 +11,7 @@

@Data
@ApiModel("私聊消息VO")
public class PrivateMessageVO {
public class PrivateMessageSendReq {


@NotNull(message="接收用户id不可为空")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package io.pisceshub.muchat.server.common.vo.user;

import io.pisceshub.muchat.common.core.enums.ChatType;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;

/**
* @author xiaochangbai
* @date 2023-06-15 21:44
*/
@Data
public class ChatSessionAddReq implements Serializable {


@NotNull(message = "对方id不能为空")
private Long targetId;

@NotNull(message = "聊天类型不能为空")
private ChatType chatType;


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package io.pisceshub.muchat.server.common.vo.user;

import io.pisceshub.muchat.common.core.enums.ChatType;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Objects;

/**
* @author xiaochangbai
* @date 2023-06-15 21:44
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ChatSessionInfoResp implements Serializable {


/**
* 对方的id:好友id或群id
*/
private Long targetId;


/**
* 聊天类型
*/
private ChatType chatType;

/**
* 好友昵称或群名称
*/
private String name;


/**
* 头像
*/
private String headImage;


/**
* 未读消息数量
*/
private Long unReadCount;


@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ChatSessionInfoResp that = (ChatSessionInfoResp) o;
return Objects.equals(targetId, that.targetId) && chatType == that.chatType;
}

@Override
public int hashCode() {
return Objects.hash(targetId, chatType);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.pisceshub.muchat.server.vo;
package io.pisceshub.muchat.server.common.vo.user;


import io.swagger.annotations.ApiModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.pisceshub.muchat.server.vo;
package io.pisceshub.muchat.server.common.vo.user;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
Expand All @@ -10,7 +10,7 @@

@Data
@ApiModel("邀请好友进群请求VO")
public class GroupInviteVO {
public class GroupInviteReq {

@NotNull(message = "群id不可为空")
@ApiModelProperty(value = "群id")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.pisceshub.muchat.server.vo;
package io.pisceshub.muchat.server.common.vo.user;


import io.swagger.annotations.ApiModel;
Expand All @@ -7,7 +7,7 @@

@Data
@ApiModel("群成员信息VO")
public class GroupMemberVO {
public class GroupMemberResp {

@ApiModelProperty("用户id")
private Long userId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.pisceshub.muchat.server.vo;
package io.pisceshub.muchat.server.common.vo.user;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.pisceshub.muchat.server.dto;
package io.pisceshub.muchat.server.common.vo.user;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
Expand All @@ -7,7 +7,7 @@

@Data
@ApiModel("用户登录VO")
public class LoginDTO {
public class LoginReq {

//@NotEmpty(message="用户名不可为空")
@ApiModelProperty(value = "用户名")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package io.pisceshub.muchat.server.vo;
package io.pisceshub.muchat.server.common.vo.user;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel("用户登录VO")
public class LoginVO {
public class LoginResp {

@ApiModelProperty(value = "每次请求都必须在header中携带accessToken")
private String accessToken;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.pisceshub.muchat.server.dto;
package io.pisceshub.muchat.server.common.vo.user;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
Expand All @@ -9,7 +9,7 @@

@Data
@ApiModel("用户注册VO")
public class RegisterDTO {
public class RegisterReq {

@Length(max = 64,message = "用户名不能大于64字符")
@NotEmpty(message="用户名不可为空")
Expand Down
Loading

0 comments on commit 86a81f8

Please sign in to comment.