Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sequoia_score
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mark
sequoia_score
Commits
19fa49b7
Commit
19fa49b7
authored
Jul 28, 2021
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新赛程
parent
a3090728
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
3 additions
and
112 deletions
+3
-112
UserInfoResponse.java
...java/com/live/common/domain/dto/api/UserInfoResponse.java
+1
-1
UserServiceImpl.java
...in/java/com/live/common/service/impl/UserServiceImpl.java
+1
-6
ScheduledService.java
.../src/main/java/com/live/job/service/ScheduledService.java
+0
-0
ChatTimedSendingServiceImpl.java
...om/live/job/service/impl/ChatTimedSendingServiceImpl.java
+0
-104
CrawlAlStatServiceImpl.java
...ava/com/live/job/service/impl/CrawlAlStatServiceImpl.java
+1
-1
CrawlLeYuServiceImpl.java
.../java/com/live/job/service/impl/CrawlLeYuServiceImpl.java
+0
-0
No files found.
score-common/src/main/java/com/live/common/domain/dto/api/UserInfoResponse.java
View file @
19fa49b7
...
...
@@ -21,7 +21,7 @@ public class UserInfoResponse {
private
Integer
message
;
private
Integer
collect
Match
;
private
Integer
collect
Article
;
private
Integer
collectTeam
;
...
...
score-common/src/main/java/com/live/common/service/impl/UserServiceImpl.java
View file @
19fa49b7
...
...
@@ -577,11 +577,6 @@ public class UserServiceImpl implements UserService {
.
eq
(
UserMessage:
:
getUserId
,
account
.
getId
())
);
long
collectMatch
=
userReserveMapper
.
selectCount
(
Wrappers
.<
UserReserve
>
lambdaQuery
()
.
eq
(
UserReserve:
:
getDeleted
,
StatusEnum
.
ENABLE
.
getCode
())
.
eq
(
UserReserve:
:
getUserId
,
account
.
getId
())
.
eq
(
UserReserve:
:
getType
,
0
)
);
long
collectTeam
=
userReserveMapper
.
selectCount
(
Wrappers
.<
UserReserve
>
lambdaQuery
()
.
eq
(
UserReserve:
:
getDeleted
,
StatusEnum
.
ENABLE
.
getCode
())
.
eq
(
UserReserve:
:
getUserId
,
account
.
getId
())
...
...
@@ -594,7 +589,7 @@ public class UserServiceImpl implements UserService {
.
userName
(
account
.
getUserName
())
.
userDesc
(
account
.
getUserDesc
())
.
message
((
int
)
count
+
1
)
.
collect
Match
((
int
)
collectMatch
)
.
collect
Article
(
0
)
.
collectTeam
((
int
)
collectTeam
)
.
build
());
}
...
...
score-job/src/main/java/com/live/job/service/ScheduledService.java
View file @
19fa49b7
This diff is collapsed.
Click to expand it.
score-job/src/main/java/com/live/job/service/impl/ChatTimedSendingServiceImpl.java
deleted
100644 → 0
View file @
a3090728
package
com
.
live
.
job
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.live.common.domain.entity.RobotMsg
;
import
com.live.common.domain.entity.Room
;
import
com.live.common.domain.request.SendMessageByRoomRequest
;
import
com.live.common.mapper.RobotMsgMapper
;
import
com.live.common.mapper.RoomMapper
;
import
com.live.common.service.HuanXinIMService
;
import
com.live.common.utils.ChatFakeMsgUtils
;
import
com.live.common.utils.IdGen
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.time.Instant
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Slf4j
@Service
public
class
ChatTimedSendingServiceImpl
{
@Resource
private
RoomMapper
roomMapper
;
@Resource
private
RobotMsgMapper
robotMsgMapper
;
@Resource
private
HuanXinIMService
huanXinIMService
;
@Resource
private
ThreadPoolTaskScheduler
taskScheduler
;
// @Scheduled(fixedRate = 10 * 60 * 1000)
// @Scheduled(cron = "01 01/01 * * * ?")
public
void
timedSendingServiceImpl
()
{
List
<
Room
>
rooms
=
roomMapper
.
selectList
(
Wrappers
.<
Room
>
lambdaQuery
()
.
eq
(
Room:
:
getDeleted
,
0
)
.
eq
(
Room:
:
getType
,
1
)
.
eq
(
Room:
:
getEnableFakeChat
,
1
)
);
for
(
String
roomId
:
rooms
.
stream
().
map
(
Room:
:
getHuanXinRoomId
).
collect
(
Collectors
.
toList
()))
{
int
randomSeconds
=
IdGen
.
randomUtil
(
60
);
taskScheduler
.
schedule
(()
->
sendFakeMessage
(
roomId
),
Instant
.
now
().
plusSeconds
(
randomSeconds
));
}
}
private
void
sendFakeMessage
(
String
roomId
)
{
List
<
RobotMsg
>
robotMsgs
=
returnFakeMsg
();
for
(
RobotMsg
msg
:
robotMsgs
)
{
String
userName
=
StringUtils
.
isBlank
(
msg
.
getNickName
())
?
ChatFakeMsgUtils
.
generateName
()
:
msg
.
getNickName
();
huanXinIMService
.
sendMessageByRoom
(
SendMessageByRoomRequest
.
builder
()
.
ext
(
SendMessageByRoomRequest
.
Ext
.
builder
()
.
live_room_user_name
(
userName
)
.
user_level
(
getRandomLevel
())
.
user_nick
(
userName
)
.
build
())
.
from
(
userName
)
.
msg
(
SendMessageByRoomRequest
.
SendMessage
.
builder
()
.
msg
(
msg
.
getFakeMsg
())
.
type
(
"txt"
)
.
build
())
.
target_type
(
"chatrooms"
)
.
target
(
Collections
.
singletonList
(
roomId
))
.
build
());
}
}
private
List
<
RobotMsg
>
returnFakeMsg
()
{
int
random
=
IdGen
.
randomUtil
(
6
)
+
1
;
return
robotMsgMapper
.
selectList
(
Wrappers
.<
RobotMsg
>
lambdaQuery
()
.
eq
(
RobotMsg:
:
getMsgType
,
-
1
)
.
eq
(
RobotMsg:
:
getDeleted
,
0
)
.
last
(
String
.
format
(
" ORDER BY RAND() LIMIT %s"
,
random
))
);
}
private
int
getRandomLevel
()
{
int
random
=
IdGen
.
randomUtil
(
1000
)
+
1
;
if
(
random
>
950
)
{
return
7
;
}
else
if
(
random
>
880
)
{
return
6
;
}
else
if
(
random
>
800
)
{
return
5
;
}
else
if
(
random
>
650
)
{
return
4
;
}
else
if
(
random
>
550
)
{
return
3
;
}
else
if
(
random
>
350
)
{
return
2
;
}
else
{
return
1
;
}
}
}
score-job/src/main/java/com/live/job/service/impl/CrawlAlStatServiceImpl.java
View file @
19fa49b7
...
...
@@ -452,7 +452,7 @@ public class CrawlAlStatServiceImpl implements CrawlMatchService {
* 10 分钟爬取一次 AlStat 足球实时比分
*/
// @Scheduled(fixedRate = 2 * 60 * 60 * 1000)
//
@Scheduled(cron = "11 11/10 * * * ?")
@Scheduled
(
cron
=
"11 11/10 * * * ?"
)
public
void
crawlAlStatFootballScore
()
{
String
url
=
String
.
format
(
"http://data43.aistat.cn/matchs/liveScores?key=%s"
,
footballKey
);
ResponseEntity
<
String
>
response
=
restTemplate
.
getForEntity
(
url
,
String
.
class
);
...
...
score-job/src/main/java/com/live/job/service/impl/CrawlLeYuServiceImpl.java
deleted
100644 → 0
View file @
a3090728
This diff is collapsed.
Click to expand it.
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