Commit 233de2ab authored by haoyanbin's avatar haoyanbin

Club

parent 7f6c3f53
......@@ -61,7 +61,7 @@ func (e OrgPlayer) GetPage(c *gin.Context) {
// @Tags <手机端>球员数据
// @Param id path string false "id"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /api/v1/org-player/{id} [get]
// @Router /mobile/v1/org-player/{id} [get]
// @Security Bearer
func (e OrgPlayer) Get(c *gin.Context) {
req := dto.OrgPlayerGetReq{}
......
package apis
import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/go-admin-team/go-admin-core/sdk/api"
_ "github.com/go-admin-team/go-admin-core/sdk/pkg/response"
......@@ -144,72 +143,3 @@ func (e OrgPlayerUser) Login(c *gin.Context) {
e.OK(reply, "查询成功")
}
// GetPage <手机端>获取球员账户信息列表
// @Summary <手机端>获取球员账户信息列表
// @Description <手机端>获取球员账户信息列表
// @Tags <手机端>球员账户
// @Param pageSize query int false "页条数"
// @Param pageIndex query int false "页码"
// @Success 200 {string} string {"code": 200, "data": [...]}
// @Router /mobile/v1/org-player-user [get]
// @Security Bearer
func (e OrgPlayerUser) GetPage(c *gin.Context) {
req := dto.OrgPlayerUserGetPageReq{}
s := service.OrgPlayerUser{}
err := e.MakeContext(c).
MakeOrm().
Bind(&req).
MakeService(&s.Service).
Errors
if err != nil {
e.Logger.Error(err)
e.Error(500, err, err.Error())
return
}
p := actions.GetPermissionFromContext(c)
list := make([]models.OrgPlayerUser, 0)
var count int64
err = s.GetPage(&req, p, &list, &count)
if err != nil {
e.Error(500, err, fmt.Sprintf("获取球员账户信息 失败,\r\n失败信息 %s", err.Error()))
return
}
e.PageOK(list, int(count), req.GetPageIndex(), req.GetPageSize(), "查询成功")
}
// Get <手机端>获取球员账户信息
// @Summary <手机端>获取球员账户信息
// @Description <手机端>获取球员账户信息
// @Tags <手机端>球员账户
// @Param id path string false "id"
// @Success 200 {string} string "{"code": 200,"msg":"更新成功","data":{}}"
// @Router /mobile/v1/org-player-user/{id} [get]
// @Security Bearer
func (e OrgPlayerUser) Get(c *gin.Context) {
req := dto.OrgPlayerUserGetReq{}
s := service.OrgPlayerUser{}
err := e.MakeContext(c).
MakeOrm().
Bind(&req).
MakeService(&s.Service).
Errors
if err != nil {
e.Logger.Error(err)
e.Error(500, err, err.Error())
return
}
var object models.OrgPlayerUser
p := actions.GetPermissionFromContext(c)
err = s.Get(&req, p, &object)
if err != nil {
e.Error(500, err, fmt.Sprintf("获取球员账户信息失败,\r\n失败信息 %s", err.Error()))
return
}
e.OK(object, "查询成功")
}
......@@ -2,6 +2,7 @@ package apis
import (
"fmt"
"strconv"
"github.com/gin-gonic/gin"
"github.com/go-admin-team/go-admin-core/sdk/api"
......@@ -24,7 +25,7 @@ type OrgTeamClub struct {
// @Tags <球队>俱乐部
// @Param id path string false "id"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /api/v1/org-team-club/{id} [get]
// @Router /api/v1/org-team-club [get]
// @Security Bearer
func (e OrgTeamClub) Get(c *gin.Context) {
req := dto.OrgClubGetReq{}
......@@ -39,9 +40,18 @@ func (e OrgTeamClub) Get(c *gin.Context) {
e.Error(500, err, err.Error())
return
}
sOrgTeamUser := service.OrgTeamUser{}
e.MakeContext(c).MakeOrm().MakeService(&sOrgTeamUser.Service)
_, teamId := sOrgTeamUser.GetTeamId(user.GetUserId(c))
_, clubId := sOrgTeamUser.GetClubId(teamId)
var object models.OrgClub
p := actions.GetPermissionFromContext(c)
req.Id, _ = strconv.Atoi(clubId)
err = s.Get(&req, p, &object)
if err != nil {
e.Error(500, err, fmt.Sprintf("获取俱乐部失败,\r\n失败信息 %s", err.Error()))
......
......@@ -17,7 +17,7 @@ func registerOrgTeamClubRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMi
api := apis.OrgTeamClub{}
r := v1.Group("/org-team-club").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
{
r.GET("/:id", api.Get)
r.GET("", api.Get)
r.PUT("/:id", api.Update)
}
}
......@@ -138,6 +138,21 @@ func (e *OrgTeamUser) GetUserIds(ids []int) (error, []int) {
return nil, userIds
}
// Get 获取OrgClubUser对象
func (e *OrgTeamUser) GetClubId(teamId string) (error, string) {
data := new(models.OrgTeam)
err := e.Orm.Table("org_team").
Select("club_id").
Where("id=?", teamId).
First(&data).Error
if err != nil {
e.Log.Errorf("db error:%s", err)
return err, ""
}
return nil, data.ClubId
}
// Get 获取OrgClubUser对象
func (e *OrgTeamUser) GetTeamId(userId int) (error, string) {
data := new(models.OrgTeamUser)
......
......@@ -3670,7 +3670,7 @@ var doc = `{
}
}
},
"/api/v1/org-team-club/{id}": {
"/api/v1/org-team-club": {
"get": {
"security": [
{
......@@ -3698,7 +3698,9 @@ var doc = `{
}
}
}
}
},
"/api/v1/org-team-club/{id}": {
"put": {
"security": [
{
......@@ -6720,42 +6722,6 @@ var doc = `{
}
}
},
"/mobile/v1/org-player-user": {
"get": {
"security": [
{
"Bearer": []
}
],
"description": "\u003c手机端\u003e获取球员账户信息列表",
"tags": [
"\u003c手机端\u003e球员账户"
],
"summary": "\u003c手机端\u003e获取球员账户信息列表",
"parameters": [
{
"type": "integer",
"description": "页条数",
"name": "pageSize",
"in": "query"
},
{
"type": "integer",
"description": "页码",
"name": "pageIndex",
"in": "query"
}
],
"responses": {
"200": {
"description": "code\": 200, \"data\": [...]}",
"schema": {
"type": "string"
}
}
}
}
},
"/mobile/v1/org-player-user/get-msg": {
"post": {
"security": [
......@@ -6822,36 +6788,6 @@ var doc = `{
}
}
},
"/mobile/v1/org-player-user/{id}": {
"get": {
"security": [
{
"Bearer": []
}
],
"description": "\u003c手机端\u003e获取球员账户信息",
"tags": [
"\u003c手机端\u003e球员账户"
],
"summary": "\u003c手机端\u003e获取球员账户信息",
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"in": "path"
}
],
"responses": {
"200": {
"description": "{\"code\": 200,\"msg\":\"更新成功\",\"data\":{}}",
"schema": {
"type": "string"
}
}
}
}
},
"/mobile/v1/org-player/evaluate": {
"get": {
"security": [
......@@ -6965,6 +6901,36 @@ var doc = `{
}
}
}
},
"/mobile/v1/org-player/{id}": {
"get": {
"security": [
{
"Bearer": []
}
],
"description": "\u003c手机端\u003e获取球员详情",
"tags": [
"\u003c手机端\u003e球员数据"
],
"summary": "\u003c手机端\u003e获取球员详情",
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"in": "path"
}
],
"responses": {
"200": {
"description": "{\"code\": 200, \"data\": [...]}",
"schema": {
"type": "string"
}
}
}
}
}
},
"definitions": {
......@@ -7318,19 +7284,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": {
......@@ -7338,15 +7293,6 @@ var doc = `{
},
"pageSize": {
"type": "integer"
},
"status": {
"type": "string"
},
"updateBy": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
},
......@@ -7799,27 +7745,11 @@ var doc = `{
"dto.OrgNewsGetPageReq": {
"type": "object",
"properties": {
"endTime": {
"description": "结束时间",
"type": "string"
},
"newsName": {
"description": "新闻名称",
"type": "string"
},
"pageIndex": {
"type": "integer"
},
"pageSize": {
"type": "integer"
},
"startTime": {
"description": "开始时间",
"type": "string"
},
"status": {
"description": "新闻状态",
"type": "string"
}
}
},
......@@ -9557,21 +9487,12 @@ 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"
......@@ -9591,9 +9512,6 @@ var doc = `{
"description": "负责人",
"type": "string"
},
"params": {
"type": "string"
},
"parentId": {
"description": "上级部门",
"type": "integer"
......@@ -9624,9 +9542,21 @@ 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"
},
......@@ -9636,12 +9566,18 @@ var doc = `{
"createdAt": {
"type": "string"
},
"dataScope": {
"type": "string"
},
"icon": {
"type": "string"
},
"isFrame": {
"type": "string"
},
"is_select": {
"type": "boolean"
},
"menuId": {
"type": "integer"
},
......@@ -9654,6 +9590,9 @@ var doc = `{
"noCache": {
"type": "boolean"
},
"params": {
"type": "string"
},
"parentId": {
"type": "integer"
},
......@@ -9666,6 +9605,9 @@ var doc = `{
"permission": {
"type": "string"
},
"roleId": {
"type": "integer"
},
"sort": {
"type": "integer"
},
......
......@@ -3653,7 +3653,7 @@
}
}
},
"/api/v1/org-team-club/{id}": {
"/api/v1/org-team-club": {
"get": {
"security": [
{
......@@ -3681,7 +3681,9 @@
}
}
}
}
},
"/api/v1/org-team-club/{id}": {
"put": {
"security": [
{
......@@ -6703,42 +6705,6 @@
}
}
},
"/mobile/v1/org-player-user": {
"get": {
"security": [
{
"Bearer": []
}
],
"description": "\u003c手机端\u003e获取球员账户信息列表",
"tags": [
"\u003c手机端\u003e球员账户"
],
"summary": "\u003c手机端\u003e获取球员账户信息列表",
"parameters": [
{
"type": "integer",
"description": "页条数",
"name": "pageSize",
"in": "query"
},
{
"type": "integer",
"description": "页码",
"name": "pageIndex",
"in": "query"
}
],
"responses": {
"200": {
"description": "code\": 200, \"data\": [...]}",
"schema": {
"type": "string"
}
}
}
}
},
"/mobile/v1/org-player-user/get-msg": {
"post": {
"security": [
......@@ -6805,36 +6771,6 @@
}
}
},
"/mobile/v1/org-player-user/{id}": {
"get": {
"security": [
{
"Bearer": []
}
],
"description": "\u003c手机端\u003e获取球员账户信息",
"tags": [
"\u003c手机端\u003e球员账户"
],
"summary": "\u003c手机端\u003e获取球员账户信息",
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"in": "path"
}
],
"responses": {
"200": {
"description": "{\"code\": 200,\"msg\":\"更新成功\",\"data\":{}}",
"schema": {
"type": "string"
}
}
}
}
},
"/mobile/v1/org-player/evaluate": {
"get": {
"security": [
......@@ -6948,6 +6884,36 @@
}
}
}
},
"/mobile/v1/org-player/{id}": {
"get": {
"security": [
{
"Bearer": []
}
],
"description": "\u003c手机端\u003e获取球员详情",
"tags": [
"\u003c手机端\u003e球员数据"
],
"summary": "\u003c手机端\u003e获取球员详情",
"parameters": [
{
"type": "string",
"description": "id",
"name": "id",
"in": "path"
}
],
"responses": {
"200": {
"description": "{\"code\": 200, \"data\": [...]}",
"schema": {
"type": "string"
}
}
}
}
}
},
"definitions": {
......@@ -7301,19 +7267,8 @@
"dto.OrgLeagueGetPageReq": {
"type": "object",
"properties": {
"createBy": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"deletedAt": {
"type": "string"
},
"id": {
"type": "integer"
},
"leagueName": {
"description": "联赛级别",
"type": "string"
},
"pageIndex": {
......@@ -7321,15 +7276,6 @@
},
"pageSize": {
"type": "integer"
},
"status": {
"type": "string"
},
"updateBy": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
},
......@@ -7782,27 +7728,11 @@
"dto.OrgNewsGetPageReq": {
"type": "object",
"properties": {
"endTime": {
"description": "结束时间",
"type": "string"
},
"newsName": {
"description": "新闻名称",
"type": "string"
},
"pageIndex": {
"type": "integer"
},
"pageSize": {
"type": "integer"
},
"startTime": {
"description": "开始时间",
"type": "string"
},
"status": {
"description": "新闻状态",
"type": "string"
}
}
},
......@@ -9540,21 +9470,12 @@
"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"
......@@ -9574,9 +9495,6 @@
"description": "负责人",
"type": "string"
},
"params": {
"type": "string"
},
"parentId": {
"description": "上级部门",
"type": "integer"
......@@ -9607,9 +9525,21 @@
"action": {
"type": "string"
},
"apis": {
"type": "array",
"items": {
"type": "integer"
}
},
"breadcrumb": {
"type": "string"
},
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/models.SysMenu"
}
},
"component": {
"type": "string"
},
......@@ -9619,12 +9549,18 @@
"createdAt": {
"type": "string"
},
"dataScope": {
"type": "string"
},
"icon": {
"type": "string"
},
"isFrame": {
"type": "string"
},
"is_select": {
"type": "boolean"
},
"menuId": {
"type": "integer"
},
......@@ -9637,6 +9573,9 @@
"noCache": {
"type": "boolean"
},
"params": {
"type": "string"
},
"parentId": {
"type": "integer"
},
......@@ -9649,6 +9588,9 @@
"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:
......@@ -552,22 +539,10 @@ definitions:
type: object
dto.OrgNewsGetPageReq:
properties:
endTime:
description: 结束时间
type: string
newsName:
description: 新闻名称
type: string
pageIndex:
type: integer
pageSize:
type: integer
startTime:
description: 开始时间
type: string
status:
description: 新闻状态
type: string
type: object
dto.OrgNewsInsertReq:
properties:
......@@ -1739,16 +1714,10 @@ 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
......@@ -1763,8 +1732,6 @@ definitions:
leader:
description: 负责人
type: string
params:
type: string
parentId:
description: 上级部门
type: integer
......@@ -1786,16 +1753,28 @@ 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:
......@@ -1806,6 +1785,8 @@ definitions:
type: string
noCache:
type: boolean
params:
type: string
parentId:
type: integer
path:
......@@ -1814,6 +1795,8 @@ definitions:
type: string
permission:
type: string
roleId:
type: integer
sort:
type: integer
sysApi:
......@@ -4265,7 +4248,7 @@ paths:
summary: <球队>创建球队
tags:
- <球队>球队
/api/v1/org-team-club/{id}:
/api/v1/org-team-club:
get:
description: <球队>获取俱乐部详情
parameters:
......@@ -4283,6 +4266,7 @@ paths:
summary: <球队>获取俱乐部详情
tags:
- <球队>俱乐部
/api/v1/org-team-club/{id}:
put:
consumes:
- application/json
......@@ -6141,46 +6125,6 @@ paths:
summary: <手机端>获取球员排名
tags:
- <手机端>比赛排名
/mobile/v1/org-player-user:
get:
description: <手机端>获取球员账户信息列表
parameters:
- description: 页条数
in: query
name: pageSize
type: integer
- description: 页码
in: query
name: pageIndex
type: integer
responses:
"200":
description: 'code": 200, "data": [...]}'
schema:
type: string
security:
- Bearer: []
summary: <手机端>获取球员账户信息列表
tags:
- <手机端>球员账户
/mobile/v1/org-player-user/{id}:
get:
description: <手机端>获取球员账户信息
parameters:
- description: id
in: path
name: id
type: string
responses:
"200":
description: '{"code": 200,"msg":"更新成功","data":{}}'
schema:
type: string
security:
- Bearer: []
summary: <手机端>获取球员账户信息
tags:
- <手机端>球员账户
/mobile/v1/org-player-user/get-msg:
post:
description: <手机端>获取验证码
......@@ -6221,6 +6165,24 @@ paths:
summary: 获取球员账户信息列表
tags:
- <手机端>球员账户
/mobile/v1/org-player/{id}:
get:
description: <手机端>获取球员详情
parameters:
- description: id
in: path
name: id
type: string
responses:
"200":
description: '{"code": 200, "data": [...]}'
schema:
type: string
security:
- Bearer: []
summary: <手机端>获取球员详情
tags:
- <手机端>球员数据
/mobile/v1/org-player/evaluate:
get:
description: <手机端>获取球员精彩时刻
......
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