Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
GnssServer
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhushanglei
GnssServer
Commits
9414269b
Commit
9414269b
authored
Aug 19, 2022
by
zhushanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gps数据采集修改redis
parent
fa375150
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
TcpClientHandler.java
src/main/java/client/TcpClientHandler.java
+4
-0
No files found.
src/main/java/client/TcpClientHandler.java
View file @
9414269b
...
...
@@ -19,12 +19,15 @@ import java.util.concurrent.TimeUnit;
**/
public
class
TcpClientHandler
extends
SimpleChannelInboundHandler
<
Object
>
{
private
static
final
String
NAMESPACE
=
"gps:"
;
public
static
String
serverUrl
;
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
TcpClientHandler
.
class
);
public
static
boolean
complex
=
false
;
//是否差分定位模式
public
static
int
expireTime
=
120
;
@Override
protected
void
channelRead0
(
ChannelHandlerContext
ctx
,
Object
msg
)
{
try
{
...
...
@@ -114,6 +117,7 @@ public class TcpClientHandler extends SimpleChannelInboundHandler<Object> {
}
String
jsonObject
=
JSON
.
toJSONString
(
gpsDto
);
String
result
=
post
(
serverUrl
,
jsonObject
);
RedisUtils
.
set
(
NAMESPACE
+
TcpClient
.
deviceId
,
jsonObject
,
expireTime
);
//放入redis
logger
.
info
(
result
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
...
...
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