Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
47687924
Commit
47687924
authored
Jan 22, 2022
by
hweeeeeei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化IM相关常量,新建常量类"ImConstant"
parent
87d0832e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
18 deletions
+68
-18
core/src/main/java/com/wecloud/im/netty/core/WsReadHandler.java
+3
-3
core/src/main/java/com/wecloud/im/ws/ImConstant.java
+56
-0
core/src/main/java/com/wecloud/im/ws/strategy/AbstractImCmdStrategy.java
+9
-15
No files found.
core/src/main/java/com/wecloud/im/netty/core/WsReadHandler.java
View file @
47687924
...
@@ -13,6 +13,9 @@ import org.springframework.stereotype.Component;
...
@@ -13,6 +13,9 @@ import org.springframework.stereotype.Component;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
static
com
.
wecloud
.
im
.
ws
.
ImConstant
.
PING
;
import
static
com
.
wecloud
.
im
.
ws
.
ImConstant
.
PONG
;
/**
/**
* @Description app端 长连接事件处理
* @Description app端 长连接事件处理
* @Author hewei hwei1233@163.com
* @Author hewei hwei1233@163.com
...
@@ -23,9 +26,6 @@ import javax.annotation.Resource;
...
@@ -23,9 +26,6 @@ import javax.annotation.Resource;
@Slf4j
@Slf4j
public
class
WsReadHandler
extends
SimpleChannelInboundHandler
<
TextWebSocketFrame
>
{
public
class
WsReadHandler
extends
SimpleChannelInboundHandler
<
TextWebSocketFrame
>
{
private
static
final
String
PING
=
"ping"
;
private
static
final
String
PONG
=
"pong"
;
@Resource
@Resource
private
ChannelManager
channelManager
;
private
ChannelManager
channelManager
;
...
...
core/src/main/java/com/wecloud/im/ws/ImConstant.java
0 → 100644
View file @
47687924
package
com
.
wecloud
.
im
.
ws
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* IM相关常量
*/
@Data
public
class
ImConstant
implements
Serializable
{
/**
* 心跳
*/
public
static
final
String
PING
=
"ping"
;
/**
* 心跳
*/
public
static
final
String
PONG
=
"pong"
;
/**
* 推送
*/
public
static
final
String
PUSH_KEY
=
"push"
;
public
static
final
String
TITLE
=
"title"
;
public
static
final
String
SUB_TITLE
=
"subTitle"
;
/**
* 数据
*/
public
static
final
String
DATA
=
"data"
;
/**
* 您收到一条新消息
*/
public
static
final
String
PUSH_TITLE
=
"You have received a new message"
;
/**
* 点击查看
*/
public
static
final
String
PUSH_BODY
=
"Click to view"
;
/**
* 会话id的key名
*/
public
static
final
String
TO_CONVERSATION_KEY
=
"toConversation"
;
/**
* 消息类型
*/
public
static
final
String
MSG_TYPE
=
"type"
;
}
core/src/main/java/com/wecloud/im/ws/strategy/AbstractImCmdStrategy.java
View file @
47687924
...
@@ -18,6 +18,15 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -18,6 +18,15 @@ import lombok.extern.slf4j.Slf4j;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
static
com
.
wecloud
.
im
.
ws
.
ImConstant
.
DATA
;
import
static
com
.
wecloud
.
im
.
ws
.
ImConstant
.
MSG_TYPE
;
import
static
com
.
wecloud
.
im
.
ws
.
ImConstant
.
PUSH_BODY
;
import
static
com
.
wecloud
.
im
.
ws
.
ImConstant
.
PUSH_KEY
;
import
static
com
.
wecloud
.
im
.
ws
.
ImConstant
.
PUSH_TITLE
;
import
static
com
.
wecloud
.
im
.
ws
.
ImConstant
.
SUB_TITLE
;
import
static
com
.
wecloud
.
im
.
ws
.
ImConstant
.
TITLE
;
import
static
com
.
wecloud
.
im
.
ws
.
ImConstant
.
TO_CONVERSATION_KEY
;
/**
/**
* @Description 处理Cmd请求
* @Description 处理Cmd请求
* 抽象类 策略设计模式
* 抽象类 策略设计模式
...
@@ -27,21 +36,6 @@ import java.util.HashMap;
...
@@ -27,21 +36,6 @@ import java.util.HashMap;
@Slf4j
@Slf4j
public
abstract
class
AbstractImCmdStrategy
{
public
abstract
class
AbstractImCmdStrategy
{
public
static
final
String
PUSH_KEY
=
"push"
;
private
static
final
String
TITLE
=
"title"
;
private
static
final
String
SUB_TITLE
=
"subTitle"
;
private
static
final
String
DATA
=
"data"
;
/**
* 您收到一条新消息
*/
private
static
final
String
PUSH_TITLE
=
"You have received a new message"
;
/**
* 点击查看
*/
private
static
final
String
PUSH_BODY
=
"Click to view"
;
private
static
final
String
TO_CONVERSATION_KEY
=
"toConversation"
;
private
static
final
String
MSG_TYPE
=
"type"
;
private
static
volatile
ImCmdStrategyFactory
imCmdStrategyFactory
;
private
static
volatile
ImCmdStrategyFactory
imCmdStrategyFactory
;
private
static
ImApplicationService
imApplicationService
;
private
static
ImApplicationService
imApplicationService
;
private
static
ImClientService
imClientService
;
private
static
ImClientService
imClientService
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment