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
325bc153
Commit
325bc153
authored
Nov 30, 2022
by
马33
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加解绑接口
parent
31253801
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
1 deletion
+57
-1
TerminalDeviceController.java
.../sixiang/license/controller/TerminalDeviceController.java
+7
-0
TerminalDevieUnBindDTO.java
...iot/sixiang/license/model/dto/TerminalDevieUnBindDTO.java
+10
-0
DeviceService.java
.../main/java/iot/sixiang/license/service/DeviceService.java
+3
-0
TerminalDeviceService.java
...va/iot/sixiang/license/service/TerminalDeviceService.java
+3
-0
DeviceServiceImpl.java
...a/iot/sixiang/license/service/impl/DeviceServiceImpl.java
+18
-1
TerminalDeviceServiceImpl.java
...xiang/license/service/impl/TerminalDeviceServiceImpl.java
+16
-0
No files found.
license/src/main/java/iot/sixiang/license/controller/TerminalDeviceController.java
View file @
325bc153
...
...
@@ -7,6 +7,7 @@ import iot.sixiang.license.model.ResResult;
import
iot.sixiang.license.model.dto.GetTerminalDeviceTokenDTO
;
import
iot.sixiang.license.model.dto.ReportErrorMsgDTO
;
import
iot.sixiang.license.model.dto.TerminalDevieBindDTO
;
import
iot.sixiang.license.model.dto.TerminalDevieUnBindDTO
;
import
iot.sixiang.license.service.TerminalDeviceService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -41,4 +42,10 @@ public class TerminalDeviceController {
public
BaseResult
terminalDevieBind
(
@RequestBody
TerminalDevieBindDTO
terminalDevieBindDTO
)
{
return
terminalDeviceService
.
terminalDeviceBind
(
terminalDevieBindDTO
);
}
@PostMapping
(
"/unbind"
)
@ApiOperation
(
value
=
"终端设备解绑接口"
,
notes
=
"终端设备解绑接口"
)
public
BaseResult
terminalDevieunBind
(
@RequestBody
TerminalDevieUnBindDTO
terminalDevieUnBindDTO
)
{
return
terminalDeviceService
.
terminalDeviceunBind
(
terminalDevieUnBindDTO
);
}
}
license/src/main/java/iot/sixiang/license/model/dto/TerminalDevieUnBindDTO.java
0 → 100644
View file @
325bc153
package
iot
.
sixiang
.
license
.
model
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
TerminalDevieUnBindDTO
{
@ApiModelProperty
(
"设备SN"
)
private
String
snBind
;
}
license/src/main/java/iot/sixiang/license/service/DeviceService.java
View file @
325bc153
...
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
iot.sixiang.license.entity.Device
;
import
iot.sixiang.license.model.PageInfoModel
;
import
iot.sixiang.license.model.dto.TerminalDevieBindDTO
;
import
iot.sixiang.license.model.dto.TerminalDevieUnBindDTO
;
import
iot.sixiang.license.model.vo.DeviceVo
;
/**
...
...
@@ -18,4 +19,6 @@ public interface DeviceService extends IService<Device> {
boolean
addDevice
(
String
appId
,
int
count
);
Boolean
terminalDevieBind
(
TerminalDevieBindDTO
terminalDevieBindDTO
);
Boolean
terminalDevieunBind
(
TerminalDevieUnBindDTO
terminalDevieUnBindDTO
);
}
license/src/main/java/iot/sixiang/license/service/TerminalDeviceService.java
View file @
325bc153
...
...
@@ -5,6 +5,7 @@ import iot.sixiang.license.model.ResResult;
import
iot.sixiang.license.model.dto.GetTerminalDeviceTokenDTO
;
import
iot.sixiang.license.model.dto.ReportErrorMsgDTO
;
import
iot.sixiang.license.model.dto.TerminalDevieBindDTO
;
import
iot.sixiang.license.model.dto.TerminalDevieUnBindDTO
;
import
java.util.List
;
...
...
@@ -14,4 +15,6 @@ public interface TerminalDeviceService {
BaseResult
reportErrorMsg
(
List
<
ReportErrorMsgDTO
>
reportErrorMsgDTO
);
BaseResult
terminalDeviceBind
(
TerminalDevieBindDTO
terminalDevieBindDTO
);
BaseResult
terminalDeviceunBind
(
TerminalDevieUnBindDTO
terminalDevieUnBindDTO
);
}
license/src/main/java/iot/sixiang/license/service/impl/DeviceServiceImpl.java
View file @
325bc153
...
...
@@ -9,6 +9,7 @@ import iot.sixiang.license.handler.IotLicenseException;
import
iot.sixiang.license.mapper.DeviceMapper
;
import
iot.sixiang.license.model.PageInfoModel
;
import
iot.sixiang.license.model.dto.TerminalDevieBindDTO
;
import
iot.sixiang.license.model.dto.TerminalDevieUnBindDTO
;
import
iot.sixiang.license.model.vo.DeviceVo
;
import
iot.sixiang.license.service.DeviceService
;
import
iot.sixiang.license.util.CommonUtil
;
...
...
@@ -94,7 +95,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
device
.
setStatus
(
1
);
device
.
setUpdateTime
(
new
Date
());
int
res
=
deviceMapper
.
updateById
(
device
);
if
(
res
>
=
0
)
{
if
(
res
>
0
)
{
return
true
;
}
else
{
return
false
;
...
...
@@ -102,4 +103,20 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
}
return
false
;
}
@Override
public
Boolean
terminalDevieunBind
(
TerminalDevieUnBindDTO
terminalDevieUnBindDTO
)
{
String
snBind
=
terminalDevieUnBindDTO
.
getSnBind
();
LambdaQueryWrapper
<
Device
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
Device:
:
getSnBind
,
snBind
).
last
(
"limit 1"
);
Device
device
=
deviceMapper
.
selectOne
(
queryWrapper
);
if
(
device
!=
null
)
{
device
.
setSnBind
(
null
);
device
.
setStatus
(
0
);
device
.
setUpdateTime
(
new
Date
());
int
res
=
deviceMapper
.
updateById
(
device
);
return
res
>
0
;
}
return
false
;
}
}
license/src/main/java/iot/sixiang/license/service/impl/TerminalDeviceServiceImpl.java
View file @
325bc153
...
...
@@ -10,6 +10,7 @@ import iot.sixiang.license.model.ResResult;
import
iot.sixiang.license.model.dto.GetTerminalDeviceTokenDTO
;
import
iot.sixiang.license.model.dto.ReportErrorMsgDTO
;
import
iot.sixiang.license.model.dto.TerminalDevieBindDTO
;
import
iot.sixiang.license.model.dto.TerminalDevieUnBindDTO
;
import
iot.sixiang.license.service.DeviceService
;
import
iot.sixiang.license.service.PmsUseService
;
import
iot.sixiang.license.service.TerminalDeviceService
;
...
...
@@ -107,4 +108,19 @@ public class TerminalDeviceServiceImpl implements TerminalDeviceService {
return
BaseResult
.
failed
();
}
}
@Override
public
BaseResult
terminalDeviceunBind
(
TerminalDevieUnBindDTO
terminalDevieUnBindDTO
)
{
String
snBind
=
terminalDevieUnBindDTO
.
getSnBind
();
if
(
StringUtils
.
isEmpty
(
snBind
))
{
return
BaseResult
.
validate_failed
();
}
Boolean
res
=
deviceService
.
terminalDevieunBind
(
terminalDevieUnBindDTO
);
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