Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
so-operation-api
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
smart-operation
so-operation-api
Commits
0faaf323
Commit
0faaf323
authored
Jul 13, 2023
by
黄智
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取角色接口调整
parent
53069cea
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
src/controller/system_user.go
src/controller/system_user.go
+2
-1
src/service/system_user.go
src/service/system_user.go
+9
-5
No files found.
src/controller/system_user.go
View file @
0faaf323
...
...
@@ -123,8 +123,9 @@ func CheckRepetition(c *gin.Context) {
// 运维人员获取
func
DevOps
(
c
*
gin
.
Context
)
{
isAll
:=
c
.
Query
(
"is_all"
)
svc
:=
service
.
User
{
User
:
header
.
GetUser
(
c
)}
list
,
err
:=
svc
.
DevOps
()
list
,
err
:=
svc
.
DevOps
(
isAll
)
if
err
!=
nil
{
SendJsonResponse
(
c
,
err
,
nil
)
return
...
...
src/service/system_user.go
View file @
0faaf323
...
...
@@ -311,7 +311,7 @@ func (u *User) SystemUserUpdateState(params request.SystemUserStateReq) error {
return
nil
}
func
(
o
*
User
)
DevOps
()
([]
entity
.
SystemUserInfo
,
error
)
{
func
(
o
*
User
)
DevOps
(
isAll
string
)
([]
entity
.
SystemUserInfo
,
error
)
{
var
(
err
error
result
[]
entity
.
SystemUserInfo
...
...
@@ -322,11 +322,15 @@ func (o *User) DevOps() ([]entity.SystemUserInfo, error) {
return
result
,
resp
.
DbConnectError
.
WithError
(
err
)
}
err
=
db
.
Table
(
"system_user"
)
.
Alias
(
"su"
)
.
session
:
=
db
.
Table
(
"system_user"
)
.
Alias
(
"su"
)
.
Join
(
"LEFT"
,
"system_user_role sur"
,
"su.id = sur.user_id"
)
.
Join
(
"LEFT"
,
"system_role sr"
,
"sur.role_id = sr.role_id"
)
.
Where
(
"su.is_deleted = 0 and su.state =1 and sr.is_deleted = 0 and sr.state = 1 and role_type = 1"
)
.
Select
(
"DISTINCT su.*"
)
.
Find
(
&
result
)
Join
(
"LEFT"
,
"system_role sr"
,
"sur.role_id = sr.role_id"
)
.
Select
(
"DISTINCT su.*"
)
if
isAll
==
""
{
err
=
session
.
Where
(
"su.is_deleted = 0 and su.state =1 and sr.is_deleted = 0 and sr.state = 1 and role_type = 1"
)
.
Find
(
&
result
)
}
else
{
err
=
session
.
Where
(
"su.is_deleted = 0 and su.state =1 and sr.is_deleted = 0 and sr.state = 1"
)
.
Find
(
&
result
)
}
if
err
!=
nil
{
return
result
,
resp
.
DbSelectError
.
WithError
(
err
)
}
...
...
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