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
b6947173
Commit
b6947173
authored
Jul 23, 2021
by
lenx065@gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
所有赛事,所有球队
parent
df846deb
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
189 additions
and
2 deletions
+189
-2
RedisKeySplicing.java
.../main/java/com/live/common/constant/RedisKeySplicing.java
+1
-1
GetMatchTypeInfoListResponse.java
...e/common/domain/dto/api/GetMatchTypeInfoListResponse.java
+30
-0
GetTeamInfoListResponse.java
...m/live/common/domain/dto/api/GetTeamInfoListResponse.java
+31
-0
Team.java
...mon/src/main/java/com/live/common/domain/entity/Team.java
+3
-0
MatchService.java
...n/src/main/java/com/live/common/service/MatchService.java
+4
-0
MatchServiceImpl.java
...n/java/com/live/common/service/impl/MatchServiceImpl.java
+68
-0
IntercaptorConfig.java
...c/main/java/com/live/server/config/IntercaptorConfig.java
+1
-1
MatchDataController.java
.../java/com/live/server/controller/MatchDataController.java
+51
-0
No files found.
score-common/src/main/java/com/live/common/constant/RedisKeySplicing.java
View file @
b6947173
...
@@ -30,7 +30,7 @@ public class RedisKeySplicing {
...
@@ -30,7 +30,7 @@ public class RedisKeySplicing {
}
}
public
static
String
requestLock
(
String
method
,
String
phone
){
public
static
String
requestLock
(
String
method
,
String
phone
){
return
RedisCommonChar
.
REDIS_LOCK
.
concat
(
"method
:"
).
concat
(
phone
);
return
RedisCommonChar
.
REDIS_LOCK
.
concat
(
method
).
concat
(
"
:"
).
concat
(
phone
);
}
}
}
}
score-common/src/main/java/com/live/common/domain/dto/api/GetMatchTypeInfoListResponse.java
0 → 100644
View file @
b6947173
package
com
.
live
.
common
.
domain
.
dto
.
api
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
GetMatchTypeInfoListResponse
{
private
List
<
MatchTypeInfoResponse
>
basketball
;
private
List
<
MatchTypeInfoResponse
>
football
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
static
class
MatchTypeInfoResponse
{
private
String
id
;
private
String
shortName
;
private
String
shortNameEn
;
private
String
icon
;
}
}
score-common/src/main/java/com/live/common/domain/dto/api/GetTeamInfoListResponse.java
0 → 100644
View file @
b6947173
package
com
.
live
.
common
.
domain
.
dto
.
api
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
GetTeamInfoListResponse
{
private
List
<
GetTeamInfoInfoResponse
>
hotTeam
;
private
List
<
GetTeamInfoInfoResponse
>
otherTeam
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
static
class
GetTeamInfoInfoResponse
{
private
String
id
;
private
String
teamIcon
;
private
String
teamName
;
private
String
teamNameEn
;
}
}
score-common/src/main/java/com/live/common/domain/entity/Team.java
View file @
b6947173
...
@@ -17,10 +17,13 @@ public class Team extends BaseStringIdEntity {
...
@@ -17,10 +17,13 @@ public class Team extends BaseStringIdEntity {
private
int
sportsId
;
private
int
sportsId
;
private
String
originalId
;
private
String
originalId
;
//0 Leyu 1 AlStat
private
Integer
originalType
;
private
Integer
originalType
;
private
String
teamNameEn
;
private
String
teamNameEn
;
private
String
teamName
;
private
String
teamName
;
private
String
sportsName
;
private
String
sportsName
;
private
String
teamIcon
;
private
String
teamIcon
;
//0默认1热门
private
Integer
hotTeam
;
}
}
score-common/src/main/java/com/live/common/service/MatchService.java
View file @
b6947173
...
@@ -16,6 +16,10 @@ public interface MatchService {
...
@@ -16,6 +16,10 @@ public interface MatchService {
ResponseData
<?>
getMatchListBySportsId
(
GetMatchListByRequest
commonStringId
,
HttpServletRequest
request
);
ResponseData
<?>
getMatchListBySportsId
(
GetMatchListByRequest
commonStringId
,
HttpServletRequest
request
);
ResponseData
<?>
getMatchTypeInfoList
(
HttpServletRequest
request
);
ResponseData
<?>
getTeamInfoList
(
HttpServletRequest
request
);
ResponseData
<?>
getMatchList
(
GetMatchListRequest
commonStringId
,
HttpServletRequest
request
);
ResponseData
<?>
getMatchList
(
GetMatchListRequest
commonStringId
,
HttpServletRequest
request
);
...
...
score-common/src/main/java/com/live/common/service/impl/MatchServiceImpl.java
View file @
b6947173
...
@@ -207,6 +207,74 @@ public class MatchServiceImpl implements MatchService {
...
@@ -207,6 +207,74 @@ public class MatchServiceImpl implements MatchService {
}
}
@Override
@Override
public
ResponseData
<?>
getMatchTypeInfoList
(
HttpServletRequest
request
)
{
String
key
=
RedisKeySplicing
.
requestLock
(
"getMatchTypeInfoList"
,
"0"
);
if
(
redisUtilsService
.
existsKey
(
key
)){
String
cacheInfo
=
redisUtilsService
.
getCacheStringInfo
(
key
);
GetMatchTypeInfoListResponse
response
=
JSONObject
.
toJavaObject
(
JSONObject
.
parseObject
(
cacheInfo
),
GetMatchTypeInfoListResponse
.
class
);
return
ResponseData
.
successResponse
(
response
);
}
List
<
Sports
>
sports
=
sportsMapper
.
selectList
(
Wrappers
.<
Sports
>
lambdaQuery
()
.
eq
(
Sports:
:
getDeleted
,
0
)
.
eq
(
Sports:
:
getSourceType
,
1
)
);
GetMatchTypeInfoListResponse
response
=
new
GetMatchTypeInfoListResponse
();
for
(
Sports
s
:
sports
)
{
GetMatchTypeInfoListResponse
.
MatchTypeInfoResponse
matchTypeInfo
=
GetMatchTypeInfoListResponse
.
MatchTypeInfoResponse
.
builder
()
.
icon
(
s
.
getCompetitionIcon
())
.
id
(
s
.
getId
())
.
shortName
(
s
.
getCompetitionShortName
())
.
shortNameEn
(
s
.
getCompetitionShortNameEn
())
.
build
();
if
(
s
.
getSportsId
()
==
0
)
{
response
.
getFootball
().
add
(
matchTypeInfo
);
}
else
if
(
s
.
getSportsId
()
==
1
)
{
response
.
getBasketball
().
add
(
matchTypeInfo
);
}
}
redisUtilsService
.
cacheStringInfoByDay
(
key
,
JSON
.
toJSONString
(
response
),
7
);
return
ResponseData
.
successResponse
(
response
);
}
@Override
public
ResponseData
<?>
getTeamInfoList
(
HttpServletRequest
request
)
{
String
key
=
RedisKeySplicing
.
requestLock
(
"getTeamInfoList"
,
"0"
);
if
(
redisUtilsService
.
existsKey
(
key
)){
String
cacheInfo
=
redisUtilsService
.
getCacheStringInfo
(
key
);
GetTeamInfoListResponse
response
=
JSONObject
.
toJavaObject
(
JSONObject
.
parseObject
(
cacheInfo
),
GetTeamInfoListResponse
.
class
);
return
ResponseData
.
successResponse
(
response
);
}
List
<
Team
>
teams
=
teamMapper
.
selectList
(
Wrappers
.<
Team
>
lambdaQuery
()
.
eq
(
Team:
:
getDeleted
,
0
)
.
eq
(
Team:
:
getOriginalType
,
1
)
.
orderByDesc
(
Team:
:
getCreateTime
)
);
GetTeamInfoListResponse
response
=
new
GetTeamInfoListResponse
();
for
(
Team
team
:
teams
)
{
GetTeamInfoListResponse
.
GetTeamInfoInfoResponse
teamInfo
=
GetTeamInfoListResponse
.
GetTeamInfoInfoResponse
.
builder
()
.
id
(
team
.
getId
())
.
teamIcon
(
team
.
getTeamIcon
())
.
teamName
(
team
.
getTeamName
())
.
teamNameEn
(
team
.
getTeamNameEn
())
.
build
();
if
(
team
.
getHotTeam
()
==
1
)
{
response
.
getHotTeam
().
add
(
teamInfo
);
}
else
if
(
team
.
getHotTeam
()
==
0
)
{
response
.
getOtherTeam
().
add
(
teamInfo
);
}
}
redisUtilsService
.
cacheStringInfoByDay
(
key
,
JSON
.
toJSONString
(
response
),
7
);
return
ResponseData
.
successResponse
(
response
);
}
@Override
public
ResponseData
<?>
getMatchList
(
GetMatchListRequest
commonStringId
,
HttpServletRequest
request
)
{
public
ResponseData
<?>
getMatchList
(
GetMatchListRequest
commonStringId
,
HttpServletRequest
request
)
{
List
<
Match
>
matches
;
List
<
Match
>
matches
;
...
...
score-server/src/main/java/com/live/server/config/IntercaptorConfig.java
View file @
b6947173
...
@@ -35,7 +35,7 @@ public class IntercaptorConfig implements WebMvcConfigurer {
...
@@ -35,7 +35,7 @@ public class IntercaptorConfig implements WebMvcConfigurer {
.
excludePathPatterns
(
"/live/**"
)
.
excludePathPatterns
(
"/live/**"
)
.
excludePathPatterns
(
"/article/**"
)
.
excludePathPatterns
(
"/article/**"
)
.
excludePathPatterns
(
"/pcHome/**"
)
.
excludePathPatterns
(
"/pcHome/**"
)
.
excludePathPatterns
(
"/data/**"
)
.
excludePathPatterns
(
"/platform/liveCutImgNotify"
)
.
excludePathPatterns
(
"/platform/liveCutImgNotify"
)
;
;
...
...
score-server/src/main/java/com/live/server/controller/MatchDataController.java
0 → 100644
View file @
b6947173
package
com
.
live
.
server
.
controller
;
import
com.live.common.domain.ResponseData
;
import
com.live.common.domain.request.CommonStringId
;
import
com.live.common.domain.request.CreateRoomRequest
;
import
com.live.common.service.CategoryService
;
import
com.live.common.service.LiveService
;
import
com.live.common.service.MatchService
;
import
io.swagger.annotations.*
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
@CrossOrigin
@RestController
@RequestMapping
(
"/data"
)
@Api
(
tags
=
"赛事/球队 数据接口"
)
public
class
MatchDataController
{
@Resource
private
MatchService
matchService
;
@PostMapping
(
value
=
"/getMatchTypeInfoAllList"
)
@ApiOperation
(
value
=
"获取 全部 赛事类别详情"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"成功处理请求"
),
@ApiResponse
(
code
=
401
,
message
=
"没有权限访问该服务"
),
@ApiResponse
(
code
=
403
,
message
=
"权限不足无法访问该服务"
),
@ApiResponse
(
code
=
404
,
message
=
"未发现该服务"
),
@ApiResponse
(
code
=
500
,
message
=
"服务器内部错误"
)
})
public
ResponseData
<?>
getMatchTypeInfoList
(
HttpServletRequest
request
)
{
return
matchService
.
getMatchTypeInfoList
(
request
);
}
@PostMapping
(
value
=
"/getTeamInfoList"
)
@ApiOperation
(
value
=
"获取 所有 球队列表"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"成功处理请求"
),
@ApiResponse
(
code
=
401
,
message
=
"没有权限访问该服务"
),
@ApiResponse
(
code
=
403
,
message
=
"权限不足无法访问该服务"
),
@ApiResponse
(
code
=
404
,
message
=
"未发现该服务"
),
@ApiResponse
(
code
=
500
,
message
=
"服务器内部错误"
)
})
public
ResponseData
<?>
getTeamInfoList
(
HttpServletRequest
request
)
{
return
matchService
.
getTeamInfoList
(
request
);
}
}
\ No newline at end of file
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