Commit 361f4e51 authored by haoyanbin's avatar haoyanbin

swag

parent 676562a8
......@@ -131,7 +131,7 @@ func (e OrgPlayer) Get(c *gin.Context) {
// @Summary <手机端>获取球员赛季数据
// @Description <手机端>获取球员赛季数据
// @Tags <手机端>球员数据
// @Param id path string false "id"
// @Param playerId path string false "playerId"
// @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.PlayerId), 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.PlayerId), seasonId)
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 {
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 "id"
// @Param playerId path string false "playerId"
// @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.PlayerId), "")
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 {
e.Error(500, err, fmt.Sprintf("获取比赛球员信息 失败,\r\n失败信息 %s", err.Error()))
return
......
......@@ -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)
......
......@@ -139,7 +139,7 @@ type OrgMatchEvaluateList struct {
// OrgPlayerGetReq 功能获取请求参数
type OrgPlayerGetReq struct {
Id int `uri:"id"`
PlayerId int `form:"playerId" json:"playerId"`
}
type OrgPlayerGetReply struct {
......@@ -165,7 +165,7 @@ type OrgPlayerGetReply struct {
}
func (s *OrgPlayerGetReq) GetId() interface{} {
return s.Id
return s.PlayerId
}
func Pwd(password string) string {
......
......@@ -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)
}
......@@ -6791,8 +6791,8 @@ var doc = `{
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"description": "playerId",
"name": "playerId",
"in": "path"
}
],
......@@ -6851,8 +6851,8 @@ var doc = `{
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"description": "playerId",
"name": "playerId",
"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"
},
......
......@@ -6774,8 +6774,8 @@
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"description": "playerId",
"name": "playerId",
"in": "path"
}
],
......@@ -6834,8 +6834,8 @@
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"description": "playerId",
"name": "playerId",
"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"
},
......
......@@ -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: id
- description: playerId
in: path
name: id
name: playerId
type: string
responses:
"200":
......@@ -6337,9 +6318,9 @@ paths:
get:
description: <手机端>获取球员赛季数据
parameters:
- description: id
- description: playerId
in: path
name: id
name: playerId
type: string
responses:
"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