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
c88db01a
Commit
c88db01a
authored
Jun 10, 2022
by
吴星煌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码规范问题
parent
500fa5ae
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
110 additions
and
32 deletions
+110
-32
client/src/main/java/com/wecloud/imserver/client/api/ImOverview.java
+32
-9
client/src/main/java/com/wecloud/imserver/client/model/ao/ImOverviewAO.java
+26
-0
client/src/main/java/com/wecloud/imserver/client/model/ao/ImRtcOverviewAo.java
+22
-0
core/src/main/java/com/wecloud/im/appmanager/ImOverviewImpl.java
+30
-23
No files found.
client/src/main/java/com/wecloud/imserver/client/api/ImOverview.java
View file @
c88db01a
package
com
.
wecloud
.
imserver
.
client
.
api
;
import
com.wecloud.imserver.client.model.ao.ImOverviewAO
;
import
com.wecloud.imserver.client.model.ao.ImRtcOverviewAo
;
import
com.wecloud.imserver.client.model.dto.Result
;
import
com.wecloud.imserver.client.model.vo.LineChart
;
import
com.wecloud.imserver.client.model.vo.OverviewVo
;
import
com.wecloud.imserver.client.model.vo.RtcRecordVo
;
import
com.wecloud.imserver.client.model.vo.StatisticsVo
;
import
java.time.LocalDateTime
;
import
java.util.List
;
/**
* @author wxh
*/
public
interface
ImOverview
{
/
/服务概览
OverviewVo
overview
(
Long
appId
);
//数据统计中的业务统计
StatisticsVo
groupStatistics
(
Long
appId
,
LocalDateTime
start
,
LocalDateTime
end
);
//用户统计折线图
List
<
LineChart
>
activeUser
(
Long
appId
,
LocalDateTime
start
,
LocalDateTime
en
d
);
/
**
* 服务概览
* @param appId
* @return
*/
Result
<
OverviewVo
>
overview
(
Long
appI
d
);
//音视频资讯的数量统计
RtcRecordVo
RtcStatistics
(
Long
appId
,
LocalDateTime
date
);
/**
* 数据统计中的业务统计
* @param imOverviewAo
* @return
*/
Result
<
StatisticsVo
>
groupStatistics
(
ImOverviewAO
imOverviewAo
);
/**
* 用户统计折线图
* @param imOverviewAo
* @return
*/
Result
<
List
<
LineChart
>>
activeUser
(
ImOverviewAO
imOverviewAo
);
/**
* 音视频资讯的数量统计
* @param imrtcOverviewAo
* @return
*/
Result
<
RtcRecordVo
>
rtcStatistics
(
ImRtcOverviewAo
imrtcOverviewAo
);
}
client/src/main/java/com/wecloud/imserver/client/model/ao/ImOverviewAO.java
0 → 100644
View file @
c88db01a
package
com
.
wecloud
.
imserver
.
client
.
model
.
ao
;
import
lombok.Data
;
import
java.time.LocalDateTime
;
/**
* @author wxh
*/
@Data
public
class
ImOverviewAO
extends
BaseAO
{
/**
* appId
*/
private
Long
appId
;
/**
* 查询开始时间
*/
private
LocalDateTime
start
;
/**
* 查询结束时间
*/
private
LocalDateTime
end
;
}
client/src/main/java/com/wecloud/imserver/client/model/ao/ImRtcOverviewAo.java
0 → 100644
View file @
c88db01a
package
com
.
wecloud
.
imserver
.
client
.
model
.
ao
;
import
lombok.Data
;
import
java.time.LocalDateTime
;
/**
* @author wxh
*/
@Data
public
class
ImRtcOverviewAo
extends
BaseAO
{
/**
* appId
*/
private
Long
appId
;
/**
* 查询开始时间
*/
private
LocalDateTime
start
;
}
core/src/main/java/com/wecloud/im/appmanager/ImOverviewImpl.java
View file @
c88db01a
...
...
@@ -6,6 +6,9 @@ import com.wecloud.im.sdk.enums.ChatTypeEnum;
import
com.wecloud.im.service.*
;
import
com.wecloud.im.ws.enums.MsgTypeEnum
;
import
com.wecloud.imserver.client.api.ImOverview
;
import
com.wecloud.imserver.client.model.ao.ImOverviewAO
;
import
com.wecloud.imserver.client.model.ao.ImRtcOverviewAo
;
import
com.wecloud.imserver.client.model.dto.Result
;
import
com.wecloud.imserver.client.model.vo.LineChart
;
import
com.wecloud.imserver.client.model.vo.OverviewVo
;
import
com.wecloud.imserver.client.model.vo.RtcRecordVo
;
...
...
@@ -40,7 +43,7 @@ public class ImOverviewImpl implements ImOverview {
private
ImRtcTranscribeService
imRtcTranscribeService
;
@Override
public
OverviewVo
overview
(
Long
appId
)
{
public
Result
<
OverviewVo
>
overview
(
Long
appId
)
{
log
.
info
(
"即时通讯服务概览的入参appId为{}"
,
appId
);
OverviewVo
overviewVo
=
new
OverviewVo
();
//今日活跃用户
...
...
@@ -85,12 +88,14 @@ public class ImOverviewImpl implements ImOverview {
log
.
info
(
"即时通讯服务概览的总群组数量为{}"
,
activeGroup
);
log
.
info
(
"即时通讯服务概览的返回参数为{}"
,
overviewVo
);
return
overviewVo
;
return
Result
.
getSuccessResult
(
overviewVo
)
;
}
@Override
public
StatisticsVo
groupStatistics
(
Long
appId
,
LocalDateTime
start
,
LocalDateTime
end
)
{
log
.
info
(
"即时通讯数据统计的业务统计的appId为{}"
,
appId
);
public
Result
<
StatisticsVo
>
groupStatistics
(
ImOverviewAO
imOverviewAo
)
{
log
.
info
(
"即时通讯数据统计的业务统计的appId为{}"
,
imOverviewAo
.
getAppId
());
LocalDateTime
start
=
imOverviewAo
.
getStart
();
LocalDateTime
end
=
imOverviewAo
.
getEnd
();
if
(
start
==
null
&&
end
==
null
){
start
=
LocalDateTime
.
of
(
LocalDate
.
now
(),
LocalTime
.
MIN
).
minusDays
(
8
);
end
=
start
.
plusDays
(
7
);
...
...
@@ -99,7 +104,7 @@ public class ImOverviewImpl implements ImOverview {
StatisticsVo
statisticsVo
=
new
StatisticsVo
();
//活跃群组数(前1天)
ImStatistics
statistics
=
imStatisticsService
.
getOne
(
new
LambdaQueryWrapper
<
ImStatistics
>()
.
eq
(
ImStatistics:
:
getFkAppid
,
appId
)
.
eq
(
ImStatistics:
:
getFkAppid
,
imOverviewAo
.
getAppId
()
)
.
eq
(
ImStatistics:
:
getType
,
2
)
.
between
(
ImStatistics:
:
getTime
,
LocalDateTime
.
of
(
LocalDate
.
now
(),
LocalTime
.
MIN
).
minusDays
(
1
),
...
...
@@ -110,7 +115,7 @@ public class ImOverviewImpl implements ImOverview {
log
.
info
(
"即时通讯数据统计的业务统计的活跃群组数为{}"
,
activeGroup
);
//新增群组数(前1天)
Integer
newGroup
=
imConversationService
.
count
(
new
LambdaQueryWrapper
<
ImConversation
>()
.
eq
(
ImConversation:
:
getFkAppid
,
appId
)
.
eq
(
ImConversation:
:
getFkAppid
,
imOverviewAo
.
getAppId
()
)
.
eq
(
ImConversation:
:
getChatType
,
ChatTypeEnum
.
NORMAL_GROUP
.
getCode
())
.
eq
(
ImConversation:
:
getChatType
,
ChatTypeEnum
.
THOUSAND_GROUP
.
getCode
())
.
between
(
ImConversation:
:
getCreateTime
,
...
...
@@ -121,7 +126,7 @@ public class ImOverviewImpl implements ImOverview {
log
.
info
(
"即时通讯数据统计的业务统计的新增群组数为{}"
,
newGroup
);
//解散群组数(前一天)
Integer
dismissGroup
=
imMessageService
.
count
(
new
LambdaQueryWrapper
<
ImMessage
>()
.
eq
(
ImMessage:
:
getFkAppid
,
appId
)
.
eq
(
ImMessage:
:
getFkAppid
,
imOverviewAo
.
getAppId
()
)
.
eq
(
ImMessage:
:
getMsgType
,
MsgTypeEnum
.
CONVERSATION_DISBAND
.
getUriCode
())
.
between
(
ImMessage:
:
getCreateTime
,
LocalDateTime
.
of
(
LocalDate
.
now
(),
LocalTime
.
MIN
).
minusDays
(
1
),
...
...
@@ -135,7 +140,7 @@ public class ImOverviewImpl implements ImOverview {
statisticsVo
.
setAvgActiveGroup
(
avgMember
);
log
.
info
(
"即时通讯数据统计的业务统计的活跃群组平均成员数为{}"
,
avgMember
);
//活跃群组折线图
List
<
ImStatistics
>
imStatistics
=
imStatisticsService
.
activeUserOrGroup
(
appId
,
2
,
start
,
end
);
List
<
ImStatistics
>
imStatistics
=
imStatisticsService
.
activeUserOrGroup
(
imOverviewAo
.
getAppId
()
,
2
,
start
,
end
);
List
<
LineChart
>
activeGroupLine
=
new
ArrayList
<>();
for
(
ImStatistics
imStatistic
:
imStatistics
)
{
LineChart
lineChart
=
new
LineChart
();
...
...
@@ -151,7 +156,7 @@ public class ImOverviewImpl implements ImOverview {
for
(
int
i
=
days
.
intValue
();
i
>
0
;
i
--){
LineChart
lineChart
=
new
LineChart
();
Integer
count
=
imConversationService
.
count
(
new
LambdaQueryWrapper
<
ImConversation
>()
.
eq
(
ImConversation:
:
getFkAppid
,
appId
)
.
eq
(
ImConversation:
:
getFkAppid
,
imOverviewAo
.
getAppId
()
)
.
eq
(
ImConversation:
:
getChatType
,
ChatTypeEnum
.
NORMAL_GROUP
.
getCode
())
.
eq
(
ImConversation:
:
getChatType
,
ChatTypeEnum
.
THOUSAND_GROUP
.
getCode
())
.
between
(
ImConversation:
:
getCreateTime
,
LocalDateTime
.
of
(
LocalDate
.
now
(),
LocalTime
.
MIN
).
minusDays
(
i
),
LocalDateTime
.
of
(
LocalDate
.
now
(),
LocalTime
.
MIN
).
minusDays
(
i
-
1
))
...
...
@@ -167,7 +172,7 @@ public class ImOverviewImpl implements ImOverview {
for
(
int
i
=
days
.
intValue
();
i
>
0
;
i
--){
LineChart
lineChart
=
new
LineChart
();
Integer
count
=
imMessageService
.
count
(
new
LambdaQueryWrapper
<
ImMessage
>()
.
eq
(
ImMessage:
:
getFkAppid
,
appId
)
.
eq
(
ImMessage:
:
getFkAppid
,
imOverviewAo
.
getAppId
()
)
.
eq
(
ImMessage:
:
getMsgType
,
MsgTypeEnum
.
CONVERSATION_DISBAND
.
getUriCode
())
.
between
(
ImMessage:
:
getCreateTime
,
LocalDateTime
.
of
(
LocalDate
.
now
(),
LocalTime
.
MIN
).
minusDays
(
i
),
LocalDateTime
.
of
(
LocalDate
.
now
(),
LocalTime
.
MIN
).
minusDays
(
i
-
1
))
);
...
...
@@ -187,19 +192,21 @@ public class ImOverviewImpl implements ImOverview {
}
statisticsVo
.
setAvgActiveGroupLine
(
avgActiveGroupLine
);
log
.
info
(
"即时通讯数据统计的业务统计的返回参数为{}"
,
statisticsVo
);
return
statisticsVo
;
return
Result
.
getSuccessResult
(
statisticsVo
)
;
}
@Override
public
List
<
LineChart
>
activeUser
(
Long
appId
,
LocalDateTime
start
,
LocalDateTime
end
)
{
log
.
info
(
"即时通讯数据统计的用户统计入参为{}"
,
appId
);
public
Result
<
List
<
LineChart
>>
activeUser
(
ImOverviewAO
imOverviewAo
)
{
log
.
info
(
"即时通讯数据统计的用户统计入参为{}"
,
imOverviewAo
.
getAppId
());
LocalDateTime
start
=
imOverviewAo
.
getStart
();
LocalDateTime
end
=
imOverviewAo
.
getEnd
();
if
(
start
==
null
&&
end
==
null
){
start
=
LocalDateTime
.
of
(
LocalDate
.
now
(),
LocalTime
.
MIN
).
minusDays
(
8
);
end
=
start
.
plusDays
(
7
);
}
//活跃用户数
List
<
ImStatistics
>
imStatistics
=
imStatisticsService
.
activeUserOrGroup
(
appId
,
1
,
start
,
end
);
List
<
ImStatistics
>
imStatistics
=
imStatisticsService
.
activeUserOrGroup
(
imOverviewAo
.
getAppId
()
,
1
,
start
,
end
);
List
<
LineChart
>
activeUser
=
new
ArrayList
<>();
for
(
ImStatistics
imStatistic
:
imStatistics
)
{
LineChart
lineChart
=
new
LineChart
();
...
...
@@ -208,28 +215,28 @@ public class ImOverviewImpl implements ImOverview {
activeUser
.
add
(
lineChart
);
}
log
.
info
(
"即时通讯数据统计的用户统计返回参数为{}"
,
activeUser
);
return
activeUser
;
return
Result
.
getSuccessResult
(
activeUser
)
;
}
@Override
public
R
tcRecordVo
RtcStatistics
(
Long
appId
,
LocalDateTime
date
)
{
log
.
info
(
"音视频通讯数据统计的入参的appId为{}"
,
appId
);
public
R
esult
<
RtcRecordVo
>
rtcStatistics
(
ImRtcOverviewAo
imrtcOverviewAo
)
{
log
.
info
(
"音视频通讯数据统计的入参的appId为{}"
,
imrtcOverviewAo
.
getAppId
()
);
RtcRecordVo
rtcRecordVo
=
new
RtcRecordVo
();
List
<
LineChart
>
video
=
new
ArrayList
<>();
List
<
LineChart
>
voice
=
new
ArrayList
<>();
List
<
LineChart
>
videoTranscribe
=
new
ArrayList
<>();
List
<
LineChart
>
voiceTranscribe
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
ChronoUnit
.
DAYS
.
between
(
date
,
date
.
plusMonths
(
1
));
i
++)
{
for
(
int
i
=
0
;
i
<
ChronoUnit
.
DAYS
.
between
(
imrtcOverviewAo
.
getStart
(),
imrtcOverviewAo
.
getStart
()
.
plusMonths
(
1
));
i
++)
{
//每天的视频通话数据==============================
LineChart
videoLineChart
=
new
LineChart
();
LocalDateTime
start
=
date
.
plusDays
(
i
);
LocalDateTime
end
=
date
.
plusDays
(
i
+
1
);
LocalDateTime
start
=
imrtcOverviewAo
.
getStart
()
.
plusDays
(
i
);
LocalDateTime
end
=
imrtcOverviewAo
.
getStart
()
.
plusDays
(
i
+
1
);
Integer
videoLength
=
0
;
List
<
ImRtcRecord
>
imVideoList
=
imRtcRecordService
.
list
(
new
LambdaQueryWrapper
<
ImRtcRecord
>()
.
eq
(
ImRtcRecord:
:
getFkAppid
,
appId
)
.
eq
(
ImRtcRecord:
:
getFkAppid
,
imrtcOverviewAo
.
getAppId
()
)
.
eq
(
ImRtcRecord:
:
getCallType
,
1
)
.
between
(
ImRtcRecord:
:
getStartTime
,
start
,
end
)
);
...
...
@@ -256,7 +263,7 @@ public class ImOverviewImpl implements ImOverview {
Integer
voiceLength
=
0
;
List
<
ImRtcRecord
>
imVoiceList
=
imRtcRecordService
.
list
(
new
LambdaQueryWrapper
<
ImRtcRecord
>()
.
eq
(
ImRtcRecord:
:
getFkAppid
,
appId
)
.
eq
(
ImRtcRecord:
:
getFkAppid
,
imrtcOverviewAo
.
getAppId
()
)
.
eq
(
ImRtcRecord:
:
getCallType
,
2
)
.
between
(
ImRtcRecord:
:
getStartTime
,
start
,
end
)
);
...
...
@@ -297,6 +304,6 @@ public class ImOverviewImpl implements ImOverview {
rtcRecordVo
.
setVideo
(
video
);
rtcRecordVo
.
setVoice
(
voice
);
log
.
info
(
"音视频通讯数据统计的返回参数为{}"
,
rtcRecordVo
);
return
rtcRecordVo
;
return
Result
.
getSuccessResult
(
rtcRecordVo
)
;
}
}
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