Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
com.hdp.customerservice
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘文胜
com.hdp.customerservice
Commits
ca22ba1b
Commit
ca22ba1b
authored
Jun 25, 2015
by
杨翌文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tijiao
parent
65d30f1a
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
30 deletions
+52
-30
APP.java
src/main/java/com/hdp/APP.java
+2
-4
IMManager.java
...ain/java/com/hdp/customerservice/websocket/IMManager.java
+9
-7
IMWebSocketEndpoint.java
...om/hdp/customerservice/websocket/IMWebSocketEndpoint.java
+0
-9
applicationContext.xml
src/main/resources/META-INF/spring/applicationContext.xml
+7
-2
application.development.properties
src/main/resources/application.development.properties
+6
-4
application.production.properties
src/main/resources/application.production.properties
+14
-2
application.sandbox.properties
src/main/resources/application.sandbox.properties
+14
-2
No files found.
src/main/java/com/hdp/APP.java
View file @
ca22ba1b
...
...
@@ -24,7 +24,6 @@ import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.ImportResource
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.data.redis.connection.RedisConnectionFactory
;
import
org.springframework.data.redis.connection.jedis.JedisConnectionFactory
;
import
org.springframework.data.redis.listener.PatternTopic
;
...
...
@@ -38,11 +37,10 @@ import org.springframework.web.socket.server.standard.ServerEndpointExporter;
import
redis.clients.jedis.JedisPoolConfig
;
import
com.hdp.customerservice.websocket.
*
;
import
com.hdp.customerservice.websocket.
IMWebSocketEndpoint
;
import
com.hdp.pi.wechat.Subscriber
;
@PropertySource
(
value
=
"classpath:application.${model}.properties"
)
@ComponentScan
@ComponentScan
(
"com.hdp"
)
@EnableAutoConfiguration
@EnableWebMvc
@EnableWebSocket
...
...
src/main/java/com/hdp/customerservice/websocket/IMManager.java
View file @
ca22ba1b
...
...
@@ -57,7 +57,7 @@ public final class IMManager {
newUserMessage
.
entCode
=
e
.
entCode
;
newUserMessage
.
openId
=
e
.
openId
;
try
{
queue
.
put
(
e
);
queue
.
put
(
newUserMessag
e
);
}
catch
(
InterruptedException
e1
)
{
}
}
...
...
@@ -65,19 +65,21 @@ public final class IMManager {
public
static
void
broadcast
(
AbstractMessage
message
){
String
m
=
JSONObject
.
toJSONString
(
message
);
for
(
Waiter
waiter
:
waiters
)
{
/*
if(waiter == null ||
if
(
waiter
==
null
||
message
.
entCode
==
null
||
waiter
.
entCode
==
null
||
waiter
.
entCode
.
intValue
()
!=
message
.
entCode
.
intValue
()){
//没有客服
continue
;
}
*/
}
Session
session
=
waiter
.
session
;
/*
if(session == null || !session.isOpen()){
if
(
session
==
null
||
!
session
.
isOpen
()){
return
;
}
*/
}
try
{
session
.
getBasicRemote
().
sendText
(
m
);
session
.
getAsyncRemote
().
sendText
(
m
);
session
.
getAsyncRemote
().
flushBatch
();
}
catch
(
IOException
e1
)
{
e1
.
printStackTrace
();
}
}
}
...
...
@@ -89,7 +91,7 @@ public final class IMManager {
waiters
.
remove
(
w
);
}
static
{
for
(
int
i
=
0
;
i
<
poolSize
;
i
++){
for
(
int
i
=
0
;
i
<
1
;
i
++){
pool
.
execute
(
new
Runnable
()
{
//消息发射器
public
void
hand
(){
AbstractMessage
e
=
queue
.
poll
();
...
...
src/main/java/com/hdp/customerservice/websocket/IMWebSocketEndpoint.java
View file @
ca22ba1b
...
...
@@ -2,8 +2,6 @@ package com.hdp.customerservice.websocket;
import
java.io.IOException
;
import
javax.servlet.http.HttpSession
;
import
javax.websocket.EndpointConfig
;
import
javax.websocket.OnClose
;
import
javax.websocket.OnError
;
import
javax.websocket.OnMessage
;
...
...
@@ -13,14 +11,7 @@ import javax.websocket.server.ServerEndpoint;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.socket.CloseStatus
;
import
org.springframework.web.socket.WebSocketHandler
;
import
org.springframework.web.socket.WebSocketMessage
;
import
org.springframework.web.socket.WebSocketSession
;
import
org.springframework.web.socket.handler.WebSocketHandlerDecorator
;
import
com.hdp.customerservice.model.WorksEntity
;
import
com.hdp.customerservice.websocket.model.Waiter
;
@ServerEndpoint
(
value
=
"/im"
/*,configurator=GetHttpSessionConfigurator.class*/
)
...
...
src/main/resources/META-INF/spring/applicationContext.xml
View file @
ca22ba1b
...
...
@@ -15,7 +15,7 @@
<context:property-placeholder
ignore-resource-not-found=
"true"
location=
"classpath*:/application.
development
.properties"
/>
location=
"classpath*:/application.
${mode}
.properties"
/>
<bean
id=
"dataSource"
class=
"com.alibaba.druid.pool.DruidDataSource"
init-method=
"init"
...
...
@@ -68,11 +68,16 @@
<bean
id=
"validator"
class=
"org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"
/>
<bean
id=
"securityFilter"
class=
"com.hdp.pi.security.filter.SecurityFilter"
>
<property
name=
"debug"
value=
"
true
"
/>
<property
name=
"debug"
value=
"
${app.debug}
"
/>
<property
name=
"whiteList"
>
<list>
<value>
.wxpai.cn
</value>
</list>
</property>
<property
name=
"excludes"
>
<list>
<value>
/v1.0/internal
</value>
</list>
</property>
<property
name=
"maxAge"
value=
"7200"
/>
</bean>
...
...
src/main/resources/application.development.properties
View file @
ca22ba1b
...
...
@@ -7,11 +7,13 @@ redis.channel = __http_weixin__
#mysql database setting
jdbc.driver
=
com.mysql.jdbc.Driver
jdbc.url
=
jdbc:mysql://12
7.0.0.1:3306/customerservice
?autoReconnect=true&zeroDateTimeBehavior=convertToNull&characterEncoding=UTF-8
jdbc.username
=
root
jdbc.password
=
liuwensheng
jdbc.url
=
jdbc:mysql://12
1.199.42.240:3306/picrm
?autoReconnect=true&zeroDateTimeBehavior=convertToNull&characterEncoding=UTF-8
jdbc.username
=
future
jdbc.password
=
future123456
jdbc.pool.maxActive
=
20
jdbc.pool.initialSize
=
1
jdbc.pool.minIdle
=
1
jpa.showsql
=
true
jpa.showsql
=
false
app.debug
=
true
src/main/resources/application.production.properties
View file @
ca22ba1b
...
...
@@ -2,5 +2,17 @@ redis.host = 46826d8cc18c11e4.m.cnhza.kvstore.aliyuncs.com
redis.port
=
6379
redis.pass
=
46826d8cc18c11e4:xQUFLhOctr8b3ZA2RTFQ
redis.idle
=
1
redis.maxAtive
=
20
redis.channel
=
__http_monitor__
\ No newline at end of file
redis.maxActive
=
20
redis.channel
=
__http_weixin__
jdbc.driver
=
com.mysql.jdbc.Driver
jdbc.url
=
jdbc:mysql://rdsefzzbf7bv6j3.mysql.rds.aliyuncs.com/piscrm?autoReconnect=true&zeroDateTimeBehavior=convertToNull&characterEncoding=UTF-8
jdbc.username
=
future
jdbc.password
=
future123456
jdbc.pool.maxActive
=
50
jdbc.pool.initialSize
=
20
jdbc.pool.minIdle
=
10
jpa.showsql
=
false
app.debug
=
false
\ No newline at end of file
src/main/resources/application.sandbox.properties
View file @
ca22ba1b
...
...
@@ -2,5 +2,17 @@ redis.host = 10.161.177.181
redis.port
=
6379
redis.pass
=
future123456
redis.idle
=
1
redis.maxAtive
=
20
redis.channel
=
__http_monitor__
\ No newline at end of file
redis.maxActive
=
20
redis.channel
=
__http_weixin__
jdbc.driver
=
com.mysql.jdbc.Driver
jdbc.url
=
jdbc:mysql://121.199.42.240:3306/sandbox?autoReconnect=true&zeroDateTimeBehavior=convertToNull&characterEncoding=UTF-8
jdbc.username
=
future
jdbc.password
=
future123456
jdbc.pool.maxActive
=
20
jdbc.pool.initialSize
=
1
jdbc.pool.minIdle
=
1
jpa.showsql
=
false
app.debug
=
true
\ No newline at end of file
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