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
6f87e226
Commit
6f87e226
authored
Dec 02, 2022
by
AfirSraftGarrier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合并修改
parent
3aa797e5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
7 deletions
+35
-7
DeviceController.java
...java/iot/sixiang/license/controller/DeviceController.java
+28
-4
LoginController.java
.../java/iot/sixiang/license/controller/LoginController.java
+3
-0
ForwardClient.java
.../main/java/iot/sixiang/license/forward/ForwardClient.java
+2
-2
JwtFilter.java
license/src/main/java/iot/sixiang/license/jwt/JwtFilter.java
+1
-0
TerminalDeviceServiceImpl.java
...xiang/license/service/impl/TerminalDeviceServiceImpl.java
+1
-1
No files found.
license/src/main/java/iot/sixiang/license/controller/DeviceController.java
View file @
6f87e226
...
@@ -5,6 +5,10 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -5,6 +5,10 @@ import com.alibaba.fastjson.JSONObject;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.github.xiaoymin.knife4j.annotations.DynamicParameter
;
import
com.github.xiaoymin.knife4j.annotations.DynamicParameter
;
import
com.github.xiaoymin.knife4j.annotations.DynamicParameters
;
import
com.github.xiaoymin.knife4j.annotations.DynamicParameters
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
iot.sixiang.license.device.DeviceManager
;
import
iot.sixiang.license.device.DeviceManager
;
import
iot.sixiang.license.entity.DeviceBlack
;
import
iot.sixiang.license.entity.DeviceBlack
;
import
iot.sixiang.license.log.BusinessType
;
import
iot.sixiang.license.log.BusinessType
;
...
@@ -16,8 +20,16 @@ import iot.sixiang.license.model.vo.DeviceDetailVo;
...
@@ -16,8 +20,16 @@ import iot.sixiang.license.model.vo.DeviceDetailVo;
import
iot.sixiang.license.model.vo.DeviceVo
;
import
iot.sixiang.license.model.vo.DeviceVo
;
import
iot.sixiang.license.service.DeviceBlackService
;
import
iot.sixiang.license.service.DeviceBlackService
;
import
iot.sixiang.license.service.DeviceService
;
import
iot.sixiang.license.service.DeviceService
;
import
iot.sixiang.license.xss.XssUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.WebDataBinder
;
import
org.springframework.web.bind.WebDataBinder
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.InitBinder
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
java.util.List
;
...
@@ -79,12 +91,24 @@ public class DeviceController {
...
@@ -79,12 +91,24 @@ public class DeviceController {
*/
*/
@ApiOperation
(
value
=
"获取设备列表接口"
,
notes
=
"用于获取设备列表"
)
@ApiOperation
(
value
=
"获取设备列表接口"
,
notes
=
"用于获取设备列表"
)
@GetMapping
(
"list"
)
@GetMapping
(
"list"
)
@MyLog
(
title
=
"获取设备列表"
,
optParam
=
"#{pageNo},#{pageSize},#{appName},#{userName}"
,
businessType
=
BusinessType
.
SELECT
)
@MyLog
(
title
=
"获取设备列表"
,
optParam
=
"#{pageNo},#{pageSize},#{appName},#{userName},#{sn},#{status}"
,
businessType
=
BusinessType
.
SELECT
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前在第几页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"每页显示多少页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"appName"
,
value
=
"应用名"
),
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"用户名"
)})
@ApiImplicitParams
({
public
PageResult
<
DeviceVo
>
getDeviceList
(
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
int
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"0"
)
int
pageSize
,
@RequestParam
(
value
=
"appName"
,
required
=
false
)
String
appName
,
@RequestParam
(
value
=
"userName"
,
required
=
false
)
String
userName
)
{
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前在第几页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"每页显示多少页"
,
required
=
true
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"appName"
,
value
=
"应用名"
),
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"用户名"
),
@ApiImplicitParam
(
name
=
"sn"
,
value
=
"设备编码"
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态"
,
dataType
=
"int"
)
})
public
PageResult
<
DeviceVo
>
getDeviceList
(
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
int
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"0"
)
int
pageSize
,
@RequestParam
(
value
=
"appName"
,
required
=
false
)
String
appName
,
@RequestParam
(
value
=
"userName"
,
required
=
false
)
String
userName
,
@RequestParam
(
value
=
"sn"
,
required
=
false
)
String
sn
,
@RequestParam
(
value
=
"status"
,
required
=
false
)
Integer
status
)
{
appName
=
XssUtil
.
checkXSS
(
appName
);
appName
=
XssUtil
.
checkXSS
(
appName
);
userName
=
XssUtil
.
checkXSS
(
userName
);
userName
=
XssUtil
.
checkXSS
(
userName
);
PageInfoModel
<
DeviceVo
>
records
=
deviceService
.
getDeviceList
(
pageNo
,
pageSize
,
appName
,
userName
);
PageInfoModel
<
DeviceVo
>
records
=
deviceService
.
getDeviceList
(
pageNo
,
pageSize
,
appName
,
userName
,
sn
,
status
);
int
total
=
records
.
getTotal
();
int
total
=
records
.
getTotal
();
int
pages
=
total
/
pageSize
;
//pages为总页数
int
pages
=
total
/
pageSize
;
//pages为总页数
int
mod
=
total
%
pageSize
;
int
mod
=
total
%
pageSize
;
...
...
license/src/main/java/iot/sixiang/license/controller/LoginController.java
View file @
6f87e226
...
@@ -14,6 +14,7 @@ import iot.sixiang.license.mapper.UserMapper;
...
@@ -14,6 +14,7 @@ import iot.sixiang.license.mapper.UserMapper;
import
iot.sixiang.license.model.BaseResult
;
import
iot.sixiang.license.model.BaseResult
;
import
iot.sixiang.license.model.ResResult
;
import
iot.sixiang.license.model.ResResult
;
import
iot.sixiang.license.model.dto.CheckCodeDto
;
import
iot.sixiang.license.model.dto.CheckCodeDto
;
import
iot.sixiang.license.model.vo.LoginReqVo
;
import
iot.sixiang.license.model.vo.LoginVo
;
import
iot.sixiang.license.model.vo.LoginVo
;
import
iot.sixiang.license.model.vo.UserResetPwdVo
;
import
iot.sixiang.license.model.vo.UserResetPwdVo
;
import
iot.sixiang.license.service.UserService
;
import
iot.sixiang.license.service.UserService
;
...
@@ -23,6 +24,8 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -23,6 +24,8 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
license/src/main/java/iot/sixiang/license/forward/ForwardClient.java
View file @
6f87e226
...
@@ -45,8 +45,8 @@ public class ForwardClient {
...
@@ -45,8 +45,8 @@ public class ForwardClient {
}
}
}
}
public
void
startTcp
(
String
host
,
int
port
,
String
appId
)
{
public
void
startTcp
(
String
host
,
int
port
,
String
sn
)
{
log
.
debug
(
"桥接客户端,开始连接桥接服务:{},{},{}"
,
host
,
port
,
appId
);
log
.
debug
(
"桥接客户端,开始连接桥接服务:{},{},{}"
,
host
,
port
,
sn
);
ForwardConnectionListener
listener
=
new
ForwardConnectionListener
();
ForwardConnectionListener
listener
=
new
ForwardConnectionListener
();
listener
.
setSn
(
sn
);
listener
.
setSn
(
sn
);
listener
.
setHost
(
host
);
listener
.
setHost
(
host
);
...
...
license/src/main/java/iot/sixiang/license/jwt/JwtFilter.java
View file @
6f87e226
...
@@ -10,6 +10,7 @@ import javax.servlet.Filter;
...
@@ -10,6 +10,7 @@ import javax.servlet.Filter;
import
javax.servlet.FilterChain
;
import
javax.servlet.FilterChain
;
import
javax.servlet.FilterConfig
;
import
javax.servlet.FilterConfig
;
import
javax.servlet.ServletException
;
import
javax.servlet.ServletException
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.ServletRequest
;
import
javax.servlet.ServletRequest
;
import
javax.servlet.ServletResponse
;
import
javax.servlet.ServletResponse
;
import
javax.servlet.annotation.WebFilter
;
import
javax.servlet.annotation.WebFilter
;
...
...
license/src/main/java/iot/sixiang/license/service/impl/TerminalDeviceServiceImpl.java
View file @
6f87e226
...
@@ -54,7 +54,7 @@ public class TerminalDeviceServiceImpl implements TerminalDeviceService {
...
@@ -54,7 +54,7 @@ public class TerminalDeviceServiceImpl implements TerminalDeviceService {
user
.
setUserId
(
appId
);
user
.
setUserId
(
appId
);
user
.
setUserName
(
sn
);
user
.
setUserName
(
sn
);
String
token
=
JwtUtil
.
createToken
(
user
);
String
token
=
JwtUtil
.
createToken
(
user
);
return
ResResult
.
success
().
r
ecord
(
token
);
return
ResResult
.
success
().
goR
ecord
(
token
);
}
else
{
}
else
{
return
ResResult
.
validate_failed
();
return
ResResult
.
validate_failed
();
}
}
...
...
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