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
417aa49c
Commit
417aa49c
authored
Jul 26, 2021
by
lenx065@gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
球员数据
parent
3aeb54b7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
145 additions
and
19 deletions
+145
-19
PlayerInfoFootballResponse.java
...ive/common/domain/dto/api/PlayerInfoFootballResponse.java
+1
-1
Country.java
.../src/main/java/com/live/common/domain/entity/Country.java
+48
-0
CountryMapper.java
...n/src/main/java/com/live/common/mapper/CountryMapper.java
+8
-0
MatchService.java
...n/src/main/java/com/live/common/service/MatchService.java
+3
-5
MatchServiceImpl.java
...n/java/com/live/common/service/impl/MatchServiceImpl.java
+29
-11
CommonUtil.java
...src/main/java/com/live/common/utils/match/CommonUtil.java
+52
-0
MatchDataController.java
.../java/com/live/server/controller/MatchDataController.java
+4
-2
No files found.
score-common/src/main/java/com/live/common/domain/dto/api/PlayerInfoFootballResponse.java
View file @
417aa49c
...
@@ -34,7 +34,7 @@ public class PlayerInfoFootballResponse {
...
@@ -34,7 +34,7 @@ public class PlayerInfoFootballResponse {
private
String
secondPosition1
;
private
String
secondPosition1
;
@ApiModelProperty
(
"次要位置"
)
@ApiModelProperty
(
"次要位置"
)
private
String
secondPosition2
;
private
String
secondPosition2
;
@ApiModelProperty
(
"身价 欧元"
)
@ApiModelProperty
(
"身价
万
欧元"
)
private
Integer
marketValue
;
private
Integer
marketValue
;
@ApiModelProperty
(
"国家队进球数"
)
@ApiModelProperty
(
"国家队进球数"
)
private
Integer
nationalGoals
;
private
Integer
nationalGoals
;
...
...
score-common/src/main/java/com/live/common/domain/entity/Country.java
0 → 100644
View file @
417aa49c
package
com
.
live
.
common
.
domain
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.experimental.SuperBuilder
;
import
java.util.Date
;
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@TableName
(
"t_country"
)
public
class
Country
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
INPUT
)
private
Integer
id
;
private
String
nameZh
;
private
String
nameEn
;
private
String
apiResponse
;
/**
* 创建人
*/
private
String
createBy
;
/**
* '创建时间'
*/
private
Date
createTime
;
/**
* '更新时间'
*/
@TableField
(
value
=
"update_time"
)
private
Date
updateTime
;
/**
* '是否删除' 默认0未删除
*/
private
Integer
deleted
;
}
score-common/src/main/java/com/live/common/mapper/CountryMapper.java
0 → 100644
View file @
417aa49c
package
com
.
live
.
common
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.live.common.domain.entity.Country
;
public
interface
CountryMapper
extends
BaseMapper
<
Country
>
{
}
score-common/src/main/java/com/live/common/service/MatchService.java
View file @
417aa49c
package
com
.
live
.
common
.
service
;
package
com
.
live
.
common
.
service
;
import
com.live.common.domain.ResponseData
;
import
com.live.common.domain.ResponseData
;
import
com.live.common.domain.dto.api.MatchBasketballOddsResponse
;
import
com.live.common.domain.dto.api.*
;
import
com.live.common.domain.dto.api.MatchFootballOddsResponse
;
import
com.live.common.domain.dto.api.MatchListResponse
;
import
com.live.common.domain.entity.Match
;
import
com.live.common.domain.entity.Match
;
import
com.live.common.domain.request.*
;
import
com.live.common.domain.request.*
;
import
com.live.common.domain.request.back.*
;
import
com.live.common.domain.request.back.*
;
...
@@ -22,9 +20,9 @@ public interface MatchService {
...
@@ -22,9 +20,9 @@ public interface MatchService {
ResponseData
<?>
getPlayerList
(
CommonPage
commonPage
,
HttpServletRequest
request
);
ResponseData
<?>
getPlayerList
(
CommonPage
commonPage
,
HttpServletRequest
request
);
ResponseData
<
?
>
getPlayerInfoBasketballById
(
CommonIntId
commonIntId
,
HttpServletRequest
request
);
ResponseData
<
PlayerInfoBasketballResponse
>
getPlayerInfoBasketballById
(
CommonIntId
commonIntId
,
HttpServletRequest
request
);
ResponseData
<
?
>
getPlayerInfoFootballById
(
CommonIntId
commonIntId
,
HttpServletRequest
request
);
ResponseData
<
PlayerInfoFootballResponse
>
getPlayerInfoFootballById
(
CommonIntId
commonIntId
,
HttpServletRequest
request
);
...
...
score-common/src/main/java/com/live/common/service/impl/MatchServiceImpl.java
View file @
417aa49c
...
@@ -17,6 +17,7 @@ import com.live.common.domain.entity.*;
...
@@ -17,6 +17,7 @@ import com.live.common.domain.entity.*;
import
com.live.common.domain.request.*
;
import
com.live.common.domain.request.*
;
import
com.live.common.domain.request.back.*
;
import
com.live.common.domain.request.back.*
;
import
com.live.common.enums.StatusEnum
;
import
com.live.common.enums.StatusEnum
;
import
com.live.common.enums.SystemConfigEnum
;
import
com.live.common.mapper.*
;
import
com.live.common.mapper.*
;
import
com.live.common.service.ArticleService
;
import
com.live.common.service.ArticleService
;
import
com.live.common.service.MatchService
;
import
com.live.common.service.MatchService
;
...
@@ -55,6 +56,8 @@ public class MatchServiceImpl implements MatchService {
...
@@ -55,6 +56,8 @@ public class MatchServiceImpl implements MatchService {
@Resource
@Resource
private
SportsMapper
sportsMapper
;
private
SportsMapper
sportsMapper
;
@Resource
@Resource
private
CountryMapper
countryMapper
;
@Resource
private
ArticleService
articleService
;
private
ArticleService
articleService
;
@Resource
@Resource
private
MatchOddsMapper
matchOddsMapper
;
private
MatchOddsMapper
matchOddsMapper
;
...
@@ -347,7 +350,7 @@ public class MatchServiceImpl implements MatchService {
...
@@ -347,7 +350,7 @@ public class MatchServiceImpl implements MatchService {
}
}
@Override
@Override
public
ResponseData
<
?
>
getPlayerInfoBasketballById
(
CommonIntId
commonIntId
,
HttpServletRequest
request
)
{
public
ResponseData
<
PlayerInfoBasketballResponse
>
getPlayerInfoBasketballById
(
CommonIntId
commonIntId
,
HttpServletRequest
request
)
{
TeamPlayer
teamPlayer
=
teamPlayerMapper
.
selectById
(
commonIntId
.
getId
());
TeamPlayer
teamPlayer
=
teamPlayerMapper
.
selectById
(
commonIntId
.
getId
());
if
(
teamPlayer
==
null
||
teamPlayer
.
getSportsId
()
==
0
){
if
(
teamPlayer
==
null
||
teamPlayer
.
getSportsId
()
==
0
){
return
ResponseData
.
fail400Response
(
"ID 错误, 球员类型不匹配"
);
return
ResponseData
.
fail400Response
(
"ID 错误, 球员类型不匹配"
);
...
@@ -369,30 +372,45 @@ public class MatchServiceImpl implements MatchService {
...
@@ -369,30 +372,45 @@ public class MatchServiceImpl implements MatchService {
}
}
@Override
@Override
public
ResponseData
<
?
>
getPlayerInfoFootballById
(
CommonIntId
commonIntId
,
HttpServletRequest
request
)
{
public
ResponseData
<
PlayerInfoFootballResponse
>
getPlayerInfoFootballById
(
CommonIntId
commonIntId
,
HttpServletRequest
request
)
{
TeamPlayer
teamPlayer
=
teamPlayerMapper
.
selectById
(
commonIntId
.
getId
());
TeamPlayer
teamPlayer
=
teamPlayerMapper
.
selectById
(
commonIntId
.
getId
());
if
(
teamPlayer
==
null
||
teamPlayer
.
getSportsId
()
==
1
){
if
(
teamPlayer
==
null
||
teamPlayer
.
getSportsId
()
==
1
){
return
ResponseData
.
fail400Response
(
"ID 错误, 球员类型不匹配"
);
return
ResponseData
.
fail400Response
(
"ID 错误, 球员类型不匹配"
);
}
}
String
countryName
=
""
;
if
(
StringUtils
.
isNotBlank
(
teamPlayer
.
getCountry
()))
{
Country
country
=
countryMapper
.
selectOne
(
Wrappers
.<
Country
>
lambdaQuery
()
.
eq
(
Country:
:
getDeleted
,
0
)
.
eq
(
Country:
:
getNameEn
,
teamPlayer
.
getCountry
())
);
if
(
country
!=
null
)
countryName
=
country
.
getNameZh
();
}
Integer
height
=
null
;
if
(
StringUtils
.
isNoneBlank
(
teamPlayer
.
getHeight
()))
{
height
=
(
int
)
(
Double
.
parseDouble
(
teamPlayer
.
getHeight
().
substring
(
0
,
teamPlayer
.
getHeight
().
length
()
-
1
))
*
100
);
}
return
ResponseData
.
successResponse
(
PlayerInfoFootballResponse
.
builder
()
return
ResponseData
.
successResponse
(
PlayerInfoFootballResponse
.
builder
()
.
birthday
(
teamPlayer
.
getBirthday
())
.
birthday
(
teamPlayer
.
getBirthday
())
.
country
(
teamPlayer
.
getCountry
()
)
.
country
(
countryName
)
.
foot
(
teamPlayer
.
getFoot
(
))
.
foot
(
CommonUtil
.
getFootZh
(
teamPlayer
.
getFoot
()
))
.
height
(
teamPlayer
.
getHeight
()
)
.
height
(
height
!=
null
?
height
+
"CM"
:
""
)
.
icon
(
"http://dt.aistat.cn/players/"
+
teamPlayer
.
getSourceId
()
+
".jpg"
)
.
icon
(
"http://dt.aistat.cn/players/"
+
teamPlayer
.
getSourceId
()
+
".jpg"
)
.
id
(
teamPlayer
.
getId
())
.
id
(
teamPlayer
.
getId
())
.
mainPosition
(
teamPlayer
.
getMainPosition
(
))
.
mainPosition
(
CommonUtil
.
getMainPosition
(
teamPlayer
.
getMainPosition
()
))
.
marketValue
(
teamPlayer
.
getMarketValue
())
.
marketValue
(
teamPlayer
.
getMarketValue
()
!=
null
?
teamPlayer
.
getMarketValue
()
/
10000
:
null
)
.
name
(
teamPlayer
.
getName
())
.
name
(
teamPlayer
.
getName
())
.
nameEn
(
teamPlayer
.
getNameEn
())
.
nameEn
(
teamPlayer
.
getNameEn
())
.
nationalChosenTimes
(
teamPlayer
.
getNationalChosenTimes
())
.
nationalChosenTimes
(
teamPlayer
.
getNationalChosenTimes
())
.
nationalGoals
(
teamPlayer
.
getNationalGoals
())
.
nationalGoals
(
teamPlayer
.
getNationalGoals
())
.
position
(
teamPlayer
.
getPosition
(
))
.
position
(
CommonUtil
.
positionZh
(
teamPlayer
.
getPosition
()
))
.
rnNumber
(
teamPlayer
.
getRnNumber
())
.
rnNumber
(
teamPlayer
.
getRnNumber
())
.
secondPosition1
(
teamPlayer
.
getSecondPosition1
(
))
.
secondPosition1
(
CommonUtil
.
getMainPosition
(
teamPlayer
.
getSecondPosition1
()
))
.
secondPosition2
(
teamPlayer
.
getSecondPosition2
(
))
.
secondPosition2
(
CommonUtil
.
getMainPosition
(
teamPlayer
.
getSecondPosition2
()
))
.
weight
(
teamPlayer
.
getWeight
())
.
weight
(
teamPlayer
.
getWeight
()
==
null
?
""
:
teamPlayer
.
getWeight
()
)
.
build
());
.
build
());
}
}
...
...
score-common/src/main/java/com/live/common/utils/match/CommonUtil.java
View file @
417aa49c
...
@@ -2,8 +2,44 @@ package com.live.common.utils.match;
...
@@ -2,8 +2,44 @@ package com.live.common.utils.match;
import
com.live.common.domain.entity.Match
;
import
com.live.common.domain.entity.Match
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
CommonUtil
{
public
class
CommonUtil
{
private
static
final
Map
<
String
,
String
>
positionName
;
private
static
final
Map
<
String
,
String
>
footName
;
private
static
final
Map
<
String
,
String
>
mainPosition
;
static
{
positionName
=
new
HashMap
<>();
positionName
.
put
(
"Striker"
,
"前锋"
);
positionName
.
put
(
"Midfield"
,
"中场"
);
positionName
.
put
(
"Defence"
,
"后卫"
);
positionName
.
put
(
"Goalkeeper"
,
"门将"
);
footName
=
new
HashMap
<>();
footName
.
put
(
"left"
,
"左脚"
);
footName
.
put
(
"right"
,
"右脚"
);
footName
.
put
(
"both"
,
"左右脚"
);
mainPosition
=
new
HashMap
<>();
mainPosition
.
put
(
"Keeper"
,
"门将"
);
mainPosition
.
put
(
"Sweeper"
,
"清道夫"
);
mainPosition
.
put
(
"Centre-Back"
,
"中后卫"
);
mainPosition
.
put
(
"Left-Back"
,
"左后卫"
);
mainPosition
.
put
(
"Right-Back"
,
"右后卫"
);
mainPosition
.
put
(
"Defensive Midfield"
,
"后腰"
);
mainPosition
.
put
(
"Central Midfield"
,
"中场"
);
mainPosition
.
put
(
"Left Midfield"
,
"左中场"
);
mainPosition
.
put
(
"Right Midfield"
,
"右中场"
);
mainPosition
.
put
(
"Attacking Midfield"
,
"前腰"
);
mainPosition
.
put
(
"Left Wing"
,
"左边锋"
);
mainPosition
.
put
(
"Right Winger"
,
"右边锋"
);
mainPosition
.
put
(
"Secondary Striker"
,
"影子前锋"
);
mainPosition
.
put
(
"Centre-Forward"
,
"中锋"
);
}
//根据下注区域判断
//根据下注区域判断
public
static
boolean
winOrLose
(
Match
match
,
Integer
betPosition
){
public
static
boolean
winOrLose
(
Match
match
,
Integer
betPosition
){
if
(
match
.
getCompetitionStatus
()
!=
3
)
if
(
match
.
getCompetitionStatus
()
!=
3
)
...
@@ -25,4 +61,20 @@ public class CommonUtil {
...
@@ -25,4 +61,20 @@ public class CommonUtil {
}
}
}
}
public
static
String
positionZh
(
String
position
){
return
positionName
.
get
(
position
);
}
public
static
String
getFootZh
(
String
foot
){
return
footName
.
get
(
foot
);
}
public
static
String
getMainPosition
(
String
position
){
return
mainPosition
.
get
(
position
);
}
// public static void main(String[] args) {
// System.out.println(positionZh("1"));
// }
}
}
score-server/src/main/java/com/live/server/controller/MatchDataController.java
View file @
417aa49c
package
com
.
live
.
server
.
controller
;
package
com
.
live
.
server
.
controller
;
import
com.live.common.domain.ResponseData
;
import
com.live.common.domain.ResponseData
;
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.CommonIntId
;
import
com.live.common.domain.request.CommonPage
;
import
com.live.common.domain.request.CommonPage
;
import
com.live.common.service.MatchService
;
import
com.live.common.service.MatchService
;
...
@@ -66,7 +68,7 @@ public class MatchDataController {
...
@@ -66,7 +68,7 @@ public class MatchDataController {
@ApiResponse
(
code
=
404
,
message
=
"未发现该服务"
),
@ApiResponse
(
code
=
404
,
message
=
"未发现该服务"
),
@ApiResponse
(
code
=
500
,
message
=
"服务器内部错误"
)
@ApiResponse
(
code
=
500
,
message
=
"服务器内部错误"
)
})
})
public
ResponseData
<
?
>
getPlayerInfoBasketballById
(
@RequestBody
CommonIntId
commonIntId
,
HttpServletRequest
request
)
{
public
ResponseData
<
PlayerInfoBasketballResponse
>
getPlayerInfoBasketballById
(
@RequestBody
CommonIntId
commonIntId
,
HttpServletRequest
request
)
{
return
matchService
.
getPlayerInfoBasketballById
(
commonIntId
,
request
);
return
matchService
.
getPlayerInfoBasketballById
(
commonIntId
,
request
);
}
}
...
@@ -79,7 +81,7 @@ public class MatchDataController {
...
@@ -79,7 +81,7 @@ public class MatchDataController {
@ApiResponse
(
code
=
404
,
message
=
"未发现该服务"
),
@ApiResponse
(
code
=
404
,
message
=
"未发现该服务"
),
@ApiResponse
(
code
=
500
,
message
=
"服务器内部错误"
)
@ApiResponse
(
code
=
500
,
message
=
"服务器内部错误"
)
})
})
public
ResponseData
<
?
>
getPlayerInfoFootballById
(
@RequestBody
CommonIntId
commonIntId
,
HttpServletRequest
request
)
{
public
ResponseData
<
PlayerInfoFootballResponse
>
getPlayerInfoFootballById
(
@RequestBody
CommonIntId
commonIntId
,
HttpServletRequest
request
)
{
return
matchService
.
getPlayerInfoFootballById
(
commonIntId
,
request
);
return
matchService
.
getPlayerInfoFootballById
(
commonIntId
,
request
);
}
}
...
...
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