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
be730734
Commit
be730734
authored
Nov 28, 2022
by
AfirSraftGarrier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绑定完善
parent
e4d2d03d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
7 deletions
+19
-7
TerminalDeviceController.java
.../sixiang/license/controller/TerminalDeviceController.java
+6
-2
DeviceManager.java
...c/main/java/iot/sixiang/license/device/DeviceManager.java
+5
-3
TerminalDeviceService.java
...va/iot/sixiang/license/service/TerminalDeviceService.java
+1
-1
TerminalDeviceServiceImpl.java
...xiang/license/service/impl/TerminalDeviceServiceImpl.java
+7
-1
No files found.
license/src/main/java/iot/sixiang/license/controller/TerminalDeviceController.java
View file @
be730734
...
...
@@ -9,7 +9,11 @@ import iot.sixiang.license.model.dto.ReportErrorMsgDTO;
import
iot.sixiang.license.model.dto.TerminalDevieBindDTO
;
import
iot.sixiang.license.service.TerminalDeviceService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
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.RestController
;
@RestController
@RequestMapping
(
"/iot_license/terminal_device"
)
...
...
@@ -33,6 +37,6 @@ public class TerminalDeviceController {
@PostMapping
(
"/bind"
)
@ApiOperation
(
value
=
"终端设备绑定接口"
,
notes
=
"终端设备绑定接口"
)
public
BaseResult
terminalDevieBind
(
@RequestBody
TerminalDevieBindDTO
terminalDevieBindDTO
)
{
return
terminalDeviceService
.
terminalDevieBind
(
terminalDevieBindDTO
);
return
terminalDeviceService
.
terminalDevi
c
eBind
(
terminalDevieBindDTO
);
}
}
license/src/main/java/iot/sixiang/license/device/DeviceManager.java
View file @
be730734
...
...
@@ -13,14 +13,16 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
@Component
@Slf4j
public
class
DeviceManager
{
private
Map
<
String
,
SessionContext
>
sessionContexts
=
null
;
private
DeviceChannelInitializer
channelInitializer
;
private
TcpServer
server
=
null
;
...
...
license/src/main/java/iot/sixiang/license/service/TerminalDeviceService.java
View file @
be730734
...
...
@@ -11,5 +11,5 @@ public interface TerminalDeviceService {
BaseResult
reportErrorMsg
(
ReportErrorMsgDTO
reportErrorMsgDTO
);
BaseResult
terminalDevieBind
(
TerminalDevieBindDTO
terminalDevieBindDTO
);
BaseResult
terminalDevi
c
eBind
(
TerminalDevieBindDTO
terminalDevieBindDTO
);
}
license/src/main/java/iot/sixiang/license/service/impl/TerminalDeviceServiceImpl.java
View file @
be730734
package
iot
.
sixiang
.
license
.
service
.
impl
;
import
iot.sixiang.license.auth.AuthManager
;
import
iot.sixiang.license.device.DeviceManager
;
import
iot.sixiang.license.handler.IotLicenseException
;
import
iot.sixiang.license.jwt.JwtUtil
;
import
iot.sixiang.license.jwt.LoginUser
;
...
...
@@ -17,6 +18,8 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
@Slf4j
@Service
public
class
TerminalDeviceServiceImpl
implements
TerminalDeviceService
{
...
...
@@ -26,6 +29,8 @@ public class TerminalDeviceServiceImpl implements TerminalDeviceService {
private
DeviceService
deviceService
;
@Autowired
private
PmsUseService
pmsUseService
;
@Resource
private
DeviceManager
deviceManager
;
@Override
public
ResResult
getToken
(
GetTerminalDeviceTokenDTO
getTerminalDeviceTokenDTO
)
{
...
...
@@ -68,7 +73,7 @@ public class TerminalDeviceServiceImpl implements TerminalDeviceService {
}
@Override
public
BaseResult
terminalDevieBind
(
TerminalDevieBindDTO
terminalDevieBindDTO
)
{
public
BaseResult
terminalDevi
c
eBind
(
TerminalDevieBindDTO
terminalDevieBindDTO
)
{
String
sn
=
terminalDevieBindDTO
.
getSn
();
String
snBind
=
terminalDevieBindDTO
.
getSnBind
();
if
(
StringUtils
.
isEmpty
(
sn
)
||
StringUtils
.
isEmpty
(
snBind
))
{
...
...
@@ -76,6 +81,7 @@ public class TerminalDeviceServiceImpl implements TerminalDeviceService {
}
Boolean
res
=
deviceService
.
terminalDevieBind
(
terminalDevieBindDTO
);
if
(
res
)
{
deviceManager
.
initDevices
();
return
BaseResult
.
success
();
}
else
{
return
BaseResult
.
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