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
04a18616
Commit
04a18616
authored
Aug 02, 2021
by
Lem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
球队详情
parent
b079804d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
112 additions
and
0 deletions
+112
-0
TeamAllInfoResponse.java
...a/com/live/common/domain/dto/api/TeamAllInfoResponse.java
+50
-0
MatchService.java
...n/src/main/java/com/live/common/service/MatchService.java
+2
-0
MatchServiceImpl.java
...n/java/com/live/common/service/impl/MatchServiceImpl.java
+46
-0
MatchDataController.java
.../java/com/live/server/controller/MatchDataController.java
+14
-0
No files found.
score-common/src/main/java/com/live/common/domain/dto/api/TeamAllInfoResponse.java
0 → 100644
View file @
04a18616
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
TeamAllInfoResponse
{
private
TeamInfoResponse
teamInfo
;
private
List
<
TeamPlayerInfoResponse
>
teamPlayers
;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
static
class
TeamPlayerInfoResponse
{
private
Integer
id
;
private
String
name
;
private
String
nameEn
;
private
String
country
;
private
String
birthday
;
private
String
height
;
private
String
rnNumber
;
private
String
marketValue
;
private
String
position
;
}
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
static
class
TeamInfoResponse
{
private
String
id
;
private
String
teamName
;
private
String
teamNameEn
;
private
String
sportsName
;
private
String
teamType
;
private
String
country
;
private
String
teamIcon
;
}
}
score-common/src/main/java/com/live/common/service/MatchService.java
View file @
04a18616
...
...
@@ -26,6 +26,8 @@ public interface MatchService {
ResponseData
<?>
getTeamInfoListSearch
(
PlayerInfoSearchRequest
commonPage
,
HttpServletRequest
request
);
ResponseData
<?>
getTeamInfoById
(
CommonStringId
commonStringId
,
HttpServletRequest
request
);
ResponseData
<?>
getPlayerList
(
CommonPage
commonPage
,
HttpServletRequest
request
);
ResponseData
<
PlayerInfoBasketballResponse
>
getPlayerInfoBasketballById
(
CommonIntId
commonIntId
,
HttpServletRequest
request
);
...
...
score-common/src/main/java/com/live/common/service/impl/MatchServiceImpl.java
View file @
04a18616
...
...
@@ -459,6 +459,52 @@ public class MatchServiceImpl implements MatchService {
return
ResponseData
.
successResponse
(
new
ResultPage
<>(
commonPage
.
getPageNum
(),
commonPage
.
getPageSize
(),
(
int
)
count
,
responses
));
}
@Override
public
ResponseData
<?>
getTeamInfoById
(
CommonStringId
commonStringId
,
HttpServletRequest
request
)
{
Team
team
=
teamMapper
.
selectById
(
commonStringId
.
getId
());
if
(
team
==
null
)
{
return
ResponseData
.
fail400Response
(
"ID 错误,比赛不存在"
);
}
Sports
sports
=
sportsMapper
.
selectById
(
team
.
getSportsDbId
());
List
<
TeamPlayer
>
teamPlayers
=
teamPlayerMapper
.
selectList
(
Wrappers
.<
TeamPlayer
>
lambdaQuery
()
.
eq
(
TeamPlayer:
:
getDeleted
,
StatusEnum
.
ENABLE
.
getCode
())
.
eq
(
TeamPlayer:
:
getTeamId
,
team
.
getId
())
);
List
<
Country
>
countries
=
countryMapper
.
selectList
(
null
);
Map
<
String
,
String
>
countryMap
=
countries
.
stream
().
collect
(
Collectors
.
toMap
(
Country:
:
getNameEn
,
b
->
b
.
getNameZh
()));
return
ResponseData
.
successResponse
(
TeamAllInfoResponse
.
builder
()
.
teamInfo
(
TeamAllInfoResponse
.
TeamInfoResponse
.
builder
()
.
country
(
countryMap
.
getOrDefault
(
team
.
getCountry
(),
null
))
.
id
(
team
.
getId
())
.
sportsName
(
sports
.
getCompetitionShortName
())
.
teamIcon
(
team
.
getTeamIcon
())
.
teamName
(
team
.
getTeamName
())
.
teamNameEn
(
team
.
getTeamNameEn
())
.
teamType
(
sports
.
getTeamType
().
equals
(
"club"
)
?
"俱乐部"
:
"国家队"
)
.
build
())
.
teamPlayers
(
teamPlayers
.
stream
().
map
(
b
->
{
Integer
market
=
b
.
getMarketValue
();
return
TeamAllInfoResponse
.
TeamPlayerInfoResponse
.
builder
()
.
birthday
(
b
.
getBirthday
())
.
country
(
countryMap
.
getOrDefault
(
b
.
getCountry
(),
null
))
.
height
(
b
.
getHeight
())
.
id
(
b
.
getId
())
.
marketValue
(
market
!=
null
?
String
.
format
(
"%.2f"
,
(
double
)
market
/
10000
)
+
"万欧元"
:
null
)
.
name
(
b
.
getName
())
.
nameEn
(
b
.
getNameEn
())
.
position
(
CommonUtil
.
positionZh
(
b
.
getPosition
()))
.
rnNumber
(
b
.
getRnNumber
())
.
build
();
}).
collect
(
Collectors
.
toList
()))
.
build
());
}
@Resource
private
TeamPlayerMapper
teamPlayerMapper
;
...
...
score-server/src/main/java/com/live/server/controller/MatchDataController.java
View file @
04a18616
...
...
@@ -5,6 +5,7 @@ import com.live.common.domain.dto.api.PlayerInfoBasketballResponse;
import
com.live.common.domain.dto.api.PlayerInfoFootballResponse
;
import
com.live.common.domain.request.CommonIntId
;
import
com.live.common.domain.request.CommonPage
;
import
com.live.common.domain.request.CommonStringId
;
import
com.live.common.domain.request.PlayerInfoSearchRequest
;
import
com.live.common.service.MatchService
;
import
io.swagger.annotations.*
;
...
...
@@ -60,6 +61,19 @@ public class MatchDataController {
return
matchService
.
getTeamInfoListSearch
(
commonPage
,
request
);
}
@PostMapping
(
value
=
"/getTeamInfoById"
)
@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
<?>
getTeamInfoById
(
@RequestBody
CommonStringId
commonStringId
,
HttpServletRequest
request
)
{
return
matchService
.
getTeamInfoById
(
commonStringId
,
request
);
}
@PostMapping
(
value
=
"/getPlayerList"
)
@ApiOperation
(
value
=
"获取球员列表 其他球员分页"
)
@ApiResponses
({
...
...
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