Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioc_sixiang_license
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zengtianlai3
ioc_sixiang_license
Commits
a6cc690e
Commit
a6cc690e
authored
Jul 07, 2022
by
AfirSraftGarrier
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/m33' into for-yx
parents
5871464f
8e4794fb
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
20 additions
and
10 deletions
+20
-10
DeviceServerHandler.java
.../java/iot/sixiang/license/device/DeviceServerHandler.java
+1
-1
User.java
license/src/main/java/iot/sixiang/license/entity/User.java
+1
-1
ForwardClientHandler.java
...ava/iot/sixiang/license/forward/ForwardClientHandler.java
+1
-1
ForwardConnectionListener.java
...ot/sixiang/license/forward/ForwardConnectionListener.java
+1
-1
AuthenticationInterceptor.java
...va/iot/sixiang/license/jwt/AuthenticationInterceptor.java
+2
-2
JwtUtil.java
license/src/main/java/iot/sixiang/license/jwt/JwtUtil.java
+7
-1
BaseChannelInitializer.java
.../java/iot/sixiang/license/net/BaseChannelInitializer.java
+3
-1
BaseConnectionListener.java
.../java/iot/sixiang/license/net/BaseConnectionListener.java
+4
-2
No files found.
license/src/main/java/iot/sixiang/license/device/DeviceServerHandler.java
View file @
a6cc690e
...
@@ -111,7 +111,7 @@ public class DeviceServerHandler extends SimpleChannelInboundHandler<Object> {
...
@@ -111,7 +111,7 @@ public class DeviceServerHandler extends SimpleChannelInboundHandler<Object> {
}
}
@Override
@Override
public
void
exceptionCaught
(
ChannelHandlerContext
ctx
,
Throwable
cause
)
throws
Exception
{
public
void
exceptionCaught
(
ChannelHandlerContext
ctx
,
Throwable
cause
)
throws
Exception
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
super
.
exceptionCaught
(
ctx
,
cause
);
super
.
exceptionCaught
(
ctx
,
cause
);
log
.
debug
(
"设备服务器,exceptionCaught:{}"
,
ctx
.
channel
().
id
().
asLongText
());
log
.
debug
(
"设备服务器,exceptionCaught:{}"
,
ctx
.
channel
().
id
().
asLongText
());
...
...
license/src/main/java/iot/sixiang/license/entity/User.java
View file @
a6cc690e
...
@@ -32,7 +32,7 @@ public class User implements Serializable {
...
@@ -32,7 +32,7 @@ public class User implements Serializable {
private
Integer
userId
;
private
Integer
userId
;
@ApiModelProperty
(
"密码"
)
@ApiModelProperty
(
"密码"
)
private
String
password
;
private
transient
String
password
;
@ApiModelProperty
(
"用户名"
)
@ApiModelProperty
(
"用户名"
)
private
String
userName
;
private
String
userName
;
...
...
license/src/main/java/iot/sixiang/license/forward/ForwardClientHandler.java
View file @
a6cc690e
...
@@ -94,7 +94,7 @@ public class ForwardClientHandler extends SimpleChannelInboundHandler<Object> {
...
@@ -94,7 +94,7 @@ public class ForwardClientHandler extends SimpleChannelInboundHandler<Object> {
}
}
@Override
@Override
public
synchronized
void
userEventTriggered
(
ChannelHandlerContext
ctx
,
Object
obj
)
throws
Exception
{
public
synchronized
void
userEventTriggered
(
ChannelHandlerContext
ctx
,
Object
obj
)
{
log
.
debug
(
"桥接客户端,userEventTriggered:{}"
,
ctx
.
channel
().
id
().
asLongText
());
log
.
debug
(
"桥接客户端,userEventTriggered:{}"
,
ctx
.
channel
().
id
().
asLongText
());
}
}
...
...
license/src/main/java/iot/sixiang/license/forward/ForwardConnectionListener.java
View file @
a6cc690e
...
@@ -17,7 +17,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -17,7 +17,7 @@ import lombok.extern.slf4j.Slf4j;
public
class
ForwardConnectionListener
extends
BaseConnectionListener
{
public
class
ForwardConnectionListener
extends
BaseConnectionListener
{
@Override
@Override
public
void
operationComplete
(
ChannelFuture
channelFuture
)
throws
Exception
{
public
void
operationComplete
(
ChannelFuture
channelFuture
)
{
AlarmService
alarmService
=
SpringUtil
.
getBean
(
AlarmService
.
class
);
AlarmService
alarmService
=
SpringUtil
.
getBean
(
AlarmService
.
class
);
if
(!
channelFuture
.
isSuccess
())
{
if
(!
channelFuture
.
isSuccess
())
{
//TODO 失败进行告警
//TODO 失败进行告警
...
...
license/src/main/java/iot/sixiang/license/jwt/AuthenticationInterceptor.java
View file @
a6cc690e
...
@@ -21,14 +21,14 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
...
@@ -21,14 +21,14 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
@Override
@Override
public
void
afterCompletion
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
throws
Exception
{
public
void
afterCompletion
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
{
UserUtils
.
removeUser
();
UserUtils
.
removeUser
();
UserUtils
.
removeUri
();
UserUtils
.
removeUri
();
}
}
@Override
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
{
response
.
setHeader
(
"Set-Cookie"
,
"HttpOnly"
);
response
.
setHeader
(
"Set-Cookie"
,
"HttpOnly"
);
return
true
;
return
true
;
}
}
...
...
license/src/main/java/iot/sixiang/license/jwt/JwtUtil.java
View file @
a6cc690e
...
@@ -66,7 +66,13 @@ public class JwtUtil {
...
@@ -66,7 +66,13 @@ public class JwtUtil {
*/
*/
public
static
DecodedJWT
verifyToken
(
String
token
)
{
public
static
DecodedJWT
verifyToken
(
String
token
)
{
JWTVerifier
verifier
=
JWT
.
require
(
Algorithm
.
HMAC256
(
SECRET
)).
build
();
JWTVerifier
verifier
=
JWT
.
require
(
Algorithm
.
HMAC256
(
SECRET
)).
build
();
DecodedJWT
jwt
=
verifier
.
verify
(
token
);
DecodedJWT
jwt
=
null
;
try
{
jwt
=
verifier
.
verify
(
token
);
}
catch
(
RuntimeException
e
)
{
log
.
error
(
e
.
getMessage
());
log
.
error
(
"解析编码异常"
);
}
return
jwt
;
return
jwt
;
}
}
}
}
license/src/main/java/iot/sixiang/license/net/BaseChannelInitializer.java
View file @
a6cc690e
...
@@ -2,13 +2,15 @@ package iot.sixiang.license.net;
...
@@ -2,13 +2,15 @@ package iot.sixiang.license.net;
import
io.netty.channel.ChannelInitializer
;
import
io.netty.channel.ChannelInitializer
;
import
io.netty.channel.socket.SocketChannel
;
import
io.netty.channel.socket.SocketChannel
;
import
lombok.extern.slf4j.Slf4j
;
@Slf4j
public
class
BaseChannelInitializer
extends
ChannelInitializer
<
SocketChannel
>
{
public
class
BaseChannelInitializer
extends
ChannelInitializer
<
SocketChannel
>
{
@Override
@Override
protected
void
initChannel
(
SocketChannel
ch
)
throws
Exception
{
protected
void
initChannel
(
SocketChannel
ch
)
throws
Exception
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
System
.
out
.
println
(
"重写了initChannel方法"
);
log
.
info
(
"重写了initChannel方法"
);
}
}
}
}
license/src/main/java/iot/sixiang/license/net/BaseConnectionListener.java
View file @
a6cc690e
...
@@ -3,16 +3,18 @@ package iot.sixiang.license.net;
...
@@ -3,16 +3,18 @@ package iot.sixiang.license.net;
import
io.netty.channel.ChannelFuture
;
import
io.netty.channel.ChannelFuture
;
import
io.netty.channel.ChannelFutureListener
;
import
io.netty.channel.ChannelFutureListener
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
@Data
@Data
@Slf4j
public
class
BaseConnectionListener
implements
ChannelFutureListener
{
public
class
BaseConnectionListener
implements
ChannelFutureListener
{
public
String
appId
;
public
String
appId
;
public
String
host
;
public
String
host
;
public
int
port
;
public
int
port
;
@Override
@Override
public
void
operationComplete
(
ChannelFuture
future
)
throws
Exception
{
public
void
operationComplete
(
ChannelFuture
future
)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
System
.
out
.
println
(
"重写了operationComplete方法"
);
log
.
info
(
"重写了operationComplete方法"
);
}
}
}
}
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