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
f62515d2
Commit
f62515d2
authored
Jul 31, 2021
by
Lem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
count
parent
2886f5e5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
91 deletions
+91
-91
MatchService.java
...n/src/main/java/com/live/common/service/MatchService.java
+1
-1
RoomService.java
...on/src/main/java/com/live/common/service/RoomService.java
+0
-6
MatchServiceImpl.java
...n/java/com/live/common/service/impl/MatchServiceImpl.java
+90
-84
RoomServiceImpl.java
...in/java/com/live/common/service/impl/RoomServiceImpl.java
+0
-0
No files found.
score-common/src/main/java/com/live/common/service/MatchService.java
View file @
f62515d2
...
@@ -35,7 +35,7 @@ public interface MatchService {
...
@@ -35,7 +35,7 @@ public interface MatchService {
ResponseData
<?>
getPlayerInfoSearch
(
PlayerInfoSearchRequest
searchRequest
,
HttpServletRequest
request
);
ResponseData
<?>
getPlayerInfoSearch
(
PlayerInfoSearchRequest
searchRequest
,
HttpServletRequest
request
);
ResponseData
<?>
getMatchList
(
GetMatchListRequest
commonStringId
,
HttpServletRequest
request
);
//
ResponseData<?> getMatchList(GetMatchListRequest commonStringId, HttpServletRequest request);
ResponseData
<?>
getMatchInfo
(
CommonStringId
commonStringId
,
HttpServletRequest
request
);
ResponseData
<?>
getMatchInfo
(
CommonStringId
commonStringId
,
HttpServletRequest
request
);
...
...
score-common/src/main/java/com/live/common/service/RoomService.java
View file @
f62515d2
...
@@ -11,12 +11,6 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -11,12 +11,6 @@ import javax.servlet.http.HttpServletRequest;
public
interface
RoomService
{
public
interface
RoomService
{
ResponseData
<?>
getRoomInfo
(
CommonStringId
commonStringId
,
HttpServletRequest
request
);
ResponseData
<?>
anchorMatch
(
CommonStringId
commonIntId
,
HttpServletRequest
request
);
ResponseData
<?>
leaderboard
(
CommonStringId
commonStringId
);
ResponseData
<?>
getGiftList
(
HttpServletRequest
request
);
ResponseData
<?>
getGiftList
(
HttpServletRequest
request
);
ResponseData
<?>
sendGift
(
SendGiftRequest
sendGiftRequest
,
HttpServletRequest
request
);
ResponseData
<?>
sendGift
(
SendGiftRequest
sendGiftRequest
,
HttpServletRequest
request
);
...
...
score-common/src/main/java/com/live/common/service/impl/MatchServiceImpl.java
View file @
f62515d2
...
@@ -265,6 +265,7 @@ public class MatchServiceImpl implements MatchService {
...
@@ -265,6 +265,7 @@ public class MatchServiceImpl implements MatchService {
List
<
UserReserve
>
userReserves
=
userReserveMapper
.
selectList
(
Wrappers
.<
UserReserve
>
lambdaQuery
()
List
<
UserReserve
>
userReserves
=
userReserveMapper
.
selectList
(
Wrappers
.<
UserReserve
>
lambdaQuery
()
.
eq
(
UserReserve:
:
getUserId
,
account
.
getId
())
.
eq
(
UserReserve:
:
getUserId
,
account
.
getId
())
.
eq
(
UserReserve:
:
getDeleted
,
StatusEnum
.
ENABLE
.
getCode
())
.
eq
(
UserReserve:
:
getType
,
1
)
.
eq
(
UserReserve:
:
getType
,
1
)
.
orderByDesc
(
UserReserve:
:
getCreateTime
)
.
orderByDesc
(
UserReserve:
:
getCreateTime
)
);
);
...
@@ -622,85 +623,85 @@ public class MatchServiceImpl implements MatchService {
...
@@ -622,85 +623,85 @@ public class MatchServiceImpl implements MatchService {
return
ResponseData
.
successResponse
(
new
ResultPage
<>(
commonPage
.
getPageNum
(),
commonPage
.
getPageSize
(),
(
int
)
count
,
response
));
return
ResponseData
.
successResponse
(
new
ResultPage
<>(
commonPage
.
getPageNum
(),
commonPage
.
getPageSize
(),
(
int
)
count
,
response
));
}
}
@Override
//
@Override
public
ResponseData
<?>
getMatchList
(
GetMatchListRequest
commonStringId
,
HttpServletRequest
request
)
{
//
public ResponseData<?> getMatchList(GetMatchListRequest commonStringId, HttpServletRequest request) {
List
<
Match
>
matches
;
//
List<Match> matches;
//
QueryWrapper
<
Match
>
wrapper
=
new
QueryWrapper
<>();
//
QueryWrapper<Match> wrapper = new QueryWrapper<>();
wrapper
.
eq
(
"deleted"
,
StatusEnum
.
ENABLE
.
getCode
());
//
wrapper.eq("deleted", StatusEnum.ENABLE.getCode());
wrapper
.
eq
(
"source_type"
,
1
);
//
wrapper.eq("source_type", 1);
wrapper
.
ge
(
"match_time"
,
DateUtil
.
getStartTime
());
//
wrapper.ge("match_time", DateUtil.getStartTime());
//
Integer
status
=
commonStringId
.
getStatus
()
==
null
?
0
:
commonStringId
.
getStatus
();
//
Integer status = commonStringId.getStatus() == null ? 0 : commonStringId.getStatus();
switch
(
status
)
{
//
switch (status) {
case
-
1
:
//
case -1:
wrapper
.
notIn
(
"competition_status"
,
4
);
//
wrapper.notIn("competition_status", 4);
if
(
StringUtils
.
isNotBlank
(
commonStringId
.
getId
()))
{
//
if (StringUtils.isNotBlank(commonStringId.getId())) {
if
(
commonStringId
.
getId
().
length
()
<
10
)
{
//
if (commonStringId.getId().length() < 10) {
wrapper
.
apply
(
"FIND_IN_SET({0},category_id)"
,
commonStringId
.
getId
());
//
wrapper.apply("FIND_IN_SET({0},category_id)", commonStringId.getId());
}
else
{
//
} else {
wrapper
.
eq
(
"sports_id"
,
commonStringId
.
getId
());
//
wrapper.eq("sports_id", commonStringId.getId());
}
//
}
}
//
}
wrapper
.
orderByAsc
(
"match_time"
);
//
wrapper.orderByAsc("match_time");
matches
=
matchMapper
.
selectList
(
wrapper
);
//
matches = matchMapper.selectList(wrapper);
break
;
//
break;
case
1
:
//
case 1:
case
2
:
//
case 2:
case
3
:
//
case 3:
wrapper
.
eq
(
"competition_status"
,
status
);
//
wrapper.eq("competition_status", status);
if
(
StringUtils
.
isNotBlank
(
commonStringId
.
getId
()))
{
//
if (StringUtils.isNotBlank(commonStringId.getId())) {
if
(
commonStringId
.
getId
().
length
()
<
10
)
{
//
if (commonStringId.getId().length() < 10) {
wrapper
.
apply
(
"FIND_IN_SET({0},category_id)"
,
commonStringId
.
getId
());
//
wrapper.apply("FIND_IN_SET({0},category_id)", commonStringId.getId());
}
else
{
//
} else {
wrapper
.
eq
(
"sports_id"
,
commonStringId
.
getId
());
//
wrapper.eq("sports_id", commonStringId.getId());
}
//
}
}
//
}
//
wrapper
.
orderByAsc
(
"match_time"
);
//
wrapper.orderByAsc("match_time");
matches
=
matchMapper
.
selectList
(
wrapper
);
//
matches = matchMapper.selectList(wrapper);
break
;
//
break;
default
:
//
default:
wrapper
.
in
(
"competition_status"
,
1
,
2
);
//
wrapper.in("competition_status", 1, 2);
if
(
StringUtils
.
isNotBlank
(
commonStringId
.
getId
()))
{
//
if (StringUtils.isNotBlank(commonStringId.getId())) {
if
(
commonStringId
.
getId
().
length
()
<
10
)
{
//
if (commonStringId.getId().length() < 10) {
wrapper
.
apply
(
"FIND_IN_SET({0},category_id)"
,
commonStringId
.
getId
());
//
wrapper.apply("FIND_IN_SET({0},category_id)", commonStringId.getId());
}
else
{
//
} else {
wrapper
.
eq
(
"sports_id"
,
commonStringId
.
getId
());
//
wrapper.eq("sports_id", commonStringId.getId());
}
//
}
}
//
}
//
wrapper
.
orderByAsc
(
"match_time"
);
//
wrapper.orderByAsc("match_time");
matches
=
matchMapper
.
selectList
(
wrapper
);
//
matches = matchMapper.selectList(wrapper);
break
;
//
break;
}
//
}
//
MatchListResponse
matchListResponse
=
conversionByList
(
matches
,
true
);
//
MatchListResponse matchListResponse = conversionByList(matches, true);
//
try
{
//
try {
String
phone
=
CommonMethod
.
getUserPhone
(
request
);
//
String phone = CommonMethod.getUserPhone(request);
User
account
=
userMapper
.
selectOne
(
Wrappers
.<
User
>
lambdaQuery
()
//
User account = userMapper.selectOne(Wrappers.<User>lambdaQuery()
.
eq
(
User:
:
getPhone
,
phone
)
//
.eq(User::getPhone, phone)
);
//
);
//
List
<
UserReserve
>
userReserves
=
userReserveMapper
.
selectList
(
Wrappers
.<
UserReserve
>
lambdaQuery
()
//
List<UserReserve> userReserves = userReserveMapper.selectList(Wrappers.<UserReserve>lambdaQuery()
.
eq
(
UserReserve:
:
getUserId
,
account
.
getId
())
//
.eq(UserReserve::getUserId, account.getId())
.
eq
(
UserReserve:
:
getDeleted
,
0
)
//
.eq(UserReserve::getDeleted, 0)
);
//
);
Set
<
String
>
reservesId
=
userReserves
.
stream
().
map
(
UserReserve:
:
getMatchId
).
collect
(
Collectors
.
toSet
());
//
Set<String> reservesId = userReserves.stream().map(UserReserve::getMatchId).collect(Collectors.toSet());
//
matchListResponse
.
getMatchLists
().
forEach
(
match
->
{
//
matchListResponse.getMatchLists().forEach(match -> {
match
.
getMatchInfos
().
forEach
(
matchInfo
->
{
//
match.getMatchInfos().forEach(matchInfo -> {
if
(
reservesId
.
contains
(
matchInfo
.
getId
()))
{
//
if (reservesId.contains(matchInfo.getId())) {
matchInfo
.
setSubscribe
(
true
);
//
matchInfo.setSubscribe(true);
}
//
}
});
//
});
});
//
});
}
catch
(
RuntimeException
e
)
{
//
} catch (RuntimeException e) {
log
.
info
(
"未携带 token !"
);
//
log.info("未携带 token !");
}
//
}
return
ResponseData
.
successResponse
(
matchListResponse
);
//
return ResponseData.successResponse(matchListResponse);
}
//
}
@Override
@Override
public
ResponseData
<?>
getMatchInfo
(
CommonStringId
commonStringId
,
HttpServletRequest
request
)
{
public
ResponseData
<?>
getMatchInfo
(
CommonStringId
commonStringId
,
HttpServletRequest
request
)
{
...
@@ -781,22 +782,27 @@ public class MatchServiceImpl implements MatchService {
...
@@ -781,22 +782,27 @@ public class MatchServiceImpl implements MatchService {
long
count
=
userReserveMapper
.
selectCount
(
Wrappers
.<
UserReserve
>
lambdaQuery
()
long
count
=
userReserveMapper
.
selectCount
(
Wrappers
.<
UserReserve
>
lambdaQuery
()
.
eq
(
UserReserve:
:
getUserId
,
account
.
getId
())
.
eq
(
UserReserve:
:
getUserId
,
account
.
getId
())
.
eq
(
UserReserve:
:
getType
,
0
)
.
eq
(
UserReserve:
:
getDeleted
,
0
)
.
eq
(
UserReserve:
:
getDeleted
,
0
)
);
);
List
<
UserReserve
>
userReserves
=
userReserveMapper
.
selectList
(
Wrappers
.<
UserReserve
>
lambdaQuery
()
List
<
UserReserve
>
userReserves
=
userReserveMapper
.
selectList
(
Wrappers
.<
UserReserve
>
lambdaQuery
()
.
eq
(
UserReserve:
:
getUserId
,
account
.
getId
())
.
eq
(
UserReserve:
:
getUserId
,
account
.
getId
())
.
eq
(
UserReserve:
:
getDeleted
,
0
)
.
eq
(
UserReserve:
:
getDeleted
,
0
)
.
eq
(
UserReserve:
:
getType
,
0
)
.
last
(
String
.
format
(
" limit %s,%s"
,
jumpNum
,
commonPage
.
getPageSize
()))
.
last
(
String
.
format
(
" limit %s,%s"
,
jumpNum
,
commonPage
.
getPageSize
()))
);
);
List
<
Match
>
matches
=
new
ArrayList
<>();
List
<
Match
>
matches
=
new
ArrayList
<>();
if
(
userReserves
.
size
()
>
0
)
{
if
(
userReserves
.
size
()
>
0
)
{
matches
=
matchMapper
.
selectList
(
Wrappers
.<
Match
>
lambdaQuery
()
for
(
UserReserve
userReserve
:
userReserves
)
{
.
in
(
Match:
:
getId
,
userReserves
.
stream
().
map
(
UserReserve:
:
getMatchId
).
collect
(
Collectors
.
toSet
()))
Match
match
=
matchMapper
.
selectById
(
userReserve
.
getMatchId
());
.
eq
(
Match:
:
getDeleted
,
0
)
if
(
match
!=
null
)
{
.
orderByDesc
(
Match:
:
getMatchTime
)
matches
.
add
(
match
);
);
}
else
{
count
--;
}
}
}
}
MatchHomeListByDayResponse
response
=
new
MatchHomeListByDayResponse
();
MatchHomeListByDayResponse
response
=
new
MatchHomeListByDayResponse
();
...
...
score-common/src/main/java/com/live/common/service/impl/RoomServiceImpl.java
View file @
f62515d2
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