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
6880b83c
Commit
6880b83c
authored
Jul 10, 2023
by
黄智
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增用户菜单接口
parent
478ef3ef
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
21 deletions
+23
-21
src/bean/vo/response/system_role.go
src/bean/vo/response/system_role.go
+13
-13
src/router/dict.go
src/router/dict.go
+1
-2
src/service/system_menu.go
src/service/system_menu.go
+3
-3
src/service/system_role.go
src/service/system_role.go
+6
-3
No files found.
src/bean/vo/response/system_role.go
View file @
6880b83c
...
@@ -63,8 +63,8 @@ type SystemAllotUserList struct {
...
@@ -63,8 +63,8 @@ type SystemAllotUserList struct {
OrganizationName
string
`json:"organization_name" xorm:"name"`
// 所属组织
OrganizationName
string
`json:"organization_name" xorm:"name"`
// 所属组织
State
int
`json:"state"`
// 状态0禁用1启用
State
int
`json:"state"`
// 状态0禁用1启用
CreatedTime
time
.
Time
`json:"created_time"`
// 创建时间
CreatedTime
time
.
Time
`json:"created_time"`
// 创建时间
SystemId
string
`json:"system_id" xorm:"system_id"`
// 系统账号id
//
SystemId string `json:"system_id" xorm:"system_id"` // 系统账号id
Ur
SystemId
string
`json:"ur_system_id" xorm:"ur_system_id"`
// 系统账号
id
Ur
UserId
int
`json:"ur_user_id" xorm:"ur_user_id"`
// 用户
id
IsBind
int
`json:"is_bind"`
// 是否绑定 0否1是
IsBind
int
`json:"is_bind"`
// 是否绑定 0否1是
}
}
...
@@ -77,6 +77,6 @@ type SystemAllotUserListRes struct {
...
@@ -77,6 +77,6 @@ type SystemAllotUserListRes struct {
OrganizationName
string
`json:"organization_name"`
// 所属组织
OrganizationName
string
`json:"organization_name"`
// 所属组织
State
int
`json:"state"`
// 状态0禁用1启用
State
int
`json:"state"`
// 状态0禁用1启用
CreatedTime
jsontime
.
Time
`json:"created_time"`
// 创建时间
CreatedTime
jsontime
.
Time
`json:"created_time"`
// 创建时间
SystemId
string
`json:"system_id"`
// 系统账号id
//
SystemId string `json:"system_id"` // 系统账号id
IsBind
int
`json:"is_bind"`
// 是否绑定 0否1是
IsBind
int
`json:"is_bind"`
// 是否绑定 0否1是
}
}
src/router/dict.go
View file @
6880b83c
...
@@ -8,12 +8,11 @@ import (
...
@@ -8,12 +8,11 @@ import (
"gitlab.wodcloud.com/smart-operation/so-operation-api/src/router/middleware/header"
"gitlab.wodcloud.com/smart-operation/so-operation-api/src/router/middleware/header"
)
)
//
InitSystemLoginRouter 初始化登录
相关路由
//
initDictRoute 初始化字典
相关路由
func
initDictRoute
(
e
*
gin
.
Engine
)
{
func
initDictRoute
(
e
*
gin
.
Engine
)
{
base
:=
e
.
Group
(
fmt
.
Sprintf
(
"%s/dict"
,
conf
.
Options
.
Prefix
),
header
.
SetContext
)
base
:=
e
.
Group
(
fmt
.
Sprintf
(
"%s/dict"
,
conf
.
Options
.
Prefix
),
header
.
SetContext
)
//系统字典
//系统字典
dict
:=
new
(
controller
.
Dict
)
dict
:=
new
(
controller
.
Dict
)
base
.
POST
(
""
,
dict
.
Add
)
//新增字典
base
.
POST
(
""
,
dict
.
Add
)
//新增字典
base
.
PUT
(
""
,
dict
.
Update
)
//修改字典
base
.
PUT
(
""
,
dict
.
Update
)
//修改字典
...
...
src/service/system_menu.go
View file @
6880b83c
...
@@ -304,8 +304,8 @@ func (s *SystemMenu) GetSystemTree(search string) (interface{}, error) {
...
@@ -304,8 +304,8 @@ func (s *SystemMenu) GetSystemTree(search string) (interface{}, error) {
Join
(
"INNER"
,
[]
string
{
"system_role_menu"
,
"srm"
},
"sur.role_id = srm.role_id"
)
.
Join
(
"INNER"
,
[]
string
{
"system_role_menu"
,
"srm"
},
"sur.role_id = srm.role_id"
)
.
Join
(
"INNER"
,
[]
string
{
"system_menu"
,
"sm"
},
"sm.menu_id = srm.menu_id"
)
.
Join
(
"INNER"
,
[]
string
{
"system_menu"
,
"sm"
},
"sm.menu_id = srm.menu_id"
)
.
Join
(
"INNER"
,
[]
string
{
"system_role"
,
"sr"
},
"sur.role_id = sr.role_id"
)
.
Join
(
"INNER"
,
[]
string
{
"system_role"
,
"sr"
},
"sur.role_id = sr.role_id"
)
.
Select
(
"max(sur.
system_id::varchar) as system
_id,sm.*"
)
.
Select
(
"max(sur.
user_id) as user
_id,sm.*"
)
.
Where
(
"sm.is_deleted = 0 and sm.state = 1 and sur.
role
_id = ?"
,
s
.
User
.
Id
)
.
Where
(
"sm.is_deleted = 0 and sm.state = 1 and sur.
user
_id = ?"
,
s
.
User
.
Id
)
.
And
(
"sr.state = 1 and sr.is_deleted = 0"
)
.
And
(
"sr.state = 1 and sr.is_deleted = 0"
)
.
GroupBy
(
"sm.id"
)
.
GroupBy
(
"sm.id"
)
.
OrderBy
(
"sm.level"
)
.
OrderBy
(
"sm.sort"
)
.
Find
(
&
menus
);
err
!=
nil
{
OrderBy
(
"sm.level"
)
.
OrderBy
(
"sm.sort"
)
.
Find
(
&
menus
);
err
!=
nil
{
...
@@ -317,7 +317,7 @@ func (s *SystemMenu) GetSystemTree(search string) (interface{}, error) {
...
@@ -317,7 +317,7 @@ func (s *SystemMenu) GetSystemTree(search string) (interface{}, error) {
// 组装树形
// 组装树形
for
i
,
v
:=
range
menus
{
for
i
,
v
:=
range
menus
{
if
v
.
Level
==
1
{
if
v
.
Level
==
1
{
if
!
strings
.
Contains
(
v
.
MenuNam
e
,
search
)
{
if
!
strings
.
Contains
(
v
.
SystemTyp
e
,
search
)
{
continue
continue
}
}
changeMenuTreePer
(
&
menus
[
i
],
menus
,
search
)
changeMenuTreePer
(
&
menus
[
i
],
menus
,
search
)
...
...
src/service/system_role.go
View file @
6880b83c
...
@@ -301,6 +301,9 @@ func SystemAllotUserList(params *request.SystemAllotUserListReq) (resultData []r
...
@@ -301,6 +301,9 @@ func SystemAllotUserList(params *request.SystemAllotUserListReq) (resultData []r
modelObj
.
Where
(
"su.system_account like ? or su.phone ? "
,
params
.
Search
,
params
.
Search
)
modelObj
.
Where
(
"su.system_account like ? or su.phone ? "
,
params
.
Search
,
params
.
Search
)
}
}
if
systemRole
.
RoleType
==
1
{
modelObj
.
Where
(
"so.data_type < 2"
)
}
if
systemRole
.
RoleType
==
2
{
if
systemRole
.
RoleType
==
2
{
modelObj
.
Where
(
"so.data_type = 2"
)
modelObj
.
Where
(
"so.data_type = 2"
)
}
}
...
@@ -355,10 +358,10 @@ func SystemAllotUserList(params *request.SystemAllotUserListReq) (resultData []r
...
@@ -355,10 +358,10 @@ func SystemAllotUserList(params *request.SystemAllotUserListReq) (resultData []r
OrganizationName
:
v
.
OrganizationName
,
OrganizationName
:
v
.
OrganizationName
,
State
:
v
.
State
,
State
:
v
.
State
,
CreatedTime
:
jsontime
.
Time
(
v
.
CreatedTime
),
CreatedTime
:
jsontime
.
Time
(
v
.
CreatedTime
),
SystemId
:
v
.
SystemId
,
//
SystemId: v.SystemId,
IsBind
:
0
,
IsBind
:
0
,
}
}
if
v
.
Ur
SystemId
!=
""
{
if
v
.
Ur
UserId
!=
0
{
SystemUserListRes
.
IsBind
=
1
SystemUserListRes
.
IsBind
=
1
}
}
SystemUserListResArr
=
append
(
SystemUserListResArr
,
SystemUserListRes
)
SystemUserListResArr
=
append
(
SystemUserListResArr
,
SystemUserListRes
)
...
...
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