Commit 4b397d07 authored by haoyanbin's avatar haoyanbin

Swag

parent 361f4e51
package apis package apis
import ( import (
"fmt"
"github.com/gin-gonic/gin/binding" "github.com/gin-gonic/gin/binding"
sService "go-admin/app/admin/service" sService "go-admin/app/admin/service"
sDto "go-admin/app/admin/service/dto" sDto "go-admin/app/admin/service/dto"
...@@ -21,10 +22,10 @@ type OrgUser struct { ...@@ -21,10 +22,10 @@ type OrgUser struct {
api.Api api.Api
} }
// GetPage // GetPage <赛事>人员管理列表
// @Summary <赛事>列表用户信息数据 // @Summary <赛事>人员管理列表
// @Description 获取JSON // @Description 获取JSON
// @Tags 用户 // @Tags <赛事>人员管理
// @Param data body dto.OrgUserGetPageReq true "data" // @Param data body dto.OrgUserGetPageReq true "data"
// @Success 200 {string} {object} response.Response "{"code": 200, "data": [...]}" // @Success 200 {string} {object} response.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/org-user [get] // @Router /api/v1/org-user [get]
...@@ -58,10 +59,10 @@ func (e OrgUser) GetPage(c *gin.Context) { ...@@ -58,10 +59,10 @@ func (e OrgUser) GetPage(c *gin.Context) {
e.PageOK(list, int(count), req.GetPageIndex(), req.GetPageSize(), "查询成功") e.PageOK(list, int(count), req.GetPageIndex(), req.GetPageSize(), "查询成功")
} }
// Get // Get <赛事>获取人员详情
// @Summary 获取用户 // @Summary <赛事>获取人员详情
// @Description 获取JSON // @Description 获取JSON
// @Tags 用户 // @Tags <赛事>人员管理
// @Param userId path int true "用户编码" // @Param userId path int true "用户编码"
// @Success 200 {string} string "{"code": 200, "data": [...]}" // @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /api/v1/org-user/{userId} [get] // @Router /api/v1/org-user/{userId} [get]
...@@ -90,10 +91,10 @@ func (e OrgUser) Get(c *gin.Context) { ...@@ -90,10 +91,10 @@ func (e OrgUser) Get(c *gin.Context) {
e.OK(object, "查询成功") e.OK(object, "查询成功")
} }
// Insert // Insert <赛事>创建人员
// @Summary 创建用户 // @Summary <赛事>创建人员
// @Description 获取JSON // @Description 获取JSON
// @Tags 用户 // @Tags <赛事>人员管理
// @Accept application/json // @Accept application/json
// @Product application/json // @Product application/json
// @Param data body dto.OrgUserInsertReq true "用户数据" // @Param data body dto.OrgUserInsertReq true "用户数据"
...@@ -144,10 +145,10 @@ func (e OrgUser) Insert(c *gin.Context) { ...@@ -144,10 +145,10 @@ func (e OrgUser) Insert(c *gin.Context) {
e.OK(req.GetId(), "创建成功") e.OK(req.GetId(), "创建成功")
} }
// Update // Update <赛事>修改人员数据
// @Summary 修改用户数据 // @Summary <赛事>修改人员数据
// @Description 获取JSON // @Description 获取JSON
// @Tags 用户 // @Tags <赛事>人员管理
// @Accept application/json // @Accept application/json
// @Product application/json // @Product application/json
// @Param data body dto.OrgUserUpdateReq true "body" // @Param data body dto.OrgUserUpdateReq true "body"
...@@ -181,10 +182,10 @@ func (e OrgUser) Update(c *gin.Context) { ...@@ -181,10 +182,10 @@ func (e OrgUser) Update(c *gin.Context) {
e.OK(req.GetId(), "更新成功") e.OK(req.GetId(), "更新成功")
} }
// Delete // Delete <赛事>删除人员数据
// @Summary 删除用户数据 // @Summary <赛事>删除人员数据
// @Description 删除数据 // @Description 删除数据
// @Tags 用户 // @Tags <赛事>人员管理
// @Param userId path int true "userId" // @Param userId path int true "userId"
// @Success 200 {string} string "{"code": 200, "data": [...]}" // @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /api/v1/org-user/{userId} [delete] // @Router /api/v1/org-user/{userId} [delete]
...@@ -204,7 +205,7 @@ func (e OrgUser) Delete(c *gin.Context) { ...@@ -204,7 +205,7 @@ func (e OrgUser) Delete(c *gin.Context) {
} }
// 设置编辑人 // 设置编辑人
//req.SetUpdateBy(user.GetUserId(c)) //req. = user.GetUserId(c))
// 数据权限检查 // 数据权限检查
p := actions.GetPermissionFromContext(c) p := actions.GetPermissionFromContext(c)
...@@ -217,10 +218,10 @@ func (e OrgUser) Delete(c *gin.Context) { ...@@ -217,10 +218,10 @@ func (e OrgUser) Delete(c *gin.Context) {
e.OK(req.GetId(), "删除成功") e.OK(req.GetId(), "删除成功")
} }
// UpdateStatus 修改用户状态 // UpdateStatus <赛事>修改人员状态
// @Summary 修改用户状态 // @Summary <赛事>修改人员状态
// @Description 获取JSON // @Description 获取JSON
// @Tags 用户 // @Tags <赛事>人员管理
// @Accept application/json // @Accept application/json
// @Product application/json // @Product application/json
// @Param data body dto.OrgUserUpdateStatusReq true "body" // @Param data body dto.OrgUserUpdateStatusReq true "body"
...@@ -241,13 +242,14 @@ func (e OrgUser) UpdateStatus(c *gin.Context) { ...@@ -241,13 +242,14 @@ func (e OrgUser) UpdateStatus(c *gin.Context) {
return return
} }
req.SetUpdateBy(user.GetUserId(c))
//数据权限检查 //数据权限检查
p := actions.GetPermissionFromContext(c) p := actions.GetPermissionFromContext(c)
reqUpdate := dto.OrgUserUpdateReq{} reqUpdate := dto.OrgUserUpdateReq{}
reqUpdate.UserId = req.UserId
reqUpdate.Status = req.Status reqUpdate.Status = req.Status
reqUpdate.UpdateBy = user.GetUserId(c)
err = s.Update(&reqUpdate, p) err = s.Update(&reqUpdate, p)
if err != nil { if err != nil {
e.Logger.Error(err) e.Logger.Error(err)
...@@ -256,10 +258,10 @@ func (e OrgUser) UpdateStatus(c *gin.Context) { ...@@ -256,10 +258,10 @@ func (e OrgUser) UpdateStatus(c *gin.Context) {
e.OK(1, "更新成功") e.OK(1, "更新成功")
} }
// ResetPwd 重置用户密码 // ResetPwd <赛事>重置用户密码
// @Summary 重置用户密码 // @Summary <赛事>重置用户密码
// @Description 获取JSON // @Description 获取JSON
// @Tags 用户 // @Tags <赛事>人员管理
// @Accept application/json // @Accept application/json
// @Product application/json // @Product application/json
// @Param data body dto.ResetSysUserPwdReq true "body" // @Param data body dto.ResetSysUserPwdReq true "body"
...@@ -268,7 +270,8 @@ func (e OrgUser) UpdateStatus(c *gin.Context) { ...@@ -268,7 +270,8 @@ func (e OrgUser) UpdateStatus(c *gin.Context) {
// @Security Bearer // @Security Bearer
func (e OrgUser) ResetPwd(c *gin.Context) { func (e OrgUser) ResetPwd(c *gin.Context) {
// s := service.OrgUser{} // s := service.OrgUser{}
// req := dto.ResetUserPwdReq{} req := dto.ResetPwdReq{}
fmt.Println(req)
// err := e.MakeContext(c). // err := e.MakeContext(c).
// MakeOrm(). // MakeOrm().
// Bind(&req, binding.JSON). // Bind(&req, binding.JSON).
...@@ -290,5 +293,5 @@ func (e OrgUser) ResetPwd(c *gin.Context) { ...@@ -290,5 +293,5 @@ func (e OrgUser) ResetPwd(c *gin.Context) {
// e.Logger.Error(err) // e.Logger.Error(err)
// return // return
// } // }
// e.OK(req.GetId(), "更新成功") e.OK("", "更新成功")
} }
...@@ -65,7 +65,13 @@ type OrgUserUpdateReq struct { ...@@ -65,7 +65,13 @@ type OrgUserUpdateReq struct {
} }
type OrgUserUpdateStatusReq struct { type OrgUserUpdateStatusReq struct {
Id int `json:"id" comment:""` // UserId int `json:"userId" comment:""` //
Status string `json:"status" comment:"状态 1 离职 2 在职"` //状态 1 离职 2 在职
common.ControlBy
}
type ResetPwdReq struct {
UserId int `json:"userId" comment:""` //
Status string `json:"status" comment:"状态 1 离职 2 在职"` //状态 1 离职 2 在职 Status string `json:"status" comment:"状态 1 离职 2 在职"` //状态 1 离职 2 在职
common.ControlBy common.ControlBy
} }
......
...@@ -4550,9 +4550,9 @@ var doc = `{ ...@@ -4550,9 +4550,9 @@ var doc = `{
], ],
"description": "获取JSON", "description": "获取JSON",
"tags": [ "tags": [
"用户" "\u003c赛事\u003e人员管理"
], ],
"summary": "\u003c赛事\u003e列表用户信息数据", "summary": "\u003c赛事\u003e人员管理列表",
"parameters": [ "parameters": [
{ {
"description": "data", "description": "data",
...@@ -4584,9 +4584,9 @@ var doc = `{ ...@@ -4584,9 +4584,9 @@ var doc = `{
"application/json" "application/json"
], ],
"tags": [ "tags": [
"用户" "\u003c赛事\u003e人员管理"
], ],
"summary": "创建用户", "summary": "\u003c赛事\u003e创建人员",
"parameters": [ "parameters": [
{ {
"description": "用户数据", "description": "用户数据",
...@@ -4620,9 +4620,9 @@ var doc = `{ ...@@ -4620,9 +4620,9 @@ var doc = `{
"application/json" "application/json"
], ],
"tags": [ "tags": [
"用户" "\u003c赛事\u003e人员管理"
], ],
"summary": "重置用户密码", "summary": "\u003c赛事\u003e重置用户密码",
"parameters": [ "parameters": [
{ {
"description": "body", "description": "body",
...@@ -4656,9 +4656,9 @@ var doc = `{ ...@@ -4656,9 +4656,9 @@ var doc = `{
"application/json" "application/json"
], ],
"tags": [ "tags": [
"用户" "\u003c赛事\u003e人员管理"
], ],
"summary": "修改用户状态", "summary": "\u003c赛事\u003e修改人员状态",
"parameters": [ "parameters": [
{ {
"description": "body", "description": "body",
...@@ -4689,9 +4689,9 @@ var doc = `{ ...@@ -4689,9 +4689,9 @@ var doc = `{
], ],
"description": "获取JSON", "description": "获取JSON",
"tags": [ "tags": [
"用户" "\u003c赛事\u003e人员管理"
], ],
"summary": "获取用户", "summary": "\u003c赛事\u003e获取人员详情",
"parameters": [ "parameters": [
{ {
"type": "integer", "type": "integer",
...@@ -4721,9 +4721,9 @@ var doc = `{ ...@@ -4721,9 +4721,9 @@ var doc = `{
"application/json" "application/json"
], ],
"tags": [ "tags": [
"用户" "\u003c赛事\u003e人员管理"
], ],
"summary": "修改用户数据", "summary": "\u003c赛事\u003e修改人员数据",
"parameters": [ "parameters": [
{ {
"description": "body", "description": "body",
...@@ -4752,9 +4752,9 @@ var doc = `{ ...@@ -4752,9 +4752,9 @@ var doc = `{
], ],
"description": "删除数据", "description": "删除数据",
"tags": [ "tags": [
"用户" "\u003c赛事\u003e人员管理"
], ],
"summary": "删除用户数据", "summary": "\u003c赛事\u003e删除人员数据",
"parameters": [ "parameters": [
{ {
"type": "integer", "type": "integer",
...@@ -7709,11 +7709,27 @@ var doc = `{ ...@@ -7709,11 +7709,27 @@ var doc = `{
"dto.OrgNewsGetPageReq": { "dto.OrgNewsGetPageReq": {
"type": "object", "type": "object",
"properties": { "properties": {
"endTime": {
"description": "结束时间",
"type": "string"
},
"newsName": {
"description": "新闻名称",
"type": "string"
},
"pageIndex": { "pageIndex": {
"type": "integer" "type": "integer"
}, },
"pageSize": { "pageSize": {
"type": "integer" "type": "integer"
},
"startTime": {
"description": "开始时间",
"type": "string"
},
"status": {
"description": "新闻状态",
"type": "string"
} }
} }
}, },
...@@ -7784,9 +7800,6 @@ var doc = `{ ...@@ -7784,9 +7800,6 @@ var doc = `{
"playerName": { "playerName": {
"type": "string" "type": "string"
}, },
"playerUserId": {
"type": "string"
},
"status": { "status": {
"type": "string" "type": "string"
}, },
...@@ -8522,15 +8535,15 @@ var doc = `{ ...@@ -8522,15 +8535,15 @@ var doc = `{
"createBy": { "createBy": {
"type": "integer" "type": "integer"
}, },
"id": {
"type": "integer"
},
"status": { "status": {
"description": "状态 1 离职 2 在职", "description": "状态 1 离职 2 在职",
"type": "string" "type": "string"
}, },
"updateBy": { "updateBy": {
"type": "integer" "type": "integer"
},
"userId": {
"type": "integer"
} }
} }
}, },
...@@ -9611,21 +9624,12 @@ var doc = `{ ...@@ -9611,21 +9624,12 @@ 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"
...@@ -9645,9 +9649,6 @@ var doc = `{ ...@@ -9645,9 +9649,6 @@ var doc = `{
"description": "负责人", "description": "负责人",
"type": "string" "type": "string"
}, },
"params": {
"type": "string"
},
"parentId": { "parentId": {
"description": "上级部门", "description": "上级部门",
"type": "integer" "type": "integer"
......
...@@ -4533,9 +4533,9 @@ ...@@ -4533,9 +4533,9 @@
], ],
"description": "获取JSON", "description": "获取JSON",
"tags": [ "tags": [
"用户" "\u003c赛事\u003e人员管理"
], ],
"summary": "\u003c赛事\u003e列表用户信息数据", "summary": "\u003c赛事\u003e人员管理列表",
"parameters": [ "parameters": [
{ {
"description": "data", "description": "data",
...@@ -4567,9 +4567,9 @@ ...@@ -4567,9 +4567,9 @@
"application/json" "application/json"
], ],
"tags": [ "tags": [
"用户" "\u003c赛事\u003e人员管理"
], ],
"summary": "创建用户", "summary": "\u003c赛事\u003e创建人员",
"parameters": [ "parameters": [
{ {
"description": "用户数据", "description": "用户数据",
...@@ -4603,9 +4603,9 @@ ...@@ -4603,9 +4603,9 @@
"application/json" "application/json"
], ],
"tags": [ "tags": [
"用户" "\u003c赛事\u003e人员管理"
], ],
"summary": "重置用户密码", "summary": "\u003c赛事\u003e重置用户密码",
"parameters": [ "parameters": [
{ {
"description": "body", "description": "body",
...@@ -4639,9 +4639,9 @@ ...@@ -4639,9 +4639,9 @@
"application/json" "application/json"
], ],
"tags": [ "tags": [
"用户" "\u003c赛事\u003e人员管理"
], ],
"summary": "修改用户状态", "summary": "\u003c赛事\u003e修改人员状态",
"parameters": [ "parameters": [
{ {
"description": "body", "description": "body",
...@@ -4672,9 +4672,9 @@ ...@@ -4672,9 +4672,9 @@
], ],
"description": "获取JSON", "description": "获取JSON",
"tags": [ "tags": [
"用户" "\u003c赛事\u003e人员管理"
], ],
"summary": "获取用户", "summary": "\u003c赛事\u003e获取人员详情",
"parameters": [ "parameters": [
{ {
"type": "integer", "type": "integer",
...@@ -4704,9 +4704,9 @@ ...@@ -4704,9 +4704,9 @@
"application/json" "application/json"
], ],
"tags": [ "tags": [
"用户" "\u003c赛事\u003e人员管理"
], ],
"summary": "修改用户数据", "summary": "\u003c赛事\u003e修改人员数据",
"parameters": [ "parameters": [
{ {
"description": "body", "description": "body",
...@@ -4735,9 +4735,9 @@ ...@@ -4735,9 +4735,9 @@
], ],
"description": "删除数据", "description": "删除数据",
"tags": [ "tags": [
"用户" "\u003c赛事\u003e人员管理"
], ],
"summary": "删除用户数据", "summary": "\u003c赛事\u003e删除人员数据",
"parameters": [ "parameters": [
{ {
"type": "integer", "type": "integer",
...@@ -7692,11 +7692,27 @@ ...@@ -7692,11 +7692,27 @@
"dto.OrgNewsGetPageReq": { "dto.OrgNewsGetPageReq": {
"type": "object", "type": "object",
"properties": { "properties": {
"endTime": {
"description": "结束时间",
"type": "string"
},
"newsName": {
"description": "新闻名称",
"type": "string"
},
"pageIndex": { "pageIndex": {
"type": "integer" "type": "integer"
}, },
"pageSize": { "pageSize": {
"type": "integer" "type": "integer"
},
"startTime": {
"description": "开始时间",
"type": "string"
},
"status": {
"description": "新闻状态",
"type": "string"
} }
} }
}, },
...@@ -7767,9 +7783,6 @@ ...@@ -7767,9 +7783,6 @@
"playerName": { "playerName": {
"type": "string" "type": "string"
}, },
"playerUserId": {
"type": "string"
},
"status": { "status": {
"type": "string" "type": "string"
}, },
...@@ -8505,15 +8518,15 @@ ...@@ -8505,15 +8518,15 @@
"createBy": { "createBy": {
"type": "integer" "type": "integer"
}, },
"id": {
"type": "integer"
},
"status": { "status": {
"description": "状态 1 离职 2 在职", "description": "状态 1 离职 2 在职",
"type": "string" "type": "string"
}, },
"updateBy": { "updateBy": {
"type": "integer" "type": "integer"
},
"userId": {
"type": "integer"
} }
} }
}, },
...@@ -9594,21 +9607,12 @@ ...@@ -9594,21 +9607,12 @@
"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"
...@@ -9628,9 +9632,6 @@ ...@@ -9628,9 +9632,6 @@
"description": "负责人", "description": "负责人",
"type": "string" "type": "string"
}, },
"params": {
"type": "string"
},
"parentId": { "parentId": {
"description": "上级部门", "description": "上级部门",
"type": "integer" "type": "integer"
......
...@@ -539,10 +539,22 @@ definitions: ...@@ -539,10 +539,22 @@ definitions:
type: object type: object
dto.OrgNewsGetPageReq: dto.OrgNewsGetPageReq:
properties: properties:
endTime:
description: 结束时间
type: string
newsName:
description: 新闻名称
type: string
pageIndex: pageIndex:
type: integer type: integer
pageSize: pageSize:
type: integer type: integer
startTime:
description: 开始时间
type: string
status:
description: 新闻状态
type: string
type: object type: object
dto.OrgNewsInsertReq: dto.OrgNewsInsertReq:
properties: properties:
...@@ -588,8 +600,6 @@ definitions: ...@@ -588,8 +600,6 @@ definitions:
type: integer type: integer
playerName: playerName:
type: string type: string
playerUserId:
type: string
status: status:
type: string type: string
teamId: teamId:
...@@ -1081,13 +1091,13 @@ definitions: ...@@ -1081,13 +1091,13 @@ definitions:
properties: properties:
createBy: createBy:
type: integer type: integer
id:
type: integer
status: status:
description: 状态 1 离职 2 在职 description: 状态 1 离职 2 在职
type: string type: string
updateBy: updateBy:
type: integer type: integer
userId:
type: integer
type: object type: object
dto.PassWord: dto.PassWord:
properties: properties:
...@@ -1822,16 +1832,10 @@ definitions: ...@@ -1822,16 +1832,10 @@ 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
...@@ -1846,8 +1850,6 @@ definitions: ...@@ -1846,8 +1850,6 @@ definitions:
leader: leader:
description: 负责人 description: 负责人
type: string type: string
params:
type: string
parentId: parentId:
description: 上级部门 description: 上级部门
type: integer type: integer
...@@ -4897,9 +4899,9 @@ paths: ...@@ -4897,9 +4899,9 @@ paths:
type: string type: string
security: security:
- Bearer: [] - Bearer: []
summary: <赛事>列表用户信息数据 summary: <赛事>人员管理列表
tags: tags:
- 用户 - <赛事>人员管理
post: post:
consumes: consumes:
- application/json - application/json
...@@ -4918,9 +4920,9 @@ paths: ...@@ -4918,9 +4920,9 @@ paths:
type: string type: string
security: security:
- Bearer: [] - Bearer: []
summary: 创建用户 summary: <赛事>创建人员
tags: tags:
- 用户 - <赛事>人员管理
/api/v1/org-user/{userId}: /api/v1/org-user/{userId}:
delete: delete:
description: 删除数据 description: 删除数据
...@@ -4937,9 +4939,9 @@ paths: ...@@ -4937,9 +4939,9 @@ paths:
type: string type: string
security: security:
- Bearer: [] - Bearer: []
summary: 删除用户数据 summary: <赛事>删除人员数据
tags: tags:
- 用户 - <赛事>人员管理
get: get:
description: 获取JSON description: 获取JSON
parameters: parameters:
...@@ -4955,9 +4957,9 @@ paths: ...@@ -4955,9 +4957,9 @@ paths:
type: string type: string
security: security:
- Bearer: [] - Bearer: []
summary: 获取用户 summary: <赛事>获取人员详情
tags: tags:
- 用户 - <赛事>人员管理
put: put:
consumes: consumes:
- application/json - application/json
...@@ -4976,9 +4978,9 @@ paths: ...@@ -4976,9 +4978,9 @@ paths:
type: string type: string
security: security:
- Bearer: [] - Bearer: []
summary: 修改用户数据 summary: <赛事>修改人员数据
tags: tags:
- 用户 - <赛事>人员管理
/api/v1/org-user/pwd/reset: /api/v1/org-user/pwd/reset:
put: put:
consumes: consumes:
...@@ -4998,9 +5000,9 @@ paths: ...@@ -4998,9 +5000,9 @@ paths:
type: string type: string
security: security:
- Bearer: [] - Bearer: []
summary: 重置用户密码 summary: <赛事>重置用户密码
tags: tags:
- 用户 - <赛事>人员管理
/api/v1/org-user/status: /api/v1/org-user/status:
put: put:
consumes: consumes:
...@@ -5020,9 +5022,9 @@ paths: ...@@ -5020,9 +5022,9 @@ paths:
type: string type: string
security: security:
- Bearer: [] - Bearer: []
summary: 修改用户状态 summary: <赛事>修改人员状态
tags: tags:
- 用户 - <赛事>人员管理
/api/v1/org/upload: /api/v1/org/upload:
post: post:
description: <俱乐部>获取俱乐部列表 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