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