Commit 361f4e51 authored by haoyanbin's avatar haoyanbin

swag

parent 676562a8
...@@ -131,7 +131,7 @@ func (e OrgPlayer) Get(c *gin.Context) { ...@@ -131,7 +131,7 @@ func (e OrgPlayer) Get(c *gin.Context) {
// @Summary <手机端>获取球员赛季数据 // @Summary <手机端>获取球员赛季数据
// @Description <手机端>获取球员赛季数据 // @Description <手机端>获取球员赛季数据
// @Tags <手机端>球员数据 // @Tags <手机端>球员数据
// @Param id path string false "id" // @Param playerId path string false "playerId"
// @Success 200 {string} string "{"code": 200, "data": [...]}" // @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /mobile/v1/org-player/info [get] // @Router /mobile/v1/org-player/info [get]
// @Security Bearer // @Security Bearer
...@@ -158,23 +158,23 @@ func (e OrgPlayer) GetInfo(c *gin.Context) { ...@@ -158,23 +158,23 @@ func (e OrgPlayer) GetInfo(c *gin.Context) {
return return
} }
seasonId := "4" seasonId := s.GetNowSeasonId()
reply := new(dto.OrgPlayerGetInfoReply) reply := new(dto.OrgPlayerGetInfoReply)
reply.OrgPlayerInfo = object reply.OrgPlayerInfo = object
replyOrgMatchInfo := new(dto.OrgMatchInfo) replyOrgMatchInfo := new(dto.OrgMatchInfo)
err = s.StatisticsScoringAvg(strconv.Itoa(req.Id), seasonId, "avg", replyOrgMatchInfo) err = s.StatisticsScoringAvg(strconv.Itoa(req.PlayerId), seasonId, "avg", replyOrgMatchInfo)
if err != nil { if err != nil {
e.Error(500, err, fmt.Sprintf("获取比赛球员信息 失败,\r\n失败信息 %s", err.Error())) e.Error(500, err, fmt.Sprintf("获取比赛球员信息 失败,\r\n失败信息 %s", err.Error()))
return return
} }
reply.OrgMatchInfo = *replyOrgMatchInfo reply.OrgMatchInfo = *replyOrgMatchInfo
err, matchId := s.GetMatchId(strconv.Itoa(req.Id), seasonId) err, matchId := s.GetMatchId(strconv.Itoa(req.PlayerId), seasonId)
replyGetRoundsScoring := make([]dto.OrgPlayerRoundsScoring, 0) replyGetRoundsScoring := make([]dto.OrgPlayerRoundsScoring, 0)
err = s.GetRoundsScoring(strconv.Itoa(req.Id), matchId, &replyGetRoundsScoring) err = s.GetRoundsScoring(strconv.Itoa(req.PlayerId), matchId, &replyGetRoundsScoring)
if err != nil { if err != nil {
e.Error(500, err, fmt.Sprintf("获取比赛球员信息 失败,\r\n失败信息 %s", err.Error())) e.Error(500, err, fmt.Sprintf("获取比赛球员信息 失败,\r\n失败信息 %s", err.Error()))
return return
...@@ -188,7 +188,7 @@ func (e OrgPlayer) GetInfo(c *gin.Context) { ...@@ -188,7 +188,7 @@ func (e OrgPlayer) GetInfo(c *gin.Context) {
// @Summary <手机端>获取球员生涯数据 // @Summary <手机端>获取球员生涯数据
// @Description <手机端>获取球员生涯数据 // @Description <手机端>获取球员生涯数据
// @Tags <手机端>球员数据 // @Tags <手机端>球员数据
// @Param id path string false "id" // @Param playerId path string false "playerId"
// @Success 200 {string} string "{"code": 200, "data": [...]}" // @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /mobile/v1/org-player/get-match-season [get] // @Router /mobile/v1/org-player/get-match-season [get]
// @Security Bearer // @Security Bearer
...@@ -206,10 +206,10 @@ func (e OrgPlayer) GetOrgMatchSeason(c *gin.Context) { ...@@ -206,10 +206,10 @@ func (e OrgPlayer) GetOrgMatchSeason(c *gin.Context) {
return return
} }
//生涯数据 //生涯数据
err, matchId2 := s.GetMatchId(strconv.Itoa(req.Id), "") err, matchId2 := s.GetMatchId(strconv.Itoa(req.PlayerId), "")
replyGetRoundsScoring := make([]dto.OrgPlayerRoundsScoring, 0) replyGetRoundsScoring := make([]dto.OrgPlayerRoundsScoring, 0)
err = s.GetSeasonRoundsScoring(strconv.Itoa(req.Id), matchId2, &replyGetRoundsScoring) err = s.GetSeasonRoundsScoring(strconv.Itoa(req.PlayerId), matchId2, &replyGetRoundsScoring)
if err != nil { if err != nil {
e.Error(500, err, fmt.Sprintf("获取比赛球员信息 失败,\r\n失败信息 %s", err.Error())) e.Error(500, err, fmt.Sprintf("获取比赛球员信息 失败,\r\n失败信息 %s", err.Error()))
return return
......
...@@ -16,7 +16,7 @@ func registerOrgPlayerRouter(v1 *gin.RouterGroup) { ...@@ -16,7 +16,7 @@ func registerOrgPlayerRouter(v1 *gin.RouterGroup) {
{ {
r.GET("", api.GetPage) r.GET("", api.GetPage)
r.GET("/:id", api.Get) 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("/get-match-season", api.GetOrgMatchSeason)
r.GET("/evaluate", api.GetOrgMatchEvaluate) r.GET("/evaluate", api.GetOrgMatchEvaluate)
r.GET("/get-rounds", api.GetOrgRounds) r.GET("/get-rounds", api.GetOrgRounds)
......
...@@ -139,7 +139,7 @@ type OrgMatchEvaluateList struct { ...@@ -139,7 +139,7 @@ type OrgMatchEvaluateList struct {
// OrgPlayerGetReq 功能获取请求参数 // OrgPlayerGetReq 功能获取请求参数
type OrgPlayerGetReq struct { type OrgPlayerGetReq struct {
Id int `uri:"id"` PlayerId int `form:"playerId" json:"playerId"`
} }
type OrgPlayerGetReply struct { type OrgPlayerGetReply struct {
...@@ -165,7 +165,7 @@ type OrgPlayerGetReply struct { ...@@ -165,7 +165,7 @@ type OrgPlayerGetReply struct {
} }
func (s *OrgPlayerGetReq) GetId() interface{} { func (s *OrgPlayerGetReq) GetId() interface{} {
return s.Id return s.PlayerId
} }
func Pwd(password string) string { func Pwd(password string) string {
......
...@@ -591,12 +591,14 @@ func (e *OrgPlayer) GetPageWonderful(evaluateId string, list *[]cDto.Wonderful, ...@@ -591,12 +591,14 @@ func (e *OrgPlayer) GetPageWonderful(evaluateId string, list *[]cDto.Wonderful,
func (e *OrgPlayer) GetNowSeasonId() string { func (e *OrgPlayer) GetNowSeasonId() string {
reply := new(models.OrgSeason) reply := new(models.OrgSeason)
now := time.Now() now := time.Now()
negativeM, _ := time.ParseDuration("-5m") //negativeM, _ := time.ParseDuration("-5m")
nowBefore := now.Add(negativeM) //nowBefore := now.Add(negativeM)
err := e.Orm.Table("org_season"). err := e.Orm.Table("org_season").
Select("id").
Scopes(cDto.PassDel("org_season")). Scopes(cDto.PassDel("org_season")).
Where("start_time>?", nowBefore). Where("start_time<?", now).
Where("end_time>?", now).
Order("id desc"). Order("id desc").
First(&reply).Error First(&reply).Error
if err != nil && errors.Is(err, gorm.ErrRecordNotFound) { if err != nil && errors.Is(err, gorm.ErrRecordNotFound) {
...@@ -608,5 +610,5 @@ func (e *OrgPlayer) GetNowSeasonId() string { ...@@ -608,5 +610,5 @@ func (e *OrgPlayer) GetNowSeasonId() string {
e.Log.Errorf("db error:%s", err) e.Log.Errorf("db error:%s", err)
return "0" return "0"
} }
return "0" return strconv.Itoa(reply.Id)
} }
...@@ -6791,8 +6791,8 @@ var doc = `{ ...@@ -6791,8 +6791,8 @@ var doc = `{
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
"description": "id", "description": "playerId",
"name": "id", "name": "playerId",
"in": "path" "in": "path"
} }
], ],
...@@ -6851,8 +6851,8 @@ var doc = `{ ...@@ -6851,8 +6851,8 @@ var doc = `{
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
"description": "id", "description": "playerId",
"name": "id", "name": "playerId",
"in": "path" "in": "path"
} }
], ],
...@@ -7248,19 +7248,8 @@ var doc = `{ ...@@ -7248,19 +7248,8 @@ var doc = `{
"dto.OrgLeagueGetPageReq": { "dto.OrgLeagueGetPageReq": {
"type": "object", "type": "object",
"properties": { "properties": {
"createBy": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"deletedAt": {
"type": "string"
},
"id": {
"type": "integer"
},
"leagueName": { "leagueName": {
"description": "联赛级别",
"type": "string" "type": "string"
}, },
"pageIndex": { "pageIndex": {
...@@ -7268,15 +7257,6 @@ var doc = `{ ...@@ -7268,15 +7257,6 @@ var doc = `{
}, },
"pageSize": { "pageSize": {
"type": "integer" "type": "integer"
},
"status": {
"type": "string"
},
"updateBy": {
"type": "string"
},
"updatedAt": {
"type": "string"
} }
} }
}, },
...@@ -7804,6 +7784,9 @@ var doc = `{ ...@@ -7804,6 +7784,9 @@ var doc = `{
"playerName": { "playerName": {
"type": "string" "type": "string"
}, },
"playerUserId": {
"type": "string"
},
"status": { "status": {
"type": "string" "type": "string"
}, },
...@@ -9628,12 +9611,21 @@ var doc = `{ ...@@ -9628,12 +9611,21 @@ var doc = `{
"models.SysDept": { "models.SysDept": {
"type": "object", "type": "object",
"properties": { "properties": {
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/models.SysDept"
}
},
"createBy": { "createBy": {
"type": "integer" "type": "integer"
}, },
"createdAt": { "createdAt": {
"type": "string" "type": "string"
}, },
"dataScope": {
"type": "string"
},
"deptId": { "deptId": {
"description": "部门编码", "description": "部门编码",
"type": "integer" "type": "integer"
...@@ -9653,6 +9645,9 @@ var doc = `{ ...@@ -9653,6 +9645,9 @@ var doc = `{
"description": "负责人", "description": "负责人",
"type": "string" "type": "string"
}, },
"params": {
"type": "string"
},
"parentId": { "parentId": {
"description": "上级部门", "description": "上级部门",
"type": "integer" "type": "integer"
...@@ -9683,21 +9678,9 @@ var doc = `{ ...@@ -9683,21 +9678,9 @@ var doc = `{
"action": { "action": {
"type": "string" "type": "string"
}, },
"apis": {
"type": "array",
"items": {
"type": "integer"
}
},
"breadcrumb": { "breadcrumb": {
"type": "string" "type": "string"
}, },
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/models.SysMenu"
}
},
"component": { "component": {
"type": "string" "type": "string"
}, },
...@@ -9707,18 +9690,12 @@ var doc = `{ ...@@ -9707,18 +9690,12 @@ var doc = `{
"createdAt": { "createdAt": {
"type": "string" "type": "string"
}, },
"dataScope": {
"type": "string"
},
"icon": { "icon": {
"type": "string" "type": "string"
}, },
"isFrame": { "isFrame": {
"type": "string" "type": "string"
}, },
"is_select": {
"type": "boolean"
},
"menuId": { "menuId": {
"type": "integer" "type": "integer"
}, },
...@@ -9731,9 +9708,6 @@ var doc = `{ ...@@ -9731,9 +9708,6 @@ var doc = `{
"noCache": { "noCache": {
"type": "boolean" "type": "boolean"
}, },
"params": {
"type": "string"
},
"parentId": { "parentId": {
"type": "integer" "type": "integer"
}, },
...@@ -9746,9 +9720,6 @@ var doc = `{ ...@@ -9746,9 +9720,6 @@ var doc = `{
"permission": { "permission": {
"type": "string" "type": "string"
}, },
"roleId": {
"type": "integer"
},
"sort": { "sort": {
"type": "integer" "type": "integer"
}, },
......
...@@ -6774,8 +6774,8 @@ ...@@ -6774,8 +6774,8 @@
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
"description": "id", "description": "playerId",
"name": "id", "name": "playerId",
"in": "path" "in": "path"
} }
], ],
...@@ -6834,8 +6834,8 @@ ...@@ -6834,8 +6834,8 @@
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
"description": "id", "description": "playerId",
"name": "id", "name": "playerId",
"in": "path" "in": "path"
} }
], ],
...@@ -7231,19 +7231,8 @@ ...@@ -7231,19 +7231,8 @@
"dto.OrgLeagueGetPageReq": { "dto.OrgLeagueGetPageReq": {
"type": "object", "type": "object",
"properties": { "properties": {
"createBy": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"deletedAt": {
"type": "string"
},
"id": {
"type": "integer"
},
"leagueName": { "leagueName": {
"description": "联赛级别",
"type": "string" "type": "string"
}, },
"pageIndex": { "pageIndex": {
...@@ -7251,15 +7240,6 @@ ...@@ -7251,15 +7240,6 @@
}, },
"pageSize": { "pageSize": {
"type": "integer" "type": "integer"
},
"status": {
"type": "string"
},
"updateBy": {
"type": "string"
},
"updatedAt": {
"type": "string"
} }
} }
}, },
...@@ -7787,6 +7767,9 @@ ...@@ -7787,6 +7767,9 @@
"playerName": { "playerName": {
"type": "string" "type": "string"
}, },
"playerUserId": {
"type": "string"
},
"status": { "status": {
"type": "string" "type": "string"
}, },
...@@ -9611,12 +9594,21 @@ ...@@ -9611,12 +9594,21 @@
"models.SysDept": { "models.SysDept": {
"type": "object", "type": "object",
"properties": { "properties": {
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/models.SysDept"
}
},
"createBy": { "createBy": {
"type": "integer" "type": "integer"
}, },
"createdAt": { "createdAt": {
"type": "string" "type": "string"
}, },
"dataScope": {
"type": "string"
},
"deptId": { "deptId": {
"description": "部门编码", "description": "部门编码",
"type": "integer" "type": "integer"
...@@ -9636,6 +9628,9 @@ ...@@ -9636,6 +9628,9 @@
"description": "负责人", "description": "负责人",
"type": "string" "type": "string"
}, },
"params": {
"type": "string"
},
"parentId": { "parentId": {
"description": "上级部门", "description": "上级部门",
"type": "integer" "type": "integer"
...@@ -9666,21 +9661,9 @@ ...@@ -9666,21 +9661,9 @@
"action": { "action": {
"type": "string" "type": "string"
}, },
"apis": {
"type": "array",
"items": {
"type": "integer"
}
},
"breadcrumb": { "breadcrumb": {
"type": "string" "type": "string"
}, },
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/models.SysMenu"
}
},
"component": { "component": {
"type": "string" "type": "string"
}, },
...@@ -9690,18 +9673,12 @@ ...@@ -9690,18 +9673,12 @@
"createdAt": { "createdAt": {
"type": "string" "type": "string"
}, },
"dataScope": {
"type": "string"
},
"icon": { "icon": {
"type": "string" "type": "string"
}, },
"isFrame": { "isFrame": {
"type": "string" "type": "string"
}, },
"is_select": {
"type": "boolean"
},
"menuId": { "menuId": {
"type": "integer" "type": "integer"
}, },
...@@ -9714,9 +9691,6 @@ ...@@ -9714,9 +9691,6 @@
"noCache": { "noCache": {
"type": "boolean" "type": "boolean"
}, },
"params": {
"type": "string"
},
"parentId": { "parentId": {
"type": "integer" "type": "integer"
}, },
...@@ -9729,9 +9703,6 @@ ...@@ -9729,9 +9703,6 @@
"permission": { "permission": {
"type": "string" "type": "string"
}, },
"roleId": {
"type": "integer"
},
"sort": { "sort": {
"type": "integer" "type": "integer"
}, },
......
...@@ -232,26 +232,13 @@ definitions: ...@@ -232,26 +232,13 @@ definitions:
type: object type: object
dto.OrgLeagueGetPageReq: dto.OrgLeagueGetPageReq:
properties: properties:
createBy:
type: string
createdAt:
type: string
deletedAt:
type: string
id:
type: integer
leagueName: leagueName:
description: 联赛级别
type: string type: string
pageIndex: pageIndex:
type: integer type: integer
pageSize: pageSize:
type: integer type: integer
status:
type: string
updateBy:
type: string
updatedAt:
type: string
type: object type: object
dto.OrgLeagueInsertReq: dto.OrgLeagueInsertReq:
properties: properties:
...@@ -601,6 +588,8 @@ definitions: ...@@ -601,6 +588,8 @@ definitions:
type: integer type: integer
playerName: playerName:
type: string type: string
playerUserId:
type: string
status: status:
type: string type: string
teamId: teamId:
...@@ -1833,10 +1822,16 @@ definitions: ...@@ -1833,10 +1822,16 @@ definitions:
type: object type: object
models.SysDept: models.SysDept:
properties: properties:
children:
items:
$ref: '#/definitions/models.SysDept'
type: array
createBy: createBy:
type: integer type: integer
createdAt: createdAt:
type: string type: string
dataScope:
type: string
deptId: deptId:
description: 部门编码 description: 部门编码
type: integer type: integer
...@@ -1851,6 +1846,8 @@ definitions: ...@@ -1851,6 +1846,8 @@ definitions:
leader: leader:
description: 负责人 description: 负责人
type: string type: string
params:
type: string
parentId: parentId:
description: 上级部门 description: 上级部门
type: integer type: integer
...@@ -1872,28 +1869,16 @@ definitions: ...@@ -1872,28 +1869,16 @@ definitions:
properties: properties:
action: action:
type: string type: string
apis:
items:
type: integer
type: array
breadcrumb: breadcrumb:
type: string type: string
children:
items:
$ref: '#/definitions/models.SysMenu'
type: array
component: component:
type: string type: string
createBy: createBy:
type: integer type: integer
createdAt: createdAt:
type: string type: string
dataScope:
type: string
icon: icon:
type: string type: string
is_select:
type: boolean
isFrame: isFrame:
type: string type: string
menuId: menuId:
...@@ -1904,8 +1889,6 @@ definitions: ...@@ -1904,8 +1889,6 @@ definitions:
type: string type: string
noCache: noCache:
type: boolean type: boolean
params:
type: string
parentId: parentId:
type: integer type: integer
path: path:
...@@ -1914,8 +1897,6 @@ definitions: ...@@ -1914,8 +1897,6 @@ definitions:
type: string type: string
permission: permission:
type: string type: string
roleId:
type: integer
sort: sort:
type: integer type: integer
sysApi: sysApi:
...@@ -6301,9 +6282,9 @@ paths: ...@@ -6301,9 +6282,9 @@ paths:
get: get:
description: <手机端>获取球员生涯数据 description: <手机端>获取球员生涯数据
parameters: parameters:
- description: id - description: playerId
in: path in: path
name: id name: playerId
type: string type: string
responses: responses:
"200": "200":
...@@ -6337,9 +6318,9 @@ paths: ...@@ -6337,9 +6318,9 @@ paths:
get: get:
description: <手机端>获取球员赛季数据 description: <手机端>获取球员赛季数据
parameters: parameters:
- description: id - description: playerId
in: path in: path
name: id name: playerId
type: string type: string
responses: responses:
"200": "200":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment