Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzuaa
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzuaa
提交
503211cb
提交
503211cb
编写于
4月 28, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibizdev提交
上级
15295543
变更
34
显示空白字符变更
内嵌
并排
正在显示
34 个修改的文件
包含
4748 行增加
和
200 行删除
+4748
-200
en-US.ts
app_web/src/locale/lang/en-US.ts
+0
-1
zh-CN.ts
app_web/src/locale/lang/zh-CN.ts
+0
-1
main-appmenu.ts
app_web/src/mock/app/main-appmenu/main-appmenu.ts
+3
-23
sys-permissions.ts
app_web/src/mock/entity/sys-permissions/sys-permissions.ts
+214
-9
sys-psappmenuitems.ts
.../src/mock/entity/sys-psappmenuitems/sys-psappmenuitems.ts
+214
-9
sys-psdeopprivs.ts
app_web/src/mock/entity/sys-psdeopprivs/sys-psdeopprivs.ts
+214
-9
sys-role-permissions.ts
.../mock/entity/sys-role-permissions/sys-role-permissions.ts
+570
-27
sys-roles.ts
app_web/src/mock/entity/sys-roles/sys-roles.ts
+214
-9
sys-user-roles.ts
app_web/src/mock/entity/sys-user-roles/sys-user-roles.ts
+570
-27
sys-users.ts
app_web/src/mock/entity/sys-users/sys-users.ts
+214
-9
sys-permission-service-base.ts
...src/service/sys-permission/sys-permission-service-base.ts
+163
-1
sys-psappmenuitem-service-base.ts
...rvice/sys-psappmenuitem/sys-psappmenuitem-service-base.ts
+113
-1
sys-psdeoppriv-service-base.ts
...src/service/sys-psdeoppriv/sys-psdeoppriv-service-base.ts
+113
-1
sys-role-permission-service-base.ts
...e/sys-role-permission/sys-role-permission-service-base.ts
+169
-3
sys-role-service-base.ts
app_web/src/service/sys-role/sys-role-service-base.ts
+213
-1
sys-user-role-service-base.ts
...b/src/service/sys-user-role/sys-user-role-service-base.ts
+169
-3
sys-user-service-base.ts
app_web/src/service/sys-user/sys-user-service-base.ts
+163
-1
main-appmenu-model.ts
app_web/src/widgets/app/main-appmenu/main-appmenu-model.ts
+3
-23
SYS_PERMISSIONMapper.java
...java/cn/ibizlab/core/uaa/mapper/SYS_PERMISSIONMapper.java
+0
-2
SYS_PSAPPMENUITEMMapper.java
...a/cn/ibizlab/core/uaa/mapper/SYS_PSAPPMENUITEMMapper.java
+0
-2
SYS_PSDEOPPRIVMapper.java
...java/cn/ibizlab/core/uaa/mapper/SYS_PSDEOPPRIVMapper.java
+0
-2
SYS_ROLEMapper.java
.../main/java/cn/ibizlab/core/uaa/mapper/SYS_ROLEMapper.java
+0
-2
SYS_ROLE_PERMISSIONMapper.java
...cn/ibizlab/core/uaa/mapper/SYS_ROLE_PERMISSIONMapper.java
+0
-2
SYS_USERMapper.java
.../main/java/cn/ibizlab/core/uaa/mapper/SYS_USERMapper.java
+0
-2
SYS_USER_ROLEMapper.java
.../java/cn/ibizlab/core/uaa/mapper/SYS_USER_ROLEMapper.java
+0
-2
h2_table.xml
ibzuaa-core/src/main/resources/liquibase/h2_table.xml
+14
-14
SYS_PERMISSIONResource.java
...n/java/cn/ibizlab/uaaapi/rest/SYS_PERMISSIONResource.java
+132
-0
SYS_PSAPPMENUITEMResource.java
...ava/cn/ibizlab/uaaapi/rest/SYS_PSAPPMENUITEMResource.java
+132
-0
SYS_PSDEOPPRIVResource.java
...n/java/cn/ibizlab/uaaapi/rest/SYS_PSDEOPPRIVResource.java
+132
-0
SYS_ROLEResource.java
...rc/main/java/cn/ibizlab/uaaapi/rest/SYS_ROLEResource.java
+132
-0
SYS_ROLE_PERMISSIONResource.java
...a/cn/ibizlab/uaaapi/rest/SYS_ROLE_PERMISSIONResource.java
+376
-0
SYS_USERResource.java
...rc/main/java/cn/ibizlab/uaaapi/rest/SYS_USERResource.java
+132
-0
SYS_USER_ROLEResource.java
...in/java/cn/ibizlab/uaaapi/rest/SYS_USER_ROLEResource.java
+376
-0
UAAFeignClient.java
.../main/java/cn/ibizlab/util/client/uaa/UAAFeignClient.java
+3
-14
未找到文件。
app_web/src/locale/lang/en-US.ts
浏览文件 @
503211cb
...
@@ -63,7 +63,6 @@ export default {
...
@@ -63,7 +63,6 @@ export default {
menus
:
{
menus
:
{
main
:
{
main
:
{
menuitem3
:
'用户管理'
,
menuitem3
:
'用户管理'
,
menuitem8
:
'系统管理'
,
menuitem6
:
'角色'
,
menuitem6
:
'角色'
,
menuitem7
:
'用户角色'
,
menuitem7
:
'用户角色'
,
menuitem10
:
'权限'
,
menuitem10
:
'权限'
,
...
...
app_web/src/locale/lang/zh-CN.ts
浏览文件 @
503211cb
...
@@ -63,7 +63,6 @@ export default {
...
@@ -63,7 +63,6 @@ export default {
menus
:
{
menus
:
{
main
:
{
main
:
{
menuitem3
:
'用户管理'
,
menuitem3
:
'用户管理'
,
menuitem8
:
'系统管理'
,
menuitem6
:
'角色'
,
menuitem6
:
'角色'
,
menuitem7
:
'用户角色'
,
menuitem7
:
'用户角色'
,
menuitem10
:
'权限'
,
menuitem10
:
'权限'
,
...
...
app_web/src/mock/app/main-appmenu/main-appmenu.ts
浏览文件 @
503211cb
...
@@ -29,24 +29,6 @@ mock.onGet('v7/mainappmenu').reply((config: any) => {
...
@@ -29,24 +29,6 @@ mock.onGet('v7/mainappmenu').reply((config: any) => {
resourcetag
:
''
,
resourcetag
:
''
,
},
},
{
{
id
:
'cd792e015d353e121fd014ef1f698aaf'
,
name
:
'menuitem8'
,
text
:
'系统管理'
,
type
:
'MENUITEM'
,
counterid
:
''
,
tooltip
:
'系统管理'
,
expanded
:
false
,
separator
:
false
,
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
''
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
''
,
resourcetag
:
''
,
items
:
[
{
id
:
'db3e0d48d6e76a66784adc84edd90cdc'
,
id
:
'db3e0d48d6e76a66784adc84edd90cdc'
,
name
:
'menuitem6'
,
name
:
'menuitem6'
,
text
:
'角色'
,
text
:
'角色'
,
...
@@ -117,8 +99,6 @@ mock.onGet('v7/mainappmenu').reply((config: any) => {
...
@@ -117,8 +99,6 @@ mock.onGet('v7/mainappmenu').reply((config: any) => {
textcls
:
''
,
textcls
:
''
,
appfunctag
:
'Auto1'
,
appfunctag
:
'Auto1'
,
resourcetag
:
''
,
resourcetag
:
''
,
},
],
},
},
],
],
}];
}];
...
...
app_web/src/mock/entity/sys-permissions/sys-permissions.ts
浏览文件 @
503211cb
...
@@ -34,16 +34,165 @@ mock.onGet(new RegExp(/^\/sys_permissions\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).r
...
@@ -34,16 +34,165 @@ mock.onGet(new RegExp(/^\/sys_permissions\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).r
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
];
return
[
status
,
_items
];
});
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// Save
// URI参数传递情况未实现
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_permissions
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
// URI参数传递情况未实现
console
.
groupCollapsed
(
"实体:sys_permission 方法: Save"
);
// URI参数传递情况未实现
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// URI参数传递情况未实现
let
status
=
MockAdapter
.
mockStatus
(
config
);
// URI参数传递情况未实现
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'permissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.permissionid, tempValue.permissionid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'permissionid'
]
==
tempValue
[
'permissionid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// GetDraft
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_permissions
\/
getdraft$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_permission 方法: GetDraft"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// GetDraft
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// Update
mock
.
onPut
(
new
RegExp
(
/^
\/
sys_permissions
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_permission 方法: Update"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'permissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.permissionid, tempValue.permissionid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'permissionid'
]
==
tempValue
[
'permissionid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Create
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_permissions
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_permission 方法: Create"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'permissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
mockDatas
[
0
]);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
mockDatas
[
0
]];
});
// CheckKey
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_permissions
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
checkkey$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_permission 方法: CheckKey"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'permissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.permissionid, tempValue.permissionid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'permissionid'
]
==
tempValue
[
'permissionid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// FetchDefault
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_permissions
\/
selec
t$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_permissions
\/
fetchdefaul
t$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_permission 方法: FetchDefault"
);
console
.
groupCollapsed
(
"实体:sys_permission 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
...
@@ -58,7 +207,7 @@ mock.onGet(new RegExp(/^\/sys_permissions\/select$/)).reply((config: any) => {
...
@@ -58,7 +207,7 @@ mock.onGet(new RegExp(/^\/sys_permissions\/select$/)).reply((config: any) => {
});
});
// FetchDefault
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_permissions
\/
selec
t
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_permissions
\/
fetchdefaul
t
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_permission 方法: FetchDefault"
);
console
.
groupCollapsed
(
"实体:sys_permission 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
if
(
config
.
url
.
includes
(
'page'
)){
if
(
config
.
url
.
includes
(
'page'
)){
...
@@ -93,3 +242,59 @@ mock.onGet(new RegExp(/^\/sys_permissions\/select(\?[\w-./?%&=,]*)*$/)).reply((c
...
@@ -93,3 +242,59 @@ mock.onGet(new RegExp(/^\/sys_permissions\/select(\?[\w-./?%&=,]*)*$/)).reply((c
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Remove
mock
.
onDelete
(
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_permission 方法: Remove"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'permissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
permissionid
,
tempValue
.
permissionid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Get
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_permission 方法: Get"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'permissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
permissionid
,
tempValue
.
permissionid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
app_web/src/mock/entity/sys-psappmenuitems/sys-psappmenuitems.ts
浏览文件 @
503211cb
...
@@ -34,16 +34,165 @@ mock.onGet(new RegExp(/^\/sys_psappmenuitems\/([a-zA-Z0-9\-\;]{1,35})\/select$/)
...
@@ -34,16 +34,165 @@ mock.onGet(new RegExp(/^\/sys_psappmenuitems\/([a-zA-Z0-9\-\;]{1,35})\/select$/)
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
];
return
[
status
,
_items
];
});
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// Save
// URI参数传递情况未实现
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_psappmenuitems
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
// URI参数传递情况未实现
console
.
groupCollapsed
(
"实体:sys_psappmenuitem 方法: Save"
);
// URI参数传递情况未实现
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// URI参数传递情况未实现
let
status
=
MockAdapter
.
mockStatus
(
config
);
// URI参数传递情况未实现
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'appmenuitemid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_psappmenuitems
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.appmenuitemid, tempValue.appmenuitemid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'appmenuitemid'
]
==
tempValue
[
'appmenuitemid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Create
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_psappmenuitems
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_psappmenuitem 方法: Create"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'appmenuitemid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_psappmenuitems
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
mockDatas
[
0
]);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
mockDatas
[
0
]];
});
// Update
mock
.
onPut
(
new
RegExp
(
/^
\/
sys_psappmenuitems
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_psappmenuitem 方法: Update"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'appmenuitemid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_psappmenuitems
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.appmenuitemid, tempValue.appmenuitemid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'appmenuitemid'
]
==
tempValue
[
'appmenuitemid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// GetDraft
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_psappmenuitems
\/
getdraft$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_psappmenuitem 方法: GetDraft"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// GetDraft
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// CheckKey
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_psappmenuitems
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
checkkey$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_psappmenuitem 方法: CheckKey"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'appmenuitemid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_psappmenuitems
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.appmenuitemid, tempValue.appmenuitemid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'appmenuitemid'
]
==
tempValue
[
'appmenuitemid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// FetchDefault
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_psappmenuitems
\/
selec
t$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_psappmenuitems
\/
fetchdefaul
t$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_psappmenuitem 方法: FetchDefault"
);
console
.
groupCollapsed
(
"实体:sys_psappmenuitem 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
...
@@ -58,7 +207,7 @@ mock.onGet(new RegExp(/^\/sys_psappmenuitems\/select$/)).reply((config: any) =>
...
@@ -58,7 +207,7 @@ mock.onGet(new RegExp(/^\/sys_psappmenuitems\/select$/)).reply((config: any) =>
});
});
// FetchDefault
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_psappmenuitems
\/
selec
t
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_psappmenuitems
\/
fetchdefaul
t
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_psappmenuitem 方法: FetchDefault"
);
console
.
groupCollapsed
(
"实体:sys_psappmenuitem 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
if
(
config
.
url
.
includes
(
'page'
)){
if
(
config
.
url
.
includes
(
'page'
)){
...
@@ -93,3 +242,59 @@ mock.onGet(new RegExp(/^\/sys_psappmenuitems\/select(\?[\w-./?%&=,]*)*$/)).reply
...
@@ -93,3 +242,59 @@ mock.onGet(new RegExp(/^\/sys_psappmenuitems\/select(\?[\w-./?%&=,]*)*$/)).reply
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Remove
mock
.
onDelete
(
new
RegExp
(
/^
\/
sys_psappmenuitems
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_psappmenuitem 方法: Remove"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'appmenuitemid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_psappmenuitems
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
appmenuitemid
,
tempValue
.
appmenuitemid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Get
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_psappmenuitems
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_psappmenuitem 方法: Get"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'appmenuitemid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_psappmenuitems
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
appmenuitemid
,
tempValue
.
appmenuitemid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
app_web/src/mock/entity/sys-psdeopprivs/sys-psdeopprivs.ts
浏览文件 @
503211cb
...
@@ -34,16 +34,165 @@ mock.onGet(new RegExp(/^\/sys_psdeopprivs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).r
...
@@ -34,16 +34,165 @@ mock.onGet(new RegExp(/^\/sys_psdeopprivs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).r
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
];
return
[
status
,
_items
];
});
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// CheckKey
// URI参数传递情况未实现
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_psdeopprivs
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
checkkey$/
)).
reply
((
config
:
any
)
=>
{
// URI参数传递情况未实现
console
.
groupCollapsed
(
"实体:sys_psdeoppriv 方法: CheckKey"
);
// URI参数传递情况未实现
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// URI参数传递情况未实现
let
status
=
MockAdapter
.
mockStatus
(
config
);
// URI参数传递情况未实现
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'psdeopprivid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_psdeopprivs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.psdeopprivid, tempValue.psdeopprivid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'psdeopprivid'
]
==
tempValue
[
'psdeopprivid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// GetDraft
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_psdeopprivs
\/
getdraft$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_psdeoppriv 方法: GetDraft"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// GetDraft
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// Create
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_psdeopprivs
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_psdeoppriv 方法: Create"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'psdeopprivid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_psdeopprivs
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
mockDatas
[
0
]);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
mockDatas
[
0
]];
});
// Update
mock
.
onPut
(
new
RegExp
(
/^
\/
sys_psdeopprivs
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_psdeoppriv 方法: Update"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'psdeopprivid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_psdeopprivs
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.psdeopprivid, tempValue.psdeopprivid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'psdeopprivid'
]
==
tempValue
[
'psdeopprivid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Save
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_psdeopprivs
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_psdeoppriv 方法: Save"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'psdeopprivid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_psdeopprivs
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.psdeopprivid, tempValue.psdeopprivid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'psdeopprivid'
]
==
tempValue
[
'psdeopprivid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// FetchDefault
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_psdeopprivs
\/
selec
t$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_psdeopprivs
\/
fetchdefaul
t$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_psdeoppriv 方法: FetchDefault"
);
console
.
groupCollapsed
(
"实体:sys_psdeoppriv 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
...
@@ -58,7 +207,7 @@ mock.onGet(new RegExp(/^\/sys_psdeopprivs\/select$/)).reply((config: any) => {
...
@@ -58,7 +207,7 @@ mock.onGet(new RegExp(/^\/sys_psdeopprivs\/select$/)).reply((config: any) => {
});
});
// FetchDefault
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_psdeopprivs
\/
selec
t
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_psdeopprivs
\/
fetchdefaul
t
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_psdeoppriv 方法: FetchDefault"
);
console
.
groupCollapsed
(
"实体:sys_psdeoppriv 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
if
(
config
.
url
.
includes
(
'page'
)){
if
(
config
.
url
.
includes
(
'page'
)){
...
@@ -93,3 +242,59 @@ mock.onGet(new RegExp(/^\/sys_psdeopprivs\/select(\?[\w-./?%&=,]*)*$/)).reply((c
...
@@ -93,3 +242,59 @@ mock.onGet(new RegExp(/^\/sys_psdeopprivs\/select(\?[\w-./?%&=,]*)*$/)).reply((c
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Remove
mock
.
onDelete
(
new
RegExp
(
/^
\/
sys_psdeopprivs
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_psdeoppriv 方法: Remove"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'psdeopprivid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_psdeopprivs
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
psdeopprivid
,
tempValue
.
psdeopprivid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Get
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_psdeopprivs
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_psdeoppriv 方法: Get"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'psdeopprivid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_psdeopprivs
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
psdeopprivid
,
tempValue
.
psdeopprivid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
app_web/src/mock/entity/sys-role-permissions/sys-role-permissions.ts
浏览文件 @
503211cb
...
@@ -93,44 +93,419 @@ mock.onGet(new RegExp(/^\/sys_role_permissions\/([a-zA-Z0-9\-\;]{1,35})\/select$
...
@@ -93,44 +93,419 @@ mock.onGet(new RegExp(/^\/sys_role_permissions\/([a-zA-Z0-9\-\;]{1,35})\/select$
return
[
status
,
_items
];
return
[
status
,
_items
];
});
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// GetDraft
// URI参数传递情况未实现
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/
getdraft$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: GetDraft"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// GetDraft
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// GetDraft
// URI参数传递情况未实现
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/
getdraft$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: GetDraft"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// GetDraft
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// URI参数传递情况未实现
// GetDraft
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_role_permissions
\/
getdraft$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: GetDraft"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// GetDraft
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Create
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: Create"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'roleid'
,
'rolepermissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Create
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: Create"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'permissionid'
,
'rolepermissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// URI参数传递情况未实现
// Create
// URI参数传递情况未实现
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_role_permissions
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: Create"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'rolepermissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
mockDatas
[
0
]);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
mockDatas
[
0
]];
});
// CheckKey
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: CheckKey"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'roleid'
,
'rolepermissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// CheckKey
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: CheckKey"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'permissionid'
,
'rolepermissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// CheckKey
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_role_permissions
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
checkkey$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: CheckKey"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'rolepermissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.rolepermissionid, tempValue.rolepermissionid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'rolepermissionid'
]
==
tempValue
[
'rolepermissionid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Save
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: Save"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'roleid'
,
'rolepermissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// Save
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: Save"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'permissionid'
,
'rolepermissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// Save
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_role_permissions
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: Save"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'rolepermissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.rolepermissionid, tempValue.rolepermissionid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'rolepermissionid'
]
==
tempValue
[
'rolepermissionid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Update
mock
.
onPut
(
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: Update"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'roleid'
,
'rolepermissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// Update
mock
.
onPut
(
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: Update"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'permissionid'
,
'rolepermissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// Update
mock
.
onPut
(
new
RegExp
(
/^
\/
sys_role_permissions
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: Update"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'rolepermissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.rolepermissionid, tempValue.rolepermissionid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'rolepermissionid'
]
==
tempValue
[
'rolepermissionid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// FetchDefault
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/
selec
t$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/
fetchdefaul
t$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: FetchDefault"
);
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
...
@@ -139,7 +514,7 @@ mock.onGet(new RegExp(/^\/sys_roles\/([a-zA-Z0-9\-\;]{1,35})\/sys_role_permissio
...
@@ -139,7 +514,7 @@ mock.onGet(new RegExp(/^\/sys_roles\/([a-zA-Z0-9\-\;]{1,35})\/sys_role_permissio
}
}
const
paramArray
:
Array
<
any
>
=
[
'roleid'
];
const
paramArray
:
Array
<
any
>
=
[
'roleid'
];
let
tempValue
:
any
=
{};
let
tempValue
:
any
=
{};
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/
selec
t$/
).
exec
(
config
.
url
);
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/
fetchdefaul
t$/
).
exec
(
config
.
url
);
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
Object
.
defineProperty
(
tempValue
,
item
,
{
...
@@ -175,7 +550,7 @@ mock.onGet(new RegExp(/^\/sys_roles\/([a-zA-Z0-9\-\;]{1,35})\/sys_role_permissio
...
@@ -175,7 +550,7 @@ mock.onGet(new RegExp(/^\/sys_roles\/([a-zA-Z0-9\-\;]{1,35})\/sys_role_permissio
// FetchDefault
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/
selec
t$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/
fetchdefaul
t$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: FetchDefault"
);
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
...
@@ -184,7 +559,7 @@ mock.onGet(new RegExp(/^\/sys_permissions\/([a-zA-Z0-9\-\;]{1,35})\/sys_role_per
...
@@ -184,7 +559,7 @@ mock.onGet(new RegExp(/^\/sys_permissions\/([a-zA-Z0-9\-\;]{1,35})\/sys_role_per
}
}
const
paramArray
:
Array
<
any
>
=
[
'permissionid'
];
const
paramArray
:
Array
<
any
>
=
[
'permissionid'
];
let
tempValue
:
any
=
{};
let
tempValue
:
any
=
{};
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/
selec
t$/
).
exec
(
config
.
url
);
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/
fetchdefaul
t$/
).
exec
(
config
.
url
);
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
Object
.
defineProperty
(
tempValue
,
item
,
{
...
@@ -219,7 +594,7 @@ mock.onGet(new RegExp(/^\/sys_permissions\/([a-zA-Z0-9\-\;]{1,35})\/sys_role_per
...
@@ -219,7 +594,7 @@ mock.onGet(new RegExp(/^\/sys_permissions\/([a-zA-Z0-9\-\;]{1,35})\/sys_role_per
});
});
// FetchDefault
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_role_permissions
\/
selec
t$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_role_permissions
\/
fetchdefaul
t$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: FetchDefault"
);
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
...
@@ -234,7 +609,7 @@ mock.onGet(new RegExp(/^\/sys_role_permissions\/select$/)).reply((config: any) =
...
@@ -234,7 +609,7 @@ mock.onGet(new RegExp(/^\/sys_role_permissions\/select$/)).reply((config: any) =
});
});
// FetchDefault
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_role_permissions
\/
selec
t
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_role_permissions
\/
fetchdefaul
t
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: FetchDefault"
);
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
if
(
config
.
url
.
includes
(
'page'
)){
if
(
config
.
url
.
includes
(
'page'
)){
...
@@ -297,3 +672,171 @@ mock.onGet(new RegExp(/^\/sys_role_permissions\/select(\?[\w-./?%&=,]*)*$/)).rep
...
@@ -297,3 +672,171 @@ mock.onGet(new RegExp(/^\/sys_role_permissions\/select(\?[\w-./?%&=,]*)*$/)).rep
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Get
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: Get"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'roleid'
,
'rolepermissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
rolepermissionid
,
tempValue
.
rolepermissionid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Get
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: Get"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'permissionid'
,
'rolepermissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
rolepermissionid
,
tempValue
.
rolepermissionid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Get
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: Get"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'rolepermissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
rolepermissionid
,
tempValue
.
rolepermissionid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Remove
mock
.
onDelete
(
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: Remove"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'roleid'
,
'rolepermissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
rolepermissionid
,
tempValue
.
rolepermissionid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Remove
mock
.
onDelete
(
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: Remove"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'permissionid'
,
'rolepermissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
rolepermissionid
,
tempValue
.
rolepermissionid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Remove
mock
.
onDelete
(
new
RegExp
(
/^
\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role_permission 方法: Remove"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'rolepermissionid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_role_permissions
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
rolepermissionid
,
tempValue
.
rolepermissionid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
app_web/src/mock/entity/sys-roles/sys-roles.ts
浏览文件 @
503211cb
...
@@ -34,16 +34,165 @@ mock.onGet(new RegExp(/^\/sys_roles\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((
...
@@ -34,16 +34,165 @@ mock.onGet(new RegExp(/^\/sys_roles\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
];
return
[
status
,
_items
];
});
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// Save
// URI参数传递情况未实现
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_roles
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
// URI参数传递情况未实现
console
.
groupCollapsed
(
"实体:sys_role 方法: Save"
);
// URI参数传递情况未实现
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// URI参数传递情况未实现
let
status
=
MockAdapter
.
mockStatus
(
config
);
// URI参数传递情况未实现
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'roleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.roleid, tempValue.roleid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'roleid'
]
==
tempValue
[
'roleid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Update
mock
.
onPut
(
new
RegExp
(
/^
\/
sys_roles
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role 方法: Update"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'roleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.roleid, tempValue.roleid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'roleid'
]
==
tempValue
[
'roleid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Create
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_roles
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role 方法: Create"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'roleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
mockDatas
[
0
]);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
mockDatas
[
0
]];
});
// GetDraft
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_roles
\/
getdraft$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role 方法: GetDraft"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// GetDraft
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// CheckKey
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_roles
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
checkkey$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role 方法: CheckKey"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'roleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.roleid, tempValue.roleid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'roleid'
]
==
tempValue
[
'roleid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// FetchDefault
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_roles
\/
selec
t$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_roles
\/
fetchdefaul
t$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role 方法: FetchDefault"
);
console
.
groupCollapsed
(
"实体:sys_role 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
...
@@ -58,7 +207,7 @@ mock.onGet(new RegExp(/^\/sys_roles\/select$/)).reply((config: any) => {
...
@@ -58,7 +207,7 @@ mock.onGet(new RegExp(/^\/sys_roles\/select$/)).reply((config: any) => {
});
});
// FetchDefault
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_roles
\/
selec
t
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_roles
\/
fetchdefaul
t
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role 方法: FetchDefault"
);
console
.
groupCollapsed
(
"实体:sys_role 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
if
(
config
.
url
.
includes
(
'page'
)){
if
(
config
.
url
.
includes
(
'page'
)){
...
@@ -93,3 +242,59 @@ mock.onGet(new RegExp(/^\/sys_roles\/select(\?[\w-./?%&=,]*)*$/)).reply((config:
...
@@ -93,3 +242,59 @@ mock.onGet(new RegExp(/^\/sys_roles\/select(\?[\w-./?%&=,]*)*$/)).reply((config:
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Get
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role 方法: Get"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'roleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
roleid
,
tempValue
.
roleid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Remove
mock
.
onDelete
(
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_role 方法: Remove"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'roleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
roleid
,
tempValue
.
roleid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
app_web/src/mock/entity/sys-user-roles/sys-user-roles.ts
浏览文件 @
503211cb
...
@@ -93,44 +93,419 @@ mock.onGet(new RegExp(/^\/sys_user_roles\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).re
...
@@ -93,44 +93,419 @@ mock.onGet(new RegExp(/^\/sys_user_roles\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).re
return
[
status
,
_items
];
return
[
status
,
_items
];
});
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// CheckKey
// URI参数传递情况未实现
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: CheckKey"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'userid'
,
'userroleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// CheckKey
// URI参数传递情况未实现
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: CheckKey"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'roleid'
,
'userroleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// URI参数传递情况未实现
// CheckKey
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_user_roles
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
checkkey$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: CheckKey"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'userroleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.userroleid, tempValue.userroleid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'userroleid'
]
==
tempValue
[
'userroleid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// GetDraft
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/
getdraft$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: GetDraft"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// GetDraft
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// GetDraft
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/
getdraft$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: GetDraft"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// GetDraft
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// URI参数传递情况未实现
// GetDraft
// URI参数传递情况未实现
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_user_roles
\/
getdraft$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: GetDraft"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// GetDraft
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// Update
// URI参数传递情况未实现
mock
.
onPut
(
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: Update"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'userid'
,
'userroleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// Update
// URI参数传递情况未实现
mock
.
onPut
(
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: Update"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'roleid'
,
'userroleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// Update
mock
.
onPut
(
new
RegExp
(
/^
\/
sys_user_roles
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: Update"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'userroleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.userroleid, tempValue.userroleid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'userroleid'
]
==
tempValue
[
'userroleid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Create
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: Create"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'userid'
,
'userroleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// Create
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: Create"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'roleid'
,
'userroleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// Create
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_user_roles
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: Create"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'userroleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
mockDatas
[
0
]);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
mockDatas
[
0
]];
});
// Save
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: Save"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'userid'
,
'userroleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// Save
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: Save"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'roleid'
,
'userroleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// Save
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_user_roles
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: Save"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'userroleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.userroleid, tempValue.userroleid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'userroleid'
]
==
tempValue
[
'userroleid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// FetchDefault
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/
selec
t$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/
fetchdefaul
t$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: FetchDefault"
);
console
.
groupCollapsed
(
"实体:sys_user_role 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
...
@@ -139,7 +514,7 @@ mock.onGet(new RegExp(/^\/sys_users\/([a-zA-Z0-9\-\;]{1,35})\/sys_user_roles\/se
...
@@ -139,7 +514,7 @@ mock.onGet(new RegExp(/^\/sys_users\/([a-zA-Z0-9\-\;]{1,35})\/sys_user_roles\/se
}
}
const
paramArray
:
Array
<
any
>
=
[
'userid'
];
const
paramArray
:
Array
<
any
>
=
[
'userid'
];
let
tempValue
:
any
=
{};
let
tempValue
:
any
=
{};
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/
selec
t$/
).
exec
(
config
.
url
);
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/
fetchdefaul
t$/
).
exec
(
config
.
url
);
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
Object
.
defineProperty
(
tempValue
,
item
,
{
...
@@ -175,7 +550,7 @@ mock.onGet(new RegExp(/^\/sys_users\/([a-zA-Z0-9\-\;]{1,35})\/sys_user_roles\/se
...
@@ -175,7 +550,7 @@ mock.onGet(new RegExp(/^\/sys_users\/([a-zA-Z0-9\-\;]{1,35})\/sys_user_roles\/se
// FetchDefault
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/
selec
t$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/
fetchdefaul
t$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: FetchDefault"
);
console
.
groupCollapsed
(
"实体:sys_user_role 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
...
@@ -184,7 +559,7 @@ mock.onGet(new RegExp(/^\/sys_roles\/([a-zA-Z0-9\-\;]{1,35})\/sys_user_roles\/se
...
@@ -184,7 +559,7 @@ mock.onGet(new RegExp(/^\/sys_roles\/([a-zA-Z0-9\-\;]{1,35})\/sys_user_roles\/se
}
}
const
paramArray
:
Array
<
any
>
=
[
'roleid'
];
const
paramArray
:
Array
<
any
>
=
[
'roleid'
];
let
tempValue
:
any
=
{};
let
tempValue
:
any
=
{};
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/
selec
t$/
).
exec
(
config
.
url
);
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/
fetchdefaul
t$/
).
exec
(
config
.
url
);
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
Object
.
defineProperty
(
tempValue
,
item
,
{
...
@@ -219,7 +594,7 @@ mock.onGet(new RegExp(/^\/sys_roles\/([a-zA-Z0-9\-\;]{1,35})\/sys_user_roles\/se
...
@@ -219,7 +594,7 @@ mock.onGet(new RegExp(/^\/sys_roles\/([a-zA-Z0-9\-\;]{1,35})\/sys_user_roles\/se
});
});
// FetchDefault
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_user_roles
\/
selec
t$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_user_roles
\/
fetchdefaul
t$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: FetchDefault"
);
console
.
groupCollapsed
(
"实体:sys_user_role 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
...
@@ -234,7 +609,7 @@ mock.onGet(new RegExp(/^\/sys_user_roles\/select$/)).reply((config: any) => {
...
@@ -234,7 +609,7 @@ mock.onGet(new RegExp(/^\/sys_user_roles\/select$/)).reply((config: any) => {
});
});
// FetchDefault
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_user_roles
\/
selec
t
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_user_roles
\/
fetchdefaul
t
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: FetchDefault"
);
console
.
groupCollapsed
(
"实体:sys_user_role 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
if
(
config
.
url
.
includes
(
'page'
)){
if
(
config
.
url
.
includes
(
'page'
)){
...
@@ -297,3 +672,171 @@ mock.onGet(new RegExp(/^\/sys_user_roles\/select(\?[\w-./?%&=,]*)*$/)).reply((co
...
@@ -297,3 +672,171 @@ mock.onGet(new RegExp(/^\/sys_user_roles\/select(\?[\w-./?%&=,]*)*$/)).reply((co
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Remove
mock
.
onDelete
(
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: Remove"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'userid'
,
'userroleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
userroleid
,
tempValue
.
userroleid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Remove
mock
.
onDelete
(
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: Remove"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'roleid'
,
'userroleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
userroleid
,
tempValue
.
userroleid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Remove
mock
.
onDelete
(
new
RegExp
(
/^
\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: Remove"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'userroleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
userroleid
,
tempValue
.
userroleid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Get
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: Get"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'userid'
,
'userroleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
userroleid
,
tempValue
.
userroleid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Get
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: Get"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'roleid'
,
'userroleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_roles
\/([
a-zA-Z0-9
\-\;]{1,35})\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
userroleid
,
tempValue
.
userroleid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Get
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user_role 方法: Get"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'userroleid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_user_roles
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
userroleid
,
tempValue
.
userroleid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
app_web/src/mock/entity/sys-users/sys-users.ts
浏览文件 @
503211cb
...
@@ -34,16 +34,165 @@ mock.onGet(new RegExp(/^\/sys_users\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((
...
@@ -34,16 +34,165 @@ mock.onGet(new RegExp(/^\/sys_users\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
];
return
[
status
,
_items
];
});
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// Update
// URI参数传递情况未实现
mock
.
onPut
(
new
RegExp
(
/^
\/
sys_users
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
// URI参数传递情况未实现
console
.
groupCollapsed
(
"实体:sys_user 方法: Update"
);
// URI参数传递情况未实现
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// URI参数传递情况未实现
let
status
=
MockAdapter
.
mockStatus
(
config
);
// URI参数传递情况未实现
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'userid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.userid, tempValue.userid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'userid'
]
==
tempValue
[
'userid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// CheckKey
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_users
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
checkkey$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user 方法: CheckKey"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'userid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.userid, tempValue.userid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'userid'
]
==
tempValue
[
'userid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Save
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_users
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user 方法: Save"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'userid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.userid, tempValue.userid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'userid'
]
==
tempValue
[
'userid'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// GetDraft
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_users
\/
getdraft$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user 方法: GetDraft"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// GetDraft
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// Create
mock
.
onPost
(
new
RegExp
(
/^
\/
sys_users
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user 方法: Create"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'userid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
mockDatas
[
0
]);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
mockDatas
[
0
]];
});
// FetchDefault
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_users
\/
selec
t$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_users
\/
fetchdefaul
t$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user 方法: FetchDefault"
);
console
.
groupCollapsed
(
"实体:sys_user 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
...
@@ -58,7 +207,7 @@ mock.onGet(new RegExp(/^\/sys_users\/select$/)).reply((config: any) => {
...
@@ -58,7 +207,7 @@ mock.onGet(new RegExp(/^\/sys_users\/select$/)).reply((config: any) => {
});
});
// FetchDefault
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_users
\/
selec
t
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_users
\/
fetchdefaul
t
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user 方法: FetchDefault"
);
console
.
groupCollapsed
(
"实体:sys_user 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
if
(
config
.
url
.
includes
(
'page'
)){
if
(
config
.
url
.
includes
(
'page'
)){
...
@@ -93,3 +242,59 @@ mock.onGet(new RegExp(/^\/sys_users\/select(\?[\w-./?%&=,]*)*$/)).reply((config:
...
@@ -93,3 +242,59 @@ mock.onGet(new RegExp(/^\/sys_users\/select(\?[\w-./?%&=,]*)*$/)).reply((config:
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Remove
mock
.
onDelete
(
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user 方法: Remove"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'userid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
userid
,
tempValue
.
userid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Get
mock
.
onGet
(
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:sys_user 方法: Get"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'userid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
sys_users
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
userid
,
tempValue
.
userid
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
app_web/src/service/sys-permission/sys-permission-service-base.ts
浏览文件 @
503211cb
...
@@ -49,6 +49,168 @@ export default class SYS_PERMISSIONServiceBase extends EntityService {
...
@@ -49,6 +49,168 @@ export default class SYS_PERMISSIONServiceBase extends EntityService {
return
Http
.
getInstance
().
get
(
`/sys_permissions/
${
context
.
sys_permission
}
/select`
,
isloading
);
return
Http
.
getInstance
().
get
(
`/sys_permissions/
${
context
.
sys_permission
}
/select`
,
isloading
);
}
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PERMISSIONServiceBase
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
sys_role_permissionsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_role_permissions'
),
'undefined'
)){
sys_role_permissionsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_role_permissions'
)
as
any
);
if
(
sys_role_permissionsData
&&
sys_role_permissionsData
.
length
&&
sys_role_permissionsData
.
length
>
0
){
sys_role_permissionsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
rolepermissionid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
sys_role_permissions
=
sys_role_permissionsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/sys_permissions/
${
context
.
sys_permission
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sys_role_permissions'
,
JSON
.
stringify
(
res
.
data
.
sys_role_permissions
));
return
res
;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PERMISSIONServiceBase
*/
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sys_permissions/getdraft`
,
isloading
);
res
.
data
.
sys_permission
=
data
.
sys_permission
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sys_role_permissions'
,
JSON
.
stringify
(
res
.
data
.
sys_role_permissions
));
return
res
;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PERMISSIONServiceBase
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
delete
(
`/sys_permissions/
${
context
.
sys_permission
}
`
,
isloading
);
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PERMISSIONServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
sys_role_permissionsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_role_permissions'
),
'undefined'
)){
sys_role_permissionsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_role_permissions'
)
as
any
);
if
(
sys_role_permissionsData
&&
sys_role_permissionsData
.
length
&&
sys_role_permissionsData
.
length
>
0
){
sys_role_permissionsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
rolepermissionid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
sys_role_permissions
=
sys_role_permissionsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/sys_permissions/
${
context
.
sys_permission
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sys_role_permissions'
,
JSON
.
stringify
(
res
.
data
.
sys_role_permissions
));
return
res
;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PERMISSIONServiceBase
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
sys_role_permissionsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_role_permissions'
),
'undefined'
)){
sys_role_permissionsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_role_permissions'
)
as
any
);
if
(
sys_role_permissionsData
&&
sys_role_permissionsData
.
length
&&
sys_role_permissionsData
.
length
>
0
){
sys_role_permissionsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
rolepermissionid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
sys_role_permissions
=
sys_role_permissionsData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/sys_permissions`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_sys_role_permissions'
,
JSON
.
stringify
(
res
.
data
.
sys_role_permissions
));
return
res
;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PERMISSIONServiceBase
*/
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
post
(
`/sys_permissions/
${
context
.
sys_permission
}
/checkkey`
,
data
,
isloading
);
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PERMISSIONServiceBase
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sys_permissions/
${
context
.
sys_permission
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sys_role_permissions'
,
JSON
.
stringify
(
res
.
data
.
sys_role_permissions
));
return
res
;
}
/**
/**
* FetchDefault接口方法
* FetchDefault接口方法
*
*
...
@@ -60,6 +222,6 @@ export default class SYS_PERMISSIONServiceBase extends EntityService {
...
@@ -60,6 +222,6 @@ export default class SYS_PERMISSIONServiceBase extends EntityService {
*/
*/
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/sys_permissions/
selec
t`
,
tempData
,
isloading
);
return
Http
.
getInstance
().
get
(
`/sys_permissions/
fetchdefaul
t`
,
tempData
,
isloading
);
}
}
}
}
\ No newline at end of file
app_web/src/service/sys-psappmenuitem/sys-psappmenuitem-service-base.ts
浏览文件 @
503211cb
...
@@ -49,6 +49,118 @@ export default class SYS_PSAPPMENUITEMServiceBase extends EntityService {
...
@@ -49,6 +49,118 @@ export default class SYS_PSAPPMENUITEMServiceBase extends EntityService {
return
Http
.
getInstance
().
get
(
`/sys_psappmenuitems/
${
context
.
sys_psappmenuitem
}
/select`
,
isloading
);
return
Http
.
getInstance
().
get
(
`/sys_psappmenuitems/
${
context
.
sys_psappmenuitem
}
/select`
,
isloading
);
}
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PSAPPMENUITEMServiceBase
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/sys_psappmenuitems/
${
context
.
sys_psappmenuitem
}
/save`
,
data
,
isloading
);
return
res
;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PSAPPMENUITEMServiceBase
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/sys_psappmenuitems`
,
data
,
isloading
);
return
res
;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PSAPPMENUITEMServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/sys_psappmenuitems/
${
context
.
sys_psappmenuitem
}
`
,
data
,
isloading
);
return
res
;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PSAPPMENUITEMServiceBase
*/
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sys_psappmenuitems/getdraft`
,
isloading
);
res
.
data
.
sys_psappmenuitem
=
data
.
sys_psappmenuitem
;
return
res
;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PSAPPMENUITEMServiceBase
*/
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
post
(
`/sys_psappmenuitems/
${
context
.
sys_psappmenuitem
}
/checkkey`
,
data
,
isloading
);
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PSAPPMENUITEMServiceBase
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
delete
(
`/sys_psappmenuitems/
${
context
.
sys_psappmenuitem
}
`
,
isloading
);
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PSAPPMENUITEMServiceBase
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sys_psappmenuitems/
${
context
.
sys_psappmenuitem
}
`
,
isloading
);
return
res
;
}
/**
/**
* FetchDefault接口方法
* FetchDefault接口方法
*
*
...
@@ -60,6 +172,6 @@ export default class SYS_PSAPPMENUITEMServiceBase extends EntityService {
...
@@ -60,6 +172,6 @@ export default class SYS_PSAPPMENUITEMServiceBase extends EntityService {
*/
*/
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/sys_psappmenuitems/
selec
t`
,
tempData
,
isloading
);
return
Http
.
getInstance
().
get
(
`/sys_psappmenuitems/
fetchdefaul
t`
,
tempData
,
isloading
);
}
}
}
}
\ No newline at end of file
app_web/src/service/sys-psdeoppriv/sys-psdeoppriv-service-base.ts
浏览文件 @
503211cb
...
@@ -49,6 +49,118 @@ export default class SYS_PSDEOPPRIVServiceBase extends EntityService {
...
@@ -49,6 +49,118 @@ export default class SYS_PSDEOPPRIVServiceBase extends EntityService {
return
Http
.
getInstance
().
get
(
`/sys_psdeopprivs/
${
context
.
sys_psdeoppriv
}
/select`
,
isloading
);
return
Http
.
getInstance
().
get
(
`/sys_psdeopprivs/
${
context
.
sys_psdeoppriv
}
/select`
,
isloading
);
}
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PSDEOPPRIVServiceBase
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
delete
(
`/sys_psdeopprivs/
${
context
.
sys_psdeoppriv
}
`
,
isloading
);
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PSDEOPPRIVServiceBase
*/
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
post
(
`/sys_psdeopprivs/
${
context
.
sys_psdeoppriv
}
/checkkey`
,
data
,
isloading
);
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PSDEOPPRIVServiceBase
*/
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sys_psdeopprivs/getdraft`
,
isloading
);
res
.
data
.
sys_psdeoppriv
=
data
.
sys_psdeoppriv
;
return
res
;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PSDEOPPRIVServiceBase
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/sys_psdeopprivs`
,
data
,
isloading
);
return
res
;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PSDEOPPRIVServiceBase
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sys_psdeopprivs/
${
context
.
sys_psdeoppriv
}
`
,
isloading
);
return
res
;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PSDEOPPRIVServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/sys_psdeopprivs/
${
context
.
sys_psdeoppriv
}
`
,
data
,
isloading
);
return
res
;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_PSDEOPPRIVServiceBase
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/sys_psdeopprivs/
${
context
.
sys_psdeoppriv
}
/save`
,
data
,
isloading
);
return
res
;
}
/**
/**
* FetchDefault接口方法
* FetchDefault接口方法
*
*
...
@@ -60,6 +172,6 @@ export default class SYS_PSDEOPPRIVServiceBase extends EntityService {
...
@@ -60,6 +172,6 @@ export default class SYS_PSDEOPPRIVServiceBase extends EntityService {
*/
*/
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/sys_psdeopprivs/
selec
t`
,
tempData
,
isloading
);
return
Http
.
getInstance
().
get
(
`/sys_psdeopprivs/
fetchdefaul
t`
,
tempData
,
isloading
);
}
}
}
}
\ No newline at end of file
app_web/src/service/sys-role-permission/sys-role-permission-service-base.ts
浏览文件 @
503211cb
...
@@ -55,6 +55,172 @@ export default class SYS_ROLE_PERMISSIONServiceBase extends EntityService {
...
@@ -55,6 +55,172 @@ export default class SYS_ROLE_PERMISSIONServiceBase extends EntityService {
return
Http
.
getInstance
().
get
(
`/sys_role_permissions/
${
context
.
sys_role_permission
}
/select`
,
isloading
);
return
Http
.
getInstance
().
get
(
`/sys_role_permissions/
${
context
.
sys_role_permission
}
/select`
,
isloading
);
}
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_ROLE_PERMISSIONServiceBase
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sys_role
&&
context
.
sys_role_permission
){
return
Http
.
getInstance
().
get
(
`/sys_roles/
${
context
.
sys_role
}
/sys_role_permissions/
${
context
.
sys_role_permission
}
`
,
isloading
);
}
if
(
context
.
sys_permission
&&
context
.
sys_role_permission
){
return
Http
.
getInstance
().
get
(
`/sys_permissions/
${
context
.
sys_permission
}
/sys_role_permissions/
${
context
.
sys_role_permission
}
`
,
isloading
);
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sys_role_permissions/
${
context
.
sys_role_permission
}
`
,
isloading
);
return
res
;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_ROLE_PERMISSIONServiceBase
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sys_role
&&
context
.
sys_role_permission
){
return
Http
.
getInstance
().
delete
(
`/sys_roles/
${
context
.
sys_role
}
/sys_role_permissions/
${
context
.
sys_role_permission
}
`
,
isloading
);
}
if
(
context
.
sys_permission
&&
context
.
sys_role_permission
){
return
Http
.
getInstance
().
delete
(
`/sys_permissions/
${
context
.
sys_permission
}
/sys_role_permissions/
${
context
.
sys_role_permission
}
`
,
isloading
);
}
return
Http
.
getInstance
().
delete
(
`/sys_role_permissions/
${
context
.
sys_role_permission
}
`
,
isloading
);
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_ROLE_PERMISSIONServiceBase
*/
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sys_role
&&
true
){
return
Http
.
getInstance
().
get
(
`/sys_roles/
${
context
.
sys_role
}
/sys_role_permissions/getdraft`
,
isloading
);
}
if
(
context
.
sys_permission
&&
true
){
return
Http
.
getInstance
().
get
(
`/sys_permissions/
${
context
.
sys_permission
}
/sys_role_permissions/getdraft`
,
isloading
);
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sys_role_permissions/getdraft`
,
isloading
);
res
.
data
.
sys_role_permission
=
data
.
sys_role_permission
;
return
res
;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_ROLE_PERMISSIONServiceBase
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sys_role
&&
true
){
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
return
Http
.
getInstance
().
post
(
`/sys_roles/
${
context
.
sys_role
}
/sys_role_permissions`
,
data
,
isloading
);
}
if
(
context
.
sys_permission
&&
true
){
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
return
Http
.
getInstance
().
post
(
`/sys_permissions/
${
context
.
sys_permission
}
/sys_role_permissions`
,
data
,
isloading
);
}
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/sys_role_permissions`
,
data
,
isloading
);
return
res
;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_ROLE_PERMISSIONServiceBase
*/
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sys_role
&&
context
.
sys_role_permission
){
return
Http
.
getInstance
().
post
(
`/sys_roles/
${
context
.
sys_role
}
/sys_role_permissions/
${
context
.
sys_role_permission
}
/checkkey`
,
data
,
isloading
);
}
if
(
context
.
sys_permission
&&
context
.
sys_role_permission
){
return
Http
.
getInstance
().
post
(
`/sys_permissions/
${
context
.
sys_permission
}
/sys_role_permissions/
${
context
.
sys_role_permission
}
/checkkey`
,
data
,
isloading
);
}
return
Http
.
getInstance
().
post
(
`/sys_role_permissions/
${
context
.
sys_role_permission
}
/checkkey`
,
data
,
isloading
);
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_ROLE_PERMISSIONServiceBase
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sys_role
&&
context
.
sys_role_permission
){
return
Http
.
getInstance
().
post
(
`/sys_roles/
${
context
.
sys_role
}
/sys_role_permissions/
${
context
.
sys_role_permission
}
/save`
,
data
,
isloading
);
}
if
(
context
.
sys_permission
&&
context
.
sys_role_permission
){
return
Http
.
getInstance
().
post
(
`/sys_permissions/
${
context
.
sys_permission
}
/sys_role_permissions/
${
context
.
sys_role_permission
}
/save`
,
data
,
isloading
);
}
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/sys_role_permissions/
${
context
.
sys_role_permission
}
/save`
,
data
,
isloading
);
return
res
;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_ROLE_PERMISSIONServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sys_role
&&
context
.
sys_role_permission
){
return
Http
.
getInstance
().
put
(
`/sys_roles/
${
context
.
sys_role
}
/sys_role_permissions/
${
context
.
sys_role_permission
}
`
,
data
,
isloading
);
}
if
(
context
.
sys_permission
&&
context
.
sys_role_permission
){
return
Http
.
getInstance
().
put
(
`/sys_permissions/
${
context
.
sys_permission
}
/sys_role_permissions/
${
context
.
sys_role_permission
}
`
,
data
,
isloading
);
}
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/sys_role_permissions/
${
context
.
sys_role_permission
}
`
,
data
,
isloading
);
return
res
;
}
/**
/**
* FetchDefault接口方法
* FetchDefault接口方法
*
*
...
@@ -67,13 +233,13 @@ export default class SYS_ROLE_PERMISSIONServiceBase extends EntityService {
...
@@ -67,13 +233,13 @@ export default class SYS_ROLE_PERMISSIONServiceBase extends EntityService {
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sys_role
&&
true
){
if
(
context
.
sys_role
&&
true
){
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/sys_roles/
${
context
.
sys_role
}
/sys_role_permissions/
selec
t`
,
tempData
,
isloading
);
return
Http
.
getInstance
().
get
(
`/sys_roles/
${
context
.
sys_role
}
/sys_role_permissions/
fetchdefaul
t`
,
tempData
,
isloading
);
}
}
if
(
context
.
sys_permission
&&
true
){
if
(
context
.
sys_permission
&&
true
){
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/sys_permissions/
${
context
.
sys_permission
}
/sys_role_permissions/
selec
t`
,
tempData
,
isloading
);
return
Http
.
getInstance
().
get
(
`/sys_permissions/
${
context
.
sys_permission
}
/sys_role_permissions/
fetchdefaul
t`
,
tempData
,
isloading
);
}
}
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/sys_role_permissions/
selec
t`
,
tempData
,
isloading
);
return
Http
.
getInstance
().
get
(
`/sys_role_permissions/
fetchdefaul
t`
,
tempData
,
isloading
);
}
}
}
}
\ No newline at end of file
app_web/src/service/sys-role/sys-role-service-base.ts
浏览文件 @
503211cb
...
@@ -49,6 +49,218 @@ export default class SYS_ROLEServiceBase extends EntityService {
...
@@ -49,6 +49,218 @@ export default class SYS_ROLEServiceBase extends EntityService {
return
Http
.
getInstance
().
get
(
`/sys_roles/
${
context
.
sys_role
}
/select`
,
isloading
);
return
Http
.
getInstance
().
get
(
`/sys_roles/
${
context
.
sys_role
}
/select`
,
isloading
);
}
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_ROLEServiceBase
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
sys_role_permissionsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_role_permissions'
),
'undefined'
)){
sys_role_permissionsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_role_permissions'
)
as
any
);
if
(
sys_role_permissionsData
&&
sys_role_permissionsData
.
length
&&
sys_role_permissionsData
.
length
>
0
){
sys_role_permissionsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
rolepermissionid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
sys_role_permissions
=
sys_role_permissionsData
;
let
sys_user_rolesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_user_roles'
),
'undefined'
)){
sys_user_rolesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_user_roles'
)
as
any
);
if
(
sys_user_rolesData
&&
sys_user_rolesData
.
length
&&
sys_user_rolesData
.
length
>
0
){
sys_user_rolesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
userroleid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
sys_user_roles
=
sys_user_rolesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/sys_roles/
${
context
.
sys_role
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sys_role_permissions'
,
JSON
.
stringify
(
res
.
data
.
sys_role_permissions
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sys_user_roles'
,
JSON
.
stringify
(
res
.
data
.
sys_user_roles
));
return
res
;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_ROLEServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
sys_role_permissionsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_role_permissions'
),
'undefined'
)){
sys_role_permissionsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_role_permissions'
)
as
any
);
if
(
sys_role_permissionsData
&&
sys_role_permissionsData
.
length
&&
sys_role_permissionsData
.
length
>
0
){
sys_role_permissionsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
rolepermissionid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
sys_role_permissions
=
sys_role_permissionsData
;
let
sys_user_rolesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_user_roles'
),
'undefined'
)){
sys_user_rolesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_user_roles'
)
as
any
);
if
(
sys_user_rolesData
&&
sys_user_rolesData
.
length
&&
sys_user_rolesData
.
length
>
0
){
sys_user_rolesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
userroleid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
sys_user_roles
=
sys_user_rolesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/sys_roles/
${
context
.
sys_role
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sys_role_permissions'
,
JSON
.
stringify
(
res
.
data
.
sys_role_permissions
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sys_user_roles'
,
JSON
.
stringify
(
res
.
data
.
sys_user_roles
));
return
res
;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_ROLEServiceBase
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
sys_role_permissionsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_role_permissions'
),
'undefined'
)){
sys_role_permissionsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_role_permissions'
)
as
any
);
if
(
sys_role_permissionsData
&&
sys_role_permissionsData
.
length
&&
sys_role_permissionsData
.
length
>
0
){
sys_role_permissionsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
rolepermissionid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
sys_role_permissions
=
sys_role_permissionsData
;
let
sys_user_rolesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_user_roles'
),
'undefined'
)){
sys_user_rolesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_user_roles'
)
as
any
);
if
(
sys_user_rolesData
&&
sys_user_rolesData
.
length
&&
sys_user_rolesData
.
length
>
0
){
sys_user_rolesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
userroleid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
sys_user_roles
=
sys_user_rolesData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/sys_roles`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_sys_role_permissions'
,
JSON
.
stringify
(
res
.
data
.
sys_role_permissions
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_sys_user_roles'
,
JSON
.
stringify
(
res
.
data
.
sys_user_roles
));
return
res
;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_ROLEServiceBase
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sys_roles/
${
context
.
sys_role
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sys_role_permissions'
,
JSON
.
stringify
(
res
.
data
.
sys_role_permissions
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sys_user_roles'
,
JSON
.
stringify
(
res
.
data
.
sys_user_roles
));
return
res
;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_ROLEServiceBase
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
delete
(
`/sys_roles/
${
context
.
sys_role
}
`
,
isloading
);
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_ROLEServiceBase
*/
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sys_roles/getdraft`
,
isloading
);
res
.
data
.
sys_role
=
data
.
sys_role
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sys_role_permissions'
,
JSON
.
stringify
(
res
.
data
.
sys_role_permissions
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sys_user_roles'
,
JSON
.
stringify
(
res
.
data
.
sys_user_roles
));
return
res
;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_ROLEServiceBase
*/
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
post
(
`/sys_roles/
${
context
.
sys_role
}
/checkkey`
,
data
,
isloading
);
}
/**
/**
* FetchDefault接口方法
* FetchDefault接口方法
*
*
...
@@ -60,6 +272,6 @@ export default class SYS_ROLEServiceBase extends EntityService {
...
@@ -60,6 +272,6 @@ export default class SYS_ROLEServiceBase extends EntityService {
*/
*/
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/sys_roles/
selec
t`
,
tempData
,
isloading
);
return
Http
.
getInstance
().
get
(
`/sys_roles/
fetchdefaul
t`
,
tempData
,
isloading
);
}
}
}
}
\ No newline at end of file
app_web/src/service/sys-user-role/sys-user-role-service-base.ts
浏览文件 @
503211cb
...
@@ -55,6 +55,172 @@ export default class SYS_USER_ROLEServiceBase extends EntityService {
...
@@ -55,6 +55,172 @@ export default class SYS_USER_ROLEServiceBase extends EntityService {
return
Http
.
getInstance
().
get
(
`/sys_user_roles/
${
context
.
sys_user_role
}
/select`
,
isloading
);
return
Http
.
getInstance
().
get
(
`/sys_user_roles/
${
context
.
sys_user_role
}
/select`
,
isloading
);
}
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_USER_ROLEServiceBase
*/
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sys_user
&&
context
.
sys_user_role
){
return
Http
.
getInstance
().
post
(
`/sys_users/
${
context
.
sys_user
}
/sys_user_roles/
${
context
.
sys_user_role
}
/checkkey`
,
data
,
isloading
);
}
if
(
context
.
sys_role
&&
context
.
sys_user_role
){
return
Http
.
getInstance
().
post
(
`/sys_roles/
${
context
.
sys_role
}
/sys_user_roles/
${
context
.
sys_user_role
}
/checkkey`
,
data
,
isloading
);
}
return
Http
.
getInstance
().
post
(
`/sys_user_roles/
${
context
.
sys_user_role
}
/checkkey`
,
data
,
isloading
);
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_USER_ROLEServiceBase
*/
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sys_user
&&
true
){
return
Http
.
getInstance
().
get
(
`/sys_users/
${
context
.
sys_user
}
/sys_user_roles/getdraft`
,
isloading
);
}
if
(
context
.
sys_role
&&
true
){
return
Http
.
getInstance
().
get
(
`/sys_roles/
${
context
.
sys_role
}
/sys_user_roles/getdraft`
,
isloading
);
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sys_user_roles/getdraft`
,
isloading
);
res
.
data
.
sys_user_role
=
data
.
sys_user_role
;
return
res
;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_USER_ROLEServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sys_user
&&
context
.
sys_user_role
){
return
Http
.
getInstance
().
put
(
`/sys_users/
${
context
.
sys_user
}
/sys_user_roles/
${
context
.
sys_user_role
}
`
,
data
,
isloading
);
}
if
(
context
.
sys_role
&&
context
.
sys_user_role
){
return
Http
.
getInstance
().
put
(
`/sys_roles/
${
context
.
sys_role
}
/sys_user_roles/
${
context
.
sys_user_role
}
`
,
data
,
isloading
);
}
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/sys_user_roles/
${
context
.
sys_user_role
}
`
,
data
,
isloading
);
return
res
;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_USER_ROLEServiceBase
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sys_user
&&
context
.
sys_user_role
){
return
Http
.
getInstance
().
delete
(
`/sys_users/
${
context
.
sys_user
}
/sys_user_roles/
${
context
.
sys_user_role
}
`
,
isloading
);
}
if
(
context
.
sys_role
&&
context
.
sys_user_role
){
return
Http
.
getInstance
().
delete
(
`/sys_roles/
${
context
.
sys_role
}
/sys_user_roles/
${
context
.
sys_user_role
}
`
,
isloading
);
}
return
Http
.
getInstance
().
delete
(
`/sys_user_roles/
${
context
.
sys_user_role
}
`
,
isloading
);
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_USER_ROLEServiceBase
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sys_user
&&
true
){
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
return
Http
.
getInstance
().
post
(
`/sys_users/
${
context
.
sys_user
}
/sys_user_roles`
,
data
,
isloading
);
}
if
(
context
.
sys_role
&&
true
){
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
return
Http
.
getInstance
().
post
(
`/sys_roles/
${
context
.
sys_role
}
/sys_user_roles`
,
data
,
isloading
);
}
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/sys_user_roles`
,
data
,
isloading
);
return
res
;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_USER_ROLEServiceBase
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sys_user
&&
context
.
sys_user_role
){
return
Http
.
getInstance
().
get
(
`/sys_users/
${
context
.
sys_user
}
/sys_user_roles/
${
context
.
sys_user_role
}
`
,
isloading
);
}
if
(
context
.
sys_role
&&
context
.
sys_user_role
){
return
Http
.
getInstance
().
get
(
`/sys_roles/
${
context
.
sys_role
}
/sys_user_roles/
${
context
.
sys_user_role
}
`
,
isloading
);
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sys_user_roles/
${
context
.
sys_user_role
}
`
,
isloading
);
return
res
;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_USER_ROLEServiceBase
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sys_user
&&
context
.
sys_user_role
){
return
Http
.
getInstance
().
post
(
`/sys_users/
${
context
.
sys_user
}
/sys_user_roles/
${
context
.
sys_user_role
}
/save`
,
data
,
isloading
);
}
if
(
context
.
sys_role
&&
context
.
sys_user_role
){
return
Http
.
getInstance
().
post
(
`/sys_roles/
${
context
.
sys_role
}
/sys_user_roles/
${
context
.
sys_user_role
}
/save`
,
data
,
isloading
);
}
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/sys_user_roles/
${
context
.
sys_user_role
}
/save`
,
data
,
isloading
);
return
res
;
}
/**
/**
* FetchDefault接口方法
* FetchDefault接口方法
*
*
...
@@ -67,13 +233,13 @@ export default class SYS_USER_ROLEServiceBase extends EntityService {
...
@@ -67,13 +233,13 @@ export default class SYS_USER_ROLEServiceBase extends EntityService {
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
sys_user
&&
true
){
if
(
context
.
sys_user
&&
true
){
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/sys_users/
${
context
.
sys_user
}
/sys_user_roles/
selec
t`
,
tempData
,
isloading
);
return
Http
.
getInstance
().
get
(
`/sys_users/
${
context
.
sys_user
}
/sys_user_roles/
fetchdefaul
t`
,
tempData
,
isloading
);
}
}
if
(
context
.
sys_role
&&
true
){
if
(
context
.
sys_role
&&
true
){
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/sys_roles/
${
context
.
sys_role
}
/sys_user_roles/
selec
t`
,
tempData
,
isloading
);
return
Http
.
getInstance
().
get
(
`/sys_roles/
${
context
.
sys_role
}
/sys_user_roles/
fetchdefaul
t`
,
tempData
,
isloading
);
}
}
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/sys_user_roles/
selec
t`
,
tempData
,
isloading
);
return
Http
.
getInstance
().
get
(
`/sys_user_roles/
fetchdefaul
t`
,
tempData
,
isloading
);
}
}
}
}
\ No newline at end of file
app_web/src/service/sys-user/sys-user-service-base.ts
浏览文件 @
503211cb
...
@@ -49,6 +49,168 @@ export default class SYS_USERServiceBase extends EntityService {
...
@@ -49,6 +49,168 @@ export default class SYS_USERServiceBase extends EntityService {
return
Http
.
getInstance
().
get
(
`/sys_users/
${
context
.
sys_user
}
/select`
,
isloading
);
return
Http
.
getInstance
().
get
(
`/sys_users/
${
context
.
sys_user
}
/select`
,
isloading
);
}
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_USERServiceBase
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
delete
(
`/sys_users/
${
context
.
sys_user
}
`
,
isloading
);
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_USERServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
sys_user_rolesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_user_roles'
),
'undefined'
)){
sys_user_rolesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_user_roles'
)
as
any
);
if
(
sys_user_rolesData
&&
sys_user_rolesData
.
length
&&
sys_user_rolesData
.
length
>
0
){
sys_user_rolesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
userroleid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
sys_user_roles
=
sys_user_rolesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/sys_users/
${
context
.
sys_user
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sys_user_roles'
,
JSON
.
stringify
(
res
.
data
.
sys_user_roles
));
return
res
;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_USERServiceBase
*/
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
return
Http
.
getInstance
().
post
(
`/sys_users/
${
context
.
sys_user
}
/checkkey`
,
data
,
isloading
);
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_USERServiceBase
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sys_users/
${
context
.
sys_user
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sys_user_roles'
,
JSON
.
stringify
(
res
.
data
.
sys_user_roles
));
return
res
;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_USERServiceBase
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
sys_user_rolesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_user_roles'
),
'undefined'
)){
sys_user_rolesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_user_roles'
)
as
any
);
if
(
sys_user_rolesData
&&
sys_user_rolesData
.
length
&&
sys_user_rolesData
.
length
>
0
){
sys_user_rolesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
userroleid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
sys_user_roles
=
sys_user_rolesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/sys_users/
${
context
.
sys_user
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sys_user_roles'
,
JSON
.
stringify
(
res
.
data
.
sys_user_roles
));
return
res
;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_USERServiceBase
*/
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/sys_users/getdraft`
,
isloading
);
res
.
data
.
sys_user
=
data
.
sys_user
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_sys_user_roles'
,
JSON
.
stringify
(
res
.
data
.
sys_user_roles
));
return
res
;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SYS_USERServiceBase
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
sys_user_rolesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_user_roles'
),
'undefined'
)){
sys_user_rolesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_sys_user_roles'
)
as
any
);
if
(
sys_user_rolesData
&&
sys_user_rolesData
.
length
&&
sys_user_rolesData
.
length
>
0
){
sys_user_rolesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
userroleid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
sys_user_roles
=
sys_user_rolesData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/sys_users`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_sys_user_roles'
,
JSON
.
stringify
(
res
.
data
.
sys_user_roles
));
return
res
;
}
/**
/**
* FetchDefault接口方法
* FetchDefault接口方法
*
*
...
@@ -60,6 +222,6 @@ export default class SYS_USERServiceBase extends EntityService {
...
@@ -60,6 +222,6 @@ export default class SYS_USERServiceBase extends EntityService {
*/
*/
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
Http
.
getInstance
().
get
(
`/sys_users/
selec
t`
,
tempData
,
isloading
);
return
Http
.
getInstance
().
get
(
`/sys_users/
fetchdefaul
t`
,
tempData
,
isloading
);
}
}
}
}
\ No newline at end of file
app_web/src/widgets/app/main-appmenu/main-appmenu-model.ts
浏览文件 @
503211cb
...
@@ -33,24 +33,6 @@ export default class MainModel {
...
@@ -33,24 +33,6 @@ export default class MainModel {
resourcetag
:
''
,
resourcetag
:
''
,
},
},
{
{
id
:
'cd792e015d353e121fd014ef1f698aaf'
,
name
:
'menuitem8'
,
text
:
'系统管理'
,
type
:
'MENUITEM'
,
counterid
:
''
,
tooltip
:
'系统管理'
,
expanded
:
false
,
separator
:
false
,
hidden
:
false
,
hidesidebar
:
false
,
opendefault
:
false
,
iconcls
:
''
,
icon
:
''
,
textcls
:
''
,
appfunctag
:
''
,
resourcetag
:
''
,
items
:
[
{
id
:
'db3e0d48d6e76a66784adc84edd90cdc'
,
id
:
'db3e0d48d6e76a66784adc84edd90cdc'
,
name
:
'menuitem6'
,
name
:
'menuitem6'
,
text
:
'角色'
,
text
:
'角色'
,
...
@@ -121,8 +103,6 @@ export default class MainModel {
...
@@ -121,8 +103,6 @@ export default class MainModel {
textcls
:
''
,
textcls
:
''
,
appfunctag
:
'Auto1'
,
appfunctag
:
'Auto1'
,
resourcetag
:
''
,
resourcetag
:
''
,
},
],
},
},
];
];
...
...
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/mapper/SYS_PERMISSIONMapper.java
浏览文件 @
503211cb
...
@@ -27,8 +27,6 @@ public interface SYS_PERMISSIONMapper extends BaseMapper<SYS_PERMISSION>{
...
@@ -27,8 +27,6 @@ public interface SYS_PERMISSIONMapper extends BaseMapper<SYS_PERMISSION>{
int
updateById
(
@Param
(
Constants
.
ENTITY
)
SYS_PERMISSION
entity
);
int
updateById
(
@Param
(
Constants
.
ENTITY
)
SYS_PERMISSION
entity
);
@Override
@Override
int
deleteById
(
Serializable
id
);
int
deleteById
(
Serializable
id
);
Page
<
SYS_PERMISSION
>
selectPermission
(
IPage
page
,
@Param
(
"pw"
)
Wrapper
<
SYS_PERMISSION
>
wrapper
)
;
/**
/**
* 自定义查询SQL
* 自定义查询SQL
* @param sql
* @param sql
...
...
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/mapper/SYS_PSAPPMENUITEMMapper.java
浏览文件 @
503211cb
...
@@ -27,8 +27,6 @@ public interface SYS_PSAPPMENUITEMMapper extends BaseMapper<SYS_PSAPPMENUITEM>{
...
@@ -27,8 +27,6 @@ public interface SYS_PSAPPMENUITEMMapper extends BaseMapper<SYS_PSAPPMENUITEM>{
int
updateById
(
@Param
(
Constants
.
ENTITY
)
SYS_PSAPPMENUITEM
entity
);
int
updateById
(
@Param
(
Constants
.
ENTITY
)
SYS_PSAPPMENUITEM
entity
);
@Override
@Override
int
deleteById
(
Serializable
id
);
int
deleteById
(
Serializable
id
);
Page
<
SYS_PSAPPMENUITEM
>
selectPermission
(
IPage
page
,
@Param
(
"pw"
)
Wrapper
<
SYS_PSAPPMENUITEM
>
wrapper
)
;
/**
/**
* 自定义查询SQL
* 自定义查询SQL
* @param sql
* @param sql
...
...
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/mapper/SYS_PSDEOPPRIVMapper.java
浏览文件 @
503211cb
...
@@ -27,8 +27,6 @@ public interface SYS_PSDEOPPRIVMapper extends BaseMapper<SYS_PSDEOPPRIV>{
...
@@ -27,8 +27,6 @@ public interface SYS_PSDEOPPRIVMapper extends BaseMapper<SYS_PSDEOPPRIV>{
int
updateById
(
@Param
(
Constants
.
ENTITY
)
SYS_PSDEOPPRIV
entity
);
int
updateById
(
@Param
(
Constants
.
ENTITY
)
SYS_PSDEOPPRIV
entity
);
@Override
@Override
int
deleteById
(
Serializable
id
);
int
deleteById
(
Serializable
id
);
Page
<
SYS_PSDEOPPRIV
>
selectPermission
(
IPage
page
,
@Param
(
"pw"
)
Wrapper
<
SYS_PSDEOPPRIV
>
wrapper
)
;
/**
/**
* 自定义查询SQL
* 自定义查询SQL
* @param sql
* @param sql
...
...
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/mapper/SYS_ROLEMapper.java
浏览文件 @
503211cb
...
@@ -31,8 +31,6 @@ public interface SYS_ROLEMapper extends BaseMapper<SYS_ROLE>{
...
@@ -31,8 +31,6 @@ public interface SYS_ROLEMapper extends BaseMapper<SYS_ROLE>{
@Override
@Override
@CacheEvict
(
value
=
"sys_role"
,
key
=
"'row:'+#p0"
)
@CacheEvict
(
value
=
"sys_role"
,
key
=
"'row:'+#p0"
)
int
deleteById
(
Serializable
id
);
int
deleteById
(
Serializable
id
);
Page
<
SYS_ROLE
>
selectPermission
(
IPage
page
,
@Param
(
"pw"
)
Wrapper
<
SYS_ROLE
>
wrapper
)
;
/**
/**
* 自定义查询SQL
* 自定义查询SQL
* @param sql
* @param sql
...
...
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/mapper/SYS_ROLE_PERMISSIONMapper.java
浏览文件 @
503211cb
...
@@ -27,8 +27,6 @@ public interface SYS_ROLE_PERMISSIONMapper extends BaseMapper<SYS_ROLE_PERMISSIO
...
@@ -27,8 +27,6 @@ public interface SYS_ROLE_PERMISSIONMapper extends BaseMapper<SYS_ROLE_PERMISSIO
int
updateById
(
@Param
(
Constants
.
ENTITY
)
SYS_ROLE_PERMISSION
entity
);
int
updateById
(
@Param
(
Constants
.
ENTITY
)
SYS_ROLE_PERMISSION
entity
);
@Override
@Override
int
deleteById
(
Serializable
id
);
int
deleteById
(
Serializable
id
);
Page
<
SYS_ROLE_PERMISSION
>
selectPermission
(
IPage
page
,
@Param
(
"pw"
)
Wrapper
<
SYS_ROLE_PERMISSION
>
wrapper
)
;
/**
/**
* 自定义查询SQL
* 自定义查询SQL
* @param sql
* @param sql
...
...
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/mapper/SYS_USERMapper.java
浏览文件 @
503211cb
...
@@ -31,8 +31,6 @@ public interface SYS_USERMapper extends BaseMapper<SYS_USER>{
...
@@ -31,8 +31,6 @@ public interface SYS_USERMapper extends BaseMapper<SYS_USER>{
@Override
@Override
@CacheEvict
(
value
=
"sys_user"
,
key
=
"'row:'+#p0"
)
@CacheEvict
(
value
=
"sys_user"
,
key
=
"'row:'+#p0"
)
int
deleteById
(
Serializable
id
);
int
deleteById
(
Serializable
id
);
Page
<
SYS_USER
>
selectPermission
(
IPage
page
,
@Param
(
"pw"
)
Wrapper
<
SYS_USER
>
wrapper
)
;
/**
/**
* 自定义查询SQL
* 自定义查询SQL
* @param sql
* @param sql
...
...
ibzuaa-core/src/main/java/cn/ibizlab/core/uaa/mapper/SYS_USER_ROLEMapper.java
浏览文件 @
503211cb
...
@@ -27,8 +27,6 @@ public interface SYS_USER_ROLEMapper extends BaseMapper<SYS_USER_ROLE>{
...
@@ -27,8 +27,6 @@ public interface SYS_USER_ROLEMapper extends BaseMapper<SYS_USER_ROLE>{
int
updateById
(
@Param
(
Constants
.
ENTITY
)
SYS_USER_ROLE
entity
);
int
updateById
(
@Param
(
Constants
.
ENTITY
)
SYS_USER_ROLE
entity
);
@Override
@Override
int
deleteById
(
Serializable
id
);
int
deleteById
(
Serializable
id
);
Page
<
SYS_USER_ROLE
>
selectPermission
(
IPage
page
,
@Param
(
"pw"
)
Wrapper
<
SYS_USER_ROLE
>
wrapper
)
;
/**
/**
* 自定义查询SQL
* 自定义查询SQL
* @param sql
* @param sql
...
...
ibzuaa-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
503211cb
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
<databaseChangeLog
xmlns=
"http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext=
"http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"
>
<databaseChangeLog
xmlns=
"http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext=
"http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"
>
<!--输出实体[SYS_PSDEOPPRIV]数据结构 -->
<!--输出实体[SYS_PSDEOPPRIV]数据结构 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-sys_psdeoppriv-
39
-1"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-sys_psdeoppriv-
41
-1"
>
<createTable
tableName=
"IBZPSDEOPPRIV"
>
<createTable
tableName=
"IBZPSDEOPPRIV"
>
<column
name=
"SYS_PSDEOPPRIVID"
remarks=
""
type=
"VARCHAR(
3
00)"
>
<column
name=
"SYS_PSDEOPPRIVID"
remarks=
""
type=
"VARCHAR(
2
00)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_PSDEOPPRIV_SYS_PSDEOPPR"
/>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_PSDEOPPRIV_SYS_PSDEOPPR"
/>
</column>
</column>
<column
name=
"SYS_PSDEOPPRIVNAME"
remarks=
""
type=
"VARCHAR(200)"
>
<column
name=
"SYS_PSDEOPPRIVNAME"
remarks=
""
type=
"VARCHAR(200)"
>
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
</createTable>
</createTable>
</changeSet>
</changeSet>
<!--输出实体[SYS_USER]数据结构 -->
<!--输出实体[SYS_USER]数据结构 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-sys_user-3
5
-2"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-sys_user-3
7
-2"
>
<createTable
tableName=
"IBZUSER"
>
<createTable
tableName=
"IBZUSER"
>
<column
name=
"USERID"
remarks=
""
type=
"VARCHAR(100)"
>
<column
name=
"USERID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_USER_USERID"
/>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_USER_USERID"
/>
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
</createTable>
</createTable>
</changeSet>
</changeSet>
<!--输出实体[SYS_ROLE_PERMISSION]数据结构 -->
<!--输出实体[SYS_ROLE_PERMISSION]数据结构 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-sys_role_permission-2
6
-3"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-sys_role_permission-2
8
-3"
>
<createTable
tableName=
"IBZROLE_PERMISSION"
>
<createTable
tableName=
"IBZROLE_PERMISSION"
>
<column
name=
"SYS_ROLE_PERMISSIONID"
remarks=
""
type=
"VARCHAR(100)"
>
<column
name=
"SYS_ROLE_PERMISSIONID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_ROLE_PERMISSION_SYS_ROL"
/>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_ROLE_PERMISSION_SYS_ROL"
/>
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
</column>
</column>
<column
name=
"SYS_ROLENAME"
remarks=
""
type=
"VARCHAR(200)"
>
<column
name=
"SYS_ROLENAME"
remarks=
""
type=
"VARCHAR(200)"
>
</column>
</column>
<column
name=
"SYS_PERMISSIONID"
remarks=
""
type=
"VARCHAR(
3
00)"
>
<column
name=
"SYS_PERMISSIONID"
remarks=
""
type=
"VARCHAR(
2
00)"
>
</column>
</column>
<column
name=
"SYS_PERMISSIONNAME"
remarks=
""
type=
"VARCHAR(200)"
>
<column
name=
"SYS_PERMISSIONNAME"
remarks=
""
type=
"VARCHAR(200)"
>
</column>
</column>
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
</createTable>
</createTable>
</changeSet>
</changeSet>
<!--输出实体[SYS_USER_ROLE]数据结构 -->
<!--输出实体[SYS_USER_ROLE]数据结构 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-sys_user_role-3
1
-4"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-sys_user_role-3
3
-4"
>
<createTable
tableName=
"IBZUSER_ROLE"
>
<createTable
tableName=
"IBZUSER_ROLE"
>
<column
name=
"SYS_USER_ROLEID"
remarks=
""
type=
"VARCHAR(100)"
>
<column
name=
"SYS_USER_ROLEID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_USER_ROLE_SYS_USER_ROLE"
/>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_USER_ROLE_SYS_USER_ROLE"
/>
...
@@ -96,7 +96,7 @@
...
@@ -96,7 +96,7 @@
</createTable>
</createTable>
</changeSet>
</changeSet>
<!--输出实体[SYS_ROLE]数据结构 -->
<!--输出实体[SYS_ROLE]数据结构 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-sys_role-
29
-5"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-sys_role-
31
-5"
>
<createTable
tableName=
"IBZROLE"
>
<createTable
tableName=
"IBZROLE"
>
<column
name=
"SYS_ROLEID"
remarks=
""
type=
"VARCHAR(100)"
>
<column
name=
"SYS_ROLEID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_ROLE_SYS_ROLEID"
/>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_ROLE_SYS_ROLEID"
/>
...
@@ -112,9 +112,9 @@
...
@@ -112,9 +112,9 @@
</createTable>
</createTable>
</changeSet>
</changeSet>
<!--输出实体[SYS_PERMISSION]数据结构 -->
<!--输出实体[SYS_PERMISSION]数据结构 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-sys_permission-2
3
-6"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-sys_permission-2
5
-6"
>
<createTable
tableName=
"IBZPERMISSION"
>
<createTable
tableName=
"IBZPERMISSION"
>
<column
name=
"SYS_PERMISSIONID"
remarks=
""
type=
"VARCHAR(
3
00)"
>
<column
name=
"SYS_PERMISSIONID"
remarks=
""
type=
"VARCHAR(
2
00)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_PERMISSION_SYS_PERMISSI"
/>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_PERMISSION_SYS_PERMISSI"
/>
</column>
</column>
<column
name=
"SYS_PERMISSIONNAME"
remarks=
""
type=
"VARCHAR(200)"
>
<column
name=
"SYS_PERMISSIONNAME"
remarks=
""
type=
"VARCHAR(200)"
>
...
@@ -132,9 +132,9 @@
...
@@ -132,9 +132,9 @@
</createTable>
</createTable>
</changeSet>
</changeSet>
<!--输出实体[SYS_PSAPPMENUITEM]数据结构 -->
<!--输出实体[SYS_PSAPPMENUITEM]数据结构 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-sys_psappmenuitem-2
6
-7"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-sys_psappmenuitem-2
8
-7"
>
<createTable
tableName=
"IBZPSAPPMENUITEM"
>
<createTable
tableName=
"IBZPSAPPMENUITEM"
>
<column
name=
"SYS_PSAPPMENUITEMID"
remarks=
""
type=
"VARCHAR(
3
00)"
>
<column
name=
"SYS_PSAPPMENUITEMID"
remarks=
""
type=
"VARCHAR(
2
00)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_PSAPPMENUITEM_SYS_PSAPP"
/>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_SYS_PSAPPMENUITEM_SYS_PSAPP"
/>
</column>
</column>
<column
name=
"SYS_PSAPPMENUITEMNAME"
remarks=
""
type=
"VARCHAR(200)"
>
<column
name=
"SYS_PSAPPMENUITEMNAME"
remarks=
""
type=
"VARCHAR(200)"
>
...
@@ -165,14 +165,14 @@
...
@@ -165,14 +165,14 @@
<!--输出实体[SYS_PSDEOPPRIV]外键关系 -->
<!--输出实体[SYS_PSDEOPPRIV]外键关系 -->
<!--输出实体[SYS_USER]外键关系 -->
<!--输出实体[SYS_USER]外键关系 -->
<!--输出实体[SYS_ROLE_PERMISSION]外键关系 -->
<!--输出实体[SYS_ROLE_PERMISSION]外键关系 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-sys_role_permission-2
6
-8"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-sys_role_permission-2
8
-8"
>
<addForeignKeyConstraint
baseColumnNames=
"SYS_PERMISSIONID"
baseTableName=
"IBZROLE_PERMISSION"
constraintName=
"DER1N_SYS_ROLE_PERMISSION_SYS_"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"SYS_PERMISSIONID"
referencedTableName=
"IBZPERMISSION"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"SYS_PERMISSIONID"
baseTableName=
"IBZROLE_PERMISSION"
constraintName=
"DER1N_SYS_ROLE_PERMISSION_SYS_"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"SYS_PERMISSIONID"
referencedTableName=
"IBZPERMISSION"
validate=
"true"
/>
</changeSet>
</changeSet>
<!--输出实体[SYS_USER_ROLE]外键关系 -->
<!--输出实体[SYS_USER_ROLE]外键关系 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-sys_user_role-3
1
-10"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-sys_user_role-3
3
-10"
>
<addForeignKeyConstraint
baseColumnNames=
"SYS_ROLEID"
baseTableName=
"IBZUSER_ROLE"
constraintName=
"DER1N_SYS_USER_ROLE_SYS_ROLE_S"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"SYS_ROLEID"
referencedTableName=
"IBZROLE"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"SYS_ROLEID"
baseTableName=
"IBZUSER_ROLE"
constraintName=
"DER1N_SYS_USER_ROLE_SYS_ROLE_S"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"SYS_ROLEID"
referencedTableName=
"IBZROLE"
validate=
"true"
/>
</changeSet>
</changeSet>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-sys_user_role-3
1
-11"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-sys_user_role-3
3
-11"
>
<addForeignKeyConstraint
baseColumnNames=
"SYS_USERID"
baseTableName=
"IBZUSER_ROLE"
constraintName=
"DER1N_SYS_USER_ROLE_SYS_USER_S"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"USERID"
referencedTableName=
"IBZUSER"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"SYS_USERID"
baseTableName=
"IBZUSER_ROLE"
constraintName=
"DER1N_SYS_USER_ROLE_SYS_USER_S"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"USERID"
referencedTableName=
"IBZUSER"
validate=
"true"
/>
</changeSet>
</changeSet>
<!--输出实体[SYS_ROLE]外键关系 -->
<!--输出实体[SYS_ROLE]外键关系 -->
...
...
ibzuaa-provider/ibzuaa-provider-uaaapi/src/main/java/cn/ibizlab/uaaapi/rest/SYS_PERMISSIONResource.java
浏览文件 @
503211cb
...
@@ -53,6 +53,138 @@ public class SYS_PERMISSIONResource {
...
@@ -53,6 +53,138 @@ public class SYS_PERMISSIONResource {
private
SYS_PERMISSIONMapping
sys_permissionMapping
;
private
SYS_PERMISSIONMapping
sys_permissionMapping
;
@ApiOperation
(
value
=
"Save"
,
tags
=
{
"SYS_PERMISSION"
},
notes
=
"Save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_permissions/save"
)
public
ResponseEntity
<
Boolean
>
save
(
@RequestBody
SYS_PERMISSIONDTO
sys_permissiondto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_permissionService
.
save
(
sys_permissionMapping
.
toDomain
(
sys_permissiondto
)));
}
@ApiOperation
(
value
=
"SaveBatch"
,
tags
=
{
"SaveBatch"
},
notes
=
"SaveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_permissions/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatch
(
@RequestBody
List
<
SYS_PERMISSIONDTO
>
sys_permissiondtos
)
{
sys_permissionService
.
saveBatch
(
sys_permissionMapping
.
toDomain
(
sys_permissiondtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"GetDraft"
,
tags
=
{
"SYS_PERMISSION"
},
notes
=
"GetDraft"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_permissions/getdraft"
)
public
ResponseEntity
<
SYS_PERMISSIONDTO
>
getDraft
()
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_permissionMapping
.
toDto
(
sys_permissionService
.
getDraft
(
new
SYS_PERMISSION
())));
}
@PreAuthorize
(
"hasPermission('DELETE',{#sys_permission_id,this.getEntity()})"
)
@ApiOperation
(
value
=
"Remove"
,
tags
=
{
"SYS_PERMISSION"
},
notes
=
"Remove"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/sys_permissions/{sys_permission_id}"
)
@Transactional
public
ResponseEntity
<
Boolean
>
remove
(
@PathVariable
(
"sys_permission_id"
)
String
sys_permission_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_permissionService
.
remove
(
sys_permission_id
));
}
@ApiOperation
(
value
=
"RemoveBatch"
,
tags
=
{
"RemoveBatch"
},
notes
=
"RemoveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_permissions/removebatch"
)
public
ResponseEntity
<
Boolean
>
removeBatch
(
@RequestBody
List
<
String
>
ids
)
{
sys_permissionService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission(#sys_permission_id,'UPDATE',this.getEntity())"
)
@ApiOperation
(
value
=
"Update"
,
tags
=
{
"SYS_PERMISSION"
},
notes
=
"Update"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/sys_permissions/{sys_permission_id}"
)
@Transactional
public
ResponseEntity
<
SYS_PERMISSIONDTO
>
update
(
@PathVariable
(
"sys_permission_id"
)
String
sys_permission_id
,
@RequestBody
SYS_PERMISSIONDTO
sys_permissiondto
)
{
SYS_PERMISSION
domain
=
sys_permissionMapping
.
toDomain
(
sys_permissiondto
);
domain
.
setPermissionid
(
sys_permission_id
);
sys_permissionService
.
update
(
domain
);
SYS_PERMISSIONDTO
dto
=
sys_permissionMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission(#sys_permission_id,'UPDATE',this.getEntity())"
)
@ApiOperation
(
value
=
"UpdateBatch"
,
tags
=
{
"UpdateBatch"
},
notes
=
"UpdateBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_permissions/updatebatch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
SYS_PERMISSIONDTO
>
sys_permissiondtos
)
{
sys_permissionService
.
updateBatch
(
sys_permissionMapping
.
toDomain
(
sys_permissiondtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"Create"
,
tags
=
{
"SYS_PERMISSION"
},
notes
=
"Create"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_permissions"
)
@Transactional
public
ResponseEntity
<
SYS_PERMISSIONDTO
>
create
(
@RequestBody
SYS_PERMISSIONDTO
sys_permissiondto
)
{
SYS_PERMISSION
domain
=
sys_permissionMapping
.
toDomain
(
sys_permissiondto
);
sys_permissionService
.
create
(
domain
);
SYS_PERMISSIONDTO
dto
=
sys_permissionMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"createBatch"
,
tags
=
{
"createBatch"
},
notes
=
"createBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_permissions/createbatch"
)
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
SYS_PERMISSIONDTO
>
sys_permissiondtos
)
{
sys_permissionService
.
createBatch
(
sys_permissionMapping
.
toDomain
(
sys_permissiondtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"CheckKey"
,
tags
=
{
"SYS_PERMISSION"
},
notes
=
"CheckKey"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_permissions/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKey
(
@RequestBody
SYS_PERMISSIONDTO
sys_permissiondto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_permissionService
.
checkKey
(
sys_permissionMapping
.
toDomain
(
sys_permissiondto
)));
}
@PreAuthorize
(
"hasPermission(#sys_permission_id,'READ',this.getEntity())"
)
@ApiOperation
(
value
=
"Get"
,
tags
=
{
"SYS_PERMISSION"
},
notes
=
"Get"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_permissions/{sys_permission_id}"
)
public
ResponseEntity
<
SYS_PERMISSIONDTO
>
get
(
@PathVariable
(
"sys_permission_id"
)
String
sys_permission_id
)
{
SYS_PERMISSION
domain
=
sys_permissionService
.
get
(
sys_permission_id
);
SYS_PERMISSIONDTO
dto
=
sys_permissionMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission('READ',{#context,'Default',this.getEntity()})"
)
@ApiOperation
(
value
=
"fetchDEFAULT"
,
tags
=
{
"SYS_PERMISSION"
}
,
notes
=
"fetchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_permissions/fetchdefault"
)
public
ResponseEntity
<
List
<
SYS_PERMISSIONDTO
>>
fetchDefault
(
SYS_PERMISSIONSearchContext
context
)
{
Page
<
SYS_PERMISSION
>
domains
=
sys_permissionService
.
searchDefault
(
context
)
;
List
<
SYS_PERMISSIONDTO
>
list
=
sys_permissionMapping
.
toDto
(
domains
.
getContent
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"x-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageNumber
()))
.
header
(
"x-per-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageSize
()))
.
header
(
"x-total"
,
String
.
valueOf
(
domains
.
getTotalElements
()))
.
body
(
list
);
}
@PreAuthorize
(
"hasPermission('READ',{#context,'Default',this.getEntity()})"
)
@ApiOperation
(
value
=
"searchDEFAULT"
,
tags
=
{
"SYS_PERMISSION"
}
,
notes
=
"searchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_permissions/searchdefault"
)
public
ResponseEntity
<
Page
<
SYS_PERMISSIONDTO
>>
searchDefault
(
SYS_PERMISSIONSearchContext
context
)
{
Page
<
SYS_PERMISSION
>
domains
=
sys_permissionService
.
searchDefault
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
sys_permissionMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
/**
/**
* 用户权限校验
* 用户权限校验
* @return
* @return
...
...
ibzuaa-provider/ibzuaa-provider-uaaapi/src/main/java/cn/ibizlab/uaaapi/rest/SYS_PSAPPMENUITEMResource.java
浏览文件 @
503211cb
...
@@ -53,6 +53,138 @@ public class SYS_PSAPPMENUITEMResource {
...
@@ -53,6 +53,138 @@ public class SYS_PSAPPMENUITEMResource {
private
SYS_PSAPPMENUITEMMapping
sys_psappmenuitemMapping
;
private
SYS_PSAPPMENUITEMMapping
sys_psappmenuitemMapping
;
@ApiOperation
(
value
=
"Save"
,
tags
=
{
"SYS_PSAPPMENUITEM"
},
notes
=
"Save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_psappmenuitems/save"
)
public
ResponseEntity
<
Boolean
>
save
(
@RequestBody
SYS_PSAPPMENUITEMDTO
sys_psappmenuitemdto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_psappmenuitemService
.
save
(
sys_psappmenuitemMapping
.
toDomain
(
sys_psappmenuitemdto
)));
}
@ApiOperation
(
value
=
"SaveBatch"
,
tags
=
{
"SaveBatch"
},
notes
=
"SaveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_psappmenuitems/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatch
(
@RequestBody
List
<
SYS_PSAPPMENUITEMDTO
>
sys_psappmenuitemdtos
)
{
sys_psappmenuitemService
.
saveBatch
(
sys_psappmenuitemMapping
.
toDomain
(
sys_psappmenuitemdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"Create"
,
tags
=
{
"SYS_PSAPPMENUITEM"
},
notes
=
"Create"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_psappmenuitems"
)
@Transactional
public
ResponseEntity
<
SYS_PSAPPMENUITEMDTO
>
create
(
@RequestBody
SYS_PSAPPMENUITEMDTO
sys_psappmenuitemdto
)
{
SYS_PSAPPMENUITEM
domain
=
sys_psappmenuitemMapping
.
toDomain
(
sys_psappmenuitemdto
);
sys_psappmenuitemService
.
create
(
domain
);
SYS_PSAPPMENUITEMDTO
dto
=
sys_psappmenuitemMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"createBatch"
,
tags
=
{
"createBatch"
},
notes
=
"createBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_psappmenuitems/createbatch"
)
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
SYS_PSAPPMENUITEMDTO
>
sys_psappmenuitemdtos
)
{
sys_psappmenuitemService
.
createBatch
(
sys_psappmenuitemMapping
.
toDomain
(
sys_psappmenuitemdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission(#sys_psappmenuitem_id,'UPDATE',this.getEntity())"
)
@ApiOperation
(
value
=
"Update"
,
tags
=
{
"SYS_PSAPPMENUITEM"
},
notes
=
"Update"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/sys_psappmenuitems/{sys_psappmenuitem_id}"
)
@Transactional
public
ResponseEntity
<
SYS_PSAPPMENUITEMDTO
>
update
(
@PathVariable
(
"sys_psappmenuitem_id"
)
String
sys_psappmenuitem_id
,
@RequestBody
SYS_PSAPPMENUITEMDTO
sys_psappmenuitemdto
)
{
SYS_PSAPPMENUITEM
domain
=
sys_psappmenuitemMapping
.
toDomain
(
sys_psappmenuitemdto
);
domain
.
setAppmenuitemid
(
sys_psappmenuitem_id
);
sys_psappmenuitemService
.
update
(
domain
);
SYS_PSAPPMENUITEMDTO
dto
=
sys_psappmenuitemMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission(#sys_psappmenuitem_id,'UPDATE',this.getEntity())"
)
@ApiOperation
(
value
=
"UpdateBatch"
,
tags
=
{
"UpdateBatch"
},
notes
=
"UpdateBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_psappmenuitems/updatebatch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
SYS_PSAPPMENUITEMDTO
>
sys_psappmenuitemdtos
)
{
sys_psappmenuitemService
.
updateBatch
(
sys_psappmenuitemMapping
.
toDomain
(
sys_psappmenuitemdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"GetDraft"
,
tags
=
{
"SYS_PSAPPMENUITEM"
},
notes
=
"GetDraft"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_psappmenuitems/getdraft"
)
public
ResponseEntity
<
SYS_PSAPPMENUITEMDTO
>
getDraft
()
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_psappmenuitemMapping
.
toDto
(
sys_psappmenuitemService
.
getDraft
(
new
SYS_PSAPPMENUITEM
())));
}
@ApiOperation
(
value
=
"CheckKey"
,
tags
=
{
"SYS_PSAPPMENUITEM"
},
notes
=
"CheckKey"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_psappmenuitems/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKey
(
@RequestBody
SYS_PSAPPMENUITEMDTO
sys_psappmenuitemdto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_psappmenuitemService
.
checkKey
(
sys_psappmenuitemMapping
.
toDomain
(
sys_psappmenuitemdto
)));
}
@PreAuthorize
(
"hasPermission('DELETE',{#sys_psappmenuitem_id,this.getEntity()})"
)
@ApiOperation
(
value
=
"Remove"
,
tags
=
{
"SYS_PSAPPMENUITEM"
},
notes
=
"Remove"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/sys_psappmenuitems/{sys_psappmenuitem_id}"
)
@Transactional
public
ResponseEntity
<
Boolean
>
remove
(
@PathVariable
(
"sys_psappmenuitem_id"
)
String
sys_psappmenuitem_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_psappmenuitemService
.
remove
(
sys_psappmenuitem_id
));
}
@ApiOperation
(
value
=
"RemoveBatch"
,
tags
=
{
"RemoveBatch"
},
notes
=
"RemoveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_psappmenuitems/removebatch"
)
public
ResponseEntity
<
Boolean
>
removeBatch
(
@RequestBody
List
<
String
>
ids
)
{
sys_psappmenuitemService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission(#sys_psappmenuitem_id,'READ',this.getEntity())"
)
@ApiOperation
(
value
=
"Get"
,
tags
=
{
"SYS_PSAPPMENUITEM"
},
notes
=
"Get"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_psappmenuitems/{sys_psappmenuitem_id}"
)
public
ResponseEntity
<
SYS_PSAPPMENUITEMDTO
>
get
(
@PathVariable
(
"sys_psappmenuitem_id"
)
String
sys_psappmenuitem_id
)
{
SYS_PSAPPMENUITEM
domain
=
sys_psappmenuitemService
.
get
(
sys_psappmenuitem_id
);
SYS_PSAPPMENUITEMDTO
dto
=
sys_psappmenuitemMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission('READ',{#context,'Default',this.getEntity()})"
)
@ApiOperation
(
value
=
"fetchDEFAULT"
,
tags
=
{
"SYS_PSAPPMENUITEM"
}
,
notes
=
"fetchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_psappmenuitems/fetchdefault"
)
public
ResponseEntity
<
List
<
SYS_PSAPPMENUITEMDTO
>>
fetchDefault
(
SYS_PSAPPMENUITEMSearchContext
context
)
{
Page
<
SYS_PSAPPMENUITEM
>
domains
=
sys_psappmenuitemService
.
searchDefault
(
context
)
;
List
<
SYS_PSAPPMENUITEMDTO
>
list
=
sys_psappmenuitemMapping
.
toDto
(
domains
.
getContent
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"x-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageNumber
()))
.
header
(
"x-per-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageSize
()))
.
header
(
"x-total"
,
String
.
valueOf
(
domains
.
getTotalElements
()))
.
body
(
list
);
}
@PreAuthorize
(
"hasPermission('READ',{#context,'Default',this.getEntity()})"
)
@ApiOperation
(
value
=
"searchDEFAULT"
,
tags
=
{
"SYS_PSAPPMENUITEM"
}
,
notes
=
"searchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_psappmenuitems/searchdefault"
)
public
ResponseEntity
<
Page
<
SYS_PSAPPMENUITEMDTO
>>
searchDefault
(
SYS_PSAPPMENUITEMSearchContext
context
)
{
Page
<
SYS_PSAPPMENUITEM
>
domains
=
sys_psappmenuitemService
.
searchDefault
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
sys_psappmenuitemMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
/**
/**
* 用户权限校验
* 用户权限校验
* @return
* @return
...
...
ibzuaa-provider/ibzuaa-provider-uaaapi/src/main/java/cn/ibizlab/uaaapi/rest/SYS_PSDEOPPRIVResource.java
浏览文件 @
503211cb
...
@@ -53,6 +53,138 @@ public class SYS_PSDEOPPRIVResource {
...
@@ -53,6 +53,138 @@ public class SYS_PSDEOPPRIVResource {
private
SYS_PSDEOPPRIVMapping
sys_psdeopprivMapping
;
private
SYS_PSDEOPPRIVMapping
sys_psdeopprivMapping
;
@PreAuthorize
(
"hasPermission('DELETE',{#sys_psdeoppriv_id,this.getEntity()})"
)
@ApiOperation
(
value
=
"Remove"
,
tags
=
{
"SYS_PSDEOPPRIV"
},
notes
=
"Remove"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/sys_psdeopprivs/{sys_psdeoppriv_id}"
)
@Transactional
public
ResponseEntity
<
Boolean
>
remove
(
@PathVariable
(
"sys_psdeoppriv_id"
)
String
sys_psdeoppriv_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_psdeopprivService
.
remove
(
sys_psdeoppriv_id
));
}
@ApiOperation
(
value
=
"RemoveBatch"
,
tags
=
{
"RemoveBatch"
},
notes
=
"RemoveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_psdeopprivs/removebatch"
)
public
ResponseEntity
<
Boolean
>
removeBatch
(
@RequestBody
List
<
String
>
ids
)
{
sys_psdeopprivService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"CheckKey"
,
tags
=
{
"SYS_PSDEOPPRIV"
},
notes
=
"CheckKey"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_psdeopprivs/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKey
(
@RequestBody
SYS_PSDEOPPRIVDTO
sys_psdeopprivdto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_psdeopprivService
.
checkKey
(
sys_psdeopprivMapping
.
toDomain
(
sys_psdeopprivdto
)));
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"GetDraft"
,
tags
=
{
"SYS_PSDEOPPRIV"
},
notes
=
"GetDraft"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_psdeopprivs/getdraft"
)
public
ResponseEntity
<
SYS_PSDEOPPRIVDTO
>
getDraft
()
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_psdeopprivMapping
.
toDto
(
sys_psdeopprivService
.
getDraft
(
new
SYS_PSDEOPPRIV
())));
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"Create"
,
tags
=
{
"SYS_PSDEOPPRIV"
},
notes
=
"Create"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_psdeopprivs"
)
@Transactional
public
ResponseEntity
<
SYS_PSDEOPPRIVDTO
>
create
(
@RequestBody
SYS_PSDEOPPRIVDTO
sys_psdeopprivdto
)
{
SYS_PSDEOPPRIV
domain
=
sys_psdeopprivMapping
.
toDomain
(
sys_psdeopprivdto
);
sys_psdeopprivService
.
create
(
domain
);
SYS_PSDEOPPRIVDTO
dto
=
sys_psdeopprivMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"createBatch"
,
tags
=
{
"createBatch"
},
notes
=
"createBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_psdeopprivs/createbatch"
)
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
SYS_PSDEOPPRIVDTO
>
sys_psdeopprivdtos
)
{
sys_psdeopprivService
.
createBatch
(
sys_psdeopprivMapping
.
toDomain
(
sys_psdeopprivdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission(#sys_psdeoppriv_id,'READ',this.getEntity())"
)
@ApiOperation
(
value
=
"Get"
,
tags
=
{
"SYS_PSDEOPPRIV"
},
notes
=
"Get"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_psdeopprivs/{sys_psdeoppriv_id}"
)
public
ResponseEntity
<
SYS_PSDEOPPRIVDTO
>
get
(
@PathVariable
(
"sys_psdeoppriv_id"
)
String
sys_psdeoppriv_id
)
{
SYS_PSDEOPPRIV
domain
=
sys_psdeopprivService
.
get
(
sys_psdeoppriv_id
);
SYS_PSDEOPPRIVDTO
dto
=
sys_psdeopprivMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission(#sys_psdeoppriv_id,'UPDATE',this.getEntity())"
)
@ApiOperation
(
value
=
"Update"
,
tags
=
{
"SYS_PSDEOPPRIV"
},
notes
=
"Update"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/sys_psdeopprivs/{sys_psdeoppriv_id}"
)
@Transactional
public
ResponseEntity
<
SYS_PSDEOPPRIVDTO
>
update
(
@PathVariable
(
"sys_psdeoppriv_id"
)
String
sys_psdeoppriv_id
,
@RequestBody
SYS_PSDEOPPRIVDTO
sys_psdeopprivdto
)
{
SYS_PSDEOPPRIV
domain
=
sys_psdeopprivMapping
.
toDomain
(
sys_psdeopprivdto
);
domain
.
setPsdeopprivid
(
sys_psdeoppriv_id
);
sys_psdeopprivService
.
update
(
domain
);
SYS_PSDEOPPRIVDTO
dto
=
sys_psdeopprivMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission(#sys_psdeoppriv_id,'UPDATE',this.getEntity())"
)
@ApiOperation
(
value
=
"UpdateBatch"
,
tags
=
{
"UpdateBatch"
},
notes
=
"UpdateBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_psdeopprivs/updatebatch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
SYS_PSDEOPPRIVDTO
>
sys_psdeopprivdtos
)
{
sys_psdeopprivService
.
updateBatch
(
sys_psdeopprivMapping
.
toDomain
(
sys_psdeopprivdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"Save"
,
tags
=
{
"SYS_PSDEOPPRIV"
},
notes
=
"Save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_psdeopprivs/save"
)
public
ResponseEntity
<
Boolean
>
save
(
@RequestBody
SYS_PSDEOPPRIVDTO
sys_psdeopprivdto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_psdeopprivService
.
save
(
sys_psdeopprivMapping
.
toDomain
(
sys_psdeopprivdto
)));
}
@ApiOperation
(
value
=
"SaveBatch"
,
tags
=
{
"SaveBatch"
},
notes
=
"SaveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_psdeopprivs/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatch
(
@RequestBody
List
<
SYS_PSDEOPPRIVDTO
>
sys_psdeopprivdtos
)
{
sys_psdeopprivService
.
saveBatch
(
sys_psdeopprivMapping
.
toDomain
(
sys_psdeopprivdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission('READ',{#context,'Default',this.getEntity()})"
)
@ApiOperation
(
value
=
"fetchDEFAULT"
,
tags
=
{
"SYS_PSDEOPPRIV"
}
,
notes
=
"fetchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_psdeopprivs/fetchdefault"
)
public
ResponseEntity
<
List
<
SYS_PSDEOPPRIVDTO
>>
fetchDefault
(
SYS_PSDEOPPRIVSearchContext
context
)
{
Page
<
SYS_PSDEOPPRIV
>
domains
=
sys_psdeopprivService
.
searchDefault
(
context
)
;
List
<
SYS_PSDEOPPRIVDTO
>
list
=
sys_psdeopprivMapping
.
toDto
(
domains
.
getContent
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"x-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageNumber
()))
.
header
(
"x-per-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageSize
()))
.
header
(
"x-total"
,
String
.
valueOf
(
domains
.
getTotalElements
()))
.
body
(
list
);
}
@PreAuthorize
(
"hasPermission('READ',{#context,'Default',this.getEntity()})"
)
@ApiOperation
(
value
=
"searchDEFAULT"
,
tags
=
{
"SYS_PSDEOPPRIV"
}
,
notes
=
"searchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_psdeopprivs/searchdefault"
)
public
ResponseEntity
<
Page
<
SYS_PSDEOPPRIVDTO
>>
searchDefault
(
SYS_PSDEOPPRIVSearchContext
context
)
{
Page
<
SYS_PSDEOPPRIV
>
domains
=
sys_psdeopprivService
.
searchDefault
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
sys_psdeopprivMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
/**
/**
* 用户权限校验
* 用户权限校验
* @return
* @return
...
...
ibzuaa-provider/ibzuaa-provider-uaaapi/src/main/java/cn/ibizlab/uaaapi/rest/SYS_ROLEResource.java
浏览文件 @
503211cb
...
@@ -53,6 +53,138 @@ public class SYS_ROLEResource {
...
@@ -53,6 +53,138 @@ public class SYS_ROLEResource {
private
SYS_ROLEMapping
sys_roleMapping
;
private
SYS_ROLEMapping
sys_roleMapping
;
@ApiOperation
(
value
=
"Save"
,
tags
=
{
"SYS_ROLE"
},
notes
=
"Save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles/save"
)
public
ResponseEntity
<
Boolean
>
save
(
@RequestBody
SYS_ROLEDTO
sys_roledto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_roleService
.
save
(
sys_roleMapping
.
toDomain
(
sys_roledto
)));
}
@ApiOperation
(
value
=
"SaveBatch"
,
tags
=
{
"SaveBatch"
},
notes
=
"SaveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatch
(
@RequestBody
List
<
SYS_ROLEDTO
>
sys_roledtos
)
{
sys_roleService
.
saveBatch
(
sys_roleMapping
.
toDomain
(
sys_roledtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission(#sys_role_id,'UPDATE',this.getEntity())"
)
@ApiOperation
(
value
=
"Update"
,
tags
=
{
"SYS_ROLE"
},
notes
=
"Update"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/sys_roles/{sys_role_id}"
)
@Transactional
public
ResponseEntity
<
SYS_ROLEDTO
>
update
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
@RequestBody
SYS_ROLEDTO
sys_roledto
)
{
SYS_ROLE
domain
=
sys_roleMapping
.
toDomain
(
sys_roledto
);
domain
.
setRoleid
(
sys_role_id
);
sys_roleService
.
update
(
domain
);
SYS_ROLEDTO
dto
=
sys_roleMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission(#sys_role_id,'UPDATE',this.getEntity())"
)
@ApiOperation
(
value
=
"UpdateBatch"
,
tags
=
{
"UpdateBatch"
},
notes
=
"UpdateBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles/updatebatch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
SYS_ROLEDTO
>
sys_roledtos
)
{
sys_roleService
.
updateBatch
(
sys_roleMapping
.
toDomain
(
sys_roledtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"Create"
,
tags
=
{
"SYS_ROLE"
},
notes
=
"Create"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles"
)
@Transactional
public
ResponseEntity
<
SYS_ROLEDTO
>
create
(
@RequestBody
SYS_ROLEDTO
sys_roledto
)
{
SYS_ROLE
domain
=
sys_roleMapping
.
toDomain
(
sys_roledto
);
sys_roleService
.
create
(
domain
);
SYS_ROLEDTO
dto
=
sys_roleMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"createBatch"
,
tags
=
{
"createBatch"
},
notes
=
"createBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles/createbatch"
)
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
SYS_ROLEDTO
>
sys_roledtos
)
{
sys_roleService
.
createBatch
(
sys_roleMapping
.
toDomain
(
sys_roledtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission(#sys_role_id,'READ',this.getEntity())"
)
@ApiOperation
(
value
=
"Get"
,
tags
=
{
"SYS_ROLE"
},
notes
=
"Get"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_roles/{sys_role_id}"
)
public
ResponseEntity
<
SYS_ROLEDTO
>
get
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
)
{
SYS_ROLE
domain
=
sys_roleService
.
get
(
sys_role_id
);
SYS_ROLEDTO
dto
=
sys_roleMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission('DELETE',{#sys_role_id,this.getEntity()})"
)
@ApiOperation
(
value
=
"Remove"
,
tags
=
{
"SYS_ROLE"
},
notes
=
"Remove"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/sys_roles/{sys_role_id}"
)
@Transactional
public
ResponseEntity
<
Boolean
>
remove
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_roleService
.
remove
(
sys_role_id
));
}
@ApiOperation
(
value
=
"RemoveBatch"
,
tags
=
{
"RemoveBatch"
},
notes
=
"RemoveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles/removebatch"
)
public
ResponseEntity
<
Boolean
>
removeBatch
(
@RequestBody
List
<
String
>
ids
)
{
sys_roleService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"GetDraft"
,
tags
=
{
"SYS_ROLE"
},
notes
=
"GetDraft"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_roles/getdraft"
)
public
ResponseEntity
<
SYS_ROLEDTO
>
getDraft
()
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_roleMapping
.
toDto
(
sys_roleService
.
getDraft
(
new
SYS_ROLE
())));
}
@ApiOperation
(
value
=
"CheckKey"
,
tags
=
{
"SYS_ROLE"
},
notes
=
"CheckKey"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKey
(
@RequestBody
SYS_ROLEDTO
sys_roledto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_roleService
.
checkKey
(
sys_roleMapping
.
toDomain
(
sys_roledto
)));
}
@PreAuthorize
(
"hasPermission('READ',{#context,'Default',this.getEntity()})"
)
@ApiOperation
(
value
=
"fetchDEFAULT"
,
tags
=
{
"SYS_ROLE"
}
,
notes
=
"fetchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_roles/fetchdefault"
)
public
ResponseEntity
<
List
<
SYS_ROLEDTO
>>
fetchDefault
(
SYS_ROLESearchContext
context
)
{
Page
<
SYS_ROLE
>
domains
=
sys_roleService
.
searchDefault
(
context
)
;
List
<
SYS_ROLEDTO
>
list
=
sys_roleMapping
.
toDto
(
domains
.
getContent
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"x-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageNumber
()))
.
header
(
"x-per-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageSize
()))
.
header
(
"x-total"
,
String
.
valueOf
(
domains
.
getTotalElements
()))
.
body
(
list
);
}
@PreAuthorize
(
"hasPermission('READ',{#context,'Default',this.getEntity()})"
)
@ApiOperation
(
value
=
"searchDEFAULT"
,
tags
=
{
"SYS_ROLE"
}
,
notes
=
"searchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_roles/searchdefault"
)
public
ResponseEntity
<
Page
<
SYS_ROLEDTO
>>
searchDefault
(
SYS_ROLESearchContext
context
)
{
Page
<
SYS_ROLE
>
domains
=
sys_roleService
.
searchDefault
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
sys_roleMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
/**
/**
* 用户权限校验
* 用户权限校验
* @return
* @return
...
...
ibzuaa-provider/ibzuaa-provider-uaaapi/src/main/java/cn/ibizlab/uaaapi/rest/SYS_ROLE_PERMISSIONResource.java
浏览文件 @
503211cb
...
@@ -55,6 +55,382 @@ public class SYS_ROLE_PERMISSIONResource {
...
@@ -55,6 +55,382 @@ public class SYS_ROLE_PERMISSIONResource {
@PreAuthorize
(
"hasPermission(#sys_role_permission_id,'READ',this.getEntity())"
)
@ApiOperation
(
value
=
"Get"
,
tags
=
{
"SYS_ROLE_PERMISSION"
},
notes
=
"Get"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_role_permissions/{sys_role_permission_id}"
)
public
ResponseEntity
<
SYS_ROLE_PERMISSIONDTO
>
get
(
@PathVariable
(
"sys_role_permission_id"
)
String
sys_role_permission_id
)
{
SYS_ROLE_PERMISSION
domain
=
sys_role_permissionService
.
get
(
sys_role_permission_id
);
SYS_ROLE_PERMISSIONDTO
dto
=
sys_role_permissionMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission('DELETE',{#sys_role_permission_id,this.getEntity()})"
)
@ApiOperation
(
value
=
"Remove"
,
tags
=
{
"SYS_ROLE_PERMISSION"
},
notes
=
"Remove"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/sys_role_permissions/{sys_role_permission_id}"
)
@Transactional
public
ResponseEntity
<
Boolean
>
remove
(
@PathVariable
(
"sys_role_permission_id"
)
String
sys_role_permission_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_role_permissionService
.
remove
(
sys_role_permission_id
));
}
@ApiOperation
(
value
=
"RemoveBatch"
,
tags
=
{
"RemoveBatch"
},
notes
=
"RemoveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_role_permissions/removebatch"
)
public
ResponseEntity
<
Boolean
>
removeBatch
(
@RequestBody
List
<
String
>
ids
)
{
sys_role_permissionService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"GetDraft"
,
tags
=
{
"SYS_ROLE_PERMISSION"
},
notes
=
"GetDraft"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_role_permissions/getdraft"
)
public
ResponseEntity
<
SYS_ROLE_PERMISSIONDTO
>
getDraft
()
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_role_permissionMapping
.
toDto
(
sys_role_permissionService
.
getDraft
(
new
SYS_ROLE_PERMISSION
())));
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"Create"
,
tags
=
{
"SYS_ROLE_PERMISSION"
},
notes
=
"Create"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_role_permissions"
)
@Transactional
public
ResponseEntity
<
SYS_ROLE_PERMISSIONDTO
>
create
(
@RequestBody
SYS_ROLE_PERMISSIONDTO
sys_role_permissiondto
)
{
SYS_ROLE_PERMISSION
domain
=
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondto
);
sys_role_permissionService
.
create
(
domain
);
SYS_ROLE_PERMISSIONDTO
dto
=
sys_role_permissionMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"createBatch"
,
tags
=
{
"createBatch"
},
notes
=
"createBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_role_permissions/createbatch"
)
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
SYS_ROLE_PERMISSIONDTO
>
sys_role_permissiondtos
)
{
sys_role_permissionService
.
createBatch
(
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"CheckKey"
,
tags
=
{
"SYS_ROLE_PERMISSION"
},
notes
=
"CheckKey"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_role_permissions/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKey
(
@RequestBody
SYS_ROLE_PERMISSIONDTO
sys_role_permissiondto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_role_permissionService
.
checkKey
(
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondto
)));
}
@ApiOperation
(
value
=
"Save"
,
tags
=
{
"SYS_ROLE_PERMISSION"
},
notes
=
"Save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_role_permissions/save"
)
public
ResponseEntity
<
Boolean
>
save
(
@RequestBody
SYS_ROLE_PERMISSIONDTO
sys_role_permissiondto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_role_permissionService
.
save
(
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondto
)));
}
@ApiOperation
(
value
=
"SaveBatch"
,
tags
=
{
"SaveBatch"
},
notes
=
"SaveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_role_permissions/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatch
(
@RequestBody
List
<
SYS_ROLE_PERMISSIONDTO
>
sys_role_permissiondtos
)
{
sys_role_permissionService
.
saveBatch
(
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission(#sys_role_permission_id,'UPDATE',this.getEntity())"
)
@ApiOperation
(
value
=
"Update"
,
tags
=
{
"SYS_ROLE_PERMISSION"
},
notes
=
"Update"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/sys_role_permissions/{sys_role_permission_id}"
)
@Transactional
public
ResponseEntity
<
SYS_ROLE_PERMISSIONDTO
>
update
(
@PathVariable
(
"sys_role_permission_id"
)
String
sys_role_permission_id
,
@RequestBody
SYS_ROLE_PERMISSIONDTO
sys_role_permissiondto
)
{
SYS_ROLE_PERMISSION
domain
=
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondto
);
domain
.
setRolepermissionid
(
sys_role_permission_id
);
sys_role_permissionService
.
update
(
domain
);
SYS_ROLE_PERMISSIONDTO
dto
=
sys_role_permissionMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission(#sys_role_permission_id,'UPDATE',this.getEntity())"
)
@ApiOperation
(
value
=
"UpdateBatch"
,
tags
=
{
"UpdateBatch"
},
notes
=
"UpdateBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_role_permissions/updatebatch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
SYS_ROLE_PERMISSIONDTO
>
sys_role_permissiondtos
)
{
sys_role_permissionService
.
updateBatch
(
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission('READ',{#context,'Default',this.getEntity()})"
)
@ApiOperation
(
value
=
"fetchDEFAULT"
,
tags
=
{
"SYS_ROLE_PERMISSION"
}
,
notes
=
"fetchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_role_permissions/fetchdefault"
)
public
ResponseEntity
<
List
<
SYS_ROLE_PERMISSIONDTO
>>
fetchDefault
(
SYS_ROLE_PERMISSIONSearchContext
context
)
{
Page
<
SYS_ROLE_PERMISSION
>
domains
=
sys_role_permissionService
.
searchDefault
(
context
)
;
List
<
SYS_ROLE_PERMISSIONDTO
>
list
=
sys_role_permissionMapping
.
toDto
(
domains
.
getContent
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"x-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageNumber
()))
.
header
(
"x-per-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageSize
()))
.
header
(
"x-total"
,
String
.
valueOf
(
domains
.
getTotalElements
()))
.
body
(
list
);
}
@PreAuthorize
(
"hasPermission('READ',{#context,'Default',this.getEntity()})"
)
@ApiOperation
(
value
=
"searchDEFAULT"
,
tags
=
{
"SYS_ROLE_PERMISSION"
}
,
notes
=
"searchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_role_permissions/searchdefault"
)
public
ResponseEntity
<
Page
<
SYS_ROLE_PERMISSIONDTO
>>
searchDefault
(
SYS_ROLE_PERMISSIONSearchContext
context
)
{
Page
<
SYS_ROLE_PERMISSION
>
domains
=
sys_role_permissionService
.
searchDefault
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
sys_role_permissionMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
@ApiOperation
(
value
=
"GetBySYS_PERMISSION"
,
tags
=
{
"SYS_ROLE_PERMISSIONBySYS_PERMISSION"
},
notes
=
"GetBySYS_PERMISSION"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_permissions/{sys_permission_id}/sys_role_permissions/{sys_role_permission_id}"
)
public
ResponseEntity
<
SYS_ROLE_PERMISSIONDTO
>
getBySYS_PERMISSION
(
@PathVariable
(
"sys_permission_id"
)
String
sys_permission_id
,
@PathVariable
(
"sys_role_permission_id"
)
String
sys_role_permission_id
)
{
SYS_ROLE_PERMISSION
domain
=
sys_role_permissionService
.
get
(
sys_role_permission_id
);
SYS_ROLE_PERMISSIONDTO
dto
=
sys_role_permissionMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"RemoveBySYS_PERMISSION"
,
tags
=
{
"SYS_ROLE_PERMISSIONBySYS_PERMISSION"
},
notes
=
"RemoveBySYS_PERMISSION"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/sys_permissions/{sys_permission_id}/sys_role_permissions/{sys_role_permission_id}"
)
@Transactional
public
ResponseEntity
<
Boolean
>
removeBySYS_PERMISSION
(
@PathVariable
(
"sys_permission_id"
)
String
sys_permission_id
,
@PathVariable
(
"sys_role_permission_id"
)
String
sys_role_permission_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_role_permissionService
.
remove
(
sys_role_permission_id
));
}
@ApiOperation
(
value
=
"RemoveBatchBySYS_PERMISSION"
,
tags
=
{
"RemoveBatchBySYS_PERMISSION"
},
notes
=
"RemoveBatchBySYS_PERMISSION"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_permissions/{sys_permission_id}/sys_role_permissions/removebatch"
)
public
ResponseEntity
<
Boolean
>
removeBatchBySYS_PERMISSION
(
@RequestBody
List
<
String
>
ids
)
{
sys_role_permissionService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"GetDraftBySYS_PERMISSION"
,
tags
=
{
"SYS_ROLE_PERMISSIONBySYS_PERMISSION"
},
notes
=
"GetDraftBySYS_PERMISSION"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_permissions/{sys_permission_id}/sys_role_permissions/getdraft"
)
public
ResponseEntity
<
SYS_ROLE_PERMISSIONDTO
>
getDraftBySYS_PERMISSION
(
@PathVariable
(
"sys_permission_id"
)
String
sys_permission_id
)
{
SYS_ROLE_PERMISSION
domain
=
new
SYS_ROLE_PERMISSION
();
domain
.
setPermissionid
(
sys_permission_id
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_role_permissionMapping
.
toDto
(
sys_role_permissionService
.
getDraft
(
domain
)));
}
@ApiOperation
(
value
=
"CreateBySYS_PERMISSION"
,
tags
=
{
"SYS_ROLE_PERMISSIONBySYS_PERMISSION"
},
notes
=
"CreateBySYS_PERMISSION"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_permissions/{sys_permission_id}/sys_role_permissions"
)
@Transactional
public
ResponseEntity
<
SYS_ROLE_PERMISSIONDTO
>
createBySYS_PERMISSION
(
@PathVariable
(
"sys_permission_id"
)
String
sys_permission_id
,
@RequestBody
SYS_ROLE_PERMISSIONDTO
sys_role_permissiondto
)
{
SYS_ROLE_PERMISSION
domain
=
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondto
);
domain
.
setPermissionid
(
sys_permission_id
);
sys_role_permissionService
.
create
(
domain
);
SYS_ROLE_PERMISSIONDTO
dto
=
sys_role_permissionMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"createBatchBySYS_PERMISSION"
,
tags
=
{
"createBatchBySYS_PERMISSION"
},
notes
=
"createBatchBySYS_PERMISSION"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_permissions/{sys_permission_id}/sys_role_permissions/createbatch"
)
public
ResponseEntity
<
Boolean
>
createBatchBySYS_PERMISSION
(
@PathVariable
(
"sys_permission_id"
)
String
sys_permission_id
,
@RequestBody
List
<
SYS_ROLE_PERMISSIONDTO
>
sys_role_permissiondtos
)
{
List
<
SYS_ROLE_PERMISSION
>
domainlist
=
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondtos
);
for
(
SYS_ROLE_PERMISSION
domain:
domainlist
){
domain
.
setPermissionid
(
sys_permission_id
);
}
sys_role_permissionService
.
createBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"CheckKeyBySYS_PERMISSION"
,
tags
=
{
"SYS_ROLE_PERMISSIONBySYS_PERMISSION"
},
notes
=
"CheckKeyBySYS_PERMISSION"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_permissions/{sys_permission_id}/sys_role_permissions/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKeyBySYS_PERMISSION
(
@PathVariable
(
"sys_permission_id"
)
String
sys_permission_id
,
@RequestBody
SYS_ROLE_PERMISSIONDTO
sys_role_permissiondto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_role_permissionService
.
checkKey
(
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondto
)));
}
@ApiOperation
(
value
=
"SaveBySYS_PERMISSION"
,
tags
=
{
"SYS_ROLE_PERMISSIONBySYS_PERMISSION"
},
notes
=
"SaveBySYS_PERMISSION"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_permissions/{sys_permission_id}/sys_role_permissions/save"
)
public
ResponseEntity
<
Boolean
>
saveBySYS_PERMISSION
(
@PathVariable
(
"sys_permission_id"
)
String
sys_permission_id
,
@RequestBody
SYS_ROLE_PERMISSIONDTO
sys_role_permissiondto
)
{
SYS_ROLE_PERMISSION
domain
=
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondto
);
domain
.
setPermissionid
(
sys_permission_id
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_role_permissionService
.
save
(
domain
));
}
@ApiOperation
(
value
=
"SaveBatchBySYS_PERMISSION"
,
tags
=
{
"SaveBatchBySYS_PERMISSION"
},
notes
=
"SaveBatchBySYS_PERMISSION"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_permissions/{sys_permission_id}/sys_role_permissions/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatchBySYS_PERMISSION
(
@PathVariable
(
"sys_permission_id"
)
String
sys_permission_id
,
@RequestBody
List
<
SYS_ROLE_PERMISSIONDTO
>
sys_role_permissiondtos
)
{
List
<
SYS_ROLE_PERMISSION
>
domainlist
=
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondtos
);
for
(
SYS_ROLE_PERMISSION
domain:
domainlist
){
domain
.
setPermissionid
(
sys_permission_id
);
}
sys_role_permissionService
.
saveBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"UpdateBySYS_PERMISSION"
,
tags
=
{
"SYS_ROLE_PERMISSIONBySYS_PERMISSION"
},
notes
=
"UpdateBySYS_PERMISSION"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/sys_permissions/{sys_permission_id}/sys_role_permissions/{sys_role_permission_id}"
)
@Transactional
public
ResponseEntity
<
SYS_ROLE_PERMISSIONDTO
>
updateBySYS_PERMISSION
(
@PathVariable
(
"sys_permission_id"
)
String
sys_permission_id
,
@PathVariable
(
"sys_role_permission_id"
)
String
sys_role_permission_id
,
@RequestBody
SYS_ROLE_PERMISSIONDTO
sys_role_permissiondto
)
{
SYS_ROLE_PERMISSION
domain
=
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondto
);
domain
.
setPermissionid
(
sys_permission_id
);
domain
.
setRolepermissionid
(
sys_role_permission_id
);
sys_role_permissionService
.
update
(
domain
);
SYS_ROLE_PERMISSIONDTO
dto
=
sys_role_permissionMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"UpdateBatchBySYS_PERMISSION"
,
tags
=
{
"UpdateBatchBySYS_PERMISSION"
},
notes
=
"UpdateBatchBySYS_PERMISSION"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_permissions/{sys_permission_id}/sys_role_permissions/updatebatch"
)
public
ResponseEntity
<
Boolean
>
updateBatchBySYS_PERMISSION
(
@PathVariable
(
"sys_permission_id"
)
String
sys_permission_id
,
@RequestBody
List
<
SYS_ROLE_PERMISSIONDTO
>
sys_role_permissiondtos
)
{
List
<
SYS_ROLE_PERMISSION
>
domainlist
=
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondtos
);
for
(
SYS_ROLE_PERMISSION
domain:
domainlist
){
domain
.
setPermissionid
(
sys_permission_id
);
}
sys_role_permissionService
.
updateBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"fetchDEFAULTBySYS_PERMISSION"
,
tags
=
{
"SYS_ROLE_PERMISSIONBySYS_PERMISSION"
}
,
notes
=
"fetchDEFAULTBySYS_PERMISSION"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_permissions/{sys_permission_id}/sys_role_permissions/fetchdefault"
)
public
ResponseEntity
<
List
<
SYS_ROLE_PERMISSIONDTO
>>
fetchSYS_ROLE_PERMISSIONDefaultBySYS_PERMISSION
(
@PathVariable
(
"sys_permission_id"
)
String
sys_permission_id
,
SYS_ROLE_PERMISSIONSearchContext
context
)
{
context
.
setN_sys_permissionid_eq
(
sys_permission_id
);
Page
<
SYS_ROLE_PERMISSION
>
domains
=
sys_role_permissionService
.
searchDefault
(
context
)
;
List
<
SYS_ROLE_PERMISSIONDTO
>
list
=
sys_role_permissionMapping
.
toDto
(
domains
.
getContent
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"x-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageNumber
()))
.
header
(
"x-per-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageSize
()))
.
header
(
"x-total"
,
String
.
valueOf
(
domains
.
getTotalElements
()))
.
body
(
list
);
}
@ApiOperation
(
value
=
"searchDEFAULTBySYS_PERMISSION"
,
tags
=
{
"SYS_ROLE_PERMISSIONBySYS_PERMISSION"
}
,
notes
=
"searchDEFAULTBySYS_PERMISSION"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_permissions/{sys_permission_id}/sys_role_permissions/searchdefault"
)
public
ResponseEntity
<
Page
<
SYS_ROLE_PERMISSIONDTO
>>
searchSYS_ROLE_PERMISSIONDefaultBySYS_PERMISSION
(
@PathVariable
(
"sys_permission_id"
)
String
sys_permission_id
,
SYS_ROLE_PERMISSIONSearchContext
context
)
{
context
.
setN_sys_permissionid_eq
(
sys_permission_id
);
Page
<
SYS_ROLE_PERMISSION
>
domains
=
sys_role_permissionService
.
searchDefault
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
sys_role_permissionMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
@ApiOperation
(
value
=
"GetBySYS_ROLE"
,
tags
=
{
"SYS_ROLE_PERMISSIONBySYS_ROLE"
},
notes
=
"GetBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_roles/{sys_role_id}/sys_role_permissions/{sys_role_permission_id}"
)
public
ResponseEntity
<
SYS_ROLE_PERMISSIONDTO
>
getBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
@PathVariable
(
"sys_role_permission_id"
)
String
sys_role_permission_id
)
{
SYS_ROLE_PERMISSION
domain
=
sys_role_permissionService
.
get
(
sys_role_permission_id
);
SYS_ROLE_PERMISSIONDTO
dto
=
sys_role_permissionMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"RemoveBySYS_ROLE"
,
tags
=
{
"SYS_ROLE_PERMISSIONBySYS_ROLE"
},
notes
=
"RemoveBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/sys_roles/{sys_role_id}/sys_role_permissions/{sys_role_permission_id}"
)
@Transactional
public
ResponseEntity
<
Boolean
>
removeBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
@PathVariable
(
"sys_role_permission_id"
)
String
sys_role_permission_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_role_permissionService
.
remove
(
sys_role_permission_id
));
}
@ApiOperation
(
value
=
"RemoveBatchBySYS_ROLE"
,
tags
=
{
"RemoveBatchBySYS_ROLE"
},
notes
=
"RemoveBatchBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles/{sys_role_id}/sys_role_permissions/removebatch"
)
public
ResponseEntity
<
Boolean
>
removeBatchBySYS_ROLE
(
@RequestBody
List
<
String
>
ids
)
{
sys_role_permissionService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"GetDraftBySYS_ROLE"
,
tags
=
{
"SYS_ROLE_PERMISSIONBySYS_ROLE"
},
notes
=
"GetDraftBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_roles/{sys_role_id}/sys_role_permissions/getdraft"
)
public
ResponseEntity
<
SYS_ROLE_PERMISSIONDTO
>
getDraftBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
)
{
SYS_ROLE_PERMISSION
domain
=
new
SYS_ROLE_PERMISSION
();
domain
.
setRoleid
(
sys_role_id
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_role_permissionMapping
.
toDto
(
sys_role_permissionService
.
getDraft
(
domain
)));
}
@ApiOperation
(
value
=
"CreateBySYS_ROLE"
,
tags
=
{
"SYS_ROLE_PERMISSIONBySYS_ROLE"
},
notes
=
"CreateBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles/{sys_role_id}/sys_role_permissions"
)
@Transactional
public
ResponseEntity
<
SYS_ROLE_PERMISSIONDTO
>
createBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
@RequestBody
SYS_ROLE_PERMISSIONDTO
sys_role_permissiondto
)
{
SYS_ROLE_PERMISSION
domain
=
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondto
);
domain
.
setRoleid
(
sys_role_id
);
sys_role_permissionService
.
create
(
domain
);
SYS_ROLE_PERMISSIONDTO
dto
=
sys_role_permissionMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"createBatchBySYS_ROLE"
,
tags
=
{
"createBatchBySYS_ROLE"
},
notes
=
"createBatchBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles/{sys_role_id}/sys_role_permissions/createbatch"
)
public
ResponseEntity
<
Boolean
>
createBatchBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
@RequestBody
List
<
SYS_ROLE_PERMISSIONDTO
>
sys_role_permissiondtos
)
{
List
<
SYS_ROLE_PERMISSION
>
domainlist
=
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondtos
);
for
(
SYS_ROLE_PERMISSION
domain:
domainlist
){
domain
.
setRoleid
(
sys_role_id
);
}
sys_role_permissionService
.
createBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"CheckKeyBySYS_ROLE"
,
tags
=
{
"SYS_ROLE_PERMISSIONBySYS_ROLE"
},
notes
=
"CheckKeyBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles/{sys_role_id}/sys_role_permissions/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKeyBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
@RequestBody
SYS_ROLE_PERMISSIONDTO
sys_role_permissiondto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_role_permissionService
.
checkKey
(
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondto
)));
}
@ApiOperation
(
value
=
"SaveBySYS_ROLE"
,
tags
=
{
"SYS_ROLE_PERMISSIONBySYS_ROLE"
},
notes
=
"SaveBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles/{sys_role_id}/sys_role_permissions/save"
)
public
ResponseEntity
<
Boolean
>
saveBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
@RequestBody
SYS_ROLE_PERMISSIONDTO
sys_role_permissiondto
)
{
SYS_ROLE_PERMISSION
domain
=
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondto
);
domain
.
setRoleid
(
sys_role_id
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_role_permissionService
.
save
(
domain
));
}
@ApiOperation
(
value
=
"SaveBatchBySYS_ROLE"
,
tags
=
{
"SaveBatchBySYS_ROLE"
},
notes
=
"SaveBatchBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles/{sys_role_id}/sys_role_permissions/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatchBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
@RequestBody
List
<
SYS_ROLE_PERMISSIONDTO
>
sys_role_permissiondtos
)
{
List
<
SYS_ROLE_PERMISSION
>
domainlist
=
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondtos
);
for
(
SYS_ROLE_PERMISSION
domain:
domainlist
){
domain
.
setRoleid
(
sys_role_id
);
}
sys_role_permissionService
.
saveBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"UpdateBySYS_ROLE"
,
tags
=
{
"SYS_ROLE_PERMISSIONBySYS_ROLE"
},
notes
=
"UpdateBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/sys_roles/{sys_role_id}/sys_role_permissions/{sys_role_permission_id}"
)
@Transactional
public
ResponseEntity
<
SYS_ROLE_PERMISSIONDTO
>
updateBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
@PathVariable
(
"sys_role_permission_id"
)
String
sys_role_permission_id
,
@RequestBody
SYS_ROLE_PERMISSIONDTO
sys_role_permissiondto
)
{
SYS_ROLE_PERMISSION
domain
=
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondto
);
domain
.
setRoleid
(
sys_role_id
);
domain
.
setRolepermissionid
(
sys_role_permission_id
);
sys_role_permissionService
.
update
(
domain
);
SYS_ROLE_PERMISSIONDTO
dto
=
sys_role_permissionMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"UpdateBatchBySYS_ROLE"
,
tags
=
{
"UpdateBatchBySYS_ROLE"
},
notes
=
"UpdateBatchBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles/{sys_role_id}/sys_role_permissions/updatebatch"
)
public
ResponseEntity
<
Boolean
>
updateBatchBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
@RequestBody
List
<
SYS_ROLE_PERMISSIONDTO
>
sys_role_permissiondtos
)
{
List
<
SYS_ROLE_PERMISSION
>
domainlist
=
sys_role_permissionMapping
.
toDomain
(
sys_role_permissiondtos
);
for
(
SYS_ROLE_PERMISSION
domain:
domainlist
){
domain
.
setRoleid
(
sys_role_id
);
}
sys_role_permissionService
.
updateBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"fetchDEFAULTBySYS_ROLE"
,
tags
=
{
"SYS_ROLE_PERMISSIONBySYS_ROLE"
}
,
notes
=
"fetchDEFAULTBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_roles/{sys_role_id}/sys_role_permissions/fetchdefault"
)
public
ResponseEntity
<
List
<
SYS_ROLE_PERMISSIONDTO
>>
fetchSYS_ROLE_PERMISSIONDefaultBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
SYS_ROLE_PERMISSIONSearchContext
context
)
{
context
.
setN_sys_roleid_eq
(
sys_role_id
);
Page
<
SYS_ROLE_PERMISSION
>
domains
=
sys_role_permissionService
.
searchDefault
(
context
)
;
List
<
SYS_ROLE_PERMISSIONDTO
>
list
=
sys_role_permissionMapping
.
toDto
(
domains
.
getContent
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"x-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageNumber
()))
.
header
(
"x-per-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageSize
()))
.
header
(
"x-total"
,
String
.
valueOf
(
domains
.
getTotalElements
()))
.
body
(
list
);
}
@ApiOperation
(
value
=
"searchDEFAULTBySYS_ROLE"
,
tags
=
{
"SYS_ROLE_PERMISSIONBySYS_ROLE"
}
,
notes
=
"searchDEFAULTBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_roles/{sys_role_id}/sys_role_permissions/searchdefault"
)
public
ResponseEntity
<
Page
<
SYS_ROLE_PERMISSIONDTO
>>
searchSYS_ROLE_PERMISSIONDefaultBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
SYS_ROLE_PERMISSIONSearchContext
context
)
{
context
.
setN_sys_roleid_eq
(
sys_role_id
);
Page
<
SYS_ROLE_PERMISSION
>
domains
=
sys_role_permissionService
.
searchDefault
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
sys_role_permissionMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
/**
/**
...
...
ibzuaa-provider/ibzuaa-provider-uaaapi/src/main/java/cn/ibizlab/uaaapi/rest/SYS_USERResource.java
浏览文件 @
503211cb
...
@@ -53,6 +53,138 @@ public class SYS_USERResource {
...
@@ -53,6 +53,138 @@ public class SYS_USERResource {
private
SYS_USERMapping
sys_userMapping
;
private
SYS_USERMapping
sys_userMapping
;
@PreAuthorize
(
"hasPermission('DELETE',{#sys_user_id,this.getEntity()})"
)
@ApiOperation
(
value
=
"Remove"
,
tags
=
{
"SYS_USER"
},
notes
=
"Remove"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/sys_users/{sys_user_id}"
)
@Transactional
public
ResponseEntity
<
Boolean
>
remove
(
@PathVariable
(
"sys_user_id"
)
String
sys_user_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_userService
.
remove
(
sys_user_id
));
}
@ApiOperation
(
value
=
"RemoveBatch"
,
tags
=
{
"RemoveBatch"
},
notes
=
"RemoveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_users/removebatch"
)
public
ResponseEntity
<
Boolean
>
removeBatch
(
@RequestBody
List
<
String
>
ids
)
{
sys_userService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission(#sys_user_id,'UPDATE',this.getEntity())"
)
@ApiOperation
(
value
=
"Update"
,
tags
=
{
"SYS_USER"
},
notes
=
"Update"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/sys_users/{sys_user_id}"
)
@Transactional
public
ResponseEntity
<
SYS_USERDTO
>
update
(
@PathVariable
(
"sys_user_id"
)
String
sys_user_id
,
@RequestBody
SYS_USERDTO
sys_userdto
)
{
SYS_USER
domain
=
sys_userMapping
.
toDomain
(
sys_userdto
);
domain
.
setUserid
(
sys_user_id
);
sys_userService
.
update
(
domain
);
SYS_USERDTO
dto
=
sys_userMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission(#sys_user_id,'UPDATE',this.getEntity())"
)
@ApiOperation
(
value
=
"UpdateBatch"
,
tags
=
{
"UpdateBatch"
},
notes
=
"UpdateBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_users/updatebatch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
SYS_USERDTO
>
sys_userdtos
)
{
sys_userService
.
updateBatch
(
sys_userMapping
.
toDomain
(
sys_userdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"CheckKey"
,
tags
=
{
"SYS_USER"
},
notes
=
"CheckKey"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_users/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKey
(
@RequestBody
SYS_USERDTO
sys_userdto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_userService
.
checkKey
(
sys_userMapping
.
toDomain
(
sys_userdto
)));
}
@PreAuthorize
(
"hasPermission(#sys_user_id,'READ',this.getEntity())"
)
@ApiOperation
(
value
=
"Get"
,
tags
=
{
"SYS_USER"
},
notes
=
"Get"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_users/{sys_user_id}"
)
public
ResponseEntity
<
SYS_USERDTO
>
get
(
@PathVariable
(
"sys_user_id"
)
String
sys_user_id
)
{
SYS_USER
domain
=
sys_userService
.
get
(
sys_user_id
);
SYS_USERDTO
dto
=
sys_userMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"Save"
,
tags
=
{
"SYS_USER"
},
notes
=
"Save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_users/save"
)
public
ResponseEntity
<
Boolean
>
save
(
@RequestBody
SYS_USERDTO
sys_userdto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_userService
.
save
(
sys_userMapping
.
toDomain
(
sys_userdto
)));
}
@ApiOperation
(
value
=
"SaveBatch"
,
tags
=
{
"SaveBatch"
},
notes
=
"SaveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_users/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatch
(
@RequestBody
List
<
SYS_USERDTO
>
sys_userdtos
)
{
sys_userService
.
saveBatch
(
sys_userMapping
.
toDomain
(
sys_userdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"GetDraft"
,
tags
=
{
"SYS_USER"
},
notes
=
"GetDraft"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_users/getdraft"
)
public
ResponseEntity
<
SYS_USERDTO
>
getDraft
()
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_userMapping
.
toDto
(
sys_userService
.
getDraft
(
new
SYS_USER
())));
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"Create"
,
tags
=
{
"SYS_USER"
},
notes
=
"Create"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_users"
)
@Transactional
public
ResponseEntity
<
SYS_USERDTO
>
create
(
@RequestBody
SYS_USERDTO
sys_userdto
)
{
SYS_USER
domain
=
sys_userMapping
.
toDomain
(
sys_userdto
);
sys_userService
.
create
(
domain
);
SYS_USERDTO
dto
=
sys_userMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"createBatch"
,
tags
=
{
"createBatch"
},
notes
=
"createBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_users/createbatch"
)
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
SYS_USERDTO
>
sys_userdtos
)
{
sys_userService
.
createBatch
(
sys_userMapping
.
toDomain
(
sys_userdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission('READ',{#context,'Default',this.getEntity()})"
)
@ApiOperation
(
value
=
"fetchDEFAULT"
,
tags
=
{
"SYS_USER"
}
,
notes
=
"fetchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_users/fetchdefault"
)
public
ResponseEntity
<
List
<
SYS_USERDTO
>>
fetchDefault
(
SYS_USERSearchContext
context
)
{
Page
<
SYS_USER
>
domains
=
sys_userService
.
searchDefault
(
context
)
;
List
<
SYS_USERDTO
>
list
=
sys_userMapping
.
toDto
(
domains
.
getContent
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"x-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageNumber
()))
.
header
(
"x-per-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageSize
()))
.
header
(
"x-total"
,
String
.
valueOf
(
domains
.
getTotalElements
()))
.
body
(
list
);
}
@PreAuthorize
(
"hasPermission('READ',{#context,'Default',this.getEntity()})"
)
@ApiOperation
(
value
=
"searchDEFAULT"
,
tags
=
{
"SYS_USER"
}
,
notes
=
"searchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_users/searchdefault"
)
public
ResponseEntity
<
Page
<
SYS_USERDTO
>>
searchDefault
(
SYS_USERSearchContext
context
)
{
Page
<
SYS_USER
>
domains
=
sys_userService
.
searchDefault
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
sys_userMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
/**
/**
* 用户权限校验
* 用户权限校验
* @return
* @return
...
...
ibzuaa-provider/ibzuaa-provider-uaaapi/src/main/java/cn/ibizlab/uaaapi/rest/SYS_USER_ROLEResource.java
浏览文件 @
503211cb
...
@@ -55,6 +55,382 @@ public class SYS_USER_ROLEResource {
...
@@ -55,6 +55,382 @@ public class SYS_USER_ROLEResource {
@ApiOperation
(
value
=
"CheckKey"
,
tags
=
{
"SYS_USER_ROLE"
},
notes
=
"CheckKey"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_user_roles/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKey
(
@RequestBody
SYS_USER_ROLEDTO
sys_user_roledto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_user_roleService
.
checkKey
(
sys_user_roleMapping
.
toDomain
(
sys_user_roledto
)));
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"GetDraft"
,
tags
=
{
"SYS_USER_ROLE"
},
notes
=
"GetDraft"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_user_roles/getdraft"
)
public
ResponseEntity
<
SYS_USER_ROLEDTO
>
getDraft
()
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_user_roleMapping
.
toDto
(
sys_user_roleService
.
getDraft
(
new
SYS_USER_ROLE
())));
}
@PreAuthorize
(
"hasPermission(#sys_user_role_id,'UPDATE',this.getEntity())"
)
@ApiOperation
(
value
=
"Update"
,
tags
=
{
"SYS_USER_ROLE"
},
notes
=
"Update"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/sys_user_roles/{sys_user_role_id}"
)
@Transactional
public
ResponseEntity
<
SYS_USER_ROLEDTO
>
update
(
@PathVariable
(
"sys_user_role_id"
)
String
sys_user_role_id
,
@RequestBody
SYS_USER_ROLEDTO
sys_user_roledto
)
{
SYS_USER_ROLE
domain
=
sys_user_roleMapping
.
toDomain
(
sys_user_roledto
);
domain
.
setUserroleid
(
sys_user_role_id
);
sys_user_roleService
.
update
(
domain
);
SYS_USER_ROLEDTO
dto
=
sys_user_roleMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission(#sys_user_role_id,'UPDATE',this.getEntity())"
)
@ApiOperation
(
value
=
"UpdateBatch"
,
tags
=
{
"UpdateBatch"
},
notes
=
"UpdateBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_user_roles/updatebatch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
SYS_USER_ROLEDTO
>
sys_user_roledtos
)
{
sys_user_roleService
.
updateBatch
(
sys_user_roleMapping
.
toDomain
(
sys_user_roledtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission('DELETE',{#sys_user_role_id,this.getEntity()})"
)
@ApiOperation
(
value
=
"Remove"
,
tags
=
{
"SYS_USER_ROLE"
},
notes
=
"Remove"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/sys_user_roles/{sys_user_role_id}"
)
@Transactional
public
ResponseEntity
<
Boolean
>
remove
(
@PathVariable
(
"sys_user_role_id"
)
String
sys_user_role_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_user_roleService
.
remove
(
sys_user_role_id
));
}
@ApiOperation
(
value
=
"RemoveBatch"
,
tags
=
{
"RemoveBatch"
},
notes
=
"RemoveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_user_roles/removebatch"
)
public
ResponseEntity
<
Boolean
>
removeBatch
(
@RequestBody
List
<
String
>
ids
)
{
sys_user_roleService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"Create"
,
tags
=
{
"SYS_USER_ROLE"
},
notes
=
"Create"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_user_roles"
)
@Transactional
public
ResponseEntity
<
SYS_USER_ROLEDTO
>
create
(
@RequestBody
SYS_USER_ROLEDTO
sys_user_roledto
)
{
SYS_USER_ROLE
domain
=
sys_user_roleMapping
.
toDomain
(
sys_user_roledto
);
sys_user_roleService
.
create
(
domain
);
SYS_USER_ROLEDTO
dto
=
sys_user_roleMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasPermission('','CREATE',this.getEntity())"
)
@ApiOperation
(
value
=
"createBatch"
,
tags
=
{
"createBatch"
},
notes
=
"createBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_user_roles/createbatch"
)
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
SYS_USER_ROLEDTO
>
sys_user_roledtos
)
{
sys_user_roleService
.
createBatch
(
sys_user_roleMapping
.
toDomain
(
sys_user_roledtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission(#sys_user_role_id,'READ',this.getEntity())"
)
@ApiOperation
(
value
=
"Get"
,
tags
=
{
"SYS_USER_ROLE"
},
notes
=
"Get"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_user_roles/{sys_user_role_id}"
)
public
ResponseEntity
<
SYS_USER_ROLEDTO
>
get
(
@PathVariable
(
"sys_user_role_id"
)
String
sys_user_role_id
)
{
SYS_USER_ROLE
domain
=
sys_user_roleService
.
get
(
sys_user_role_id
);
SYS_USER_ROLEDTO
dto
=
sys_user_roleMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"Save"
,
tags
=
{
"SYS_USER_ROLE"
},
notes
=
"Save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_user_roles/save"
)
public
ResponseEntity
<
Boolean
>
save
(
@RequestBody
SYS_USER_ROLEDTO
sys_user_roledto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_user_roleService
.
save
(
sys_user_roleMapping
.
toDomain
(
sys_user_roledto
)));
}
@ApiOperation
(
value
=
"SaveBatch"
,
tags
=
{
"SaveBatch"
},
notes
=
"SaveBatch"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_user_roles/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatch
(
@RequestBody
List
<
SYS_USER_ROLEDTO
>
sys_user_roledtos
)
{
sys_user_roleService
.
saveBatch
(
sys_user_roleMapping
.
toDomain
(
sys_user_roledtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasPermission('READ',{#context,'Default',this.getEntity()})"
)
@ApiOperation
(
value
=
"fetchDEFAULT"
,
tags
=
{
"SYS_USER_ROLE"
}
,
notes
=
"fetchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_user_roles/fetchdefault"
)
public
ResponseEntity
<
List
<
SYS_USER_ROLEDTO
>>
fetchDefault
(
SYS_USER_ROLESearchContext
context
)
{
Page
<
SYS_USER_ROLE
>
domains
=
sys_user_roleService
.
searchDefault
(
context
)
;
List
<
SYS_USER_ROLEDTO
>
list
=
sys_user_roleMapping
.
toDto
(
domains
.
getContent
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"x-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageNumber
()))
.
header
(
"x-per-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageSize
()))
.
header
(
"x-total"
,
String
.
valueOf
(
domains
.
getTotalElements
()))
.
body
(
list
);
}
@PreAuthorize
(
"hasPermission('READ',{#context,'Default',this.getEntity()})"
)
@ApiOperation
(
value
=
"searchDEFAULT"
,
tags
=
{
"SYS_USER_ROLE"
}
,
notes
=
"searchDEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_user_roles/searchdefault"
)
public
ResponseEntity
<
Page
<
SYS_USER_ROLEDTO
>>
searchDefault
(
SYS_USER_ROLESearchContext
context
)
{
Page
<
SYS_USER_ROLE
>
domains
=
sys_user_roleService
.
searchDefault
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
sys_user_roleMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
@ApiOperation
(
value
=
"CheckKeyBySYS_ROLE"
,
tags
=
{
"SYS_USER_ROLEBySYS_ROLE"
},
notes
=
"CheckKeyBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles/{sys_role_id}/sys_user_roles/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKeyBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
@RequestBody
SYS_USER_ROLEDTO
sys_user_roledto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_user_roleService
.
checkKey
(
sys_user_roleMapping
.
toDomain
(
sys_user_roledto
)));
}
@ApiOperation
(
value
=
"GetDraftBySYS_ROLE"
,
tags
=
{
"SYS_USER_ROLEBySYS_ROLE"
},
notes
=
"GetDraftBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_roles/{sys_role_id}/sys_user_roles/getdraft"
)
public
ResponseEntity
<
SYS_USER_ROLEDTO
>
getDraftBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
)
{
SYS_USER_ROLE
domain
=
new
SYS_USER_ROLE
();
domain
.
setRoleid
(
sys_role_id
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_user_roleMapping
.
toDto
(
sys_user_roleService
.
getDraft
(
domain
)));
}
@ApiOperation
(
value
=
"UpdateBySYS_ROLE"
,
tags
=
{
"SYS_USER_ROLEBySYS_ROLE"
},
notes
=
"UpdateBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/sys_roles/{sys_role_id}/sys_user_roles/{sys_user_role_id}"
)
@Transactional
public
ResponseEntity
<
SYS_USER_ROLEDTO
>
updateBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
@PathVariable
(
"sys_user_role_id"
)
String
sys_user_role_id
,
@RequestBody
SYS_USER_ROLEDTO
sys_user_roledto
)
{
SYS_USER_ROLE
domain
=
sys_user_roleMapping
.
toDomain
(
sys_user_roledto
);
domain
.
setRoleid
(
sys_role_id
);
domain
.
setUserroleid
(
sys_user_role_id
);
sys_user_roleService
.
update
(
domain
);
SYS_USER_ROLEDTO
dto
=
sys_user_roleMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"UpdateBatchBySYS_ROLE"
,
tags
=
{
"UpdateBatchBySYS_ROLE"
},
notes
=
"UpdateBatchBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles/{sys_role_id}/sys_user_roles/updatebatch"
)
public
ResponseEntity
<
Boolean
>
updateBatchBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
@RequestBody
List
<
SYS_USER_ROLEDTO
>
sys_user_roledtos
)
{
List
<
SYS_USER_ROLE
>
domainlist
=
sys_user_roleMapping
.
toDomain
(
sys_user_roledtos
);
for
(
SYS_USER_ROLE
domain:
domainlist
){
domain
.
setRoleid
(
sys_role_id
);
}
sys_user_roleService
.
updateBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"RemoveBySYS_ROLE"
,
tags
=
{
"SYS_USER_ROLEBySYS_ROLE"
},
notes
=
"RemoveBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/sys_roles/{sys_role_id}/sys_user_roles/{sys_user_role_id}"
)
@Transactional
public
ResponseEntity
<
Boolean
>
removeBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
@PathVariable
(
"sys_user_role_id"
)
String
sys_user_role_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_user_roleService
.
remove
(
sys_user_role_id
));
}
@ApiOperation
(
value
=
"RemoveBatchBySYS_ROLE"
,
tags
=
{
"RemoveBatchBySYS_ROLE"
},
notes
=
"RemoveBatchBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles/{sys_role_id}/sys_user_roles/removebatch"
)
public
ResponseEntity
<
Boolean
>
removeBatchBySYS_ROLE
(
@RequestBody
List
<
String
>
ids
)
{
sys_user_roleService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"CreateBySYS_ROLE"
,
tags
=
{
"SYS_USER_ROLEBySYS_ROLE"
},
notes
=
"CreateBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles/{sys_role_id}/sys_user_roles"
)
@Transactional
public
ResponseEntity
<
SYS_USER_ROLEDTO
>
createBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
@RequestBody
SYS_USER_ROLEDTO
sys_user_roledto
)
{
SYS_USER_ROLE
domain
=
sys_user_roleMapping
.
toDomain
(
sys_user_roledto
);
domain
.
setRoleid
(
sys_role_id
);
sys_user_roleService
.
create
(
domain
);
SYS_USER_ROLEDTO
dto
=
sys_user_roleMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"createBatchBySYS_ROLE"
,
tags
=
{
"createBatchBySYS_ROLE"
},
notes
=
"createBatchBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles/{sys_role_id}/sys_user_roles/createbatch"
)
public
ResponseEntity
<
Boolean
>
createBatchBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
@RequestBody
List
<
SYS_USER_ROLEDTO
>
sys_user_roledtos
)
{
List
<
SYS_USER_ROLE
>
domainlist
=
sys_user_roleMapping
.
toDomain
(
sys_user_roledtos
);
for
(
SYS_USER_ROLE
domain:
domainlist
){
domain
.
setRoleid
(
sys_role_id
);
}
sys_user_roleService
.
createBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"GetBySYS_ROLE"
,
tags
=
{
"SYS_USER_ROLEBySYS_ROLE"
},
notes
=
"GetBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_roles/{sys_role_id}/sys_user_roles/{sys_user_role_id}"
)
public
ResponseEntity
<
SYS_USER_ROLEDTO
>
getBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
@PathVariable
(
"sys_user_role_id"
)
String
sys_user_role_id
)
{
SYS_USER_ROLE
domain
=
sys_user_roleService
.
get
(
sys_user_role_id
);
SYS_USER_ROLEDTO
dto
=
sys_user_roleMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"SaveBySYS_ROLE"
,
tags
=
{
"SYS_USER_ROLEBySYS_ROLE"
},
notes
=
"SaveBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles/{sys_role_id}/sys_user_roles/save"
)
public
ResponseEntity
<
Boolean
>
saveBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
@RequestBody
SYS_USER_ROLEDTO
sys_user_roledto
)
{
SYS_USER_ROLE
domain
=
sys_user_roleMapping
.
toDomain
(
sys_user_roledto
);
domain
.
setRoleid
(
sys_role_id
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_user_roleService
.
save
(
domain
));
}
@ApiOperation
(
value
=
"SaveBatchBySYS_ROLE"
,
tags
=
{
"SaveBatchBySYS_ROLE"
},
notes
=
"SaveBatchBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_roles/{sys_role_id}/sys_user_roles/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatchBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
@RequestBody
List
<
SYS_USER_ROLEDTO
>
sys_user_roledtos
)
{
List
<
SYS_USER_ROLE
>
domainlist
=
sys_user_roleMapping
.
toDomain
(
sys_user_roledtos
);
for
(
SYS_USER_ROLE
domain:
domainlist
){
domain
.
setRoleid
(
sys_role_id
);
}
sys_user_roleService
.
saveBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"fetchDEFAULTBySYS_ROLE"
,
tags
=
{
"SYS_USER_ROLEBySYS_ROLE"
}
,
notes
=
"fetchDEFAULTBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_roles/{sys_role_id}/sys_user_roles/fetchdefault"
)
public
ResponseEntity
<
List
<
SYS_USER_ROLEDTO
>>
fetchSYS_USER_ROLEDefaultBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
SYS_USER_ROLESearchContext
context
)
{
context
.
setN_sys_roleid_eq
(
sys_role_id
);
Page
<
SYS_USER_ROLE
>
domains
=
sys_user_roleService
.
searchDefault
(
context
)
;
List
<
SYS_USER_ROLEDTO
>
list
=
sys_user_roleMapping
.
toDto
(
domains
.
getContent
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"x-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageNumber
()))
.
header
(
"x-per-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageSize
()))
.
header
(
"x-total"
,
String
.
valueOf
(
domains
.
getTotalElements
()))
.
body
(
list
);
}
@ApiOperation
(
value
=
"searchDEFAULTBySYS_ROLE"
,
tags
=
{
"SYS_USER_ROLEBySYS_ROLE"
}
,
notes
=
"searchDEFAULTBySYS_ROLE"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_roles/{sys_role_id}/sys_user_roles/searchdefault"
)
public
ResponseEntity
<
Page
<
SYS_USER_ROLEDTO
>>
searchSYS_USER_ROLEDefaultBySYS_ROLE
(
@PathVariable
(
"sys_role_id"
)
String
sys_role_id
,
SYS_USER_ROLESearchContext
context
)
{
context
.
setN_sys_roleid_eq
(
sys_role_id
);
Page
<
SYS_USER_ROLE
>
domains
=
sys_user_roleService
.
searchDefault
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
sys_user_roleMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
@ApiOperation
(
value
=
"CheckKeyBySYS_USER"
,
tags
=
{
"SYS_USER_ROLEBySYS_USER"
},
notes
=
"CheckKeyBySYS_USER"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_users/{sys_user_id}/sys_user_roles/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKeyBySYS_USER
(
@PathVariable
(
"sys_user_id"
)
String
sys_user_id
,
@RequestBody
SYS_USER_ROLEDTO
sys_user_roledto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_user_roleService
.
checkKey
(
sys_user_roleMapping
.
toDomain
(
sys_user_roledto
)));
}
@ApiOperation
(
value
=
"GetDraftBySYS_USER"
,
tags
=
{
"SYS_USER_ROLEBySYS_USER"
},
notes
=
"GetDraftBySYS_USER"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_users/{sys_user_id}/sys_user_roles/getdraft"
)
public
ResponseEntity
<
SYS_USER_ROLEDTO
>
getDraftBySYS_USER
(
@PathVariable
(
"sys_user_id"
)
String
sys_user_id
)
{
SYS_USER_ROLE
domain
=
new
SYS_USER_ROLE
();
domain
.
setUserid
(
sys_user_id
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_user_roleMapping
.
toDto
(
sys_user_roleService
.
getDraft
(
domain
)));
}
@ApiOperation
(
value
=
"UpdateBySYS_USER"
,
tags
=
{
"SYS_USER_ROLEBySYS_USER"
},
notes
=
"UpdateBySYS_USER"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/sys_users/{sys_user_id}/sys_user_roles/{sys_user_role_id}"
)
@Transactional
public
ResponseEntity
<
SYS_USER_ROLEDTO
>
updateBySYS_USER
(
@PathVariable
(
"sys_user_id"
)
String
sys_user_id
,
@PathVariable
(
"sys_user_role_id"
)
String
sys_user_role_id
,
@RequestBody
SYS_USER_ROLEDTO
sys_user_roledto
)
{
SYS_USER_ROLE
domain
=
sys_user_roleMapping
.
toDomain
(
sys_user_roledto
);
domain
.
setUserid
(
sys_user_id
);
domain
.
setUserroleid
(
sys_user_role_id
);
sys_user_roleService
.
update
(
domain
);
SYS_USER_ROLEDTO
dto
=
sys_user_roleMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"UpdateBatchBySYS_USER"
,
tags
=
{
"UpdateBatchBySYS_USER"
},
notes
=
"UpdateBatchBySYS_USER"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_users/{sys_user_id}/sys_user_roles/updatebatch"
)
public
ResponseEntity
<
Boolean
>
updateBatchBySYS_USER
(
@PathVariable
(
"sys_user_id"
)
String
sys_user_id
,
@RequestBody
List
<
SYS_USER_ROLEDTO
>
sys_user_roledtos
)
{
List
<
SYS_USER_ROLE
>
domainlist
=
sys_user_roleMapping
.
toDomain
(
sys_user_roledtos
);
for
(
SYS_USER_ROLE
domain:
domainlist
){
domain
.
setUserid
(
sys_user_id
);
}
sys_user_roleService
.
updateBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"RemoveBySYS_USER"
,
tags
=
{
"SYS_USER_ROLEBySYS_USER"
},
notes
=
"RemoveBySYS_USER"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/sys_users/{sys_user_id}/sys_user_roles/{sys_user_role_id}"
)
@Transactional
public
ResponseEntity
<
Boolean
>
removeBySYS_USER
(
@PathVariable
(
"sys_user_id"
)
String
sys_user_id
,
@PathVariable
(
"sys_user_role_id"
)
String
sys_user_role_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_user_roleService
.
remove
(
sys_user_role_id
));
}
@ApiOperation
(
value
=
"RemoveBatchBySYS_USER"
,
tags
=
{
"RemoveBatchBySYS_USER"
},
notes
=
"RemoveBatchBySYS_USER"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_users/{sys_user_id}/sys_user_roles/removebatch"
)
public
ResponseEntity
<
Boolean
>
removeBatchBySYS_USER
(
@RequestBody
List
<
String
>
ids
)
{
sys_user_roleService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"CreateBySYS_USER"
,
tags
=
{
"SYS_USER_ROLEBySYS_USER"
},
notes
=
"CreateBySYS_USER"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_users/{sys_user_id}/sys_user_roles"
)
@Transactional
public
ResponseEntity
<
SYS_USER_ROLEDTO
>
createBySYS_USER
(
@PathVariable
(
"sys_user_id"
)
String
sys_user_id
,
@RequestBody
SYS_USER_ROLEDTO
sys_user_roledto
)
{
SYS_USER_ROLE
domain
=
sys_user_roleMapping
.
toDomain
(
sys_user_roledto
);
domain
.
setUserid
(
sys_user_id
);
sys_user_roleService
.
create
(
domain
);
SYS_USER_ROLEDTO
dto
=
sys_user_roleMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"createBatchBySYS_USER"
,
tags
=
{
"createBatchBySYS_USER"
},
notes
=
"createBatchBySYS_USER"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_users/{sys_user_id}/sys_user_roles/createbatch"
)
public
ResponseEntity
<
Boolean
>
createBatchBySYS_USER
(
@PathVariable
(
"sys_user_id"
)
String
sys_user_id
,
@RequestBody
List
<
SYS_USER_ROLEDTO
>
sys_user_roledtos
)
{
List
<
SYS_USER_ROLE
>
domainlist
=
sys_user_roleMapping
.
toDomain
(
sys_user_roledtos
);
for
(
SYS_USER_ROLE
domain:
domainlist
){
domain
.
setUserid
(
sys_user_id
);
}
sys_user_roleService
.
createBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"GetBySYS_USER"
,
tags
=
{
"SYS_USER_ROLEBySYS_USER"
},
notes
=
"GetBySYS_USER"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_users/{sys_user_id}/sys_user_roles/{sys_user_role_id}"
)
public
ResponseEntity
<
SYS_USER_ROLEDTO
>
getBySYS_USER
(
@PathVariable
(
"sys_user_id"
)
String
sys_user_id
,
@PathVariable
(
"sys_user_role_id"
)
String
sys_user_role_id
)
{
SYS_USER_ROLE
domain
=
sys_user_roleService
.
get
(
sys_user_role_id
);
SYS_USER_ROLEDTO
dto
=
sys_user_roleMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"SaveBySYS_USER"
,
tags
=
{
"SYS_USER_ROLEBySYS_USER"
},
notes
=
"SaveBySYS_USER"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_users/{sys_user_id}/sys_user_roles/save"
)
public
ResponseEntity
<
Boolean
>
saveBySYS_USER
(
@PathVariable
(
"sys_user_id"
)
String
sys_user_id
,
@RequestBody
SYS_USER_ROLEDTO
sys_user_roledto
)
{
SYS_USER_ROLE
domain
=
sys_user_roleMapping
.
toDomain
(
sys_user_roledto
);
domain
.
setUserid
(
sys_user_id
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
sys_user_roleService
.
save
(
domain
));
}
@ApiOperation
(
value
=
"SaveBatchBySYS_USER"
,
tags
=
{
"SaveBatchBySYS_USER"
},
notes
=
"SaveBatchBySYS_USER"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/sys_users/{sys_user_id}/sys_user_roles/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatchBySYS_USER
(
@PathVariable
(
"sys_user_id"
)
String
sys_user_id
,
@RequestBody
List
<
SYS_USER_ROLEDTO
>
sys_user_roledtos
)
{
List
<
SYS_USER_ROLE
>
domainlist
=
sys_user_roleMapping
.
toDomain
(
sys_user_roledtos
);
for
(
SYS_USER_ROLE
domain:
domainlist
){
domain
.
setUserid
(
sys_user_id
);
}
sys_user_roleService
.
saveBatch
(
domainlist
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"fetchDEFAULTBySYS_USER"
,
tags
=
{
"SYS_USER_ROLEBySYS_USER"
}
,
notes
=
"fetchDEFAULTBySYS_USER"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_users/{sys_user_id}/sys_user_roles/fetchdefault"
)
public
ResponseEntity
<
List
<
SYS_USER_ROLEDTO
>>
fetchSYS_USER_ROLEDefaultBySYS_USER
(
@PathVariable
(
"sys_user_id"
)
String
sys_user_id
,
SYS_USER_ROLESearchContext
context
)
{
context
.
setN_sys_userid_eq
(
sys_user_id
);
Page
<
SYS_USER_ROLE
>
domains
=
sys_user_roleService
.
searchDefault
(
context
)
;
List
<
SYS_USER_ROLEDTO
>
list
=
sys_user_roleMapping
.
toDto
(
domains
.
getContent
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"x-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageNumber
()))
.
header
(
"x-per-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageSize
()))
.
header
(
"x-total"
,
String
.
valueOf
(
domains
.
getTotalElements
()))
.
body
(
list
);
}
@ApiOperation
(
value
=
"searchDEFAULTBySYS_USER"
,
tags
=
{
"SYS_USER_ROLEBySYS_USER"
}
,
notes
=
"searchDEFAULTBySYS_USER"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/sys_users/{sys_user_id}/sys_user_roles/searchdefault"
)
public
ResponseEntity
<
Page
<
SYS_USER_ROLEDTO
>>
searchSYS_USER_ROLEDefaultBySYS_USER
(
@PathVariable
(
"sys_user_id"
)
String
sys_user_id
,
SYS_USER_ROLESearchContext
context
)
{
context
.
setN_sys_userid_eq
(
sys_user_id
);
Page
<
SYS_USER_ROLE
>
domains
=
sys_user_roleService
.
searchDefault
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
sys_user_roleMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
/**
/**
...
...
ibzuaa-util/src/main/java/cn/ibizlab/util/client/uaa/UAAFeignClient.java
浏览文件 @
503211cb
...
@@ -8,25 +8,14 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -8,25 +8,14 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.Map
;
import
java.util.Map
;
@FeignClient
(
value
=
"
uaaweb
"
,
fallback
=
UAAFallback
.
class
)
@FeignClient
(
value
=
"
ibzuaa
"
,
fallback
=
UAAFallback
.
class
)
public
interface
UAAFeignClient
public
interface
UAAFeignClient
{
{
// @PostMapping("/uaaweb/uaa/custom/regissystem")
@GetMapping
(
value
=
"/uaa/getpermission"
)
// JSONObject registPSSystem(@RequestBody PSSystem psSystem);
@GetMapping
(
value
=
"/uaaweb/uaa/sys_role/custom/getpermission"
)
JSONObject
getPermission
(
@RequestParam
(
"userid"
)
String
userid
,
@RequestParam
(
"systemid"
)
String
systemid
);
JSONObject
getPermission
(
@RequestParam
(
"userid"
)
String
userid
,
@RequestParam
(
"systemid"
)
String
systemid
);
@PostMapping
(
"/uaa
web/uaa/sys_role/custom
/pushpermissiondata"
)
@PostMapping
(
"/uaa/pushpermissiondata"
)
Map
<
String
,
Object
>
pushPermissionData
(
@RequestBody
Map
<
String
,
Object
>
map
,
@RequestParam
(
"systemid"
)
String
systemid
);
Map
<
String
,
Object
>
pushPermissionData
(
@RequestBody
Map
<
String
,
Object
>
map
,
@RequestParam
(
"systemid"
)
String
systemid
);
@PostMapping
(
value
=
"/uaaweb/uaa/sys_role/custom/createuser"
)
JSONObject
createUser
(
JSONObject
jsobject
);
@PostMapping
(
value
=
"uaaweb/uaa/sys_role/custom/updateuser"
)
JSONObject
updateUser
(
JSONObject
jsobject
);
@PostMapping
(
"/uaaweb/uaa/sys_role/custom/deleteuser"
)
void
deleteUser
(
@RequestParam
(
"userid"
)
String
userid
);
}
}
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录