Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
ece2881b
Commit
ece2881b
authored
Jun 16, 2022
by
南千昊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
程序后台下未接到音视频通话记录返回
parent
4e44f341
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
69 additions
and
15 deletions
+69
-15
core/src/main/java/com/wecloud/im/action/RtcAction.java
+2
-2
core/src/main/java/com/wecloud/im/controller/ImRtcRecordController.java
+4
-7
core/src/main/java/com/wecloud/im/service/ImRtcRecordService.java
+1
-1
core/src/main/java/com/wecloud/im/service/impl/ImRtcRecordServiceImpl.java
+2
-2
im-sdk/src/main/java/com/wecloud/im/sdk/ResourcePathConstants.java
+5
-0
im-sdk/src/main/java/com/wecloud/im/sdk/WecloudIm.java
+9
-0
im-sdk/src/main/java/com/wecloud/im/sdk/WecloudImClient.java
+7
-0
im-sdk/src/main/java/com/wecloud/im/sdk/internal/WecloudImRtcRecordOperation.java
+18
-3
im-sdk/src/main/java/com/wecloud/im/sdk/model/MissedRtcRecordParam.java
+21
-0
No files found.
core/src/main/java/com/wecloud/im/action/RtcAction.java
View file @
ece2881b
...
...
@@ -86,8 +86,8 @@ public class RtcAction {
@ApiOperation
(
"未接音视频"
)
@ActionMapping
(
"/missedConversation"
)
public
WsResponse
<
MissedRtcRecordVO
>
missedConversation
(){
MissedRtcRecordVO
missedRtcRecord
=
rtcRecordService
.
getMissedRtcRecord
();
public
WsResponse
<
MissedRtcRecordVO
>
missedConversation
(
String
userId
){
MissedRtcRecordVO
missedRtcRecord
=
rtcRecordService
.
getMissedRtcRecord
(
userId
);
return
WsResponse
.
ok
(
missedRtcRecord
);
}
}
core/src/main/java/com/wecloud/im/controller/ImRtcRecordController.java
View file @
ece2881b
...
...
@@ -12,10 +12,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
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
;
import
org.springframework.web.bind.annotation.*
;
/**
* @author nanqianhao
...
...
@@ -39,9 +36,9 @@ public class ImRtcRecordController extends BaseController {
}
@ApiOperation
(
"未接音视频"
)
@
Pos
tMapping
(
"/missedConversation"
)
ApiResult
<
MissedRtcRecordVO
>
missedConversation
(){
MissedRtcRecordVO
missedRtcRecord
=
rtcRecordService
.
getMissedRtcRecord
();
@
Ge
tMapping
(
"/missedConversation"
)
ApiResult
<
MissedRtcRecordVO
>
missedConversation
(
@RequestParam
(
"userId"
)
String
userId
){
MissedRtcRecordVO
missedRtcRecord
=
rtcRecordService
.
getMissedRtcRecord
(
userId
);
// 如果没有记录 则状态为4
if
(
missedRtcRecord
==
null
){
MissedRtcRecordVO
missedRtcRecordVO
=
new
MissedRtcRecordVO
();
...
...
core/src/main/java/com/wecloud/im/service/ImRtcRecordService.java
View file @
ece2881b
...
...
@@ -40,5 +40,5 @@ public interface ImRtcRecordService extends BaseService<ImRtcRecord> {
/**
* 获取应用后台下未接受的音视频通话
*/
MissedRtcRecordVO
getMissedRtcRecord
();
MissedRtcRecordVO
getMissedRtcRecord
(
String
userId
);
}
core/src/main/java/com/wecloud/im/service/impl/ImRtcRecordServiceImpl.java
View file @
ece2881b
...
...
@@ -121,8 +121,8 @@ public class ImRtcRecordServiceImpl extends BaseServiceImpl<ImRtcRecordMapper, I
}
@Override
public
MissedRtcRecordVO
getMissedRtcRecord
()
{
ImClient
currentClient
=
imClientService
.
getC
urrentClient
(
);
public
MissedRtcRecordVO
getMissedRtcRecord
(
String
userId
)
{
ImClient
currentClient
=
imClientService
.
getC
acheImClient
(
SecurityUtils
.
getCurrentAppId
(),
userId
);
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)
-
1
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
...
...
im-sdk/src/main/java/com/wecloud/im/sdk/ResourcePathConstants.java
View file @
ece2881b
...
...
@@ -187,4 +187,9 @@ public class ResourcePathConstants {
public
static
final
String
ADD_OR_MODIFY_CONVERSATION_ATTRIBUTE_REQUEST
=
"/api/conversation/sdk"
+
"/addOrModifyAttribute"
;
/**
* 后台状态下未接到音视频判断
*/
public
static
final
String
GET_MISSED_RTCRECORD
=
"/api/rtcRecord/missedConversation"
;
}
im-sdk/src/main/java/com/wecloud/im/sdk/WecloudIm.java
View file @
ece2881b
...
...
@@ -395,4 +395,13 @@ public interface WecloudIm {
* @Return
*/
Boolean
singleUserNotification
(
SingleUserNotification
singleUserNotification
);
/**
* 后台状态下未接到音视频判断
* @Author nanqianhao
* @Date 2022年05月25日 09:36:47
* @param
* @Return
*/
MissedRtcRecord
getMissedRtcRecord
(
String
UserId
);
}
im-sdk/src/main/java/com/wecloud/im/sdk/WecloudImClient.java
View file @
ece2881b
...
...
@@ -358,6 +358,13 @@ public class WecloudImClient implements WecloudIm {
return
imSystemNotificationOperation
.
singleUserNotification
(
singleUserNotificationRequest
);
}
@Override
public
MissedRtcRecord
getMissedRtcRecord
(
String
UserId
)
{
MissedRtcRecordParam
missedRtcRecordParam
=
MissedRtcRecordParam
.
builder
().
userId
(
UserId
).
build
();
return
imRtcRecordOperation
.
getMissedRtcRecord
(
missedRtcRecordParam
);
}
private
void
initOperations
()
{
this
.
imUserOperation
=
new
WecloudImUserOperation
(
apiDomain
,
appKey
,
appSecret
);
...
...
im-sdk/src/main/java/com/wecloud/im/sdk/internal/WecloudImRtcRecordOperation.java
View file @
ece2881b
...
...
@@ -4,14 +4,13 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.TypeReference
;
import
com.wecloud.im.sdk.common.HttpMethod
;
import
com.wecloud.im.sdk.common.RequestMessage
;
import
com.wecloud.im.sdk.model.ImRtcRecord
;
import
com.wecloud.im.sdk.model.PageResult
;
import
com.wecloud.im.sdk.model.RtcRecordRequest
;
import
com.wecloud.im.sdk.model.*
;
import
java.net.URL
;
import
java.util.HashMap
;
import
java.util.Map
;
import
static
com
.
wecloud
.
im
.
sdk
.
ResourcePathConstants
.
GET_MISSED_RTCRECORD
;
import
static
com
.
wecloud
.
im
.
sdk
.
ResourcePathConstants
.
LIST_RTC_RECORDS_REQUEST
;
/**
...
...
@@ -59,5 +58,21 @@ public class WecloudImRtcRecordOperation extends WecloudImOperation {
return
rtcRecords
;
}
public
MissedRtcRecord
getMissedRtcRecord
(
MissedRtcRecordParam
missedRtcRecordParam
){
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"userId"
,
missedRtcRecordParam
.
getUserId
()+
""
);
// 发送请求
RequestMessage
request
=
new
WecloudRequestMessageBuilder
().
setEndpoint
(
GET_MISSED_RTCRECORD
)
.
setMethod
(
HttpMethod
.
GET
).
setParameters
(
param
)
.
setOriginalRequest
(
missedRtcRecordParam
).
build
();
Object
result
=
doOperation
(
request
);
TypeReference
<
MissedRtcRecord
>
typeReference
=
new
TypeReference
<
MissedRtcRecord
>()
{
};
MissedRtcRecord
rtcRecords
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
result
),
typeReference
);
return
rtcRecords
;
}
}
im-sdk/src/main/java/com/wecloud/im/sdk/model/MissedRtcRecordParam.java
0 → 100644
View file @
ece2881b
package
com
.
wecloud
.
im
.
sdk
.
model
;
import
lombok.Builder
;
import
lombok.Getter
;
import
lombok.Setter
;
/**
* @author nanqianhao
* @date 2022/6/16
* @apiNote
*/
@Getter
@Setter
@Builder
public
class
MissedRtcRecordParam
extends
WebServiceRequest
{
/**
* 用户id
*/
private
String
userId
;
}
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