Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nbya
Project
Project
Details
Activity
Releases
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
haoyanbin
nbya
Commits
361f4e51
Commit
361f4e51
authored
Jan 24, 2022
by
haoyanbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swag
parent
676562a8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
72 additions
and
147 deletions
+72
-147
org_player.go
app/mobile/apis/org_player.go
+8
-8
org_player.go
app/mobile/router/org_player.go
+1
-1
org_player.go
app/mobile/service/dto/org_player.go
+2
-2
org_player.go
app/mobile/service/org_player.go
+6
-4
docs.go
docs/docs.go
+20
-49
swagger.json
docs/swagger.json
+20
-49
swagger.yaml
docs/swagger.yaml
+15
-34
No files found.
app/mobile/apis/org_player.go
View file @
361f4e51
...
...
@@ -131,7 +131,7 @@ func (e OrgPlayer) Get(c *gin.Context) {
// @Summary <手机端>获取球员赛季数据
// @Description <手机端>获取球员赛季数据
// @Tags <手机端>球员数据
// @Param
id path string false "i
d"
// @Param
playerId path string false "playerI
d"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /mobile/v1/org-player/info [get]
// @Security Bearer
...
...
@@ -158,23 +158,23 @@ func (e OrgPlayer) GetInfo(c *gin.Context) {
return
}
seasonId
:=
"4"
seasonId
:=
s
.
GetNowSeasonId
()
reply
:=
new
(
dto
.
OrgPlayerGetInfoReply
)
reply
.
OrgPlayerInfo
=
object
replyOrgMatchInfo
:=
new
(
dto
.
OrgMatchInfo
)
err
=
s
.
StatisticsScoringAvg
(
strconv
.
Itoa
(
req
.
Id
),
seasonId
,
"avg"
,
replyOrgMatchInfo
)
err
=
s
.
StatisticsScoringAvg
(
strconv
.
Itoa
(
req
.
Player
Id
),
seasonId
,
"avg"
,
replyOrgMatchInfo
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取比赛球员信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
reply
.
OrgMatchInfo
=
*
replyOrgMatchInfo
err
,
matchId
:=
s
.
GetMatchId
(
strconv
.
Itoa
(
req
.
Id
),
seasonId
)
err
,
matchId
:=
s
.
GetMatchId
(
strconv
.
Itoa
(
req
.
Player
Id
),
seasonId
)
replyGetRoundsScoring
:=
make
([]
dto
.
OrgPlayerRoundsScoring
,
0
)
err
=
s
.
GetRoundsScoring
(
strconv
.
Itoa
(
req
.
Id
),
matchId
,
&
replyGetRoundsScoring
)
err
=
s
.
GetRoundsScoring
(
strconv
.
Itoa
(
req
.
Player
Id
),
matchId
,
&
replyGetRoundsScoring
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取比赛球员信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
...
...
@@ -188,7 +188,7 @@ func (e OrgPlayer) GetInfo(c *gin.Context) {
// @Summary <手机端>获取球员生涯数据
// @Description <手机端>获取球员生涯数据
// @Tags <手机端>球员数据
// @Param
id path string false "i
d"
// @Param
playerId path string false "playerI
d"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /mobile/v1/org-player/get-match-season [get]
// @Security Bearer
...
...
@@ -206,10 +206,10 @@ func (e OrgPlayer) GetOrgMatchSeason(c *gin.Context) {
return
}
//生涯数据
err
,
matchId2
:=
s
.
GetMatchId
(
strconv
.
Itoa
(
req
.
Id
),
""
)
err
,
matchId2
:=
s
.
GetMatchId
(
strconv
.
Itoa
(
req
.
Player
Id
),
""
)
replyGetRoundsScoring
:=
make
([]
dto
.
OrgPlayerRoundsScoring
,
0
)
err
=
s
.
GetSeasonRoundsScoring
(
strconv
.
Itoa
(
req
.
Id
),
matchId2
,
&
replyGetRoundsScoring
)
err
=
s
.
GetSeasonRoundsScoring
(
strconv
.
Itoa
(
req
.
Player
Id
),
matchId2
,
&
replyGetRoundsScoring
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取比赛球员信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
...
...
app/mobile/router/org_player.go
View file @
361f4e51
...
...
@@ -16,7 +16,7 @@ func registerOrgPlayerRouter(v1 *gin.RouterGroup) {
{
r
.
GET
(
""
,
api
.
GetPage
)
r
.
GET
(
"/:id"
,
api
.
Get
)
r
.
GET
(
"/info
/:id
"
,
api
.
GetInfo
)
r
.
GET
(
"/info"
,
api
.
GetInfo
)
r
.
GET
(
"/get-match-season"
,
api
.
GetOrgMatchSeason
)
r
.
GET
(
"/evaluate"
,
api
.
GetOrgMatchEvaluate
)
r
.
GET
(
"/get-rounds"
,
api
.
GetOrgRounds
)
...
...
app/mobile/service/dto/org_player.go
View file @
361f4e51
...
...
@@ -139,7 +139,7 @@ type OrgMatchEvaluateList struct {
// OrgPlayerGetReq 功能获取请求参数
type
OrgPlayerGetReq
struct
{
Id
int
`uri:"i
d"`
PlayerId
int
`form:"playerId" json:"playerI
d"`
}
type
OrgPlayerGetReply
struct
{
...
...
@@ -165,7 +165,7 @@ type OrgPlayerGetReply struct {
}
func
(
s
*
OrgPlayerGetReq
)
GetId
()
interface
{}
{
return
s
.
Id
return
s
.
Player
Id
}
func
Pwd
(
password
string
)
string
{
...
...
app/mobile/service/org_player.go
View file @
361f4e51
...
...
@@ -591,12 +591,14 @@ func (e *OrgPlayer) GetPageWonderful(evaluateId string, list *[]cDto.Wonderful,
func
(
e
*
OrgPlayer
)
GetNowSeasonId
()
string
{
reply
:=
new
(
models
.
OrgSeason
)
now
:=
time
.
Now
()
negativeM
,
_
:=
time
.
ParseDuration
(
"-5m"
)
nowBefore
:=
now
.
Add
(
negativeM
)
//
negativeM, _ := time.ParseDuration("-5m")
//
nowBefore := now.Add(negativeM)
err
:=
e
.
Orm
.
Table
(
"org_season"
)
.
Select
(
"id"
)
.
Scopes
(
cDto
.
PassDel
(
"org_season"
))
.
Where
(
"start_time>?"
,
nowBefore
)
.
Where
(
"start_time<?"
,
now
)
.
Where
(
"end_time>?"
,
now
)
.
Order
(
"id desc"
)
.
First
(
&
reply
)
.
Error
if
err
!=
nil
&&
errors
.
Is
(
err
,
gorm
.
ErrRecordNotFound
)
{
...
...
@@ -608,5 +610,5 @@ func (e *OrgPlayer) GetNowSeasonId() string {
e
.
Log
.
Errorf
(
"db error:%s"
,
err
)
return
"0"
}
return
"0"
return
strconv
.
Itoa
(
reply
.
Id
)
}
docs/docs.go
View file @
361f4e51
...
...
@@ -6791,8 +6791,8 @@ var doc = `{
"parameters": [
{
"type": "string",
"description": "
i
d",
"name": "
i
d",
"description": "
playerI
d",
"name": "
playerI
d",
"in": "path"
}
],
...
...
@@ -6851,8 +6851,8 @@ var doc = `{
"parameters": [
{
"type": "string",
"description": "
i
d",
"name": "
i
d",
"description": "
playerI
d",
"name": "
playerI
d",
"in": "path"
}
],
...
...
@@ -7248,19 +7248,8 @@ var doc = `{
"dto.OrgLeagueGetPageReq": {
"type": "object",
"properties": {
"createBy": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"deletedAt": {
"type": "string"
},
"id": {
"type": "integer"
},
"leagueName": {
"description": "联赛级别",
"type": "string"
},
"pageIndex": {
...
...
@@ -7268,15 +7257,6 @@ var doc = `{
},
"pageSize": {
"type": "integer"
},
"status": {
"type": "string"
},
"updateBy": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
},
...
...
@@ -7804,6 +7784,9 @@ var doc = `{
"playerName": {
"type": "string"
},
"playerUserId": {
"type": "string"
},
"status": {
"type": "string"
},
...
...
@@ -9628,12 +9611,21 @@ var doc = `{
"models.SysDept": {
"type": "object",
"properties": {
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/models.SysDept"
}
},
"createBy": {
"type": "integer"
},
"createdAt": {
"type": "string"
},
"dataScope": {
"type": "string"
},
"deptId": {
"description": "部门编码",
"type": "integer"
...
...
@@ -9653,6 +9645,9 @@ var doc = `{
"description": "负责人",
"type": "string"
},
"params": {
"type": "string"
},
"parentId": {
"description": "上级部门",
"type": "integer"
...
...
@@ -9683,21 +9678,9 @@ var doc = `{
"action": {
"type": "string"
},
"apis": {
"type": "array",
"items": {
"type": "integer"
}
},
"breadcrumb": {
"type": "string"
},
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/models.SysMenu"
}
},
"component": {
"type": "string"
},
...
...
@@ -9707,18 +9690,12 @@ var doc = `{
"createdAt": {
"type": "string"
},
"dataScope": {
"type": "string"
},
"icon": {
"type": "string"
},
"isFrame": {
"type": "string"
},
"is_select": {
"type": "boolean"
},
"menuId": {
"type": "integer"
},
...
...
@@ -9731,9 +9708,6 @@ var doc = `{
"noCache": {
"type": "boolean"
},
"params": {
"type": "string"
},
"parentId": {
"type": "integer"
},
...
...
@@ -9746,9 +9720,6 @@ var doc = `{
"permission": {
"type": "string"
},
"roleId": {
"type": "integer"
},
"sort": {
"type": "integer"
},
...
...
docs/swagger.json
View file @
361f4e51
...
...
@@ -6774,8 +6774,8 @@
"parameters"
:
[
{
"type"
:
"string"
,
"description"
:
"
i
d"
,
"name"
:
"
i
d"
,
"description"
:
"
playerI
d"
,
"name"
:
"
playerI
d"
,
"in"
:
"path"
}
],
...
...
@@ -6834,8 +6834,8 @@
"parameters"
:
[
{
"type"
:
"string"
,
"description"
:
"
i
d"
,
"name"
:
"
i
d"
,
"description"
:
"
playerI
d"
,
"name"
:
"
playerI
d"
,
"in"
:
"path"
}
],
...
...
@@ -7231,19 +7231,8 @@
"dto.OrgLeagueGetPageReq"
:
{
"type"
:
"object"
,
"properties"
:
{
"createBy"
:
{
"type"
:
"string"
},
"createdAt"
:
{
"type"
:
"string"
},
"deletedAt"
:
{
"type"
:
"string"
},
"id"
:
{
"type"
:
"integer"
},
"leagueName"
:
{
"description"
:
"联赛级别"
,
"type"
:
"string"
},
"pageIndex"
:
{
...
...
@@ -7251,15 +7240,6 @@
},
"pageSize"
:
{
"type"
:
"integer"
},
"status"
:
{
"type"
:
"string"
},
"updateBy"
:
{
"type"
:
"string"
},
"updatedAt"
:
{
"type"
:
"string"
}
}
},
...
...
@@ -7787,6 +7767,9 @@
"playerName"
:
{
"type"
:
"string"
},
"playerUserId"
:
{
"type"
:
"string"
},
"status"
:
{
"type"
:
"string"
},
...
...
@@ -9611,12 +9594,21 @@
"models.SysDept"
:
{
"type"
:
"object"
,
"properties"
:
{
"children"
:
{
"type"
:
"array"
,
"items"
:
{
"$ref"
:
"#/definitions/models.SysDept"
}
},
"createBy"
:
{
"type"
:
"integer"
},
"createdAt"
:
{
"type"
:
"string"
},
"dataScope"
:
{
"type"
:
"string"
},
"deptId"
:
{
"description"
:
"部门编码"
,
"type"
:
"integer"
...
...
@@ -9636,6 +9628,9 @@
"description"
:
"负责人"
,
"type"
:
"string"
},
"params"
:
{
"type"
:
"string"
},
"parentId"
:
{
"description"
:
"上级部门"
,
"type"
:
"integer"
...
...
@@ -9666,21 +9661,9 @@
"action"
:
{
"type"
:
"string"
},
"apis"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
"integer"
}
},
"breadcrumb"
:
{
"type"
:
"string"
},
"children"
:
{
"type"
:
"array"
,
"items"
:
{
"$ref"
:
"#/definitions/models.SysMenu"
}
},
"component"
:
{
"type"
:
"string"
},
...
...
@@ -9690,18 +9673,12 @@
"createdAt"
:
{
"type"
:
"string"
},
"dataScope"
:
{
"type"
:
"string"
},
"icon"
:
{
"type"
:
"string"
},
"isFrame"
:
{
"type"
:
"string"
},
"is_select"
:
{
"type"
:
"boolean"
},
"menuId"
:
{
"type"
:
"integer"
},
...
...
@@ -9714,9 +9691,6 @@
"noCache"
:
{
"type"
:
"boolean"
},
"params"
:
{
"type"
:
"string"
},
"parentId"
:
{
"type"
:
"integer"
},
...
...
@@ -9729,9 +9703,6 @@
"permission"
:
{
"type"
:
"string"
},
"roleId"
:
{
"type"
:
"integer"
},
"sort"
:
{
"type"
:
"integer"
},
...
...
docs/swagger.yaml
View file @
361f4e51
...
...
@@ -232,26 +232,13 @@ definitions:
type
:
object
dto.OrgLeagueGetPageReq
:
properties
:
createBy
:
type
:
string
createdAt
:
type
:
string
deletedAt
:
type
:
string
id
:
type
:
integer
leagueName
:
description
:
联赛级别
type
:
string
pageIndex
:
type
:
integer
pageSize
:
type
:
integer
status
:
type
:
string
updateBy
:
type
:
string
updatedAt
:
type
:
string
type
:
object
dto.OrgLeagueInsertReq
:
properties
:
...
...
@@ -601,6 +588,8 @@ definitions:
type
:
integer
playerName
:
type
:
string
playerUserId
:
type
:
string
status
:
type
:
string
teamId
:
...
...
@@ -1833,10 +1822,16 @@ definitions:
type
:
object
models.SysDept
:
properties
:
children
:
items
:
$ref
:
'
#/definitions/models.SysDept'
type
:
array
createBy
:
type
:
integer
createdAt
:
type
:
string
dataScope
:
type
:
string
deptId
:
description
:
部门编码
type
:
integer
...
...
@@ -1851,6 +1846,8 @@ definitions:
leader
:
description
:
负责人
type
:
string
params
:
type
:
string
parentId
:
description
:
上级部门
type
:
integer
...
...
@@ -1872,28 +1869,16 @@ definitions:
properties
:
action
:
type
:
string
apis
:
items
:
type
:
integer
type
:
array
breadcrumb
:
type
:
string
children
:
items
:
$ref
:
'
#/definitions/models.SysMenu'
type
:
array
component
:
type
:
string
createBy
:
type
:
integer
createdAt
:
type
:
string
dataScope
:
type
:
string
icon
:
type
:
string
is_select
:
type
:
boolean
isFrame
:
type
:
string
menuId
:
...
...
@@ -1904,8 +1889,6 @@ definitions:
type
:
string
noCache
:
type
:
boolean
params
:
type
:
string
parentId
:
type
:
integer
path
:
...
...
@@ -1914,8 +1897,6 @@ definitions:
type
:
string
permission
:
type
:
string
roleId
:
type
:
integer
sort
:
type
:
integer
sysApi
:
...
...
@@ -6301,9 +6282,9 @@ paths:
get
:
description
:
<手机端>获取球员生涯数据
parameters
:
-
description
:
i
d
-
description
:
playerI
d
in
:
path
name
:
i
d
name
:
playerI
d
type
:
string
responses
:
"
200"
:
...
...
@@ -6337,9 +6318,9 @@ paths:
get
:
description
:
<手机端>获取球员赛季数据
parameters
:
-
description
:
i
d
-
description
:
playerI
d
in
:
path
name
:
i
d
name
:
playerI
d
type
:
string
responses
:
"
200"
:
...
...
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