Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c60328ab
authored
Nov 17, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:声网token
parent
30068236
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
server-module/src/main/java/com/makeit/module/controller/alarm/PlatAlarmRecordController.java
server-service/src/main/java/com/makeit/service/platform/alarm/PlatAlarmRecordService.java
server-service/src/main/java/com/makeit/service/platform/alarm/impl/PlatAlarmRecordServiceImpl.java
server-module/src/main/java/com/makeit/module/controller/alarm/PlatAlarmRecordController.java
View file @
c60328ab
...
@@ -80,14 +80,14 @@ public class PlatAlarmRecordController {
...
@@ -80,14 +80,14 @@ public class PlatAlarmRecordController {
@ApiOperation
(
"呼叫设备rtm"
)
@ApiOperation
(
"呼叫设备rtm"
)
@PostMapping
(
"callingDeviceAuthRtm"
)
@PostMapping
(
"callingDeviceAuthRtm"
)
@AuthIgnore
@AuthIgnore
public
ApiResponseEntity
<
PlatAlarmCallDeviceVO
>
callingDeviceAuthRtm
(
@RequestBody
BaseIdDTO
baseIdDTO
)
{
public
ApiResponseEntity
<
PlatAlarmCallDeviceVO
>
callingDeviceAuthRtm
(
@RequestBody
BaseIdDTO
baseIdDTO
)
throws
Exception
{
return
ApiResponseUtils
.
success
(
platAlarmRecordService
.
callingDeviceAuthIgnoreRtm
(
baseIdDTO
.
getId
()));
return
ApiResponseUtils
.
success
(
platAlarmRecordService
.
callingDeviceAuthIgnoreRtm
(
baseIdDTO
.
getId
()));
}
}
@ApiOperation
(
"呼叫设备rtm"
)
@ApiOperation
(
"呼叫设备rtm"
)
@PostMapping
(
"callingDeviceAuthIgnoreRtm"
)
@PostMapping
(
"callingDeviceAuthIgnoreRtm"
)
@AuthIgnore
@AuthIgnore
public
ApiResponseEntity
<
PlatAlarmCallDeviceVO
>
callingDeviceAuthIgnoreRtm
(
@RequestBody
BaseIdDTO
baseIdDTO
)
{
public
ApiResponseEntity
<
PlatAlarmCallDeviceVO
>
callingDeviceAuthIgnoreRtm
(
@RequestBody
BaseIdDTO
baseIdDTO
)
throws
Exception
{
return
ApiResponseUtils
.
success
(
platAlarmRecordService
.
callingDeviceAuthIgnoreRtm
(
baseIdDTO
.
getId
()));
return
ApiResponseUtils
.
success
(
platAlarmRecordService
.
callingDeviceAuthIgnoreRtm
(
baseIdDTO
.
getId
()));
}
}
...
...
server-service/src/main/java/com/makeit/service/platform/alarm/PlatAlarmRecordService.java
View file @
c60328ab
...
@@ -71,5 +71,5 @@ public interface PlatAlarmRecordService extends IService<PlatAlarmRecord> {
...
@@ -71,5 +71,5 @@ public interface PlatAlarmRecordService extends IService<PlatAlarmRecord> {
PlatAlarmCallDeviceVO
callingDevice
();
PlatAlarmCallDeviceVO
callingDevice
();
PlatAlarmCallDeviceVO
callingDeviceAuthIgnoreRtm
(
String
id
);
PlatAlarmCallDeviceVO
callingDeviceAuthIgnoreRtm
(
String
id
)
throws
Exception
;
}
}
server-service/src/main/java/com/makeit/service/platform/alarm/impl/PlatAlarmRecordServiceImpl.java
View file @
c60328ab
...
@@ -42,6 +42,7 @@ import com.makeit.service.platform.space.PlatRoomBedDeviceService;
...
@@ -42,6 +42,7 @@ import com.makeit.service.platform.space.PlatRoomBedDeviceService;
import
com.makeit.service.platform.space.PlatRoomService
;
import
com.makeit.service.platform.space.PlatRoomService
;
import
com.makeit.service.saas.PlatTenantService
;
import
com.makeit.service.saas.PlatTenantService
;
import
com.makeit.shengwang.agora.media.RtcTokenBuilder2
;
import
com.makeit.shengwang.agora.media.RtcTokenBuilder2
;
import
com.makeit.shengwang.agora.rtm.RtmTokenBuilder
;
import
com.makeit.shengwang.agora.rtm.RtmTokenBuilder2
;
import
com.makeit.shengwang.agora.rtm.RtmTokenBuilder2
;
import
com.makeit.utils.data.convert.BeanDtoVoUtils
;
import
com.makeit.utils.data.convert.BeanDtoVoUtils
;
import
com.makeit.utils.data.convert.PageUtil
;
import
com.makeit.utils.data.convert.PageUtil
;
...
@@ -589,16 +590,16 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
...
@@ -589,16 +590,16 @@ public class PlatAlarmRecordServiceImpl extends ServiceImpl<PlatAlarmRecordMappe
}
}
@Override
@Override
public
PlatAlarmCallDeviceVO
callingDeviceAuthIgnoreRtm
(
String
id
)
{
public
PlatAlarmCallDeviceVO
callingDeviceAuthIgnoreRtm
(
String
id
)
throws
Exception
{
RtmTokenBuilder2
token
=
new
RtmTokenBuilder2
();
RtmTokenBuilder2
token
=
new
RtmTokenBuilder2
();
String
result
=
token
.
buildToken
(
shengwangProperties
.
getAppId
(),
shengwangProperties
.
getAppCertificate
(),
id
,
shengwangProperties
.
getTokenExpirationInSeconds
());
RtmTokenBuilder
token2
=
new
RtmTokenBuilder
();
String
result2
=
token2
.
buildToken
(
shengwangProperties
.
getAppId
(),
shengwangProperties
.
getAppCertificate
(),
"0"
,
RtmTokenBuilder
.
Role
.
Rtm_User
,
shengwangProperties
.
getTokenExpirationInSeconds
());
//String result = token.buildToken(shengwangProperties.getAppId(), shengwangProperties.getAppCertificate(), id, shengwangProperties.getTokenExpirationInSeconds());
PlatAlarmCallDeviceVO
platAlarmCallDeviceVO
=
new
PlatAlarmCallDeviceVO
();
PlatAlarmCallDeviceVO
platAlarmCallDeviceVO
=
new
PlatAlarmCallDeviceVO
();
platAlarmCallDeviceVO
.
setAccessToken
(
result
);
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
now
=
LocalDateTime
.
now
();
DateTimeFormatter
dateTimeFormatter
=
DateTimeFormatter
.
ofPattern
(
"yyyyMMddHHmmss"
);
DateTimeFormatter
dateTimeFormatter
=
DateTimeFormatter
.
ofPattern
(
"yyyyMMddHHmmss"
);
String
format
=
now
.
format
(
dateTimeFormatter
);
String
format
=
now
.
format
(
dateTimeFormatter
);
platAlarmCallDeviceVO
.
setAccessToken
(
result
);
platAlarmCallDeviceVO
.
setAccessToken
(
result
2
);
platAlarmCallDeviceVO
.
setChannelName
(
format
);
platAlarmCallDeviceVO
.
setChannelName
(
format
);
return
platAlarmCallDeviceVO
;
return
platAlarmCallDeviceVO
;
}
}
...
...
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