提交 503211cb 编写于 作者: ibizdev's avatar ibizdev

ibizdev提交

上级 15295543
......@@ -63,7 +63,6 @@ export default {
menus: {
main: {
menuitem3: '用户管理',
menuitem8: '系统管理',
menuitem6: '角色',
menuitem7: '用户角色',
menuitem10: '权限',
......
......@@ -63,7 +63,6 @@ export default {
menus: {
main: {
menuitem3: '用户管理',
menuitem8: '系统管理',
menuitem6: '角色',
menuitem7: '用户角色',
menuitem10: '权限',
......
......@@ -29,24 +29,6 @@ mock.onGet('v7/mainappmenu').reply((config: any) => {
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',
name: 'menuitem6',
text: '角色',
......@@ -64,7 +46,7 @@ mock.onGet('v7/mainappmenu').reply((config: any) => {
appfunctag: 'Auto10',
resourcetag: '',
},
{
{
id: 'aa34fa65ba436d9267830d242fcda6c5',
name: 'menuitem7',
text: '用户角色',
......@@ -82,7 +64,7 @@ mock.onGet('v7/mainappmenu').reply((config: any) => {
appfunctag: 'Auto8',
resourcetag: '',
},
{
{
id: '6177ea33605de953767d48b120145efb',
name: 'menuitem10',
text: '权限',
......@@ -100,7 +82,7 @@ mock.onGet('v7/mainappmenu').reply((config: any) => {
appfunctag: 'Auto7',
resourcetag: '',
},
{
{
id: '2794bbcfc7b3c81b431d1f2e808a793b',
name: 'menuitem1',
text: '角色权限',
......@@ -117,8 +99,6 @@ mock.onGet('v7/mainappmenu').reply((config: any) => {
textcls: '',
appfunctag: 'Auto1',
resourcetag: '',
},
],
},
],
}];
......
......@@ -34,16 +34,165 @@ mock.onGet(new RegExp(/^\/sys_roles\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((
console.groupEnd();
return [status, _items];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Save
mock.onPost(new RegExp(/^\/sys_roles\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_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'];
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
mock.onGet(new RegExp(/^\/sys_roles\/select$/)).reply((config: any) => {
mock.onGet(new RegExp(/^\/sys_roles\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_role 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
......@@ -58,7 +207,7 @@ mock.onGet(new RegExp(/^\/sys_roles\/select$/)).reply((config: any) => {
});
// FetchDefault
mock.onGet(new RegExp(/^\/sys_roles\/select(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
mock.onGet(new RegExp(/^\/sys_roles\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_role 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
......@@ -93,3 +242,59 @@ mock.onGet(new RegExp(/^\/sys_roles\/select(\?[\w-./?%&=,]*)*$/)).reply((config:
// 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:{}];
});
......@@ -34,16 +34,165 @@ mock.onGet(new RegExp(/^\/sys_users\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((
console.groupEnd();
return [status, _items];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Update
mock.onPut(new RegExp(/^\/sys_users\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_user 方法: 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'];
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
mock.onGet(new RegExp(/^\/sys_users\/select$/)).reply((config: any) => {
mock.onGet(new RegExp(/^\/sys_users\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_user 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
......@@ -58,7 +207,7 @@ mock.onGet(new RegExp(/^\/sys_users\/select$/)).reply((config: any) => {
});
// FetchDefault
mock.onGet(new RegExp(/^\/sys_users\/select(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
mock.onGet(new RegExp(/^\/sys_users\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:sys_user 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
......@@ -93,3 +242,59 @@ mock.onGet(new RegExp(/^\/sys_users\/select(\?[\w-./?%&=,]*)*$/)).reply((config:
// 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:{}];
});
......@@ -49,6 +49,168 @@ export default class SYS_PERMISSIONServiceBase extends EntityService {
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接口方法
*
......@@ -60,6 +222,6 @@ export default class SYS_PERMISSIONServiceBase extends EntityService {
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/sys_permissions/select`,tempData,isloading);
return Http.getInstance().get(`/sys_permissions/fetchdefault`,tempData,isloading);
}
}
\ No newline at end of file
......@@ -49,6 +49,118 @@ export default class SYS_PSAPPMENUITEMServiceBase extends EntityService {
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接口方法
*
......@@ -60,6 +172,6 @@ export default class SYS_PSAPPMENUITEMServiceBase extends EntityService {
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/sys_psappmenuitems/select`,tempData,isloading);
return Http.getInstance().get(`/sys_psappmenuitems/fetchdefault`,tempData,isloading);
}
}
\ No newline at end of file
......@@ -49,6 +49,118 @@ export default class SYS_PSDEOPPRIVServiceBase extends EntityService {
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接口方法
*
......@@ -60,6 +172,6 @@ export default class SYS_PSDEOPPRIVServiceBase extends EntityService {
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/sys_psdeopprivs/select`,tempData,isloading);
return Http.getInstance().get(`/sys_psdeopprivs/fetchdefault`,tempData,isloading);
}
}
\ No newline at end of file
......@@ -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);
}
/**
* 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接口方法
*
......@@ -67,13 +233,13 @@ export default class SYS_ROLE_PERMISSIONServiceBase extends EntityService {
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sys_role && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/sys_roles/${context.sys_role}/sys_role_permissions/select`,tempData,isloading);
return Http.getInstance().get(`/sys_roles/${context.sys_role}/sys_role_permissions/fetchdefault`,tempData,isloading);
}
if(context.sys_permission && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/sys_permissions/${context.sys_permission}/sys_role_permissions/select`,tempData,isloading);
return Http.getInstance().get(`/sys_permissions/${context.sys_permission}/sys_role_permissions/fetchdefault`,tempData,isloading);
}
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/sys_role_permissions/select`,tempData,isloading);
return Http.getInstance().get(`/sys_role_permissions/fetchdefault`,tempData,isloading);
}
}
\ No newline at end of file
......@@ -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);
}
/**
* 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接口方法
*
......@@ -67,13 +233,13 @@ export default class SYS_USER_ROLEServiceBase extends EntityService {
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sys_user && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/sys_users/${context.sys_user}/sys_user_roles/select`,tempData,isloading);
return Http.getInstance().get(`/sys_users/${context.sys_user}/sys_user_roles/fetchdefault`,tempData,isloading);
}
if(context.sys_role && true){
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/sys_roles/${context.sys_role}/sys_user_roles/select`,tempData,isloading);
return Http.getInstance().get(`/sys_roles/${context.sys_role}/sys_user_roles/fetchdefault`,tempData,isloading);
}
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/sys_user_roles/select`,tempData,isloading);
return Http.getInstance().get(`/sys_user_roles/fetchdefault`,tempData,isloading);
}
}
\ No newline at end of file
......@@ -49,6 +49,168 @@ export default class SYS_USERServiceBase extends EntityService {
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接口方法
*
......@@ -60,6 +222,6 @@ export default class SYS_USERServiceBase extends EntityService {
*/
public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let tempData:any = JSON.parse(JSON.stringify(data));
return Http.getInstance().get(`/sys_users/select`,tempData,isloading);
return Http.getInstance().get(`/sys_users/fetchdefault`,tempData,isloading);
}
}
\ No newline at end of file
......@@ -33,24 +33,6 @@ export default class MainModel {
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',
name: 'menuitem6',
text: '角色',
......@@ -68,7 +50,7 @@ export default class MainModel {
appfunctag: 'Auto10',
resourcetag: '',
},
{
{
id: 'aa34fa65ba436d9267830d242fcda6c5',
name: 'menuitem7',
text: '用户角色',
......@@ -86,7 +68,7 @@ export default class MainModel {
appfunctag: 'Auto8',
resourcetag: '',
},
{
{
id: '6177ea33605de953767d48b120145efb',
name: 'menuitem10',
text: '权限',
......@@ -104,7 +86,7 @@ export default class MainModel {
appfunctag: 'Auto7',
resourcetag: '',
},
{
{
id: '2794bbcfc7b3c81b431d1f2e808a793b',
name: 'menuitem1',
text: '角色权限',
......@@ -121,8 +103,6 @@ export default class MainModel {
textcls: '',
appfunctag: 'Auto1',
resourcetag: '',
},
],
},
];
......
......@@ -27,8 +27,6 @@ public interface SYS_PERMISSIONMapper extends BaseMapper<SYS_PERMISSION>{
int updateById(@Param(Constants.ENTITY) SYS_PERMISSION entity);
@Override
int deleteById(Serializable id);
Page<SYS_PERMISSION> selectPermission(IPage page,@Param("pw") Wrapper<SYS_PERMISSION> wrapper) ;
/**
* 自定义查询SQL
* @param sql
......
......@@ -27,8 +27,6 @@ public interface SYS_PSAPPMENUITEMMapper extends BaseMapper<SYS_PSAPPMENUITEM>{
int updateById(@Param(Constants.ENTITY) SYS_PSAPPMENUITEM entity);
@Override
int deleteById(Serializable id);
Page<SYS_PSAPPMENUITEM> selectPermission(IPage page,@Param("pw") Wrapper<SYS_PSAPPMENUITEM> wrapper) ;
/**
* 自定义查询SQL
* @param sql
......
......@@ -27,8 +27,6 @@ public interface SYS_PSDEOPPRIVMapper extends BaseMapper<SYS_PSDEOPPRIV>{
int updateById(@Param(Constants.ENTITY) SYS_PSDEOPPRIV entity);
@Override
int deleteById(Serializable id);
Page<SYS_PSDEOPPRIV> selectPermission(IPage page,@Param("pw") Wrapper<SYS_PSDEOPPRIV> wrapper) ;
/**
* 自定义查询SQL
* @param sql
......
......@@ -31,8 +31,6 @@ public interface SYS_ROLEMapper extends BaseMapper<SYS_ROLE>{
@Override
@CacheEvict( value="sys_role",key = "'row:'+#p0")
int deleteById(Serializable id);
Page<SYS_ROLE> selectPermission(IPage page,@Param("pw") Wrapper<SYS_ROLE> wrapper) ;
/**
* 自定义查询SQL
* @param sql
......
......@@ -27,8 +27,6 @@ public interface SYS_ROLE_PERMISSIONMapper extends BaseMapper<SYS_ROLE_PERMISSIO
int updateById(@Param(Constants.ENTITY) SYS_ROLE_PERMISSION entity);
@Override
int deleteById(Serializable id);
Page<SYS_ROLE_PERMISSION> selectPermission(IPage page,@Param("pw") Wrapper<SYS_ROLE_PERMISSION> wrapper) ;
/**
* 自定义查询SQL
* @param sql
......
......@@ -31,8 +31,6 @@ public interface SYS_USERMapper extends BaseMapper<SYS_USER>{
@Override
@CacheEvict( value="sys_user",key = "'row:'+#p0")
int deleteById(Serializable id);
Page<SYS_USER> selectPermission(IPage page,@Param("pw") Wrapper<SYS_USER> wrapper) ;
/**
* 自定义查询SQL
* @param sql
......
......@@ -27,8 +27,6 @@ public interface SYS_USER_ROLEMapper extends BaseMapper<SYS_USER_ROLE>{
int updateById(@Param(Constants.ENTITY) SYS_USER_ROLE entity);
@Override
int deleteById(Serializable id);
Page<SYS_USER_ROLE> selectPermission(IPage page,@Param("pw") Wrapper<SYS_USER_ROLE> wrapper) ;
/**
* 自定义查询SQL
* @param sql
......
......@@ -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">
<!--输出实体[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">
<column name="SYS_PSDEOPPRIVID" remarks="" type="VARCHAR(300)">
<column name="SYS_PSDEOPPRIVID" remarks="" type="VARCHAR(200)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_PSDEOPPRIV_SYS_PSDEOPPR"/>
</column>
<column name="SYS_PSDEOPPRIVNAME" remarks="" type="VARCHAR(200)">
......@@ -36,7 +36,7 @@
</createTable>
</changeSet>
<!--输出实体[SYS_USER]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_user-35-2">
<changeSet author="a_A_5d9d78509" id="tab-sys_user-37-2">
<createTable tableName="IBZUSER">
<column name="USERID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_USER_USERID"/>
......@@ -48,7 +48,7 @@
</createTable>
</changeSet>
<!--输出实体[SYS_ROLE_PERMISSION]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_role_permission-26-3">
<changeSet author="a_A_5d9d78509" id="tab-sys_role_permission-28-3">
<createTable tableName="IBZROLE_PERMISSION">
<column name="SYS_ROLE_PERMISSIONID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_ROLE_PERMISSION_SYS_ROL"/>
......@@ -59,7 +59,7 @@
</column>
<column name="SYS_ROLENAME" remarks="" type="VARCHAR(200)">
</column>
<column name="SYS_PERMISSIONID" remarks="" type="VARCHAR(300)">
<column name="SYS_PERMISSIONID" remarks="" type="VARCHAR(200)">
</column>
<column name="SYS_PERMISSIONNAME" remarks="" type="VARCHAR(200)">
</column>
......@@ -74,7 +74,7 @@
</createTable>
</changeSet>
<!--输出实体[SYS_USER_ROLE]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_user_role-31-4">
<changeSet author="a_A_5d9d78509" id="tab-sys_user_role-33-4">
<createTable tableName="IBZUSER_ROLE">
<column name="SYS_USER_ROLEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_USER_ROLE_SYS_USER_ROLE"/>
......@@ -96,7 +96,7 @@
</createTable>
</changeSet>
<!--输出实体[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">
<column name="SYS_ROLEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_ROLE_SYS_ROLEID"/>
......@@ -112,9 +112,9 @@
</createTable>
</changeSet>
<!--输出实体[SYS_PERMISSION]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_permission-23-6">
<changeSet author="a_A_5d9d78509" id="tab-sys_permission-25-6">
<createTable tableName="IBZPERMISSION">
<column name="SYS_PERMISSIONID" remarks="" type="VARCHAR(300)">
<column name="SYS_PERMISSIONID" remarks="" type="VARCHAR(200)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_PERMISSION_SYS_PERMISSI"/>
</column>
<column name="SYS_PERMISSIONNAME" remarks="" type="VARCHAR(200)">
......@@ -132,9 +132,9 @@
</createTable>
</changeSet>
<!--输出实体[SYS_PSAPPMENUITEM]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_psappmenuitem-26-7">
<changeSet author="a_A_5d9d78509" id="tab-sys_psappmenuitem-28-7">
<createTable tableName="IBZPSAPPMENUITEM">
<column name="SYS_PSAPPMENUITEMID" remarks="" type="VARCHAR(300)">
<column name="SYS_PSAPPMENUITEMID" remarks="" type="VARCHAR(200)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_PSAPPMENUITEM_SYS_PSAPP"/>
</column>
<column name="SYS_PSAPPMENUITEMNAME" remarks="" type="VARCHAR(200)">
......@@ -165,14 +165,14 @@
<!--输出实体[SYS_PSDEOPPRIV]外键关系 -->
<!--输出实体[SYS_USER]外键关系 -->
<!--输出实体[SYS_ROLE_PERMISSION]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-sys_role_permission-26-8">
<changeSet author="a_A_5d9d78509" id="fk-sys_role_permission-28-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"/>
</changeSet>
<!--输出实体[SYS_USER_ROLE]外键关系 -->
<changeSet author="a_A_5d9d78509" id="fk-sys_user_role-31-10">
<changeSet author="a_A_5d9d78509" id="fk-sys_user_role-33-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"/>
</changeSet>
<changeSet author="a_A_5d9d78509" id="fk-sys_user_role-31-11">
<changeSet author="a_A_5d9d78509" id="fk-sys_user_role-33-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"/>
</changeSet>
<!--输出实体[SYS_ROLE]外键关系 -->
......
......@@ -53,6 +53,138 @@ public class SYS_PERMISSIONResource {
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
......
......@@ -53,6 +53,138 @@ public class SYS_PSAPPMENUITEMResource {
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
......
......@@ -53,6 +53,138 @@ public class SYS_PSDEOPPRIVResource {
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
......
......@@ -53,6 +53,138 @@ public class SYS_ROLEResource {
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
......
......@@ -8,25 +8,14 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Map;
@FeignClient(value = "uaaweb",fallback = UAAFallback.class)
@FeignClient(value = "ibzuaa",fallback = UAAFallback.class)
public interface UAAFeignClient
{
// @PostMapping("/uaaweb/uaa/custom/regissystem")
// JSONObject registPSSystem(@RequestBody PSSystem psSystem);
@GetMapping(value = "/uaaweb/uaa/sys_role/custom/getpermission")
@GetMapping(value = "/uaa/getpermission")
JSONObject getPermission( @RequestParam("userid") String userid, @RequestParam("systemid") String systemid);
@PostMapping("/uaaweb/uaa/sys_role/custom/pushpermissiondata")
@PostMapping("/uaa/pushpermissiondata")
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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册