52 changed files with 141 additions and 187 deletions
@ -1,41 +0,0 @@
|
||||
<?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"> |
||||
<parent> |
||||
<artifactId>so-im</artifactId> |
||||
<groupId>net.sopod</groupId> |
||||
<version>1.0.0</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>im-core</artifactId> |
||||
|
||||
<dependencies> |
||||
<dependency> |
||||
<groupId>net.sopod</groupId> |
||||
<artifactId>im-common</artifactId> |
||||
<version>${soim.version}</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>net.sopod</groupId> |
||||
<artifactId>im-data</artifactId> |
||||
<version>${soim.version}</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>io.netty</groupId> |
||||
<artifactId>netty-all</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.springframework</groupId> |
||||
<artifactId>spring-context</artifactId> |
||||
<scope>provided</scope> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.apache.dubbo</groupId> |
||||
<artifactId>dubbo</artifactId> |
||||
<scope>provided</scope> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
</project> |
||||
@ -1,38 +0,0 @@
|
||||
<?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"> |
||||
<parent> |
||||
<artifactId>so-im</artifactId> |
||||
<groupId>net.sopod</groupId> |
||||
<version>1.0.0</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>im-data</artifactId> |
||||
|
||||
<dependencies> |
||||
<dependency> |
||||
<groupId>net.sopod</groupId> |
||||
<artifactId>im-common</artifactId> |
||||
<version>${soim.version}</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>io.netty</groupId> |
||||
<artifactId>netty-buffer</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.google.protobuf</groupId> |
||||
<artifactId>protobuf-java</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.projectlombok</groupId> |
||||
<artifactId>lombok</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.reflections</groupId> |
||||
<artifactId>reflections</artifactId> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
</project> |
||||
@ -1,10 +1,10 @@
|
||||
package net.sopod.soim.entry.handler.auth; |
||||
package net.sopod.soim.entry.handlers.auth; |
||||
|
||||
import com.google.protobuf.MessageLite; |
||||
import net.sopod.soim.entry.config.ImEntryAppContextHolder; |
||||
import net.sopod.soim.entry.handler.NetUserMessageHandler; |
||||
import net.sopod.soim.core.session.Account; |
||||
import net.sopod.soim.core.session.NetUser; |
||||
import net.sopod.soim.entry.server.handler.NetUserMessageHandler; |
||||
import net.sopod.soim.entry.server.session.Account; |
||||
import net.sopod.soim.entry.server.session.NetUser; |
||||
import net.sopod.soim.data.msg.auth.Auth; |
||||
import net.sopod.soim.entry.config.EntryServerConfig; |
||||
import net.sopod.soim.entry.server.AccountRegistry; |
||||
@ -1,8 +1,8 @@
|
||||
package net.sopod.soim.entry.handler.chat; |
||||
package net.sopod.soim.entry.handlers.chat; |
||||
|
||||
import com.google.protobuf.MessageLite; |
||||
import net.sopod.soim.entry.handler.AccountMessageHandler; |
||||
import net.sopod.soim.core.session.Account; |
||||
import net.sopod.soim.entry.server.handler.AccountMessageHandler; |
||||
import net.sopod.soim.entry.server.session.Account; |
||||
import net.sopod.soim.data.msg.chat.Chat; |
||||
import net.sopod.soim.logic.common.model.TextChat; |
||||
import net.sopod.soim.logic.user.service.ChatService; |
||||
@ -1,8 +1,8 @@
|
||||
package net.sopod.soim.entry.handler.task; |
||||
package net.sopod.soim.entry.handlers.task; |
||||
|
||||
import com.google.protobuf.MessageLite; |
||||
import net.sopod.soim.entry.handler.NetUserMessageHandler; |
||||
import net.sopod.soim.core.session.NetUser; |
||||
import net.sopod.soim.entry.server.handler.NetUserMessageHandler; |
||||
import net.sopod.soim.entry.server.session.NetUser; |
||||
import net.sopod.soim.data.msg.task.Tasks; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
@ -1,10 +1,10 @@
|
||||
package net.sopod.soim.entry.handler.user; |
||||
package net.sopod.soim.entry.handlers.user; |
||||
|
||||
import com.google.protobuf.MessageLite; |
||||
import net.sopod.soim.core.session.Account; |
||||
import net.sopod.soim.entry.server.session.Account; |
||||
import net.sopod.soim.data.msg.hello.HelloPB; |
||||
import net.sopod.soim.entry.delay.NetUserDelayTaskManager; |
||||
import net.sopod.soim.entry.handler.AccountMessageHandler; |
||||
import net.sopod.soim.entry.server.handler.AccountMessageHandler; |
||||
import net.sopod.soim.logic.api.segmentid.core.SegmentIdGenerator; |
||||
import net.sopod.soim.logic.user.service.UserBizService; |
||||
import org.apache.dubbo.config.annotation.DubboReference; |
||||
@ -1,9 +1,9 @@
|
||||
package net.sopod.soim.entry.handler.user; |
||||
package net.sopod.soim.entry.handlers.user; |
||||
|
||||
import com.google.protobuf.MessageLite; |
||||
import net.sopod.soim.core.session.Account; |
||||
import net.sopod.soim.entry.server.session.Account; |
||||
import net.sopod.soim.data.msg.user.UserGroup; |
||||
import net.sopod.soim.entry.handler.AccountMessageHandler; |
||||
import net.sopod.soim.entry.server.handler.AccountMessageHandler; |
||||
import net.sopod.soim.logic.common.model.UserInfo; |
||||
import net.sopod.soim.logic.user.service.UserBizService; |
||||
import org.apache.dubbo.config.annotation.DubboReference; |
||||
@ -1,9 +1,9 @@
|
||||
package net.sopod.soim.core.registry; |
||||
package net.sopod.soim.entry.registry; |
||||
|
||||
import com.google.protobuf.MessageLite; |
||||
import net.sopod.soim.common.util.ImClock; |
||||
import net.sopod.soim.common.util.Reflects; |
||||
import net.sopod.soim.core.handler.MessageHandler; |
||||
import net.sopod.soim.entry.server.handler.MessageHandler; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.context.ApplicationContext; |
||||
@ -1,4 +1,4 @@
|
||||
package net.sopod.soim.core.net; |
||||
package net.sopod.soim.entry.server; |
||||
|
||||
import io.netty.util.AttributeKey; |
||||
|
||||
@ -1,10 +1,8 @@
|
||||
package net.sopod.soim.entry.handler; |
||||
package net.sopod.soim.entry.server.handler; |
||||
|
||||
import com.google.protobuf.MessageLite; |
||||
import net.sopod.soim.core.handler.MessageHandler; |
||||
import net.sopod.soim.core.session.Account; |
||||
import net.sopod.soim.core.session.NetUser; |
||||
import org.apache.dubbo.rpc.RpcContext; |
||||
import net.sopod.soim.entry.server.session.Account; |
||||
import net.sopod.soim.entry.server.session.NetUser; |
||||
|
||||
/** |
||||
* AccountMessageHandler |
||||
@ -1,6 +1,6 @@
|
||||
package net.sopod.soim.core.handler; |
||||
package net.sopod.soim.entry.server.handler; |
||||
|
||||
import net.sopod.soim.core.session.NetUser; |
||||
import net.sopod.soim.entry.server.session.NetUser; |
||||
|
||||
/** |
||||
* MessageHandler |
||||
@ -1,8 +1,7 @@
|
||||
package net.sopod.soim.entry.handler; |
||||
package net.sopod.soim.entry.server.handler; |
||||
|
||||
import com.google.protobuf.MessageLite; |
||||
import net.sopod.soim.core.handler.MessageHandler; |
||||
import net.sopod.soim.core.session.NetUser; |
||||
import net.sopod.soim.entry.server.session.NetUser; |
||||
|
||||
/** |
||||
* NetUserMessageHandler |
||||
@ -1,4 +1,4 @@
|
||||
package net.sopod.soim.core.session; |
||||
package net.sopod.soim.entry.server.session; |
||||
|
||||
import com.google.common.base.Preconditions; |
||||
import org.slf4j.Logger; |
||||
@ -1,4 +1,4 @@
|
||||
package net.sopod.soim.core.session; |
||||
package net.sopod.soim.entry.server.session; |
||||
|
||||
import io.netty.channel.Channel; |
||||
import io.netty.util.AttributeKey; |
||||
@ -0,0 +1,90 @@
|
||||
<?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"> |
||||
<parent> |
||||
<artifactId>so-im</artifactId> |
||||
<groupId>net.sopod</groupId> |
||||
<version>1.0.0</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>im-entry-protocol</artifactId> |
||||
|
||||
<dependencies> |
||||
<dependency> |
||||
<groupId>net.sopod</groupId> |
||||
<artifactId>im-common</artifactId> |
||||
<version>${soim.version}</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>io.netty</groupId> |
||||
<artifactId>netty-buffer</artifactId> |
||||
<version>${netty.version}</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>io.netty</groupId> |
||||
<artifactId>netty-codec</artifactId> |
||||
<version>${netty.version}</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>io.netty</groupId> |
||||
<artifactId>netty-transport</artifactId> |
||||
<version>${netty.version}</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.google.protobuf</groupId> |
||||
<artifactId>protobuf-java</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.projectlombok</groupId> |
||||
<artifactId>lombok</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>org.reflections</groupId> |
||||
<artifactId>reflections</artifactId> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
<build> |
||||
<extensions> |
||||
<extension> |
||||
<groupId>kr.motd.maven</groupId> |
||||
<artifactId>os-maven-plugin</artifactId><!--引入操作系统os设置的属性插件,否则${os.detected.classifier} 操作系统版本会找不到 --> |
||||
<version>1.6.1</version> |
||||
</extension> |
||||
</extensions> |
||||
<plugins> |
||||
<!--添加编译proto文件的编译程序和对应的编译插件--> |
||||
<plugin> |
||||
<groupId>org.xolstice.maven.plugins</groupId> |
||||
<artifactId>protobuf-maven-plugin</artifactId> |
||||
<version>0.6.1</version> |
||||
<configuration> |
||||
<protocArtifact>com.google.protobuf:protoc:${protoc.version}:exe:${os.detected.classifier}</protocArtifact> |
||||
<protoSourceRoot>src/main/resources</protoSourceRoot> |
||||
<outputDirectory>src/main/java</outputDirectory> |
||||
<clearOutputDirectory>false</clearOutputDirectory> |
||||
<!-- <protocPlugins>--> |
||||
<!-- <protocPlugin>--> |
||||
<!-- <id>dubbo</id>--> |
||||
<!-- <groupId>org.apache.dubbo</groupId>--> |
||||
<!-- <artifactId>dubbo-compiler</artifactId>--> |
||||
<!-- <version>${dubbo.compiler.version}</version>--> |
||||
<!-- <mainClass>org.apache.dubbo.gen.dubbo.Dubbo3Generator</mainClass>--> |
||||
<!-- </protocPlugin>--> |
||||
<!-- </protocPlugins>--> |
||||
</configuration> |
||||
<executions> |
||||
<execution> |
||||
<goals> |
||||
<goal>compile</goal> |
||||
<goal>test-compile</goal> |
||||
</goals> |
||||
</execution> |
||||
</executions> |
||||
</plugin> |
||||
</plugins> |
||||
</build> |
||||
|
||||
</project> |
||||
@ -1,14 +1,12 @@
|
||||
package net.sopod.soim.core.net; |
||||
package net.sopod.soim.data.serialize; |
||||
|
||||
import com.google.protobuf.MessageLite; |
||||
import io.netty.buffer.ByteBuf; |
||||
import io.netty.buffer.Unpooled; |
||||
import io.netty.channel.ChannelHandlerContext; |
||||
import io.netty.channel.CombinedChannelDuplexHandler; |
||||
import io.netty.handler.codec.ByteToMessageDecoder; |
||||
import io.netty.handler.codec.MessageToByteEncoder; |
||||
import net.sopod.soim.data.proto.ProtoMessageManager; |
||||
import net.sopod.soim.data.serialize.ImMessage; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
|
||||
Loading…
Reference in new issue