Skip to content

Commit

Permalink
feat: 万人大群聊功能开发
Browse files Browse the repository at this point in the history
  • Loading branch information
imalasong committed Jul 1, 2023
1 parent 7e79d00 commit b8603f6
Show file tree
Hide file tree
Showing 30 changed files with 508 additions and 167 deletions.
5 changes: 0 additions & 5 deletions im-commom/im-common-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
</properties>

<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package io.pisceshub.muchat.common.core.model;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.pisceshub.muchat.common.core.serializer.DateToLongSerializer;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
* @author xiaochangbai
* @date 2023-07-01 13:38
*/
@Data
public abstract class CommonMessageInfo implements Serializable {


/*
* 发送者id
*/
private Long sendId;


/*
* 消息id
*/
private Long id;

/*
* 发送内容
*/
private String content;

/*
* 消息内容类型 具体枚举值由应用层定义
*/
private Integer type;


/**
* 发送时间
*/
@JsonSerialize(using = DateToLongSerializer.class)
private Date sendTime;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,11 @@
import java.util.Date;

@Data
public class GroupMessageInfo {

/*
* 消息id
*/
private Long id;
public class GroupMessageInfo extends CommonMessageInfo{

/*
* 群聊id
*/
private Long groupId;

/*
* 发送者id
*/
private Long sendId;

/*
* 消息内容
*/
private String content;

/*
* 消息内容类型 具体枚举值由应用层定义
*/
private Integer type;

/**
* 发送时间
*/
@JsonSerialize(using = DateToLongSerializer.class)
private Date sendTime;
}
Original file line number Diff line number Diff line change
@@ -1,42 +1,16 @@
package io.pisceshub.muchat.common.core.model;

import io.pisceshub.muchat.common.core.serializer.DateToLongSerializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;

import java.util.Date;

@Data
public class PrivateMessageInfo {

/*
* 消息id
*/
private long id;

/*
* 发送者id
*/
private Long sendId;
public class PrivateMessageInfo extends CommonMessageInfo{

/*
* 接收者id
*/
private Long recvId;

/*
* 发送内容
*/
private String content;

/*
* 消息内容类型 具体枚举值由应用层定义
*/
private Integer type;

/**
* 发送时间
*/
@JsonSerialize(using = DateToLongSerializer.class)
private Date sendTime;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package io.pisceshub.muchat.common.core.utils;

import lombok.Getter;

/**
* @author xiaochangbai
* @date 2023-07-01 11:36
*/
@Getter
public class TPair<L,R> {

private L left;

private R right;

public TPair(L left,R right){
this.left = left;
this.right = right;
}

}
38 changes: 38 additions & 0 deletions im-commom/im-common-log/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
55 changes: 55 additions & 0 deletions im-commom/im-common-log/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.pisceshub.muchat</groupId>
<artifactId>im-commom</artifactId>
<version>1.0</version>
</parent>

<artifactId>im-common-log</artifactId>

<dependencies>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>

<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>

<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
</dependency>
<dependency>
<groupId>io.pisceshub.muchat</groupId>
<artifactId>im-common-core</artifactId>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package io.pisceshub.muchat.common.log;

import io.pisceshub.muchat.common.log.aop.ApiLogAspect;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
* @author xiaochangbai
* @date 2023-07-01 11:23
*/
@Configuration
public class LogAutoConfig {

@Bean
public ApiLogAspect apiLogAspect(){
return new ApiLogAspect();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package io.pisceshub.muchat.common.log.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* @author xiaochangbai
* @date 2023-07-01 10:42
*/
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface ApiLog {

/**
* 打印请求参数
*/
boolean input() default true;

/**
* 打印返回值
*/
boolean output() default true;

/**
* 是否持久化
* @return
*/
boolean isPersistence() default false;
}
Loading

0 comments on commit b8603f6

Please sign in to comment.