-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
508 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...im-common-core/src/main/java/io/pisceshub/muchat/common/core/model/CommonMessageInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 1 addition & 27 deletions
28
...m-common-core/src/main/java/io/pisceshub/muchat/common/core/model/PrivateMessageInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
21 changes: 21 additions & 0 deletions
21
im-commom/im-common-core/src/main/java/io/pisceshub/muchat/common/core/utils/TPair.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
18 changes: 18 additions & 0 deletions
18
im-commom/im-common-log/src/main/java/io/pisceshub/muchat/common/log/LogAutoConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
im-commom/im-common-log/src/main/java/io/pisceshub/muchat/common/log/annotation/ApiLog.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
Oops, something went wrong.