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

ibiz4j 发布系统代码

上级 95b79a19
...@@ -115,16 +115,42 @@ mock.onGet(new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((co ...@@ -115,16 +115,42 @@ mock.onGet(new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((co
return [status, _items]; return [status, _items];
}); });
// Save // Create
mock.onPost(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysapp 方法: Save"); console.groupCollapsed("实体:sysapp 方法: Create");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysapps\/([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(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysapp 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -207,16 +233,16 @@ mock.onPost(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply ...@@ -207,16 +233,16 @@ mock.onPost(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply
return [status, data]; return [status, data];
}); });
// Update // Save
mock.onPut(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:sysapp 方法: Update"); console.groupCollapsed("实体:sysapp 方法: Save");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['id']; const paramArray:Array<any> = ['id'];
const matchArray:any = new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysapps\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -245,32 +271,6 @@ mock.onPut(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: a ...@@ -245,32 +271,6 @@ mock.onPut(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: a
return [status, data]; return [status, data];
}); });
// Create
mock.onPost(new RegExp(/^\/sysapps\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysapp 方法: 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> = ['id'];
const matchArray:any = new RegExp(/^\/sysapps\/([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(/^\/sysapps\/fetchdefault$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/sysapps\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:sysapp 方法: FetchDefault"); console.groupCollapsed("实体:sysapp 方法: FetchDefault");
......
...@@ -115,20 +115,30 @@ mock.onGet(new RegExp(/^\/sysauthlogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply ...@@ -115,20 +115,30 @@ mock.onGet(new RegExp(/^\/sysauthlogs\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply
return [status, _items]; return [status, _items];
}); });
// GetDraft // Create
mock.onGet(new RegExp(/^\/sysauthlogs\/getdraft$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/sysauthlogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysauthlog 方法: GetDraft"); console.groupCollapsed("实体:sysauthlog 方法: Create");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['logid'];
const matchArray:any = new RegExp(/^\/sysauthlogs\/([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.groupCollapsed("response数据 status: "+status+" data: ");
console.table({}); console.table(mockDatas[0]);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, {}]; return [status, mockDatas[0]];
}); });
// Update // Update
...@@ -169,30 +179,20 @@ mock.onPut(new RegExp(/^\/sysauthlogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((confi ...@@ -169,30 +179,20 @@ mock.onPut(new RegExp(/^\/sysauthlogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((confi
return [status, data]; return [status, data];
}); });
// Create // GetDraft
mock.onPost(new RegExp(/^\/sysauthlogs\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/sysauthlogs\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysauthlog 方法: Create"); console.groupCollapsed("实体:sysauthlog 方法: GetDraft");
console.table({url:config.url, method: config.method, data:config.data}); console.table({url:config.url, method: config.method, data:config.data});
// GetDraft
let status = MockAdapter.mockStatus(config); let status = MockAdapter.mockStatus(config);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['logid'];
const matchArray:any = new RegExp(/^\/sysauthlogs\/([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.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]); console.table({});
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, mockDatas[0]]; return [status, {}];
}); });
// CheckKey // CheckKey
......
...@@ -115,16 +115,42 @@ mock.onGet(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).re ...@@ -115,16 +115,42 @@ mock.onGet(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).re
return [status, _items]; return [status, _items];
}); });
// Save // Create
mock.onPost(new RegExp(/^\/syspermissions\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/syspermissions\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:syspermission 方法: Save"); console.groupCollapsed("实体:syspermission 方法: Create");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['permissionid']; const paramArray:Array<any> = ['permissionid'];
const matchArray:any = new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url); const matchArray:any = new RegExp(/^\/syspermissions\/([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(/^\/syspermissions\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:syspermission 方法: 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(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -169,16 +195,16 @@ mock.onGet(new RegExp(/^\/syspermissions\/getdraft$/)).reply((config: any) => { ...@@ -169,16 +195,16 @@ mock.onGet(new RegExp(/^\/syspermissions\/getdraft$/)).reply((config: any) => {
return [status, {}]; return [status, {}];
}); });
// Update // CheckKey
mock.onPut(new RegExp(/^\/syspermissions\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/syspermissions\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:syspermission 方法: Update"); console.groupCollapsed("实体:syspermission 方法: CheckKey");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['permissionid']; const paramArray:Array<any> = ['permissionid'];
const matchArray:any = new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url); const matchArray:any = new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -207,42 +233,16 @@ mock.onPut(new RegExp(/^\/syspermissions\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((co ...@@ -207,42 +233,16 @@ mock.onPut(new RegExp(/^\/syspermissions\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((co
return [status, data]; return [status, data];
}); });
// Create // Save
mock.onPost(new RegExp(/^\/syspermissions\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/syspermissions\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:syspermission 方法: Create"); console.groupCollapsed("实体:syspermission 方法: 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'];
const matchArray:any = new RegExp(/^\/syspermissions\/([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(/^\/syspermissions\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:syspermission 方法: CheckKey");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['permissionid']; const paramArray:Array<any> = ['permissionid'];
const matchArray:any = new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
......
...@@ -174,60 +174,6 @@ mock.onGet(new RegExp(/^\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/select$/) ...@@ -174,60 +174,6 @@ mock.onGet(new RegExp(/^\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/select$/)
}); });
// GetDraft
mock.onGet(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: 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, {}];
});
// GetDraft
mock.onGet(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: 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, {}];
});
// GetDraft
mock.onGet(new RegExp(/^\/sysrolepermissions\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: 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 // Create
mock.onPost(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: Create"); console.groupCollapsed("实体:sysrolepermission 方法: Create");
...@@ -308,16 +254,16 @@ mock.onPost(new RegExp(/^\/sysrolepermissions\/?([a-zA-Z0-9\-\;]{0,35})$/)).repl ...@@ -308,16 +254,16 @@ mock.onPost(new RegExp(/^\/sysrolepermissions\/?([a-zA-Z0-9\-\;]{0,35})$/)).repl
}); });
// CheckKey // Update
mock.onPost(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/)).reply((config: any) => { mock.onPut(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: CheckKey"); console.groupCollapsed("实体:sysrolepermission 方法: Update");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['roleid','rolepermissionid']; const paramArray:Array<any> = ['roleid','rolepermissionid'];
const matchArray:any = new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -335,16 +281,16 @@ mock.onPost(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions ...@@ -335,16 +281,16 @@ mock.onPost(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions
}); });
// CheckKey // Update
mock.onPost(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/)).reply((config: any) => { mock.onPut(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: CheckKey"); console.groupCollapsed("实体:sysrolepermission 方法: Update");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['permissionid','rolepermissionid']; const paramArray:Array<any> = ['permissionid','rolepermissionid'];
const matchArray:any = new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -361,16 +307,16 @@ mock.onPost(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermi ...@@ -361,16 +307,16 @@ mock.onPost(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermi
return [status, {}]; return [status, {}];
}); });
// CheckKey // Update
mock.onPost(new RegExp(/^\/sysrolepermissions\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => { mock.onPut(new RegExp(/^\/sysrolepermissions\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: CheckKey"); console.groupCollapsed("实体:sysrolepermission 方法: Update");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['rolepermissionid']; const paramArray:Array<any> = ['rolepermissionid'];
const matchArray:any = new RegExp(/^\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -400,16 +346,70 @@ mock.onPost(new RegExp(/^\/sysrolepermissions\/?([a-zA-Z0-9\-\;]{0,35})\/checkke ...@@ -400,16 +346,70 @@ mock.onPost(new RegExp(/^\/sysrolepermissions\/?([a-zA-Z0-9\-\;]{0,35})\/checkke
}); });
// Save
mock.onPost(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: Save");
// GetDraft
mock.onGet(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: 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, {}];
});
// GetDraft
mock.onGet(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: 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, {}];
});
// GetDraft
mock.onGet(new RegExp(/^\/sysrolepermissions\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: 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(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: CheckKey");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['roleid','rolepermissionid']; const paramArray:Array<any> = ['roleid','rolepermissionid'];
const matchArray:any = new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -427,16 +427,16 @@ mock.onPost(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions ...@@ -427,16 +427,16 @@ mock.onPost(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions
}); });
// Save // CheckKey
mock.onPost(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/save$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: Save"); console.groupCollapsed("实体:sysrolepermission 方法: CheckKey");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['permissionid','rolepermissionid']; const paramArray:Array<any> = ['permissionid','rolepermissionid'];
const matchArray:any = new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url); const matchArray:any = new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -453,16 +453,16 @@ mock.onPost(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermi ...@@ -453,16 +453,16 @@ mock.onPost(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermi
return [status, {}]; return [status, {}];
}); });
// Save // CheckKey
mock.onPost(new RegExp(/^\/sysrolepermissions\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/sysrolepermissions\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: Save"); console.groupCollapsed("实体:sysrolepermission 方法: CheckKey");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['rolepermissionid']; const paramArray:Array<any> = ['rolepermissionid'];
const matchArray:any = new RegExp(/^\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -492,16 +492,16 @@ mock.onPost(new RegExp(/^\/sysrolepermissions\/?([a-zA-Z0-9\-\;]{0,35})\/save$/) ...@@ -492,16 +492,16 @@ mock.onPost(new RegExp(/^\/sysrolepermissions\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)
}); });
// Update // Save
mock.onPut(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: Update"); console.groupCollapsed("实体:sysrolepermission 方法: Save");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['roleid','rolepermissionid']; const paramArray:Array<any> = ['roleid','rolepermissionid'];
const matchArray:any = new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -519,16 +519,16 @@ mock.onPut(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\ ...@@ -519,16 +519,16 @@ mock.onPut(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\
}); });
// Update // Save
mock.onPut(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: Update"); console.groupCollapsed("实体:sysrolepermission 方法: Save");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['permissionid','rolepermissionid']; const paramArray:Array<any> = ['permissionid','rolepermissionid'];
const matchArray:any = new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url); const matchArray:any = new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -545,16 +545,16 @@ mock.onPut(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermis ...@@ -545,16 +545,16 @@ mock.onPut(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermis
return [status, {}]; return [status, {}];
}); });
// Update // Save
mock.onPut(new RegExp(/^\/sysrolepermissions\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/sysrolepermissions\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: Update"); console.groupCollapsed("实体:sysrolepermission 方法: Save");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['rolepermissionid']; const paramArray:Array<any> = ['rolepermissionid'];
const matchArray:any = new RegExp(/^\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -753,9 +753,9 @@ mock.onGet(new RegExp(/^\/sysrolepermissions\/fetchdefault(\?[\w-./?%&=,]*)*$/)) ...@@ -753,9 +753,9 @@ mock.onGet(new RegExp(/^\/sysrolepermissions\/fetchdefault(\?[\w-./?%&=,]*)*$/))
// URI参数传递情况未实现 // URI参数传递情况未实现
// Get // Remove
mock.onGet(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onDelete(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: Get"); console.groupCollapsed("实体:sysrolepermission 方法: Remove");
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);
if (status !== 200) { if (status !== 200) {
...@@ -781,9 +781,9 @@ mock.onGet(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\ ...@@ -781,9 +781,9 @@ mock.onGet(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\
return [status, _items?_items:{}]; return [status, _items?_items:{}];
}); });
// Get // Remove
mock.onGet(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onDelete(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: Get"); console.groupCollapsed("实体:sysrolepermission 方法: Remove");
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);
if (status !== 200) { if (status !== 200) {
...@@ -809,9 +809,9 @@ mock.onGet(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermis ...@@ -809,9 +809,9 @@ mock.onGet(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermis
return [status, _items?_items:{}]; return [status, _items?_items:{}];
}); });
// Get // Remove
mock.onGet(new RegExp(/^\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onDelete(new RegExp(/^\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: Get"); console.groupCollapsed("实体:sysrolepermission 方法: Remove");
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);
if (status !== 200) { if (status !== 200) {
...@@ -837,9 +837,9 @@ mock.onGet(new RegExp(/^\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply( ...@@ -837,9 +837,9 @@ mock.onGet(new RegExp(/^\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply(
return [status, _items?_items:{}]; return [status, _items?_items:{}];
}); });
// Remove // Get
mock.onDelete(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: Remove"); console.groupCollapsed("实体:sysrolepermission 方法: Get");
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);
if (status !== 200) { if (status !== 200) {
...@@ -865,9 +865,9 @@ mock.onDelete(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissio ...@@ -865,9 +865,9 @@ mock.onDelete(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissio
return [status, _items?_items:{}]; return [status, _items?_items:{}];
}); });
// Remove // Get
mock.onDelete(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: Remove"); console.groupCollapsed("实体:sysrolepermission 方法: Get");
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);
if (status !== 200) { if (status !== 200) {
...@@ -893,9 +893,9 @@ mock.onDelete(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysroleper ...@@ -893,9 +893,9 @@ mock.onDelete(new RegExp(/^\/syspermissions\/([a-zA-Z0-9\-\;]{1,35})\/sysroleper
return [status, _items?_items:{}]; return [status, _items?_items:{}];
}); });
// Remove // Get
mock.onDelete(new RegExp(/^\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/sysrolepermissions\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrolepermission 方法: Remove"); console.groupCollapsed("实体:sysrolepermission 方法: Get");
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);
if (status !== 200) { if (status !== 200) {
......
...@@ -115,16 +115,16 @@ mock.onGet(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((c ...@@ -115,16 +115,16 @@ mock.onGet(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((c
return [status, _items]; return [status, _items];
}); });
// Save // Create
mock.onPost(new RegExp(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrole 方法: Save"); console.groupCollapsed("实体:sysrole 方法: Create");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['roleid']; const paramArray:Array<any> = ['roleid'];
const matchArray:any = new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -134,23 +134,11 @@ mock.onPost(new RegExp(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((c ...@@ -134,23 +134,11 @@ mock.onPost(new RegExp(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((c
}); });
}); });
} }
//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.groupCollapsed("response数据 status: "+status+" data: ");
console.table(data); console.table(mockDatas[0]);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, data]; return [status, mockDatas[0]];
}); });
// Update // Update
...@@ -191,16 +179,32 @@ mock.onPut(new RegExp(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: ...@@ -191,16 +179,32 @@ mock.onPut(new RegExp(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
return [status, data]; return [status, data];
}); });
// Create // GetDraft
mock.onPost(new RegExp(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/sysroles\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrole 方法: Create"); console.groupCollapsed("实体:sysrole 方法: 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(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrole 方法: CheckKey");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['roleid']; const paramArray:Array<any> = ['roleid'];
const matchArray:any = new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -210,39 +214,35 @@ mock.onPost(new RegExp(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: ...@@ -210,39 +214,35 @@ mock.onPost(new RegExp(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
}); });
}); });
} }
console.groupCollapsed("response数据 status: "+status+" data: "); //let items = mockDatas ? mockDatas : [];
console.table(mockDatas[0]); //let _items = items.find((item: any) => Object.is(item.roleid, tempValue.roleid));
console.groupEnd(); let data = JSON.parse(config.data);
console.groupEnd(); mockDatas.forEach((item)=>{
return [status, mockDatas[0]]; if(item['roleid'] == tempValue['roleid'] ){
}); for(let value in data){
if(item.hasOwnProperty(value)){
// GetDraft item[value] = data[value];
mock.onGet(new RegExp(/^\/sysroles\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrole 方法: 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.groupCollapsed("response数据 status: "+status+" data: ");
console.table({}); console.table(data);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, {}]; return [status, data];
}); });
// CheckKey // Save
mock.onPost(new RegExp(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/sysroles\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrole 方法: CheckKey"); console.groupCollapsed("实体:sysrole 方法: Save");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['roleid']; const paramArray:Array<any> = ['roleid'];
const matchArray:any = new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/save$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -323,9 +323,9 @@ mock.onGet(new RegExp(/^\/sysroles\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((co ...@@ -323,9 +323,9 @@ mock.onGet(new RegExp(/^\/sysroles\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((co
// URI参数传递情况未实现 // URI参数传递情况未实现
// Get // Remove
mock.onGet(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onDelete(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrole 方法: Get"); console.groupCollapsed("实体:sysrole 方法: Remove");
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);
if (status !== 200) { if (status !== 200) {
...@@ -351,9 +351,9 @@ mock.onGet(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: a ...@@ -351,9 +351,9 @@ mock.onGet(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: a
return [status, _items?_items:{}]; return [status, _items?_items:{}];
}); });
// Remove // Get
mock.onDelete(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysrole 方法: Remove"); console.groupCollapsed("实体:sysrole 方法: Get");
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);
if (status !== 200) { if (status !== 200) {
......
...@@ -174,16 +174,16 @@ mock.onGet(new RegExp(/^\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).repl ...@@ -174,16 +174,16 @@ mock.onGet(new RegExp(/^\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).repl
}); });
// CheckKey // Create
mock.onPost(new RegExp(/^\/sysusers\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/sysusers\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuserrole 方法: CheckKey"); console.groupCollapsed("实体:sysuserrole 方法: Create");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['userid','userroleid']; const paramArray:Array<any> = ['userid','userroleid'];
const matchArray:any = new RegExp(/^\/sysusers\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysusers\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -201,16 +201,16 @@ mock.onPost(new RegExp(/^\/sysusers\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a- ...@@ -201,16 +201,16 @@ mock.onPost(new RegExp(/^\/sysusers\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-
}); });
// CheckKey // Create
mock.onPost(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuserrole 方法: CheckKey"); console.groupCollapsed("实体:sysuserrole 方法: Create");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['roleid','userroleid']; const paramArray:Array<any> = ['roleid','userroleid'];
const matchArray:any = new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -227,16 +227,16 @@ mock.onPost(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a- ...@@ -227,16 +227,16 @@ mock.onPost(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-
return [status, {}]; return [status, {}];
}); });
// CheckKey // Create
mock.onPost(new RegExp(/^\/sysuserroles\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/sysuserroles\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuserrole 方法: CheckKey"); console.groupCollapsed("实体:sysuserrole 方法: Create");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['userroleid']; const paramArray:Array<any> = ['userroleid'];
const matchArray:any = new RegExp(/^\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -246,73 +246,11 @@ mock.onPost(new RegExp(/^\/sysuserroles\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)). ...@@ -246,73 +246,11 @@ mock.onPost(new RegExp(/^\/sysuserroles\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).
}); });
}); });
} }
//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];
});
// GetDraft
mock.onGet(new RegExp(/^\/sysusers\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuserrole 方法: 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, {}];
});
// GetDraft
mock.onGet(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuserrole 方法: 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.groupCollapsed("response数据 status: "+status+" data: ");
console.table({}); console.table(mockDatas[0]);
console.groupEnd();
console.groupEnd();
return [status, {}];
});
// GetDraft
mock.onGet(new RegExp(/^\/sysuserroles\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuserrole 方法: 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();
console.groupEnd(); console.groupEnd();
return [status, {}]; return [status, mockDatas[0]];
}); });
...@@ -410,16 +348,68 @@ mock.onPut(new RegExp(/^\/sysuserroles\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((conf ...@@ -410,16 +348,68 @@ mock.onPut(new RegExp(/^\/sysuserroles\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((conf
// Create
mock.onPost(new RegExp(/^\/sysusers\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuserrole 方法: Create"); // GetDraft
mock.onGet(new RegExp(/^\/sysusers\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuserrole 方法: 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, {}];
});
// GetDraft
mock.onGet(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuserrole 方法: 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, {}];
});
// GetDraft
mock.onGet(new RegExp(/^\/sysuserroles\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuserrole 方法: 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(/^\/sysusers\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuserrole 方法: CheckKey");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['userid','userroleid']; const paramArray:Array<any> = ['userid','userroleid'];
const matchArray:any = new RegExp(/^\/sysusers\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysusers\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -437,16 +427,16 @@ mock.onPost(new RegExp(/^\/sysusers\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a- ...@@ -437,16 +427,16 @@ mock.onPost(new RegExp(/^\/sysusers\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-
}); });
// Create // CheckKey
mock.onPost(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuserrole 方法: Create"); console.groupCollapsed("实体:sysuserrole 方法: CheckKey");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['roleid','userroleid']; const paramArray:Array<any> = ['roleid','userroleid'];
const matchArray:any = new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -463,16 +453,16 @@ mock.onPost(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a- ...@@ -463,16 +453,16 @@ mock.onPost(new RegExp(/^\/sysroles\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-
return [status, {}]; return [status, {}];
}); });
// Create // CheckKey
mock.onPost(new RegExp(/^\/sysuserroles\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/sysuserroles\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuserrole 方法: Create"); console.groupCollapsed("实体:sysuserrole 方法: CheckKey");
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);
if (status !== 200) { if (status !== 200) {
return [status, null]; return [status, null];
} }
const paramArray:Array<any> = ['userroleid']; const paramArray:Array<any> = ['userroleid'];
const matchArray:any = new RegExp(/^\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})$/).exec(config.url); const matchArray:any = new RegExp(/^\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})\/checkkey$/).exec(config.url);
let tempValue: any = {}; let tempValue: any = {};
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) => {
...@@ -482,16 +472,26 @@ mock.onPost(new RegExp(/^\/sysuserroles\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((con ...@@ -482,16 +472,26 @@ mock.onPost(new RegExp(/^\/sysuserroles\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((con
}); });
}); });
} }
//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.groupCollapsed("response数据 status: "+status+" data: ");
console.table(mockDatas[0]); console.table(data);
console.groupEnd(); console.groupEnd();
console.groupEnd(); console.groupEnd();
return [status, mockDatas[0]]; return [status, data];
}); });
// Save // Save
mock.onPost(new RegExp(/^\/sysusers\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})\/save$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/sysusers\/([a-zA-Z0-9\-\;]{1,35})\/sysuserroles\/([a-zA-Z0-9\-\;]{1,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuserrole 方法: Save"); console.groupCollapsed("实体:sysuserrole 方法: Save");
......
...@@ -115,6 +115,32 @@ mock.onGet(new RegExp(/^\/sysusers\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((c ...@@ -115,6 +115,32 @@ mock.onGet(new RegExp(/^\/sysusers\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).reply((c
return [status, _items]; return [status, _items];
}); });
// Create
mock.onPost(new RegExp(/^\/sysusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuser 方法: 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(/^\/sysusers\/([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 // Update
mock.onPut(new RegExp(/^\/sysusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => { mock.onPut(new RegExp(/^\/sysusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuser 方法: Update"); console.groupCollapsed("实体:sysuser 方法: Update");
...@@ -153,6 +179,22 @@ mock.onPut(new RegExp(/^\/sysusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: ...@@ -153,6 +179,22 @@ mock.onPut(new RegExp(/^\/sysusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config:
return [status, data]; return [status, data];
}); });
// GetDraft
mock.onGet(new RegExp(/^\/sysusers\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuser 方法: 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 // CheckKey
mock.onPost(new RegExp(/^\/sysusers\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => { mock.onPost(new RegExp(/^\/sysusers\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuser 方法: CheckKey"); console.groupCollapsed("实体:sysuser 方法: CheckKey");
...@@ -229,48 +271,6 @@ mock.onPost(new RegExp(/^\/sysusers\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((c ...@@ -229,48 +271,6 @@ mock.onPost(new RegExp(/^\/sysusers\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((c
return [status, data]; return [status, data];
}); });
// GetDraft
mock.onGet(new RegExp(/^\/sysusers\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuser 方法: 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(/^\/sysusers\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuser 方法: 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(/^\/sysusers\/([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(/^\/sysusers\/fetchdefault$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/sysusers\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:sysuser 方法: FetchDefault"); console.groupCollapsed("实体:sysuser 方法: FetchDefault");
......
...@@ -747,9 +747,18 @@ export default class SYS_PERMISSIONMPickupViewBase extends Vue { ...@@ -747,9 +747,18 @@ export default class SYS_PERMISSIONMPickupViewBase extends Vue {
newSelections.push(this.viewSelections[index]); newSelections.push(this.viewSelections[index]);
} }
}); });
this.viewSelections = newSelections; this.viewSelections = this.removeDuplicates([...newSelections,...this.viewSelections]);
}); });
this.selectedData = JSON.stringify(this.viewSelections); }
/**
* 去重
*
* @memberof SYS_PERMISSIONMPickupViewBase
*/
public removeDuplicates(data:any):Array<any> {
const uniqueSet = new Set(data);
return [...uniqueSet];
} }
/** /**
......
...@@ -747,9 +747,18 @@ export default class SYS_ROLE_PERMISSIONMPickupViewBase extends Vue { ...@@ -747,9 +747,18 @@ export default class SYS_ROLE_PERMISSIONMPickupViewBase extends Vue {
newSelections.push(this.viewSelections[index]); newSelections.push(this.viewSelections[index]);
} }
}); });
this.viewSelections = newSelections; this.viewSelections = this.removeDuplicates([...newSelections,...this.viewSelections]);
}); });
this.selectedData = JSON.stringify(this.viewSelections); }
/**
* 去重
*
* @memberof SYS_ROLE_PERMISSIONMPickupViewBase
*/
public removeDuplicates(data:any):Array<any> {
const uniqueSet = new Set(data);
return [...uniqueSet];
} }
/** /**
......
...@@ -747,9 +747,18 @@ export default class SYS_ROLEMPickupViewBase extends Vue { ...@@ -747,9 +747,18 @@ export default class SYS_ROLEMPickupViewBase extends Vue {
newSelections.push(this.viewSelections[index]); newSelections.push(this.viewSelections[index]);
} }
}); });
this.viewSelections = newSelections; this.viewSelections = this.removeDuplicates([...newSelections,...this.viewSelections]);
}); });
this.selectedData = JSON.stringify(this.viewSelections); }
/**
* 去重
*
* @memberof SYS_ROLEMPickupViewBase
*/
public removeDuplicates(data:any):Array<any> {
const uniqueSet = new Set(data);
return [...uniqueSet];
} }
/** /**
......
...@@ -747,9 +747,18 @@ export default class SYS_USER_ROLEMPickupViewBase extends Vue { ...@@ -747,9 +747,18 @@ export default class SYS_USER_ROLEMPickupViewBase extends Vue {
newSelections.push(this.viewSelections[index]); newSelections.push(this.viewSelections[index]);
} }
}); });
this.viewSelections = newSelections; this.viewSelections = this.removeDuplicates([...newSelections,...this.viewSelections]);
}); });
this.selectedData = JSON.stringify(this.viewSelections); }
/**
* 去重
*
* @memberof SYS_USER_ROLEMPickupViewBase
*/
public removeDuplicates(data:any):Array<any> {
const uniqueSet = new Set(data);
return [...uniqueSet];
} }
/** /**
......
...@@ -747,9 +747,18 @@ export default class SYS_USERMPickupViewBase extends Vue { ...@@ -747,9 +747,18 @@ export default class SYS_USERMPickupViewBase extends Vue {
newSelections.push(this.viewSelections[index]); newSelections.push(this.viewSelections[index]);
} }
}); });
this.viewSelections = newSelections; this.viewSelections = this.removeDuplicates([...newSelections,...this.viewSelections]);
}); });
this.selectedData = JSON.stringify(this.viewSelections); }
/**
* 去重
*
* @memberof SYS_USERMPickupViewBase
*/
public removeDuplicates(data:any):Array<any> {
const uniqueSet = new Set(data);
return [...uniqueSet];
} }
/** /**
......
...@@ -53,7 +53,7 @@ export default class SysAppServiceBase extends EntityService { ...@@ -53,7 +53,7 @@ export default class SysAppServiceBase extends EntityService {
} }
/** /**
* Remove接口方法 * Create接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -61,13 +61,22 @@ export default class SysAppServiceBase extends EntityService { ...@@ -61,13 +61,22 @@ export default class SysAppServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysAppServiceBase * @memberof SysAppServiceBase
*/ */
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/sysapps/${context.sysapp}`,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(`/sysapps`,data,isloading);
return res; return res;
} }
/** /**
* Get接口方法 * Update接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -75,13 +84,15 @@ export default class SysAppServiceBase extends EntityService { ...@@ -75,13 +84,15 @@ export default class SysAppServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysAppServiceBase * @memberof SysAppServiceBase
*/ */
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sysapps/${context.sysapp}`,isloading); let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/sysapps/${context.sysapp}`,data,isloading);
return res; return res;
} }
/** /**
* Save接口方法 * Remove接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -89,15 +100,13 @@ export default class SysAppServiceBase extends EntityService { ...@@ -89,15 +100,13 @@ export default class SysAppServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysAppServiceBase * @memberof SysAppServiceBase
*/ */
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let res:any = await Http.getInstance().delete(`/sysapps/${context.sysapp}`,isloading);
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/sysapps/${context.sysapp}/save`,data,isloading);
return res; return res;
} }
/** /**
* GetDraft接口方法 * Get接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -105,14 +114,13 @@ export default class SysAppServiceBase extends EntityService { ...@@ -105,14 +114,13 @@ export default class SysAppServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysAppServiceBase * @memberof SysAppServiceBase
*/ */
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sysapps/getdraft`,isloading); let res:any = await Http.getInstance().get(`/sysapps/${context.sysapp}`,isloading);
res.data.sysapp = data.sysapp;
return res; return res;
} }
/** /**
* CheckKey接口方法 * GetDraft接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -120,13 +128,14 @@ export default class SysAppServiceBase extends EntityService { ...@@ -120,13 +128,14 @@ export default class SysAppServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysAppServiceBase * @memberof SysAppServiceBase
*/ */
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/sysapps/${context.sysapp}/checkkey`,data,isloading); let res:any = await Http.getInstance().get(`/sysapps/getdraft`,isloading);
res.data.sysapp = data.sysapp;
return res; return res;
} }
/** /**
* Update接口方法 * CheckKey接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -134,15 +143,13 @@ export default class SysAppServiceBase extends EntityService { ...@@ -134,15 +143,13 @@ export default class SysAppServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysAppServiceBase * @memberof SysAppServiceBase
*/ */
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let res:any = await Http.getInstance().post(`/sysapps/${context.sysapp}/checkkey`,data,isloading);
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/sysapps/${context.sysapp}`,data,isloading);
return res; return res;
} }
/** /**
* Create接口方法 * Save接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -150,17 +157,10 @@ export default class SysAppServiceBase extends EntityService { ...@@ -150,17 +157,10 @@ export default class SysAppServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysAppServiceBase * @memberof SysAppServiceBase
*/ */
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let masterData:any = {};
Object.assign(data,masterData); Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){ let res:any = await Http.getInstance().post(`/sysapps/${context.sysapp}/save`,data,isloading);
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(`/sysapps`,data,isloading);
return res; return res;
} }
......
...@@ -53,7 +53,7 @@ export default class SysAuthLogServiceBase extends EntityService { ...@@ -53,7 +53,7 @@ export default class SysAuthLogServiceBase extends EntityService {
} }
/** /**
* GetDraft接口方法 * Create接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -61,9 +61,17 @@ export default class SysAuthLogServiceBase extends EntityService { ...@@ -61,9 +61,17 @@ export default class SysAuthLogServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysAuthLogServiceBase * @memberof SysAuthLogServiceBase
*/ */
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sysauthlogs/getdraft`,isloading); let masterData:any = {};
res.data.sysauthlog = data.sysauthlog; 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(`/sysauthlogs`,data,isloading);
return res; return res;
} }
...@@ -98,7 +106,7 @@ export default class SysAuthLogServiceBase extends EntityService { ...@@ -98,7 +106,7 @@ export default class SysAuthLogServiceBase extends EntityService {
} }
/** /**
* Create接口方法 * Get接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -106,22 +114,13 @@ export default class SysAuthLogServiceBase extends EntityService { ...@@ -106,22 +114,13 @@ export default class SysAuthLogServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysAuthLogServiceBase * @memberof SysAuthLogServiceBase
*/ */
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let res:any = await Http.getInstance().get(`/sysauthlogs/${context.sysauthlog}`,isloading);
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(`/sysauthlogs`,data,isloading);
return res; return res;
} }
/** /**
* CheckKey接口方法 * GetDraft接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -129,13 +128,14 @@ export default class SysAuthLogServiceBase extends EntityService { ...@@ -129,13 +128,14 @@ export default class SysAuthLogServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysAuthLogServiceBase * @memberof SysAuthLogServiceBase
*/ */
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/sysauthlogs/${context.sysauthlog}/checkkey`,data,isloading); let res:any = await Http.getInstance().get(`/sysauthlogs/getdraft`,isloading);
res.data.sysauthlog = data.sysauthlog;
return res; return res;
} }
/** /**
* Get接口方法 * CheckKey接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -143,8 +143,8 @@ export default class SysAuthLogServiceBase extends EntityService { ...@@ -143,8 +143,8 @@ export default class SysAuthLogServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysAuthLogServiceBase * @memberof SysAuthLogServiceBase
*/ */
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sysauthlogs/${context.sysauthlog}`,isloading); let res:any = await Http.getInstance().post(`/sysauthlogs/${context.sysauthlog}/checkkey`,data,isloading);
return res; return res;
} }
......
...@@ -53,7 +53,7 @@ export default class SysPermissionServiceBase extends EntityService { ...@@ -53,7 +53,7 @@ export default class SysPermissionServiceBase extends EntityService {
} }
/** /**
* Save接口方法 * Create接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -61,7 +61,7 @@ export default class SysPermissionServiceBase extends EntityService { ...@@ -61,7 +61,7 @@ export default class SysPermissionServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysPermissionServiceBase * @memberof SysPermissionServiceBase
*/ */
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let masterData:any = {};
let sysrolepermissionsData:any = []; let sysrolepermissionsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions'),'undefined')){
...@@ -79,13 +79,20 @@ export default class SysPermissionServiceBase extends EntityService { ...@@ -79,13 +79,20 @@ export default class SysPermissionServiceBase extends EntityService {
} }
masterData.sysrolepermissions = sysrolepermissionsData; masterData.sysrolepermissions = sysrolepermissionsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/syspermissions/${context.syspermission}/save`,data,isloading); if(!data.srffrontuf || data.srffrontuf !== "1"){
this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions)); 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(`/syspermissions`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
return res; return res;
} }
/** /**
* GetDraft接口方法 * Update接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -93,9 +100,25 @@ export default class SysPermissionServiceBase extends EntityService { ...@@ -93,9 +100,25 @@ export default class SysPermissionServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysPermissionServiceBase * @memberof SysPermissionServiceBase
*/ */
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/syspermissions/getdraft`,isloading); let masterData:any = {};
res.data.syspermission = data.syspermission; let sysrolepermissionsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions'),'undefined')){
sysrolepermissionsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions') as any);
if(sysrolepermissionsData && sysrolepermissionsData.length && sysrolepermissionsData.length > 0){
sysrolepermissionsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.rolepermissionid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.sysrolepermissions = sysrolepermissionsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/syspermissions/${context.syspermission}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions)); this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
return res; return res;
} }
...@@ -115,7 +138,7 @@ export default class SysPermissionServiceBase extends EntityService { ...@@ -115,7 +138,7 @@ export default class SysPermissionServiceBase extends EntityService {
} }
/** /**
* Update接口方法 * Get接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -123,31 +146,14 @@ export default class SysPermissionServiceBase extends EntityService { ...@@ -123,31 +146,14 @@ export default class SysPermissionServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysPermissionServiceBase * @memberof SysPermissionServiceBase
*/ */
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let res:any = await Http.getInstance().get(`/syspermissions/${context.syspermission}`,isloading);
let sysrolepermissionsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions'),'undefined')){
sysrolepermissionsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions') as any);
if(sysrolepermissionsData && sysrolepermissionsData.length && sysrolepermissionsData.length > 0){
sysrolepermissionsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.rolepermissionid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.sysrolepermissions = sysrolepermissionsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/syspermissions/${context.syspermission}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions)); this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
return res; return res;
} }
/** /**
* Create接口方法 * GetDraft接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -155,33 +161,10 @@ export default class SysPermissionServiceBase extends EntityService { ...@@ -155,33 +161,10 @@ export default class SysPermissionServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysPermissionServiceBase * @memberof SysPermissionServiceBase
*/ */
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let res:any = await Http.getInstance().get(`/syspermissions/getdraft`,isloading);
let sysrolepermissionsData:any = []; res.data.syspermission = data.syspermission;
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions'),'undefined')){ this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
sysrolepermissionsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions') as any);
if(sysrolepermissionsData && sysrolepermissionsData.length && sysrolepermissionsData.length > 0){
sysrolepermissionsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.rolepermissionid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.sysrolepermissions = sysrolepermissionsData;
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(`/syspermissions`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
return res; return res;
} }
...@@ -200,7 +183,7 @@ export default class SysPermissionServiceBase extends EntityService { ...@@ -200,7 +183,7 @@ export default class SysPermissionServiceBase extends EntityService {
} }
/** /**
* Get接口方法 * Save接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -208,8 +191,25 @@ export default class SysPermissionServiceBase extends EntityService { ...@@ -208,8 +191,25 @@ export default class SysPermissionServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysPermissionServiceBase * @memberof SysPermissionServiceBase
*/ */
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/syspermissions/${context.syspermission}`,isloading); let masterData:any = {};
let sysrolepermissionsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions'),'undefined')){
sysrolepermissionsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions') as any);
if(sysrolepermissionsData && sysrolepermissionsData.length && sysrolepermissionsData.length > 0){
sysrolepermissionsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.rolepermissionid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.sysrolepermissions = sysrolepermissionsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/syspermissions/${context.syspermission}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions)); this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
return res; return res;
} }
......
...@@ -59,7 +59,7 @@ export default class SysRolePermissionServiceBase extends EntityService { ...@@ -59,7 +59,7 @@ export default class SysRolePermissionServiceBase extends EntityService {
} }
/** /**
* Get接口方法 * Create接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -67,14 +67,67 @@ export default class SysRolePermissionServiceBase extends EntityService { ...@@ -67,14 +67,67 @@ export default class SysRolePermissionServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysRolePermissionServiceBase * @memberof SysRolePermissionServiceBase
*/ */
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysrole && true){
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(`/sysroles/${context.sysrole}/sysrolepermissions`,data,isloading);
}
if(context.syspermission && true){
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(`/syspermissions/${context.syspermission}/sysrolepermissions`,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(`/sysrolepermissions`,data,isloading);
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysRolePermissionServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysrole && context.sysrolepermission){ if(context.sysrole && context.sysrolepermission){
let res:any = await Http.getInstance().get(`/sysroles/${context.sysrole}/sysrolepermissions/${context.sysrolepermission}`,isloading); let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/sysroles/${context.sysrole}/sysrolepermissions/${context.sysrolepermission}`,data,isloading);
} }
if(context.syspermission && context.sysrolepermission){ if(context.syspermission && context.sysrolepermission){
let res:any = await Http.getInstance().get(`/syspermissions/${context.syspermission}/sysrolepermissions/${context.sysrolepermission}`,isloading); let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/syspermissions/${context.syspermission}/sysrolepermissions/${context.sysrolepermission}`,data,isloading);
} }
let res:any = await Http.getInstance().get(`/sysrolepermissions/${context.sysrolepermission}`,isloading); let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/sysrolepermissions/${context.sysrolepermission}`,data,isloading);
return res; return res;
} }
...@@ -99,7 +152,7 @@ export default class SysRolePermissionServiceBase extends EntityService { ...@@ -99,7 +152,7 @@ export default class SysRolePermissionServiceBase extends EntityService {
} }
/** /**
* GetDraft接口方法 * Get接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -107,22 +160,19 @@ export default class SysRolePermissionServiceBase extends EntityService { ...@@ -107,22 +160,19 @@ export default class SysRolePermissionServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysRolePermissionServiceBase * @memberof SysRolePermissionServiceBase
*/ */
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysrole && true){ if(context.sysrole && context.sysrolepermission){
let res:any = await Http.getInstance().get(`/sysroles/${context.sysrole}/sysrolepermissions/getdraft`,isloading); let res:any = await Http.getInstance().get(`/sysroles/${context.sysrole}/sysrolepermissions/${context.sysrolepermission}`,isloading);
res.data.sysrolepermission = data.sysrolepermission;
} }
if(context.syspermission && true){ if(context.syspermission && context.sysrolepermission){
let res:any = await Http.getInstance().get(`/syspermissions/${context.syspermission}/sysrolepermissions/getdraft`,isloading); let res:any = await Http.getInstance().get(`/syspermissions/${context.syspermission}/sysrolepermissions/${context.sysrolepermission}`,isloading);
res.data.sysrolepermission = data.sysrolepermission;
} }
let res:any = await Http.getInstance().get(`/sysrolepermissions/getdraft`,isloading); let res:any = await Http.getInstance().get(`/sysrolepermissions/${context.sysrolepermission}`,isloading);
res.data.sysrolepermission = data.sysrolepermission;
return res; return res;
} }
/** /**
* Create接口方法 * GetDraft接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -130,41 +180,17 @@ export default class SysRolePermissionServiceBase extends EntityService { ...@@ -130,41 +180,17 @@ export default class SysRolePermissionServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysRolePermissionServiceBase * @memberof SysRolePermissionServiceBase
*/ */
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysrole && true){ if(context.sysrole && true){
let masterData:any = {}; let res:any = await Http.getInstance().get(`/sysroles/${context.sysrole}/sysrolepermissions/getdraft`,isloading);
Object.assign(data,masterData); res.data.sysrolepermission = data.sysrolepermission;
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(`/sysroles/${context.sysrole}/sysrolepermissions`,data,isloading);
} }
if(context.syspermission && true){ if(context.syspermission && true){
let masterData:any = {}; let res:any = await Http.getInstance().get(`/syspermissions/${context.syspermission}/sysrolepermissions/getdraft`,isloading);
Object.assign(data,masterData); res.data.sysrolepermission = data.sysrolepermission;
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(`/syspermissions/${context.syspermission}/sysrolepermissions`,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().get(`/sysrolepermissions/getdraft`,isloading);
let res:any = await Http.getInstance().post(`/sysrolepermissions`,data,isloading); res.data.sysrolepermission = data.sysrolepermission;
return res; return res;
} }
...@@ -218,32 +244,6 @@ export default class SysRolePermissionServiceBase extends EntityService { ...@@ -218,32 +244,6 @@ export default class SysRolePermissionServiceBase extends EntityService {
return res; return res;
} }
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysRolePermissionServiceBase
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysrole && context.sysrolepermission){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/sysroles/${context.sysrole}/sysrolepermissions/${context.sysrolepermission}`,data,isloading);
}
if(context.syspermission && context.sysrolepermission){
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/syspermissions/${context.syspermission}/sysrolepermissions/${context.sysrolepermission}`,data,isloading);
}
let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/sysrolepermissions/${context.sysrolepermission}`,data,isloading);
return res;
}
/** /**
* FetchDefault接口方法 * FetchDefault接口方法
* *
......
...@@ -53,7 +53,7 @@ export default class SysRoleServiceBase extends EntityService { ...@@ -53,7 +53,7 @@ export default class SysRoleServiceBase extends EntityService {
} }
/** /**
* Save接口方法 * Create接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -61,7 +61,7 @@ export default class SysRoleServiceBase extends EntityService { ...@@ -61,7 +61,7 @@ export default class SysRoleServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysRoleServiceBase * @memberof SysRoleServiceBase
*/ */
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let masterData:any = {};
let sysrolepermissionsData:any = []; let sysrolepermissionsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions'),'undefined')){
...@@ -94,9 +94,16 @@ export default class SysRoleServiceBase extends EntityService { ...@@ -94,9 +94,16 @@ export default class SysRoleServiceBase extends EntityService {
} }
masterData.sysuserroles = sysuserrolesData; masterData.sysuserroles = sysuserrolesData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/sysroles/${context.sysrole}/save`,data,isloading); if(!data.srffrontuf || data.srffrontuf !== "1"){
this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions)); data[this.APPDEKEY] = null;
this.tempStorage.setItem(context.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles)); }
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/sysroles`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
this.tempStorage.setItem(tempContext.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
return res; return res;
} }
...@@ -149,7 +156,7 @@ export default class SysRoleServiceBase extends EntityService { ...@@ -149,7 +156,7 @@ export default class SysRoleServiceBase extends EntityService {
} }
/** /**
* Create接口方法 * Remove接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -157,49 +164,8 @@ export default class SysRoleServiceBase extends EntityService { ...@@ -157,49 +164,8 @@ export default class SysRoleServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysRoleServiceBase * @memberof SysRoleServiceBase
*/ */
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let res:any = await Http.getInstance().delete(`/sysroles/${context.sysrole}`,isloading);
let sysrolepermissionsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions'),'undefined')){
sysrolepermissionsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions') as any);
if(sysrolepermissionsData && sysrolepermissionsData.length && sysrolepermissionsData.length > 0){
sysrolepermissionsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.rolepermissionid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.sysrolepermissions = sysrolepermissionsData;
let sysuserrolesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysuserroles'),'undefined')){
sysuserrolesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_sysuserroles') as any);
if(sysuserrolesData && sysuserrolesData.length && sysuserrolesData.length > 0){
sysuserrolesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.userroleid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.sysuserroles = sysuserrolesData;
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(`/sysroles`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
this.tempStorage.setItem(tempContext.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
return res; return res;
} }
...@@ -220,7 +186,7 @@ export default class SysRoleServiceBase extends EntityService { ...@@ -220,7 +186,7 @@ export default class SysRoleServiceBase extends EntityService {
} }
/** /**
* Remove接口方法 * GetDraft接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -228,13 +194,16 @@ export default class SysRoleServiceBase extends EntityService { ...@@ -228,13 +194,16 @@ export default class SysRoleServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysRoleServiceBase * @memberof SysRoleServiceBase
*/ */
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/sysroles/${context.sysrole}`,isloading); let res:any = await Http.getInstance().get(`/sysroles/getdraft`,isloading);
res.data.sysrole = data.sysrole;
this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
this.tempStorage.setItem(context.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
return res; return res;
} }
/** /**
* GetDraft接口方法 * CheckKey接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -242,16 +211,13 @@ export default class SysRoleServiceBase extends EntityService { ...@@ -242,16 +211,13 @@ export default class SysRoleServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysRoleServiceBase * @memberof SysRoleServiceBase
*/ */
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sysroles/getdraft`,isloading); let res:any = await Http.getInstance().post(`/sysroles/${context.sysrole}/checkkey`,data,isloading);
res.data.sysrole = data.sysrole;
this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
this.tempStorage.setItem(context.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
return res; return res;
} }
/** /**
* CheckKey接口方法 * Save接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -259,8 +225,42 @@ export default class SysRoleServiceBase extends EntityService { ...@@ -259,8 +225,42 @@ export default class SysRoleServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysRoleServiceBase * @memberof SysRoleServiceBase
*/ */
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/sysroles/${context.sysrole}/checkkey`,data,isloading); let masterData:any = {};
let sysrolepermissionsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions'),'undefined')){
sysrolepermissionsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_sysrolepermissions') as any);
if(sysrolepermissionsData && sysrolepermissionsData.length && sysrolepermissionsData.length > 0){
sysrolepermissionsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.rolepermissionid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.sysrolepermissions = sysrolepermissionsData;
let sysuserrolesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysuserroles'),'undefined')){
sysuserrolesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_sysuserroles') as any);
if(sysuserrolesData && sysuserrolesData.length && sysuserrolesData.length > 0){
sysuserrolesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.userroleid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.sysuserroles = sysuserrolesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/sysroles/${context.sysrole}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_sysrolepermissions',JSON.stringify(res.data.sysrolepermissions));
this.tempStorage.setItem(context.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
return res; return res;
} }
......
...@@ -59,7 +59,7 @@ export default class SysUserRoleServiceBase extends EntityService { ...@@ -59,7 +59,7 @@ export default class SysUserRoleServiceBase extends EntityService {
} }
/** /**
* CheckKey接口方法 * Create接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -67,41 +67,41 @@ export default class SysUserRoleServiceBase extends EntityService { ...@@ -67,41 +67,41 @@ export default class SysUserRoleServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysUserRoleServiceBase * @memberof SysUserRoleServiceBase
*/ */
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysuser && context.sysuserrole){ if(context.sysuser && true){
let masterData:any = {}; let masterData:any = {};
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/sysusers/${context.sysuser}/sysuserroles/${context.sysuserrole}/checkkey`,data,isloading); if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
} }
if(context.sysrole && context.sysuserrole){ if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/sysusers/${context.sysuser}/sysuserroles`,data,isloading);
}
if(context.sysrole && true){
let masterData:any = {}; let masterData:any = {};
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/sysroles/${context.sysrole}/sysuserroles/${context.sysuserrole}/checkkey`,data,isloading); if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
} }
let res:any = await Http.getInstance().post(`/sysuserroles/${context.sysuserrole}/checkkey`,data,isloading); if(data.srffrontuf){
return res; delete data.srffrontuf;
} }
let tempContext:any = JSON.parse(JSON.stringify(context));
/** let res:any = await Http.getInstance().post(`/sysroles/${context.sysrole}/sysuserroles`,data,isloading);
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysUserRoleServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysuser && true){
let res:any = await Http.getInstance().get(`/sysusers/${context.sysuser}/sysuserroles/getdraft`,isloading);
res.data.sysuserrole = data.sysuserrole;
} }
if(context.sysrole && true){ let masterData:any = {};
let res:any = await Http.getInstance().get(`/sysroles/${context.sysrole}/sysuserroles/getdraft`,isloading); Object.assign(data,masterData);
res.data.sysuserrole = data.sysuserrole; if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
} }
let res:any = await Http.getInstance().get(`/sysuserroles/getdraft`,isloading); if(data.srffrontuf){
res.data.sysuserrole = data.sysuserrole; delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/sysuserroles`,data,isloading);
return res; return res;
} }
...@@ -152,7 +152,7 @@ export default class SysUserRoleServiceBase extends EntityService { ...@@ -152,7 +152,7 @@ export default class SysUserRoleServiceBase extends EntityService {
} }
/** /**
* Create接口方法 * Get接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -160,46 +160,42 @@ export default class SysUserRoleServiceBase extends EntityService { ...@@ -160,46 +160,42 @@ export default class SysUserRoleServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysUserRoleServiceBase * @memberof SysUserRoleServiceBase
*/ */
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysuser && true){ if(context.sysuser && context.sysuserrole){
let masterData:any = {}; let res:any = await Http.getInstance().get(`/sysusers/${context.sysuser}/sysuserroles/${context.sysuserrole}`,isloading);
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(`/sysusers/${context.sysuser}/sysuserroles`,data,isloading);
}
if(context.sysrole && true){
let masterData:any = {};
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
} }
if(data.srffrontuf){ if(context.sysrole && context.sysuserrole){
delete data.srffrontuf; let res:any = await Http.getInstance().get(`/sysroles/${context.sysrole}/sysuserroles/${context.sysuserrole}`,isloading);
} }
let tempContext:any = JSON.parse(JSON.stringify(context)); let res:any = await Http.getInstance().get(`/sysuserroles/${context.sysuserrole}`,isloading);
let res:any = await Http.getInstance().post(`/sysroles/${context.sysrole}/sysuserroles`,data,isloading); return res;
} }
let masterData:any = {};
Object.assign(data,masterData); /**
if(!data.srffrontuf || data.srffrontuf !== "1"){ * GetDraft接口方法
data[this.APPDEKEY] = null; *
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof SysUserRoleServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysuser && true){
let res:any = await Http.getInstance().get(`/sysusers/${context.sysuser}/sysuserroles/getdraft`,isloading);
res.data.sysuserrole = data.sysuserrole;
} }
if(data.srffrontuf){ if(context.sysrole && true){
delete data.srffrontuf; let res:any = await Http.getInstance().get(`/sysroles/${context.sysrole}/sysuserroles/getdraft`,isloading);
res.data.sysuserrole = data.sysuserrole;
} }
let tempContext:any = JSON.parse(JSON.stringify(context)); let res:any = await Http.getInstance().get(`/sysuserroles/getdraft`,isloading);
let res:any = await Http.getInstance().post(`/sysuserroles`,data,isloading); res.data.sysuserrole = data.sysuserrole;
return res; return res;
} }
/** /**
* Get接口方法 * CheckKey接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -207,14 +203,18 @@ export default class SysUserRoleServiceBase extends EntityService { ...@@ -207,14 +203,18 @@ export default class SysUserRoleServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysUserRoleServiceBase * @memberof SysUserRoleServiceBase
*/ */
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.sysuser && context.sysuserrole){ if(context.sysuser && context.sysuserrole){
let res:any = await Http.getInstance().get(`/sysusers/${context.sysuser}/sysuserroles/${context.sysuserrole}`,isloading); let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/sysusers/${context.sysuser}/sysuserroles/${context.sysuserrole}/checkkey`,data,isloading);
} }
if(context.sysrole && context.sysuserrole){ if(context.sysrole && context.sysuserrole){
let res:any = await Http.getInstance().get(`/sysroles/${context.sysrole}/sysuserroles/${context.sysuserrole}`,isloading); let masterData:any = {};
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/sysroles/${context.sysrole}/sysuserroles/${context.sysuserrole}/checkkey`,data,isloading);
} }
let res:any = await Http.getInstance().get(`/sysuserroles/${context.sysuserrole}`,isloading); let res:any = await Http.getInstance().post(`/sysuserroles/${context.sysuserrole}/checkkey`,data,isloading);
return res; return res;
} }
......
...@@ -53,7 +53,7 @@ export default class SysUserServiceBase extends EntityService { ...@@ -53,7 +53,7 @@ export default class SysUserServiceBase extends EntityService {
} }
/** /**
* Remove接口方法 * Create接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -61,8 +61,33 @@ export default class SysUserServiceBase extends EntityService { ...@@ -61,8 +61,33 @@ export default class SysUserServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysUserServiceBase * @memberof SysUserServiceBase
*/ */
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().delete(`/sysusers/${context.sysuser}`,isloading); let masterData:any = {};
let sysuserrolesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysuserroles'),'undefined')){
sysuserrolesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_sysuserroles') as any);
if(sysuserrolesData && sysuserrolesData.length && sysuserrolesData.length > 0){
sysuserrolesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.userroleid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.sysuserroles = sysuserrolesData;
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(`/sysusers`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
return res; return res;
} }
...@@ -99,7 +124,7 @@ export default class SysUserServiceBase extends EntityService { ...@@ -99,7 +124,7 @@ export default class SysUserServiceBase extends EntityService {
} }
/** /**
* CheckKey接口方法 * Remove接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -107,8 +132,8 @@ export default class SysUserServiceBase extends EntityService { ...@@ -107,8 +132,8 @@ export default class SysUserServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysUserServiceBase * @memberof SysUserServiceBase
*/ */
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().post(`/sysusers/${context.sysuser}/checkkey`,data,isloading); let res:any = await Http.getInstance().delete(`/sysusers/${context.sysuser}`,isloading);
return res; return res;
} }
...@@ -128,7 +153,7 @@ export default class SysUserServiceBase extends EntityService { ...@@ -128,7 +153,7 @@ export default class SysUserServiceBase extends EntityService {
} }
/** /**
* Save接口方法 * GetDraft接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -136,31 +161,15 @@ export default class SysUserServiceBase extends EntityService { ...@@ -136,31 +161,15 @@ export default class SysUserServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysUserServiceBase * @memberof SysUserServiceBase
*/ */
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let res:any = await Http.getInstance().get(`/sysusers/getdraft`,isloading);
let sysuserrolesData:any = []; res.data.sysuser = data.sysuser;
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysuserroles'),'undefined')){
sysuserrolesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_sysuserroles') as any);
if(sysuserrolesData && sysuserrolesData.length && sysuserrolesData.length > 0){
sysuserrolesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.userroleid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.sysuserroles = sysuserrolesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/sysusers/${context.sysuser}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles)); this.tempStorage.setItem(context.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
return res; return res;
} }
/** /**
* GetDraft接口方法 * CheckKey接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -168,15 +177,13 @@ export default class SysUserServiceBase extends EntityService { ...@@ -168,15 +177,13 @@ export default class SysUserServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysUserServiceBase * @memberof SysUserServiceBase
*/ */
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/sysusers/getdraft`,isloading); let res:any = await Http.getInstance().post(`/sysusers/${context.sysuser}/checkkey`,data,isloading);
res.data.sysuser = data.sysuser;
this.tempStorage.setItem(context.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
return res; return res;
} }
/** /**
* Create接口方法 * Save接口方法
* *
* @param {*} [context={}] * @param {*} [context={}]
* @param {*} [data={}] * @param {*} [data={}]
...@@ -184,7 +191,7 @@ export default class SysUserServiceBase extends EntityService { ...@@ -184,7 +191,7 @@ export default class SysUserServiceBase extends EntityService {
* @returns {Promise<any>} * @returns {Promise<any>}
* @memberof SysUserServiceBase * @memberof SysUserServiceBase
*/ */
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let masterData:any = {};
let sysuserrolesData:any = []; let sysuserrolesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysuserroles'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_sysuserroles'),'undefined')){
...@@ -202,15 +209,8 @@ export default class SysUserServiceBase extends EntityService { ...@@ -202,15 +209,8 @@ export default class SysUserServiceBase extends EntityService {
} }
masterData.sysuserroles = sysuserrolesData; masterData.sysuserroles = sysuserrolesData;
Object.assign(data,masterData); Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){ let res:any = await Http.getInstance().post(`/sysusers/${context.sysuser}/save`,data,isloading);
data[this.APPDEKEY] = null; this.tempStorage.setItem(context.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/sysusers`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_sysuserroles',JSON.stringify(res.data.sysuserroles));
return res; return res;
} }
......
package cn.ibizlab.core.extensions.service;
import cn.ibizlab.core.uaa.service.impl.SysPSSystemServiceImpl;
import lombok.extern.slf4j.Slf4j;
import cn.ibizlab.core.uaa.domain.SysPSSystem;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.context.annotation.Primary;
import java.util.*;
/**
* 实体[系统] 自定义服务对象
*/
@Slf4j
@Primary
@Service("SysPSSystemServiceEx")
public class SysPSSystemServiceEx extends SysPSSystemServiceImpl {
@Override
protected Class currentModelClass() {
return com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(this.getClass().getSuperclass(), 1);
}
/**
* 自定义行为[PrepareApps]用户扩展
* @param et
* @return
*/
@Override
@Transactional
public SysPSSystem prepareApps(SysPSSystem et) {
return super.prepareApps(et);
}
/**
* 自定义行为[SyncPermission]用户扩展
* @param et
* @return
*/
@Override
@Transactional
public SysPSSystem syncPermission(SysPSSystem et) {
return super.syncPermission(et);
}
}
...@@ -19,8 +19,8 @@ import com.alibaba.fastjson.JSONObject; ...@@ -19,8 +19,8 @@ import com.alibaba.fastjson.JSONObject;
public interface SysPSSystemMapper extends BaseMapper<SysPSSystem>{ public interface SysPSSystemMapper extends BaseMapper<SysPSSystem>{
Page<SysPSSystem> searchPick(IPage page, @Param("srf") SysPSSystemSearchContext context, @Param("ew") Wrapper<SysPSSystem> wrapper) ;
Page<SysPSSystem> searchDefault(IPage page, @Param("srf") SysPSSystemSearchContext context, @Param("ew") Wrapper<SysPSSystem> wrapper) ; Page<SysPSSystem> searchDefault(IPage page, @Param("srf") SysPSSystemSearchContext context, @Param("ew") Wrapper<SysPSSystem> wrapper) ;
Page<SysPSSystem> searchPick(IPage page, @Param("srf") SysPSSystemSearchContext context, @Param("ew") Wrapper<SysPSSystem> wrapper) ;
@Override @Override
SysPSSystem selectById(Serializable id); SysPSSystem selectById(Serializable id);
@Override @Override
......
...@@ -23,17 +23,17 @@ import cn.ibizlab.core.uaa.filter.SysAppSearchContext; ...@@ -23,17 +23,17 @@ import cn.ibizlab.core.uaa.filter.SysAppSearchContext;
*/ */
public interface ISysAppService{ public interface ISysAppService{
boolean create(SysApp et) ;
void createBatch(List<SysApp> list) ;
boolean update(SysApp et) ;
void updateBatch(List<SysApp> list) ;
boolean remove(String key) ; boolean remove(String key) ;
void removeBatch(Collection<String> idList) ; void removeBatch(Collection<String> idList) ;
SysApp get(String key) ; SysApp get(String key) ;
boolean save(SysApp et) ;
void saveBatch(List<SysApp> list) ;
SysApp getDraft(SysApp et) ; SysApp getDraft(SysApp et) ;
boolean checkKey(SysApp et) ; boolean checkKey(SysApp et) ;
boolean update(SysApp et) ; boolean save(SysApp et) ;
void updateBatch(List<SysApp> list) ; void saveBatch(List<SysApp> list) ;
boolean create(SysApp et) ;
void createBatch(List<SysApp> list) ;
Page<SysApp> searchDefault(SysAppSearchContext context) ; Page<SysApp> searchDefault(SysAppSearchContext context) ;
List<SysApp> selectBySystemid(String pssystemid) ; List<SysApp> selectBySystemid(String pssystemid) ;
void removeBySystemid(String pssystemid) ; void removeBySystemid(String pssystemid) ;
......
...@@ -25,15 +25,15 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -25,15 +25,15 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface ISysAuthLogService extends IService<SysAuthLog>{ public interface ISysAuthLogService extends IService<SysAuthLog>{
SysAuthLog getDraft(SysAuthLog et) ; boolean create(SysAuthLog et) ;
void createBatch(List<SysAuthLog> list) ;
boolean update(SysAuthLog et) ; boolean update(SysAuthLog et) ;
void updateBatch(List<SysAuthLog> list) ; void updateBatch(List<SysAuthLog> list) ;
boolean remove(String key) ; boolean remove(String key) ;
void removeBatch(Collection<String> idList) ; void removeBatch(Collection<String> idList) ;
boolean create(SysAuthLog et) ;
void createBatch(List<SysAuthLog> list) ;
boolean checkKey(SysAuthLog et) ;
SysAuthLog get(String key) ; SysAuthLog get(String key) ;
SysAuthLog getDraft(SysAuthLog et) ;
boolean checkKey(SysAuthLog et) ;
boolean save(SysAuthLog et) ; boolean save(SysAuthLog et) ;
void saveBatch(List<SysAuthLog> list) ; void saveBatch(List<SysAuthLog> list) ;
Page<SysAuthLog> searchDefault(SysAuthLogSearchContext context) ; Page<SysAuthLog> searchDefault(SysAuthLogSearchContext context) ;
......
...@@ -25,19 +25,21 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -25,19 +25,21 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface ISysPSSystemService extends IService<SysPSSystem>{ public interface ISysPSSystemService extends IService<SysPSSystem>{
boolean checkKey(SysPSSystem et) ;
SysPSSystem get(String key) ;
boolean create(SysPSSystem et) ; boolean create(SysPSSystem et) ;
void createBatch(List<SysPSSystem> list) ; void createBatch(List<SysPSSystem> list) ;
SysPSSystem getDraft(SysPSSystem et) ; boolean update(SysPSSystem et) ;
void updateBatch(List<SysPSSystem> list) ;
boolean remove(String key) ; boolean remove(String key) ;
void removeBatch(Collection<String> idList) ; void removeBatch(Collection<String> idList) ;
SysPSSystem get(String key) ;
SysPSSystem getDraft(SysPSSystem et) ;
boolean checkKey(SysPSSystem et) ;
SysPSSystem prepareApps(SysPSSystem et) ;
boolean save(SysPSSystem et) ; boolean save(SysPSSystem et) ;
void saveBatch(List<SysPSSystem> list) ; void saveBatch(List<SysPSSystem> list) ;
boolean update(SysPSSystem et) ; SysPSSystem syncPermission(SysPSSystem et) ;
void updateBatch(List<SysPSSystem> list) ;
Page<SysPSSystem> searchPick(SysPSSystemSearchContext context) ;
Page<SysPSSystem> searchDefault(SysPSSystemSearchContext context) ; Page<SysPSSystem> searchDefault(SysPSSystemSearchContext context) ;
Page<SysPSSystem> searchPick(SysPSSystemSearchContext context) ;
/** /**
*自定义查询SQL *自定义查询SQL
* @param sql select * from table where id =#{et.param} * @param sql select * from table where id =#{et.param}
......
...@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface ISysPermissionService extends IService<SysPermission>{ public interface ISysPermissionService extends IService<SysPermission>{
boolean save(SysPermission et) ;
void saveBatch(List<SysPermission> list) ;
SysPermission getDraft(SysPermission et) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
boolean update(SysPermission et) ;
void updateBatch(List<SysPermission> list) ;
boolean create(SysPermission et) ; boolean create(SysPermission et) ;
void createBatch(List<SysPermission> list) ; void createBatch(List<SysPermission> list) ;
boolean checkKey(SysPermission et) ; boolean update(SysPermission et) ;
void updateBatch(List<SysPermission> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
SysPermission get(String key) ; SysPermission get(String key) ;
SysPermission getDraft(SysPermission et) ;
boolean checkKey(SysPermission et) ;
boolean save(SysPermission et) ;
void saveBatch(List<SysPermission> list) ;
Page<SysPermission> searchDefault(SysPermissionSearchContext context) ; Page<SysPermission> searchDefault(SysPermissionSearchContext context) ;
/** /**
*自定义查询SQL *自定义查询SQL
......
...@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -25,17 +25,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface ISysRolePermissionService extends IService<SysRolePermission>{ public interface ISysRolePermissionService extends IService<SysRolePermission>{
SysRolePermission get(String key) ; boolean create(SysRolePermission et) ;
void createBatch(List<SysRolePermission> list) ;
boolean update(SysRolePermission et) ;
void updateBatch(List<SysRolePermission> list) ;
boolean remove(String key) ; boolean remove(String key) ;
void removeBatch(Collection<String> idList) ; void removeBatch(Collection<String> idList) ;
SysRolePermission get(String key) ;
SysRolePermission getDraft(SysRolePermission et) ; SysRolePermission getDraft(SysRolePermission et) ;
boolean create(SysRolePermission et) ;
void createBatch(List<SysRolePermission> list) ;
boolean checkKey(SysRolePermission et) ; boolean checkKey(SysRolePermission et) ;
boolean save(SysRolePermission et) ; boolean save(SysRolePermission et) ;
void saveBatch(List<SysRolePermission> list) ; void saveBatch(List<SysRolePermission> list) ;
boolean update(SysRolePermission et) ;
void updateBatch(List<SysRolePermission> list) ;
Page<SysRolePermission> searchDefault(SysRolePermissionSearchContext context) ; Page<SysRolePermission> searchDefault(SysRolePermissionSearchContext context) ;
List<SysRolePermission> selectByPermissionid(String permissionid) ; List<SysRolePermission> selectByPermissionid(String permissionid) ;
void removeByPermissionid(String permissionid) ; void removeByPermissionid(String permissionid) ;
......
...@@ -25,21 +25,21 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -25,21 +25,21 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface ISysRoleService extends IService<SysRole>{ public interface ISysRoleService extends IService<SysRole>{
boolean save(SysRole et) ; boolean create(SysRole et) ;
@CacheEvict(value="sysrole",allEntries=true) @CacheEvict(value="sysrole",allEntries=true)
void saveBatch(List<SysRole> list) ; void createBatch(List<SysRole> list) ;
boolean update(SysRole et) ; boolean update(SysRole et) ;
@CacheEvict(value="sysrole",allEntries=true) @CacheEvict(value="sysrole",allEntries=true)
void updateBatch(List<SysRole> list) ; void updateBatch(List<SysRole> list) ;
boolean create(SysRole et) ;
@CacheEvict(value="sysrole",allEntries=true)
void createBatch(List<SysRole> list) ;
SysRole get(String key) ;
boolean remove(String key) ; boolean remove(String key) ;
@CacheEvict(value="sysrole",allEntries=true) @CacheEvict(value="sysrole",allEntries=true)
void removeBatch(Collection<String> idList) ; void removeBatch(Collection<String> idList) ;
SysRole get(String key) ;
SysRole getDraft(SysRole et) ; SysRole getDraft(SysRole et) ;
boolean checkKey(SysRole et) ; boolean checkKey(SysRole et) ;
boolean save(SysRole et) ;
@CacheEvict(value="sysrole",allEntries=true)
void saveBatch(List<SysRole> list) ;
Page<SysRole> searchDefault(SysRoleSearchContext context) ; Page<SysRole> searchDefault(SysRoleSearchContext context) ;
/** /**
*自定义查询SQL *自定义查询SQL
......
...@@ -25,15 +25,15 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -25,15 +25,15 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface ISysUserRoleService extends IService<SysUserRole>{ public interface ISysUserRoleService extends IService<SysUserRole>{
boolean checkKey(SysUserRole et) ; boolean create(SysUserRole et) ;
SysUserRole getDraft(SysUserRole et) ; void createBatch(List<SysUserRole> list) ;
boolean update(SysUserRole et) ; boolean update(SysUserRole et) ;
void updateBatch(List<SysUserRole> list) ; void updateBatch(List<SysUserRole> list) ;
boolean remove(String key) ; boolean remove(String key) ;
void removeBatch(Collection<String> idList) ; void removeBatch(Collection<String> idList) ;
boolean create(SysUserRole et) ;
void createBatch(List<SysUserRole> list) ;
SysUserRole get(String key) ; SysUserRole get(String key) ;
SysUserRole getDraft(SysUserRole et) ;
boolean checkKey(SysUserRole et) ;
boolean save(SysUserRole et) ; boolean save(SysUserRole et) ;
void saveBatch(List<SysUserRole> list) ; void saveBatch(List<SysUserRole> list) ;
Page<SysUserRole> searchDefault(SysUserRoleSearchContext context) ; Page<SysUserRole> searchDefault(SysUserRoleSearchContext context) ;
......
...@@ -25,21 +25,21 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -25,21 +25,21 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface ISysUserService extends IService<SysUser>{ public interface ISysUserService extends IService<SysUser>{
boolean remove(String key) ; boolean create(SysUser et) ;
@CacheEvict(value="sysuser",allEntries=true) @CacheEvict(value="sysuser",allEntries=true)
void removeBatch(Collection<String> idList) ; void createBatch(List<SysUser> list) ;
boolean update(SysUser et) ; boolean update(SysUser et) ;
@CacheEvict(value="sysuser",allEntries=true) @CacheEvict(value="sysuser",allEntries=true)
void updateBatch(List<SysUser> list) ; void updateBatch(List<SysUser> list) ;
boolean checkKey(SysUser et) ; boolean remove(String key) ;
@CacheEvict(value="sysuser",allEntries=true)
void removeBatch(Collection<String> idList) ;
SysUser get(String key) ; SysUser get(String key) ;
SysUser getDraft(SysUser et) ;
boolean checkKey(SysUser et) ;
boolean save(SysUser et) ; boolean save(SysUser et) ;
@CacheEvict(value="sysuser",allEntries=true) @CacheEvict(value="sysuser",allEntries=true)
void saveBatch(List<SysUser> list) ; void saveBatch(List<SysUser> list) ;
SysUser getDraft(SysUser et) ;
boolean create(SysUser et) ;
@CacheEvict(value="sysuser",allEntries=true)
void createBatch(List<SysUser> list) ;
Page<SysUser> searchDefault(SysUserSearchContext context) ; Page<SysUser> searchDefault(SysUserSearchContext context) ;
/** /**
*自定义查询SQL *自定义查询SQL
......
...@@ -39,33 +39,41 @@ public class SysAppServiceImpl implements ISysAppService { ...@@ -39,33 +39,41 @@ public class SysAppServiceImpl implements ISysAppService {
@Override @Override
public boolean remove(String key) { public boolean create(SysApp et) {
//代码实现
return true; return true;
} }
public void removeBatch(Collection<String> idList){ public void createBatch(List<SysApp> list){
} }
@Override @Override
public SysApp get(String key) { public boolean update(SysApp et) {
SysApp et = new SysApp(); //代码实现
et.setId(key); return true;
return et; }
public void updateBatch(List<SysApp> list){
} }
@Override @Override
@Transactional public boolean remove(String key) {
public boolean save(SysApp et) {
//代码实现
return true; return true;
} }
@Override public void removeBatch(Collection<String> idList){
public void saveBatch(List<SysApp> list) {
} }
@Override
public SysApp get(String key) {
SysApp et = new SysApp();
et.setId(key);
return et;
}
@Override @Override
public SysApp getDraft(SysApp et) { public SysApp getDraft(SysApp et) {
return et; return et;
...@@ -76,22 +84,14 @@ public class SysAppServiceImpl implements ISysAppService { ...@@ -76,22 +84,14 @@ public class SysAppServiceImpl implements ISysAppService {
return false; return false;
} }
@Override @Override
public boolean update(SysApp et) { @Transactional
public boolean save(SysApp et) {
//代码实现 //代码实现
return true; return true;
} }
public void updateBatch(List<SysApp> list){
}
@Override @Override
public boolean create(SysApp et) { public void saveBatch(List<SysApp> list) {
//代码实现
return true;
}
public void createBatch(List<SysApp> list){
} }
......
...@@ -48,8 +48,17 @@ public class SysAuthLogServiceImpl extends ServiceImpl<SysAuthLogMapper, SysAuth ...@@ -48,8 +48,17 @@ public class SysAuthLogServiceImpl extends ServiceImpl<SysAuthLogMapper, SysAuth
protected int batchSize = 500; protected int batchSize = 500;
@Override @Override
public SysAuthLog getDraft(SysAuthLog et) { @Transactional
return et; public boolean create(SysAuthLog et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getLogid()),et);
return true;
}
@Override
public void createBatch(List<SysAuthLog> list) {
this.saveBatch(list,batchSize);
} }
@Override @Override
...@@ -78,24 +87,6 @@ public class SysAuthLogServiceImpl extends ServiceImpl<SysAuthLogMapper, SysAuth ...@@ -78,24 +87,6 @@ public class SysAuthLogServiceImpl extends ServiceImpl<SysAuthLogMapper, SysAuth
removeByIds(idList); removeByIds(idList);
} }
@Override
@Transactional
public boolean create(SysAuthLog et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getLogid()),et);
return true;
}
@Override
public void createBatch(List<SysAuthLog> list) {
this.saveBatch(list,batchSize);
}
@Override
public boolean checkKey(SysAuthLog et) {
return (!ObjectUtils.isEmpty(et.getLogid()))&&(!Objects.isNull(this.getById(et.getLogid())));
}
@Override @Override
@Transactional @Transactional
public SysAuthLog get(String key) { public SysAuthLog get(String key) {
...@@ -109,6 +100,15 @@ public class SysAuthLogServiceImpl extends ServiceImpl<SysAuthLogMapper, SysAuth ...@@ -109,6 +100,15 @@ public class SysAuthLogServiceImpl extends ServiceImpl<SysAuthLogMapper, SysAuth
return et; return et;
} }
@Override
public SysAuthLog getDraft(SysAuthLog et) {
return et;
}
@Override
public boolean checkKey(SysAuthLog et) {
return (!ObjectUtils.isEmpty(et.getLogid()))&&(!Objects.isNull(this.getById(et.getLogid())));
}
@Override @Override
@Transactional @Transactional
public boolean save(SysAuthLog et) { public boolean save(SysAuthLog et) {
......
...@@ -47,23 +47,6 @@ public class SysPSSystemServiceImpl extends ServiceImpl<SysPSSystemMapper, SysPS ...@@ -47,23 +47,6 @@ public class SysPSSystemServiceImpl extends ServiceImpl<SysPSSystemMapper, SysPS
protected int batchSize = 500; protected int batchSize = 500;
@Override
public boolean checkKey(SysPSSystem et) {
return (!ObjectUtils.isEmpty(et.getPssystemid()))&&(!Objects.isNull(this.getById(et.getPssystemid())));
}
@Override
@Transactional
public SysPSSystem get(String key) {
SysPSSystem et = getById(key);
if(et==null){
et=new SysPSSystem();
et.setPssystemid(key);
}
else{
}
return et;
}
@Override @Override
@Transactional @Transactional
public boolean create(SysPSSystem et) { public boolean create(SysPSSystem et) {
...@@ -79,8 +62,17 @@ public class SysPSSystemServiceImpl extends ServiceImpl<SysPSSystemMapper, SysPS ...@@ -79,8 +62,17 @@ public class SysPSSystemServiceImpl extends ServiceImpl<SysPSSystemMapper, SysPS
} }
@Override @Override
public SysPSSystem getDraft(SysPSSystem et) { @Transactional
return et; public boolean update(SysPSSystem et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("pssystemid",et.getPssystemid())))
return false;
CachedBeanCopier.copy(get(et.getPssystemid()),et);
return true;
}
@Override
public void updateBatch(List<SysPSSystem> list) {
updateBatchById(list,batchSize);
} }
@Override @Override
...@@ -95,6 +87,35 @@ public class SysPSSystemServiceImpl extends ServiceImpl<SysPSSystemMapper, SysPS ...@@ -95,6 +87,35 @@ public class SysPSSystemServiceImpl extends ServiceImpl<SysPSSystemMapper, SysPS
removeByIds(idList); removeByIds(idList);
} }
@Override
@Transactional
public SysPSSystem get(String key) {
SysPSSystem et = getById(key);
if(et==null){
et=new SysPSSystem();
et.setPssystemid(key);
}
else{
}
return et;
}
@Override
public SysPSSystem getDraft(SysPSSystem et) {
return et;
}
@Override
public boolean checkKey(SysPSSystem et) {
return (!ObjectUtils.isEmpty(et.getPssystemid()))&&(!Objects.isNull(this.getById(et.getPssystemid())));
}
@Override
@Transactional
public SysPSSystem prepareApps(SysPSSystem et) {
//自定义代码
return et;
}
@Override @Override
@Transactional @Transactional
public boolean save(SysPSSystem et) { public boolean save(SysPSSystem et) {
...@@ -128,35 +149,28 @@ public class SysPSSystemServiceImpl extends ServiceImpl<SysPSSystemMapper, SysPS ...@@ -128,35 +149,28 @@ public class SysPSSystemServiceImpl extends ServiceImpl<SysPSSystemMapper, SysPS
@Override @Override
@Transactional @Transactional
public boolean update(SysPSSystem et) { public SysPSSystem syncPermission(SysPSSystem et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("pssystemid",et.getPssystemid()))) //自定义代码
return false; return et;
CachedBeanCopier.copy(get(et.getPssystemid()),et);
return true;
}
@Override
public void updateBatch(List<SysPSSystem> list) {
updateBatchById(list,batchSize);
} }
/** /**
* 查询集合 Pick * 查询集合 DEFAULT
*/ */
@Override @Override
public Page<SysPSSystem> searchPick(SysPSSystemSearchContext context) { public Page<SysPSSystem> searchDefault(SysPSSystemSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<SysPSSystem> pages=baseMapper.searchPick(context.getPages(),context,context.getSelectCond()); com.baomidou.mybatisplus.extension.plugins.pagination.Page<SysPSSystem> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<SysPSSystem>(pages.getRecords(), context.getPageable(), pages.getTotal()); return new PageImpl<SysPSSystem>(pages.getRecords(), context.getPageable(), pages.getTotal());
} }
/** /**
* 查询集合 DEFAULT * 查询集合 Pick
*/ */
@Override @Override
public Page<SysPSSystem> searchDefault(SysPSSystemSearchContext context) { public Page<SysPSSystem> searchPick(SysPSSystemSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<SysPSSystem> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond()); com.baomidou.mybatisplus.extension.plugins.pagination.Page<SysPSSystem> pages=baseMapper.searchPick(context.getPages(),context,context.getSelectCond());
return new PageImpl<SysPSSystem>(pages.getRecords(), context.getPageable(), pages.getTotal()); return new PageImpl<SysPSSystem>(pages.getRecords(), context.getPageable(), pages.getTotal());
} }
......
...@@ -52,38 +52,30 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S ...@@ -52,38 +52,30 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
@Override @Override
@Transactional @Transactional
public boolean save(SysPermission et) { public boolean create(SysPermission et) {
if(!saveOrUpdate(et)) if(!this.retBool(this.baseMapper.insert(et)))
return false; return false;
CachedBeanCopier.copy(get(et.getPermissionid()),et);
return true; return true;
} }
@Override @Override
@Transactional( public void createBatch(List<SysPermission> list) {
rollbackFor = {Exception.class} this.saveBatch(list,batchSize);
)
public boolean saveOrUpdate(SysPermission et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
} }
@Override @Override
public boolean saveBatch(Collection<SysPermission> list) { @Transactional
saveOrUpdateBatch(list,batchSize); public boolean update(SysPermission et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("sys_permissionid",et.getPermissionid())))
return false;
CachedBeanCopier.copy(get(et.getPermissionid()),et);
return true; return true;
} }
@Override @Override
public void saveBatch(List<SysPermission> list) { public void updateBatch(List<SysPermission> list) {
saveOrUpdateBatch(list,batchSize); updateBatchById(list,batchSize);
}
@Override
public SysPermission getDraft(SysPermission et) {
return et;
} }
@Override @Override
...@@ -100,47 +92,55 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S ...@@ -100,47 +92,55 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
@Override @Override
@Transactional @Transactional
public boolean update(SysPermission et) { public SysPermission get(String key) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("sys_permissionid",et.getPermissionid()))) SysPermission et = getById(key);
return false; if(et==null){
CachedBeanCopier.copy(get(et.getPermissionid()),et); et=new SysPermission();
return true; et.setPermissionid(key);
}
else{
}
return et;
} }
@Override @Override
public void updateBatch(List<SysPermission> list) { public SysPermission getDraft(SysPermission et) {
updateBatchById(list,batchSize); return et;
} }
@Override
public boolean checkKey(SysPermission et) {
return (!ObjectUtils.isEmpty(et.getPermissionid()))&&(!Objects.isNull(this.getById(et.getPermissionid())));
}
@Override @Override
@Transactional @Transactional
public boolean create(SysPermission et) { public boolean save(SysPermission et) {
if(!this.retBool(this.baseMapper.insert(et))) if(!saveOrUpdate(et))
return false; return false;
CachedBeanCopier.copy(get(et.getPermissionid()),et);
return true; return true;
} }
@Override @Override
public void createBatch(List<SysPermission> list) { @Transactional(
this.saveBatch(list,batchSize); rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(SysPermission et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
} }
@Override @Override
public boolean checkKey(SysPermission et) { public boolean saveBatch(Collection<SysPermission> list) {
return (!ObjectUtils.isEmpty(et.getPermissionid()))&&(!Objects.isNull(this.getById(et.getPermissionid()))); saveOrUpdateBatch(list,batchSize);
return true;
} }
@Override @Override
@Transactional public void saveBatch(List<SysPermission> list) {
public SysPermission get(String key) { saveOrUpdateBatch(list,batchSize);
SysPermission et = getById(key);
if(et==null){
et=new SysPermission();
et.setPermissionid(key);
}
else{
}
return et;
} }
......
...@@ -55,15 +55,34 @@ public class SysRolePermissionServiceImpl extends ServiceImpl<SysRolePermissionM ...@@ -55,15 +55,34 @@ public class SysRolePermissionServiceImpl extends ServiceImpl<SysRolePermissionM
@Override @Override
@Transactional @Transactional
public SysRolePermission get(String key) { public boolean create(SysRolePermission et) {
SysRolePermission et = getById(key); fillParentData(et);
if(et==null){ if(!this.retBool(this.baseMapper.insert(et)))
et=new SysRolePermission(); return false;
et.setRolepermissionid(key); CachedBeanCopier.copy(get(et.getRolepermissionid()),et);
return true;
} }
else{
@Override
public void createBatch(List<SysRolePermission> list) {
list.forEach(item->fillParentData(item));
this.saveOrUpdateBatch(list,batchSize);
} }
return et;
@Override
@Transactional
public boolean update(SysRolePermission et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("sys_role_permissionid",et.getRolepermissionid())))
return false;
CachedBeanCopier.copy(get(et.getRolepermissionid()),et);
return true;
}
@Override
public void updateBatch(List<SysRolePermission> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
} }
@Override @Override
...@@ -79,25 +98,22 @@ public class SysRolePermissionServiceImpl extends ServiceImpl<SysRolePermissionM ...@@ -79,25 +98,22 @@ public class SysRolePermissionServiceImpl extends ServiceImpl<SysRolePermissionM
} }
@Override @Override
public SysRolePermission getDraft(SysRolePermission et) { @Transactional
fillParentData(et); public SysRolePermission get(String key) {
SysRolePermission et = getById(key);
if(et==null){
et=new SysRolePermission();
et.setRolepermissionid(key);
}
else{
}
return et; return et;
} }
@Override @Override
@Transactional public SysRolePermission getDraft(SysRolePermission et) {
public boolean create(SysRolePermission et) {
fillParentData(et); fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et))) return et;
return false;
CachedBeanCopier.copy(get(et.getRolepermissionid()),et);
return true;
}
@Override
public void createBatch(List<SysRolePermission> list) {
list.forEach(item->fillParentData(item));
this.saveOrUpdateBatch(list,batchSize);
} }
@Override @Override
...@@ -137,22 +153,6 @@ public class SysRolePermissionServiceImpl extends ServiceImpl<SysRolePermissionM ...@@ -137,22 +153,6 @@ public class SysRolePermissionServiceImpl extends ServiceImpl<SysRolePermissionM
saveOrUpdateBatch(list,batchSize); saveOrUpdateBatch(list,batchSize);
} }
@Override
@Transactional
public boolean update(SysRolePermission et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("sys_role_permissionid",et.getRolepermissionid())))
return false;
CachedBeanCopier.copy(get(et.getRolepermissionid()),et);
return true;
}
@Override
public void updateBatch(List<SysRolePermission> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
}
@Override @Override
public List<SysRolePermission> selectByPermissionid(String permissionid) { public List<SysRolePermission> selectByPermissionid(String permissionid) {
......
...@@ -55,33 +55,16 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl ...@@ -55,33 +55,16 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
@Override @Override
@Transactional @Transactional
public boolean save(SysRole et) { public boolean create(SysRole et) {
if(!saveOrUpdate(et)) if(!this.retBool(this.baseMapper.insert(et)))
return false;
return true;
}
@Override
@Transactional(
rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(SysRole et) {
if (null == et) {
return false; return false;
} else { CachedBeanCopier.copy(get(et.getRoleid()),et);
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<SysRole> list) {
saveOrUpdateBatch(list,batchSize);
return true; return true;
} }
@Override @Override
public void saveBatch(List<SysRole> list) { public void createBatch(List<SysRole> list) {
saveOrUpdateBatch(list,batchSize); this.saveBatch(list,batchSize);
} }
@Override @Override
...@@ -100,16 +83,14 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl ...@@ -100,16 +83,14 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
@Override @Override
@Transactional @Transactional
public boolean create(SysRole et) { public boolean remove(String key) {
if(!this.retBool(this.baseMapper.insert(et))) boolean result=removeById(key);
return false; return result ;
CachedBeanCopier.copy(get(et.getRoleid()),et);
return true;
} }
@Override @Override
public void createBatch(List<SysRole> list) { public void removeBatch(Collection<String> idList) {
this.saveBatch(list,batchSize); removeByIds(idList);
} }
@Override @Override
...@@ -125,29 +106,48 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl ...@@ -125,29 +106,48 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
return et; return et;
} }
@Override
public SysRole getDraft(SysRole et) {
return et;
}
@Override
public boolean checkKey(SysRole et) {
return (!ObjectUtils.isEmpty(et.getRoleid()))&&(!Objects.isNull(this.getById(et.getRoleid())));
}
@Override @Override
@Transactional @Transactional
public boolean remove(String key) { public boolean save(SysRole et) {
boolean result=removeById(key); if(!saveOrUpdate(et))
return result ; return false;
return true;
} }
@Override @Override
public void removeBatch(Collection<String> idList) { @Transactional(
removeByIds(idList); rollbackFor = {Exception.class}
)
public boolean saveOrUpdate(SysRole et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
} }
@Override @Override
public SysRole getDraft(SysRole et) { public boolean saveBatch(Collection<SysRole> list) {
return et; saveOrUpdateBatch(list,batchSize);
return true;
} }
@Override @Override
public boolean checkKey(SysRole et) { public void saveBatch(List<SysRole> list) {
return (!ObjectUtils.isEmpty(et.getRoleid()))&&(!Objects.isNull(this.getById(et.getRoleid()))); saveOrUpdateBatch(list,batchSize);
} }
/** /**
* 查询集合 DEFAULT * 查询集合 DEFAULT
*/ */
......
...@@ -54,13 +54,19 @@ public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUs ...@@ -54,13 +54,19 @@ public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUs
protected int batchSize = 500; protected int batchSize = 500;
@Override @Override
public boolean checkKey(SysUserRole et) { @Transactional
return (!ObjectUtils.isEmpty(et.getUserroleid()))&&(!Objects.isNull(this.getById(et.getUserroleid()))); public boolean create(SysUserRole et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getUserroleid()),et);
return true;
} }
@Override @Override
public SysUserRole getDraft(SysUserRole et) { public void createBatch(List<SysUserRole> list) {
fillParentData(et); list.forEach(item->fillParentData(item));
return et; this.saveOrUpdateBatch(list,batchSize);
} }
@Override @Override
...@@ -91,22 +97,6 @@ public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUs ...@@ -91,22 +97,6 @@ public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUs
removeByIds(idList); removeByIds(idList);
} }
@Override
@Transactional
public boolean create(SysUserRole et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getUserroleid()),et);
return true;
}
@Override
public void createBatch(List<SysUserRole> list) {
list.forEach(item->fillParentData(item));
this.saveOrUpdateBatch(list,batchSize);
}
@Override @Override
@Transactional @Transactional
public SysUserRole get(String key) { public SysUserRole get(String key) {
...@@ -120,6 +110,16 @@ public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUs ...@@ -120,6 +110,16 @@ public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUs
return et; return et;
} }
@Override
public SysUserRole getDraft(SysUserRole et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(SysUserRole et) {
return (!ObjectUtils.isEmpty(et.getUserroleid()))&&(!Objects.isNull(this.getById(et.getUserroleid())));
}
@Override @Override
@Transactional @Transactional
public boolean save(SysUserRole et) { public boolean save(SysUserRole et) {
......
...@@ -52,14 +52,16 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -52,14 +52,16 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@Override @Override
@Transactional @Transactional
public boolean remove(String key) { public boolean create(SysUser et) {
boolean result=removeById(key); if(!this.retBool(this.baseMapper.insert(et)))
return result ; return false;
CachedBeanCopier.copy(get(et.getUserid()),et);
return true;
} }
@Override @Override
public void removeBatch(Collection<String> idList) { public void createBatch(List<SysUser> list) {
removeByIds(idList); this.saveBatch(list,batchSize);
} }
@Override @Override
...@@ -77,9 +79,17 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -77,9 +79,17 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
} }
@Override @Override
public boolean checkKey(SysUser et) { @Transactional
return (!ObjectUtils.isEmpty(et.getUserid()))&&(!Objects.isNull(this.getById(et.getUserid()))); public boolean remove(String key) {
boolean result=removeById(key);
return result ;
} }
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override @Override
@Transactional @Transactional
public SysUser get(String key) { public SysUser get(String key) {
...@@ -93,6 +103,15 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -93,6 +103,15 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
return et; return et;
} }
@Override
public SysUser getDraft(SysUser et) {
return et;
}
@Override
public boolean checkKey(SysUser et) {
return (!ObjectUtils.isEmpty(et.getUserid()))&&(!Objects.isNull(this.getById(et.getUserid())));
}
@Override @Override
@Transactional @Transactional
public boolean save(SysUser et) { public boolean save(SysUser et) {
...@@ -124,25 +143,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -124,25 +143,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
saveOrUpdateBatch(list,batchSize); saveOrUpdateBatch(list,batchSize);
} }
@Override
public SysUser getDraft(SysUser et) {
return et;
}
@Override
@Transactional
public boolean create(SysUser et) {
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getUserid()),et);
return true;
}
@Override
public void createBatch(List<SysUser> list) {
this.saveBatch(list,batchSize);
}
/** /**
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<!--输出实体[SYS_PSSYSTEM]数据结构 --> <!--输出实体[SYS_PSSYSTEM]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-sys_pssystem-36-5"> <changeSet author="a_A_5d9d78509" id="tab-sys_pssystem-39-5">
<createTable tableName="IBZPSSYSTEM"> <createTable tableName="IBZPSSYSTEM">
<column name="PSSYSTEMID" remarks="" type="VARCHAR(100)"> <column name="PSSYSTEMID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_SYS_PSSYSTEM_PSSYSTEMID"/> <constraints primaryKey="true" primaryKeyName="PK_SYS_PSSYSTEM_PSSYSTEMID"/>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"delogicname":"认证日志", "delogicname":"认证日志",
"sysmoudle":{"id":"UAA","name":"uaa"}, "sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}], "dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }], "deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}] "datascope":[{"id":"all","name":"全部数据"}]
} }
, { , {
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
"delogicname":"应用", "delogicname":"应用",
"sysmoudle":{"id":"UAA","name":"uaa"}, "sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}], "dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" }], "deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}] "datascope":[{"id":"all","name":"全部数据"}]
} }
, { , {
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"delogicname":"角色权限关系", "delogicname":"角色权限关系",
"sysmoudle":{"id":"UAA","name":"uaa"}, "sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}], "dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" }], "deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}] "datascope":[{"id":"all","name":"全部数据"}]
} }
, { , {
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
"delogicname":"权限/资源", "delogicname":"权限/资源",
"sysmoudle":{"id":"UAA","name":"uaa"}, "sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}], "dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" }], "deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}] "datascope":[{"id":"all","name":"全部数据"}]
} }
, { , {
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
"delogicname":"用户角色关系", "delogicname":"用户角色关系",
"sysmoudle":{"id":"UAA","name":"uaa"}, "sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}], "dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }], "deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}] "datascope":[{"id":"all","name":"全部数据"}]
} }
, { , {
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
"delogicname":"系统用户", "delogicname":"系统用户",
"sysmoudle":{"id":"UAA","name":"uaa"}, "sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}], "dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" }], "deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}] "datascope":[{"id":"all","name":"全部数据"}]
} }
, { , {
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
"delogicname":"系统角色", "delogicname":"系统角色",
"sysmoudle":{"id":"UAA","name":"uaa"}, "sysmoudle":{"id":"UAA","name":"uaa"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}], "dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Save" , "name":"Save" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" }], "deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}] "datascope":[{"id":"all","name":"全部数据"}]
} }
], ],
......
...@@ -47,6 +47,41 @@ public class SysAppResource { ...@@ -47,6 +47,41 @@ public class SysAppResource {
@Lazy @Lazy
public SysAppMapping sysappMapping; public SysAppMapping sysappMapping;
@ApiOperation(value = "新建应用", tags = {"应用" }, notes = "新建应用")
@RequestMapping(method = RequestMethod.POST, value = "/sysapps")
@Transactional
public ResponseEntity<SysAppDTO> create(@RequestBody SysAppDTO sysappdto) {
SysApp domain = sysappMapping.toDomain(sysappdto);
sysappService.create(domain);
SysAppDTO dto = sysappMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "批量新建应用", tags = {"应用" }, notes = "批量新建应用")
@RequestMapping(method = RequestMethod.POST, value = "/sysapps/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysAppDTO> sysappdtos) {
sysappService.createBatch(sysappMapping.toDomain(sysappdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "更新应用", tags = {"应用" }, notes = "更新应用")
@RequestMapping(method = RequestMethod.PUT, value = "/sysapps/{sysapp_id}")
@Transactional
public ResponseEntity<SysAppDTO> update(@PathVariable("sysapp_id") String sysapp_id, @RequestBody SysAppDTO sysappdto) {
SysApp domain = sysappMapping.toDomain(sysappdto);
domain .setId(sysapp_id);
sysappService.update(domain );
SysAppDTO dto = sysappMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "批量更新应用", tags = {"应用" }, notes = "批量更新应用")
@RequestMapping(method = RequestMethod.PUT, value = "/sysapps/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<SysAppDTO> sysappdtos) {
sysappService.updateBatch(sysappMapping.toDomain(sysappdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "删除应用", tags = {"应用" }, notes = "删除应用") @ApiOperation(value = "删除应用", tags = {"应用" }, notes = "删除应用")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysapps/{sysapp_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/sysapps/{sysapp_id}")
@Transactional @Transactional
...@@ -69,19 +104,6 @@ public class SysAppResource { ...@@ -69,19 +104,6 @@ public class SysAppResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@ApiOperation(value = "保存应用", tags = {"应用" }, notes = "保存应用")
@RequestMapping(method = RequestMethod.POST, value = "/sysapps/save")
public ResponseEntity<Boolean> save(@RequestBody SysAppDTO sysappdto) {
return ResponseEntity.status(HttpStatus.OK).body(sysappService.save(sysappMapping.toDomain(sysappdto)));
}
@ApiOperation(value = "批量保存应用", tags = {"应用" }, notes = "批量保存应用")
@RequestMapping(method = RequestMethod.POST, value = "/sysapps/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<SysAppDTO> sysappdtos) {
sysappService.saveBatch(sysappMapping.toDomain(sysappdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取应用草稿", tags = {"应用" }, notes = "获取应用草稿") @ApiOperation(value = "获取应用草稿", tags = {"应用" }, notes = "获取应用草稿")
@RequestMapping(method = RequestMethod.GET, value = "/sysapps/getdraft") @RequestMapping(method = RequestMethod.GET, value = "/sysapps/getdraft")
public ResponseEntity<SysAppDTO> getDraft() { public ResponseEntity<SysAppDTO> getDraft() {
...@@ -94,42 +116,20 @@ public class SysAppResource { ...@@ -94,42 +116,20 @@ public class SysAppResource {
return ResponseEntity.status(HttpStatus.OK).body(sysappService.checkKey(sysappMapping.toDomain(sysappdto))); return ResponseEntity.status(HttpStatus.OK).body(sysappService.checkKey(sysappMapping.toDomain(sysappdto)));
} }
@ApiOperation(value = "更新应用", tags = {"应用" }, notes = "更新应用") @ApiOperation(value = "保存应用", tags = {"应用" }, notes = "保存应用")
@RequestMapping(method = RequestMethod.PUT, value = "/sysapps/{sysapp_id}") @RequestMapping(method = RequestMethod.POST, value = "/sysapps/save")
@Transactional public ResponseEntity<Boolean> save(@RequestBody SysAppDTO sysappdto) {
public ResponseEntity<SysAppDTO> update(@PathVariable("sysapp_id") String sysapp_id, @RequestBody SysAppDTO sysappdto) { return ResponseEntity.status(HttpStatus.OK).body(sysappService.save(sysappMapping.toDomain(sysappdto)));
SysApp domain = sysappMapping.toDomain(sysappdto);
domain .setId(sysapp_id);
sysappService.update(domain );
SysAppDTO dto = sysappMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "批量更新应用", tags = {"应用" }, notes = "批量更新应用")
@RequestMapping(method = RequestMethod.PUT, value = "/sysapps/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<SysAppDTO> sysappdtos) {
sysappService.updateBatch(sysappMapping.toDomain(sysappdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "新建应用", tags = {"应用" }, notes = "新建应用")
@RequestMapping(method = RequestMethod.POST, value = "/sysapps")
@Transactional
public ResponseEntity<SysAppDTO> create(@RequestBody SysAppDTO sysappdto) {
SysApp domain = sysappMapping.toDomain(sysappdto);
sysappService.create(domain);
SysAppDTO dto = sysappMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@ApiOperation(value = "批量新建应用", tags = {"应用" }, notes = "批量新建应用") @ApiOperation(value = "批量保存应用", tags = {"应用" }, notes = "批量保存应用")
@RequestMapping(method = RequestMethod.POST, value = "/sysapps/batch") @RequestMapping(method = RequestMethod.POST, value = "/sysapps/savebatch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysAppDTO> sysappdtos) { public ResponseEntity<Boolean> saveBatch(@RequestBody List<SysAppDTO> sysappdtos) {
sysappService.createBatch(sysappMapping.toDomain(sysappdtos)); sysappService.saveBatch(sysappMapping.toDomain(sysappdtos));
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysApp-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysApp-searchDefault-all') and hasPermission(#context,'ibzuaa-SysApp-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"应用" } ,notes = "获取DEFAULT") @ApiOperation(value = "获取DEFAULT", tags = {"应用" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sysapps/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/sysapps/fetchdefault")
public ResponseEntity<List<SysAppDTO>> fetchDefault(SysAppSearchContext context) { public ResponseEntity<List<SysAppDTO>> fetchDefault(SysAppSearchContext context) {
...@@ -142,7 +142,7 @@ public class SysAppResource { ...@@ -142,7 +142,7 @@ public class SysAppResource {
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysApp-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysApp-searchDefault-all') and hasPermission(#context,'ibzuaa-SysApp-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"应用" } ,notes = "查询DEFAULT") @ApiOperation(value = "查询DEFAULT", tags = {"应用" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sysapps/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/sysapps/searchdefault")
public ResponseEntity<Page<SysAppDTO>> searchDefault(@RequestBody SysAppSearchContext context) { public ResponseEntity<Page<SysAppDTO>> searchDefault(@RequestBody SysAppSearchContext context) {
......
...@@ -47,10 +47,23 @@ public class SysAuthLogResource { ...@@ -47,10 +47,23 @@ public class SysAuthLogResource {
@Lazy @Lazy
public SysAuthLogMapping sysauthlogMapping; public SysAuthLogMapping sysauthlogMapping;
@ApiOperation(value = "获取认证日志草稿", tags = {"认证日志" }, notes = "获取认证日志草稿") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-Create-all')")
@RequestMapping(method = RequestMethod.GET, value = "/sysauthlogs/getdraft") @ApiOperation(value = "新建认证日志", tags = {"认证日志" }, notes = "新建认证日志")
public ResponseEntity<SysAuthLogDTO> getDraft() { @RequestMapping(method = RequestMethod.POST, value = "/sysauthlogs")
return ResponseEntity.status(HttpStatus.OK).body(sysauthlogMapping.toDto(sysauthlogService.getDraft(new SysAuthLog()))); @Transactional
public ResponseEntity<SysAuthLogDTO> create(@RequestBody SysAuthLogDTO sysauthlogdto) {
SysAuthLog domain = sysauthlogMapping.toDomain(sysauthlogdto);
sysauthlogService.create(domain);
SysAuthLogDTO dto = sysauthlogMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-Create-all')")
@ApiOperation(value = "批量新建认证日志", tags = {"认证日志" }, notes = "批量新建认证日志")
@RequestMapping(method = RequestMethod.POST, value = "/sysauthlogs/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysAuthLogDTO> sysauthlogdtos) {
sysauthlogService.createBatch(sysauthlogMapping.toDomain(sysauthlogdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-Update-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-Update-all')")
...@@ -89,23 +102,19 @@ public class SysAuthLogResource { ...@@ -89,23 +102,19 @@ public class SysAuthLogResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-Create-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-Get-all')")
@ApiOperation(value = "新建认证日志", tags = {"认证日志" }, notes = "新建认证日志") @ApiOperation(value = "获取认证日志", tags = {"认证日志" }, notes = "获取认证日志")
@RequestMapping(method = RequestMethod.POST, value = "/sysauthlogs") @RequestMapping(method = RequestMethod.GET, value = "/sysauthlogs/{sysauthlog_id}")
@Transactional public ResponseEntity<SysAuthLogDTO> get(@PathVariable("sysauthlog_id") String sysauthlog_id) {
public ResponseEntity<SysAuthLogDTO> create(@RequestBody SysAuthLogDTO sysauthlogdto) { SysAuthLog domain = sysauthlogService.get(sysauthlog_id);
SysAuthLog domain = sysauthlogMapping.toDomain(sysauthlogdto);
sysauthlogService.create(domain);
SysAuthLogDTO dto = sysauthlogMapping.toDto(domain); SysAuthLogDTO dto = sysauthlogMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-Create-all')") @ApiOperation(value = "获取认证日志草稿", tags = {"认证日志" }, notes = "获取认证日志草稿")
@ApiOperation(value = "批量新建认证日志", tags = {"认证日志" }, notes = "批量新建认证日志") @RequestMapping(method = RequestMethod.GET, value = "/sysauthlogs/getdraft")
@RequestMapping(method = RequestMethod.POST, value = "/sysauthlogs/batch") public ResponseEntity<SysAuthLogDTO> getDraft() {
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysAuthLogDTO> sysauthlogdtos) { return ResponseEntity.status(HttpStatus.OK).body(sysauthlogMapping.toDto(sysauthlogService.getDraft(new SysAuthLog())));
sysauthlogService.createBatch(sysauthlogMapping.toDomain(sysauthlogdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@ApiOperation(value = "检查认证日志", tags = {"认证日志" }, notes = "检查认证日志") @ApiOperation(value = "检查认证日志", tags = {"认证日志" }, notes = "检查认证日志")
...@@ -114,15 +123,6 @@ public class SysAuthLogResource { ...@@ -114,15 +123,6 @@ public class SysAuthLogResource {
return ResponseEntity.status(HttpStatus.OK).body(sysauthlogService.checkKey(sysauthlogMapping.toDomain(sysauthlogdto))); return ResponseEntity.status(HttpStatus.OK).body(sysauthlogService.checkKey(sysauthlogMapping.toDomain(sysauthlogdto)));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-Get-all')")
@ApiOperation(value = "获取认证日志", tags = {"认证日志" }, notes = "获取认证日志")
@RequestMapping(method = RequestMethod.GET, value = "/sysauthlogs/{sysauthlog_id}")
public ResponseEntity<SysAuthLogDTO> get(@PathVariable("sysauthlog_id") String sysauthlog_id) {
SysAuthLog domain = sysauthlogService.get(sysauthlog_id);
SysAuthLogDTO dto = sysauthlogMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-Save-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-Save-all')")
@ApiOperation(value = "保存认证日志", tags = {"认证日志" }, notes = "保存认证日志") @ApiOperation(value = "保存认证日志", tags = {"认证日志" }, notes = "保存认证日志")
@RequestMapping(method = RequestMethod.POST, value = "/sysauthlogs/save") @RequestMapping(method = RequestMethod.POST, value = "/sysauthlogs/save")
...@@ -138,7 +138,7 @@ public class SysAuthLogResource { ...@@ -138,7 +138,7 @@ public class SysAuthLogResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-searchDefault-all') and hasPermission(#context,'ibzuaa-SysAuthLog-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"认证日志" } ,notes = "获取DEFAULT") @ApiOperation(value = "获取DEFAULT", tags = {"认证日志" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sysauthlogs/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/sysauthlogs/fetchdefault")
public ResponseEntity<List<SysAuthLogDTO>> fetchDefault(SysAuthLogSearchContext context) { public ResponseEntity<List<SysAuthLogDTO>> fetchDefault(SysAuthLogSearchContext context) {
...@@ -151,7 +151,7 @@ public class SysAuthLogResource { ...@@ -151,7 +151,7 @@ public class SysAuthLogResource {
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysAuthLog-searchDefault-all') and hasPermission(#context,'ibzuaa-SysAuthLog-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"认证日志" } ,notes = "查询DEFAULT") @ApiOperation(value = "查询DEFAULT", tags = {"认证日志" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sysauthlogs/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/sysauthlogs/searchdefault")
public ResponseEntity<Page<SysAuthLogDTO>> searchDefault(@RequestBody SysAuthLogSearchContext context) { public ResponseEntity<Page<SysAuthLogDTO>> searchDefault(@RequestBody SysAuthLogSearchContext context) {
......
...@@ -47,40 +47,22 @@ public class SysPermissionResource { ...@@ -47,40 +47,22 @@ public class SysPermissionResource {
@Lazy @Lazy
public SysPermissionMapping syspermissionMapping; public SysPermissionMapping syspermissionMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Save-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Create-all')")
@ApiOperation(value = "保存权限/资源", tags = {"权限/资源" }, notes = "保存权限/资源") @ApiOperation(value = "新建权限/资源", tags = {"权限/资源" }, notes = "新建权限/资源")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/save") @RequestMapping(method = RequestMethod.POST, value = "/syspermissions")
public ResponseEntity<Boolean> save(@RequestBody SysPermissionDTO syspermissiondto) {
return ResponseEntity.status(HttpStatus.OK).body(syspermissionService.save(syspermissionMapping.toDomain(syspermissiondto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Save-all')")
@ApiOperation(value = "批量保存权限/资源", tags = {"权限/资源" }, notes = "批量保存权限/资源")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<SysPermissionDTO> syspermissiondtos) {
syspermissionService.saveBatch(syspermissionMapping.toDomain(syspermissiondtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "获取权限/资源草稿", tags = {"权限/资源" }, notes = "获取权限/资源草稿")
@RequestMapping(method = RequestMethod.GET, value = "/syspermissions/getdraft")
public ResponseEntity<SysPermissionDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(syspermissionMapping.toDto(syspermissionService.getDraft(new SysPermission())));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Remove-all')")
@ApiOperation(value = "删除权限/资源", tags = {"权限/资源" }, notes = "删除权限/资源")
@RequestMapping(method = RequestMethod.DELETE, value = "/syspermissions/{syspermission_id}")
@Transactional @Transactional
public ResponseEntity<Boolean> remove(@PathVariable("syspermission_id") String syspermission_id) { public ResponseEntity<SysPermissionDTO> create(@RequestBody SysPermissionDTO syspermissiondto) {
return ResponseEntity.status(HttpStatus.OK).body(syspermissionService.remove(syspermission_id)); SysPermission domain = syspermissionMapping.toDomain(syspermissiondto);
syspermissionService.create(domain);
SysPermissionDTO dto = syspermissionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Remove-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Create-all')")
@ApiOperation(value = "批量删除权限/资源", tags = {"权限/资源" }, notes = "批量删除权限/资源") @ApiOperation(value = "批量新建权限/资源", tags = {"权限/资源" }, notes = "批量新建权限/资源")
@RequestMapping(method = RequestMethod.DELETE, value = "/syspermissions/batch") @RequestMapping(method = RequestMethod.POST, value = "/syspermissions/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) { public ResponseEntity<Boolean> createBatch(@RequestBody List<SysPermissionDTO> syspermissiondtos) {
syspermissionService.removeBatch(ids); syspermissionService.createBatch(syspermissionMapping.toDomain(syspermissiondtos));
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
...@@ -105,31 +87,22 @@ public class SysPermissionResource { ...@@ -105,31 +87,22 @@ public class SysPermissionResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Create-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Remove-all')")
@ApiOperation(value = "新建权限/资源", tags = {"权限/资源" }, notes = "新建权限/资源") @ApiOperation(value = "删除权限/资源", tags = {"权限/资源" }, notes = "删除权限/资源")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions") @RequestMapping(method = RequestMethod.DELETE, value = "/syspermissions/{syspermission_id}")
@Transactional @Transactional
public ResponseEntity<SysPermissionDTO> create(@RequestBody SysPermissionDTO syspermissiondto) { public ResponseEntity<Boolean> remove(@PathVariable("syspermission_id") String syspermission_id) {
SysPermission domain = syspermissionMapping.toDomain(syspermissiondto); return ResponseEntity.status(HttpStatus.OK).body(syspermissionService.remove(syspermission_id));
syspermissionService.create(domain);
SysPermissionDTO dto = syspermissionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Create-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Remove-all')")
@ApiOperation(value = "批量新建权限/资源", tags = {"权限/资源" }, notes = "批量新建权限/资源") @ApiOperation(value = "批量删除权限/资源", tags = {"权限/资源" }, notes = "批量删除权限/资源")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/batch") @RequestMapping(method = RequestMethod.DELETE, value = "/syspermissions/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysPermissionDTO> syspermissiondtos) { public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
syspermissionService.createBatch(syspermissionMapping.toDomain(syspermissiondtos)); syspermissionService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@ApiOperation(value = "检查权限/资源", tags = {"权限/资源" }, notes = "检查权限/资源")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody SysPermissionDTO syspermissiondto) {
return ResponseEntity.status(HttpStatus.OK).body(syspermissionService.checkKey(syspermissionMapping.toDomain(syspermissiondto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Get-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Get-all')")
@ApiOperation(value = "获取权限/资源", tags = {"权限/资源" }, notes = "获取权限/资源") @ApiOperation(value = "获取权限/资源", tags = {"权限/资源" }, notes = "获取权限/资源")
@RequestMapping(method = RequestMethod.GET, value = "/syspermissions/{syspermission_id}") @RequestMapping(method = RequestMethod.GET, value = "/syspermissions/{syspermission_id}")
...@@ -139,7 +112,34 @@ public class SysPermissionResource { ...@@ -139,7 +112,34 @@ public class SysPermissionResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-searchDefault-all')") @ApiOperation(value = "获取权限/资源草稿", tags = {"权限/资源" }, notes = "获取权限/资源草稿")
@RequestMapping(method = RequestMethod.GET, value = "/syspermissions/getdraft")
public ResponseEntity<SysPermissionDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(syspermissionMapping.toDto(syspermissionService.getDraft(new SysPermission())));
}
@ApiOperation(value = "检查权限/资源", tags = {"权限/资源" }, notes = "检查权限/资源")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody SysPermissionDTO syspermissiondto) {
return ResponseEntity.status(HttpStatus.OK).body(syspermissionService.checkKey(syspermissionMapping.toDomain(syspermissiondto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Save-all')")
@ApiOperation(value = "保存权限/资源", tags = {"权限/资源" }, notes = "保存权限/资源")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/save")
public ResponseEntity<Boolean> save(@RequestBody SysPermissionDTO syspermissiondto) {
return ResponseEntity.status(HttpStatus.OK).body(syspermissionService.save(syspermissionMapping.toDomain(syspermissiondto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-Save-all')")
@ApiOperation(value = "批量保存权限/资源", tags = {"权限/资源" }, notes = "批量保存权限/资源")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<SysPermissionDTO> syspermissiondtos) {
syspermissionService.saveBatch(syspermissionMapping.toDomain(syspermissiondtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-searchDefault-all') and hasPermission(#context,'ibzuaa-SysPermission-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"权限/资源" } ,notes = "获取DEFAULT") @ApiOperation(value = "获取DEFAULT", tags = {"权限/资源" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/syspermissions/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/syspermissions/fetchdefault")
public ResponseEntity<List<SysPermissionDTO>> fetchDefault(SysPermissionSearchContext context) { public ResponseEntity<List<SysPermissionDTO>> fetchDefault(SysPermissionSearchContext context) {
...@@ -152,7 +152,7 @@ public class SysPermissionResource { ...@@ -152,7 +152,7 @@ public class SysPermissionResource {
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysPermission-searchDefault-all') and hasPermission(#context,'ibzuaa-SysPermission-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"权限/资源" } ,notes = "查询DEFAULT") @ApiOperation(value = "查询DEFAULT", tags = {"权限/资源" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/syspermissions/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/syspermissions/searchdefault")
public ResponseEntity<Page<SysPermissionDTO>> searchDefault(@RequestBody SysPermissionSearchContext context) { public ResponseEntity<Page<SysPermissionDTO>> searchDefault(@RequestBody SysPermissionSearchContext context) {
......
...@@ -47,15 +47,46 @@ public class SysRolePermissionResource { ...@@ -47,15 +47,46 @@ public class SysRolePermissionResource {
@Lazy @Lazy
public SysRolePermissionMapping sysrolepermissionMapping; public SysRolePermissionMapping sysrolepermissionMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Get-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Create-all')")
@ApiOperation(value = "获取角色权限关系", tags = {"角色权限关系" }, notes = "获取角色权限关系") @ApiOperation(value = "新建角色权限关系", tags = {"角色权限关系" }, notes = "新建角色权限关系")
@RequestMapping(method = RequestMethod.GET, value = "/sysrolepermissions/{sysrolepermission_id}") @RequestMapping(method = RequestMethod.POST, value = "/sysrolepermissions")
public ResponseEntity<SysRolePermissionDTO> get(@PathVariable("sysrolepermission_id") String sysrolepermission_id) { @Transactional
SysRolePermission domain = sysrolepermissionService.get(sysrolepermission_id); public ResponseEntity<SysRolePermissionDTO> create(@RequestBody SysRolePermissionDTO sysrolepermissiondto) {
SysRolePermission domain = sysrolepermissionMapping.toDomain(sysrolepermissiondto);
sysrolepermissionService.create(domain);
SysRolePermissionDTO dto = sysrolepermissionMapping.toDto(domain); SysRolePermissionDTO dto = sysrolepermissionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Create-all')")
@ApiOperation(value = "批量新建角色权限关系", tags = {"角色权限关系" }, notes = "批量新建角色权限关系")
@RequestMapping(method = RequestMethod.POST, value = "/sysrolepermissions/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysRolePermissionDTO> sysrolepermissiondtos) {
sysrolepermissionService.createBatch(sysrolepermissionMapping.toDomain(sysrolepermissiondtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "sysrolepermission" , versionfield = "updatedate")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Update-all')")
@ApiOperation(value = "更新角色权限关系", tags = {"角色权限关系" }, notes = "更新角色权限关系")
@RequestMapping(method = RequestMethod.PUT, value = "/sysrolepermissions/{sysrolepermission_id}")
@Transactional
public ResponseEntity<SysRolePermissionDTO> update(@PathVariable("sysrolepermission_id") String sysrolepermission_id, @RequestBody SysRolePermissionDTO sysrolepermissiondto) {
SysRolePermission domain = sysrolepermissionMapping.toDomain(sysrolepermissiondto);
domain .setRolepermissionid(sysrolepermission_id);
sysrolepermissionService.update(domain );
SysRolePermissionDTO dto = sysrolepermissionMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Update-all')")
@ApiOperation(value = "批量更新角色权限关系", tags = {"角色权限关系" }, notes = "批量更新角色权限关系")
@RequestMapping(method = RequestMethod.PUT, value = "/sysrolepermissions/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<SysRolePermissionDTO> sysrolepermissiondtos) {
sysrolepermissionService.updateBatch(sysrolepermissionMapping.toDomain(sysrolepermissiondtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Remove-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Remove-all')")
@ApiOperation(value = "删除角色权限关系", tags = {"角色权限关系" }, notes = "删除角色权限关系") @ApiOperation(value = "删除角色权限关系", tags = {"角色权限关系" }, notes = "删除角色权限关系")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysrolepermissions/{sysrolepermission_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/sysrolepermissions/{sysrolepermission_id}")
...@@ -72,29 +103,19 @@ public class SysRolePermissionResource { ...@@ -72,29 +103,19 @@ public class SysRolePermissionResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@ApiOperation(value = "获取角色权限关系草稿", tags = {"角色权限关系" }, notes = "获取角色权限关系草稿") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Get-all')")
@RequestMapping(method = RequestMethod.GET, value = "/sysrolepermissions/getdraft") @ApiOperation(value = "获取角色权限关系", tags = {"角色权限关系" }, notes = "获取角色权限关系")
public ResponseEntity<SysRolePermissionDTO> getDraft() { @RequestMapping(method = RequestMethod.GET, value = "/sysrolepermissions/{sysrolepermission_id}")
return ResponseEntity.status(HttpStatus.OK).body(sysrolepermissionMapping.toDto(sysrolepermissionService.getDraft(new SysRolePermission()))); public ResponseEntity<SysRolePermissionDTO> get(@PathVariable("sysrolepermission_id") String sysrolepermission_id) {
} SysRolePermission domain = sysrolepermissionService.get(sysrolepermission_id);
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Create-all')")
@ApiOperation(value = "新建角色权限关系", tags = {"角色权限关系" }, notes = "新建角色权限关系")
@RequestMapping(method = RequestMethod.POST, value = "/sysrolepermissions")
@Transactional
public ResponseEntity<SysRolePermissionDTO> create(@RequestBody SysRolePermissionDTO sysrolepermissiondto) {
SysRolePermission domain = sysrolepermissionMapping.toDomain(sysrolepermissiondto);
sysrolepermissionService.create(domain);
SysRolePermissionDTO dto = sysrolepermissionMapping.toDto(domain); SysRolePermissionDTO dto = sysrolepermissionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Create-all')") @ApiOperation(value = "获取角色权限关系草稿", tags = {"角色权限关系" }, notes = "获取角色权限关系草稿")
@ApiOperation(value = "批量新建角色权限关系", tags = {"角色权限关系" }, notes = "批量新建角色权限关系") @RequestMapping(method = RequestMethod.GET, value = "/sysrolepermissions/getdraft")
@RequestMapping(method = RequestMethod.POST, value = "/sysrolepermissions/batch") public ResponseEntity<SysRolePermissionDTO> getDraft() {
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysRolePermissionDTO> sysrolepermissiondtos) { return ResponseEntity.status(HttpStatus.OK).body(sysrolepermissionMapping.toDto(sysrolepermissionService.getDraft(new SysRolePermission())));
sysrolepermissionService.createBatch(sysrolepermissionMapping.toDomain(sysrolepermissiondtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@ApiOperation(value = "检查角色权限关系", tags = {"角色权限关系" }, notes = "检查角色权限关系") @ApiOperation(value = "检查角色权限关系", tags = {"角色权限关系" }, notes = "检查角色权限关系")
...@@ -118,28 +139,7 @@ public class SysRolePermissionResource { ...@@ -118,28 +139,7 @@ public class SysRolePermissionResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@VersionCheck(entity = "sysrolepermission" , versionfield = "updatedate") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-searchDefault-all') and hasPermission(#context,'ibzuaa-SysRolePermission-Get')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Update-all')")
@ApiOperation(value = "更新角色权限关系", tags = {"角色权限关系" }, notes = "更新角色权限关系")
@RequestMapping(method = RequestMethod.PUT, value = "/sysrolepermissions/{sysrolepermission_id}")
@Transactional
public ResponseEntity<SysRolePermissionDTO> update(@PathVariable("sysrolepermission_id") String sysrolepermission_id, @RequestBody SysRolePermissionDTO sysrolepermissiondto) {
SysRolePermission domain = sysrolepermissionMapping.toDomain(sysrolepermissiondto);
domain .setRolepermissionid(sysrolepermission_id);
sysrolepermissionService.update(domain );
SysRolePermissionDTO dto = sysrolepermissionMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Update-all')")
@ApiOperation(value = "批量更新角色权限关系", tags = {"角色权限关系" }, notes = "批量更新角色权限关系")
@RequestMapping(method = RequestMethod.PUT, value = "/sysrolepermissions/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<SysRolePermissionDTO> sysrolepermissiondtos) {
sysrolepermissionService.updateBatch(sysrolepermissionMapping.toDomain(sysrolepermissiondtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-searchDefault-all')")
@ApiOperation(value = "获取DEFAULT", tags = {"角色权限关系" } ,notes = "获取DEFAULT") @ApiOperation(value = "获取DEFAULT", tags = {"角色权限关系" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sysrolepermissions/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/sysrolepermissions/fetchdefault")
public ResponseEntity<List<SysRolePermissionDTO>> fetchDefault(SysRolePermissionSearchContext context) { public ResponseEntity<List<SysRolePermissionDTO>> fetchDefault(SysRolePermissionSearchContext context) {
...@@ -152,7 +152,7 @@ public class SysRolePermissionResource { ...@@ -152,7 +152,7 @@ public class SysRolePermissionResource {
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-searchDefault-all') and hasPermission(#context,'ibzuaa-SysRolePermission-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"角色权限关系" } ,notes = "查询DEFAULT") @ApiOperation(value = "查询DEFAULT", tags = {"角色权限关系" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sysrolepermissions/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/sysrolepermissions/searchdefault")
public ResponseEntity<Page<SysRolePermissionDTO>> searchDefault(@RequestBody SysRolePermissionSearchContext context) { public ResponseEntity<Page<SysRolePermissionDTO>> searchDefault(@RequestBody SysRolePermissionSearchContext context) {
...@@ -160,15 +160,56 @@ public class SysRolePermissionResource { ...@@ -160,15 +160,56 @@ public class SysRolePermissionResource {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(sysrolepermissionMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(sysrolepermissionMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Get-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Create-all')")
@ApiOperation(value = "根据权限/资源获取角色权限关系", tags = {"角色权限关系" }, notes = "根据权限/资源获取角色权限关系") @ApiOperation(value = "根据权限/资源建立角色权限关系", tags = {"角色权限关系" }, notes = "根据权限/资源建立角色权限关系")
@RequestMapping(method = RequestMethod.GET, value = "/syspermissions/{syspermission_id}/sysrolepermissions/{sysrolepermission_id}") @RequestMapping(method = RequestMethod.POST, value = "/syspermissions/{syspermission_id}/sysrolepermissions")
public ResponseEntity<SysRolePermissionDTO> getBySysPermission(@PathVariable("syspermission_id") String syspermission_id, @PathVariable("sysrolepermission_id") String sysrolepermission_id) { @Transactional
SysRolePermission domain = sysrolepermissionService.get(sysrolepermission_id); public ResponseEntity<SysRolePermissionDTO> createBySysPermission(@PathVariable("syspermission_id") String syspermission_id, @RequestBody SysRolePermissionDTO sysrolepermissiondto) {
SysRolePermission domain = sysrolepermissionMapping.toDomain(sysrolepermissiondto);
domain.setPermissionid(syspermission_id);
sysrolepermissionService.create(domain);
SysRolePermissionDTO dto = sysrolepermissionMapping.toDto(domain); SysRolePermissionDTO dto = sysrolepermissionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Create-all')")
@ApiOperation(value = "根据权限/资源批量建立角色权限关系", tags = {"角色权限关系" }, notes = "根据权限/资源批量建立角色权限关系")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/{syspermission_id}/sysrolepermissions/batch")
public ResponseEntity<Boolean> createBatchBySysPermission(@PathVariable("syspermission_id") String syspermission_id, @RequestBody List<SysRolePermissionDTO> sysrolepermissiondtos) {
List<SysRolePermission> domainlist=sysrolepermissionMapping.toDomain(sysrolepermissiondtos);
for(SysRolePermission domain:domainlist){
domain.setPermissionid(syspermission_id);
}
sysrolepermissionService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "sysrolepermission" , versionfield = "updatedate")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Update-all')")
@ApiOperation(value = "根据权限/资源更新角色权限关系", tags = {"角色权限关系" }, notes = "根据权限/资源更新角色权限关系")
@RequestMapping(method = RequestMethod.PUT, value = "/syspermissions/{syspermission_id}/sysrolepermissions/{sysrolepermission_id}")
@Transactional
public ResponseEntity<SysRolePermissionDTO> updateBySysPermission(@PathVariable("syspermission_id") String syspermission_id, @PathVariable("sysrolepermission_id") String sysrolepermission_id, @RequestBody SysRolePermissionDTO sysrolepermissiondto) {
SysRolePermission domain = sysrolepermissionMapping.toDomain(sysrolepermissiondto);
domain.setPermissionid(syspermission_id);
domain.setRolepermissionid(sysrolepermission_id);
sysrolepermissionService.update(domain);
SysRolePermissionDTO dto = sysrolepermissionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Update-all')")
@ApiOperation(value = "根据权限/资源批量更新角色权限关系", tags = {"角色权限关系" }, notes = "根据权限/资源批量更新角色权限关系")
@RequestMapping(method = RequestMethod.PUT, value = "/syspermissions/{syspermission_id}/sysrolepermissions/batch")
public ResponseEntity<Boolean> updateBatchBySysPermission(@PathVariable("syspermission_id") String syspermission_id, @RequestBody List<SysRolePermissionDTO> sysrolepermissiondtos) {
List<SysRolePermission> domainlist=sysrolepermissionMapping.toDomain(sysrolepermissiondtos);
for(SysRolePermission domain:domainlist){
domain.setPermissionid(syspermission_id);
}
sysrolepermissionService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Remove-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Remove-all')")
@ApiOperation(value = "根据权限/资源删除角色权限关系", tags = {"角色权限关系" }, notes = "根据权限/资源删除角色权限关系") @ApiOperation(value = "根据权限/资源删除角色权限关系", tags = {"角色权限关系" }, notes = "根据权限/资源删除角色权限关系")
@RequestMapping(method = RequestMethod.DELETE, value = "/syspermissions/{syspermission_id}/sysrolepermissions/{sysrolepermission_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/syspermissions/{syspermission_id}/sysrolepermissions/{sysrolepermission_id}")
...@@ -185,6 +226,15 @@ public class SysRolePermissionResource { ...@@ -185,6 +226,15 @@ public class SysRolePermissionResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Get-all')")
@ApiOperation(value = "根据权限/资源获取角色权限关系", tags = {"角色权限关系" }, notes = "根据权限/资源获取角色权限关系")
@RequestMapping(method = RequestMethod.GET, value = "/syspermissions/{syspermission_id}/sysrolepermissions/{sysrolepermission_id}")
public ResponseEntity<SysRolePermissionDTO> getBySysPermission(@PathVariable("syspermission_id") String syspermission_id, @PathVariable("sysrolepermission_id") String sysrolepermission_id) {
SysRolePermission domain = sysrolepermissionService.get(sysrolepermission_id);
SysRolePermissionDTO dto = sysrolepermissionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据权限/资源获取角色权限关系草稿", tags = {"角色权限关系" }, notes = "根据权限/资源获取角色权限关系草稿") @ApiOperation(value = "根据权限/资源获取角色权限关系草稿", tags = {"角色权限关系" }, notes = "根据权限/资源获取角色权限关系草稿")
@RequestMapping(method = RequestMethod.GET, value = "/syspermissions/{syspermission_id}/sysrolepermissions/getdraft") @RequestMapping(method = RequestMethod.GET, value = "/syspermissions/{syspermission_id}/sysrolepermissions/getdraft")
public ResponseEntity<SysRolePermissionDTO> getDraftBySysPermission(@PathVariable("syspermission_id") String syspermission_id) { public ResponseEntity<SysRolePermissionDTO> getDraftBySysPermission(@PathVariable("syspermission_id") String syspermission_id) {
...@@ -193,30 +243,6 @@ public class SysRolePermissionResource { ...@@ -193,30 +243,6 @@ public class SysRolePermissionResource {
return ResponseEntity.status(HttpStatus.OK).body(sysrolepermissionMapping.toDto(sysrolepermissionService.getDraft(domain))); return ResponseEntity.status(HttpStatus.OK).body(sysrolepermissionMapping.toDto(sysrolepermissionService.getDraft(domain)));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Create-all')")
@ApiOperation(value = "根据权限/资源建立角色权限关系", tags = {"角色权限关系" }, notes = "根据权限/资源建立角色权限关系")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/{syspermission_id}/sysrolepermissions")
@Transactional
public ResponseEntity<SysRolePermissionDTO> createBySysPermission(@PathVariable("syspermission_id") String syspermission_id, @RequestBody SysRolePermissionDTO sysrolepermissiondto) {
SysRolePermission domain = sysrolepermissionMapping.toDomain(sysrolepermissiondto);
domain.setPermissionid(syspermission_id);
sysrolepermissionService.create(domain);
SysRolePermissionDTO dto = sysrolepermissionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Create-all')")
@ApiOperation(value = "根据权限/资源批量建立角色权限关系", tags = {"角色权限关系" }, notes = "根据权限/资源批量建立角色权限关系")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/{syspermission_id}/sysrolepermissions/batch")
public ResponseEntity<Boolean> createBatchBySysPermission(@PathVariable("syspermission_id") String syspermission_id, @RequestBody List<SysRolePermissionDTO> sysrolepermissiondtos) {
List<SysRolePermission> domainlist=sysrolepermissionMapping.toDomain(sysrolepermissiondtos);
for(SysRolePermission domain:domainlist){
domain.setPermissionid(syspermission_id);
}
sysrolepermissionService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "根据权限/资源检查角色权限关系", tags = {"角色权限关系" }, notes = "根据权限/资源检查角色权限关系") @ApiOperation(value = "根据权限/资源检查角色权限关系", tags = {"角色权限关系" }, notes = "根据权限/资源检查角色权限关系")
@RequestMapping(method = RequestMethod.POST, value = "/syspermissions/{syspermission_id}/sysrolepermissions/checkkey") @RequestMapping(method = RequestMethod.POST, value = "/syspermissions/{syspermission_id}/sysrolepermissions/checkkey")
public ResponseEntity<Boolean> checkKeyBySysPermission(@PathVariable("syspermission_id") String syspermission_id, @RequestBody SysRolePermissionDTO sysrolepermissiondto) { public ResponseEntity<Boolean> checkKeyBySysPermission(@PathVariable("syspermission_id") String syspermission_id, @RequestBody SysRolePermissionDTO sysrolepermissiondto) {
...@@ -244,33 +270,7 @@ public class SysRolePermissionResource { ...@@ -244,33 +270,7 @@ public class SysRolePermissionResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@VersionCheck(entity = "sysrolepermission" , versionfield = "updatedate") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-searchDefault-all') and hasPermission(#context,'ibzuaa-SysRolePermission-Get')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Update-all')")
@ApiOperation(value = "根据权限/资源更新角色权限关系", tags = {"角色权限关系" }, notes = "根据权限/资源更新角色权限关系")
@RequestMapping(method = RequestMethod.PUT, value = "/syspermissions/{syspermission_id}/sysrolepermissions/{sysrolepermission_id}")
@Transactional
public ResponseEntity<SysRolePermissionDTO> updateBySysPermission(@PathVariable("syspermission_id") String syspermission_id, @PathVariable("sysrolepermission_id") String sysrolepermission_id, @RequestBody SysRolePermissionDTO sysrolepermissiondto) {
SysRolePermission domain = sysrolepermissionMapping.toDomain(sysrolepermissiondto);
domain.setPermissionid(syspermission_id);
domain.setRolepermissionid(sysrolepermission_id);
sysrolepermissionService.update(domain);
SysRolePermissionDTO dto = sysrolepermissionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Update-all')")
@ApiOperation(value = "根据权限/资源批量更新角色权限关系", tags = {"角色权限关系" }, notes = "根据权限/资源批量更新角色权限关系")
@RequestMapping(method = RequestMethod.PUT, value = "/syspermissions/{syspermission_id}/sysrolepermissions/batch")
public ResponseEntity<Boolean> updateBatchBySysPermission(@PathVariable("syspermission_id") String syspermission_id, @RequestBody List<SysRolePermissionDTO> sysrolepermissiondtos) {
List<SysRolePermission> domainlist=sysrolepermissionMapping.toDomain(sysrolepermissiondtos);
for(SysRolePermission domain:domainlist){
domain.setPermissionid(syspermission_id);
}
sysrolepermissionService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-searchDefault-all')")
@ApiOperation(value = "根据权限/资源获取DEFAULT", tags = {"角色权限关系" } ,notes = "根据权限/资源获取DEFAULT") @ApiOperation(value = "根据权限/资源获取DEFAULT", tags = {"角色权限关系" } ,notes = "根据权限/资源获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/syspermissions/{syspermission_id}/sysrolepermissions/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/syspermissions/{syspermission_id}/sysrolepermissions/fetchdefault")
public ResponseEntity<List<SysRolePermissionDTO>> fetchSysRolePermissionDefaultBySysPermission(@PathVariable("syspermission_id") String syspermission_id,SysRolePermissionSearchContext context) { public ResponseEntity<List<SysRolePermissionDTO>> fetchSysRolePermissionDefaultBySysPermission(@PathVariable("syspermission_id") String syspermission_id,SysRolePermissionSearchContext context) {
...@@ -284,7 +284,7 @@ public class SysRolePermissionResource { ...@@ -284,7 +284,7 @@ public class SysRolePermissionResource {
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-searchDefault-all') and hasPermission(#context,'ibzuaa-SysRolePermission-Get')")
@ApiOperation(value = "根据权限/资源查询DEFAULT", tags = {"角色权限关系" } ,notes = "根据权限/资源查询DEFAULT") @ApiOperation(value = "根据权限/资源查询DEFAULT", tags = {"角色权限关系" } ,notes = "根据权限/资源查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/syspermissions/{syspermission_id}/sysrolepermissions/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/syspermissions/{syspermission_id}/sysrolepermissions/searchdefault")
public ResponseEntity<Page<SysRolePermissionDTO>> searchSysRolePermissionDefaultBySysPermission(@PathVariable("syspermission_id") String syspermission_id, @RequestBody SysRolePermissionSearchContext context) { public ResponseEntity<Page<SysRolePermissionDTO>> searchSysRolePermissionDefaultBySysPermission(@PathVariable("syspermission_id") String syspermission_id, @RequestBody SysRolePermissionSearchContext context) {
...@@ -293,15 +293,56 @@ public class SysRolePermissionResource { ...@@ -293,15 +293,56 @@ public class SysRolePermissionResource {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(sysrolepermissionMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(sysrolepermissionMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Get-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Create-all')")
@ApiOperation(value = "根据系统角色获取角色权限关系", tags = {"角色权限关系" }, notes = "根据系统角色获取角色权限关系") @ApiOperation(value = "根据系统角色建立角色权限关系", tags = {"角色权限关系" }, notes = "根据系统角色建立角色权限关系")
@RequestMapping(method = RequestMethod.GET, value = "/sysroles/{sysrole_id}/sysrolepermissions/{sysrolepermission_id}") @RequestMapping(method = RequestMethod.POST, value = "/sysroles/{sysrole_id}/sysrolepermissions")
public ResponseEntity<SysRolePermissionDTO> getBySysRole(@PathVariable("sysrole_id") String sysrole_id, @PathVariable("sysrolepermission_id") String sysrolepermission_id) { @Transactional
SysRolePermission domain = sysrolepermissionService.get(sysrolepermission_id); public ResponseEntity<SysRolePermissionDTO> createBySysRole(@PathVariable("sysrole_id") String sysrole_id, @RequestBody SysRolePermissionDTO sysrolepermissiondto) {
SysRolePermission domain = sysrolepermissionMapping.toDomain(sysrolepermissiondto);
domain.setRoleid(sysrole_id);
sysrolepermissionService.create(domain);
SysRolePermissionDTO dto = sysrolepermissionMapping.toDto(domain); SysRolePermissionDTO dto = sysrolepermissionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Create-all')")
@ApiOperation(value = "根据系统角色批量建立角色权限关系", tags = {"角色权限关系" }, notes = "根据系统角色批量建立角色权限关系")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles/{sysrole_id}/sysrolepermissions/batch")
public ResponseEntity<Boolean> createBatchBySysRole(@PathVariable("sysrole_id") String sysrole_id, @RequestBody List<SysRolePermissionDTO> sysrolepermissiondtos) {
List<SysRolePermission> domainlist=sysrolepermissionMapping.toDomain(sysrolepermissiondtos);
for(SysRolePermission domain:domainlist){
domain.setRoleid(sysrole_id);
}
sysrolepermissionService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "sysrolepermission" , versionfield = "updatedate")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Update-all')")
@ApiOperation(value = "根据系统角色更新角色权限关系", tags = {"角色权限关系" }, notes = "根据系统角色更新角色权限关系")
@RequestMapping(method = RequestMethod.PUT, value = "/sysroles/{sysrole_id}/sysrolepermissions/{sysrolepermission_id}")
@Transactional
public ResponseEntity<SysRolePermissionDTO> updateBySysRole(@PathVariable("sysrole_id") String sysrole_id, @PathVariable("sysrolepermission_id") String sysrolepermission_id, @RequestBody SysRolePermissionDTO sysrolepermissiondto) {
SysRolePermission domain = sysrolepermissionMapping.toDomain(sysrolepermissiondto);
domain.setRoleid(sysrole_id);
domain.setRolepermissionid(sysrolepermission_id);
sysrolepermissionService.update(domain);
SysRolePermissionDTO dto = sysrolepermissionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Update-all')")
@ApiOperation(value = "根据系统角色批量更新角色权限关系", tags = {"角色权限关系" }, notes = "根据系统角色批量更新角色权限关系")
@RequestMapping(method = RequestMethod.PUT, value = "/sysroles/{sysrole_id}/sysrolepermissions/batch")
public ResponseEntity<Boolean> updateBatchBySysRole(@PathVariable("sysrole_id") String sysrole_id, @RequestBody List<SysRolePermissionDTO> sysrolepermissiondtos) {
List<SysRolePermission> domainlist=sysrolepermissionMapping.toDomain(sysrolepermissiondtos);
for(SysRolePermission domain:domainlist){
domain.setRoleid(sysrole_id);
}
sysrolepermissionService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Remove-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Remove-all')")
@ApiOperation(value = "根据系统角色删除角色权限关系", tags = {"角色权限关系" }, notes = "根据系统角色删除角色权限关系") @ApiOperation(value = "根据系统角色删除角色权限关系", tags = {"角色权限关系" }, notes = "根据系统角色删除角色权限关系")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysroles/{sysrole_id}/sysrolepermissions/{sysrolepermission_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/sysroles/{sysrole_id}/sysrolepermissions/{sysrolepermission_id}")
...@@ -318,6 +359,15 @@ public class SysRolePermissionResource { ...@@ -318,6 +359,15 @@ public class SysRolePermissionResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Get-all')")
@ApiOperation(value = "根据系统角色获取角色权限关系", tags = {"角色权限关系" }, notes = "根据系统角色获取角色权限关系")
@RequestMapping(method = RequestMethod.GET, value = "/sysroles/{sysrole_id}/sysrolepermissions/{sysrolepermission_id}")
public ResponseEntity<SysRolePermissionDTO> getBySysRole(@PathVariable("sysrole_id") String sysrole_id, @PathVariable("sysrolepermission_id") String sysrolepermission_id) {
SysRolePermission domain = sysrolepermissionService.get(sysrolepermission_id);
SysRolePermissionDTO dto = sysrolepermissionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据系统角色获取角色权限关系草稿", tags = {"角色权限关系" }, notes = "根据系统角色获取角色权限关系草稿") @ApiOperation(value = "根据系统角色获取角色权限关系草稿", tags = {"角色权限关系" }, notes = "根据系统角色获取角色权限关系草稿")
@RequestMapping(method = RequestMethod.GET, value = "/sysroles/{sysrole_id}/sysrolepermissions/getdraft") @RequestMapping(method = RequestMethod.GET, value = "/sysroles/{sysrole_id}/sysrolepermissions/getdraft")
public ResponseEntity<SysRolePermissionDTO> getDraftBySysRole(@PathVariable("sysrole_id") String sysrole_id) { public ResponseEntity<SysRolePermissionDTO> getDraftBySysRole(@PathVariable("sysrole_id") String sysrole_id) {
...@@ -326,30 +376,6 @@ public class SysRolePermissionResource { ...@@ -326,30 +376,6 @@ public class SysRolePermissionResource {
return ResponseEntity.status(HttpStatus.OK).body(sysrolepermissionMapping.toDto(sysrolepermissionService.getDraft(domain))); return ResponseEntity.status(HttpStatus.OK).body(sysrolepermissionMapping.toDto(sysrolepermissionService.getDraft(domain)));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Create-all')")
@ApiOperation(value = "根据系统角色建立角色权限关系", tags = {"角色权限关系" }, notes = "根据系统角色建立角色权限关系")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles/{sysrole_id}/sysrolepermissions")
@Transactional
public ResponseEntity<SysRolePermissionDTO> createBySysRole(@PathVariable("sysrole_id") String sysrole_id, @RequestBody SysRolePermissionDTO sysrolepermissiondto) {
SysRolePermission domain = sysrolepermissionMapping.toDomain(sysrolepermissiondto);
domain.setRoleid(sysrole_id);
sysrolepermissionService.create(domain);
SysRolePermissionDTO dto = sysrolepermissionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Create-all')")
@ApiOperation(value = "根据系统角色批量建立角色权限关系", tags = {"角色权限关系" }, notes = "根据系统角色批量建立角色权限关系")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles/{sysrole_id}/sysrolepermissions/batch")
public ResponseEntity<Boolean> createBatchBySysRole(@PathVariable("sysrole_id") String sysrole_id, @RequestBody List<SysRolePermissionDTO> sysrolepermissiondtos) {
List<SysRolePermission> domainlist=sysrolepermissionMapping.toDomain(sysrolepermissiondtos);
for(SysRolePermission domain:domainlist){
domain.setRoleid(sysrole_id);
}
sysrolepermissionService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@ApiOperation(value = "根据系统角色检查角色权限关系", tags = {"角色权限关系" }, notes = "根据系统角色检查角色权限关系") @ApiOperation(value = "根据系统角色检查角色权限关系", tags = {"角色权限关系" }, notes = "根据系统角色检查角色权限关系")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles/{sysrole_id}/sysrolepermissions/checkkey") @RequestMapping(method = RequestMethod.POST, value = "/sysroles/{sysrole_id}/sysrolepermissions/checkkey")
public ResponseEntity<Boolean> checkKeyBySysRole(@PathVariable("sysrole_id") String sysrole_id, @RequestBody SysRolePermissionDTO sysrolepermissiondto) { public ResponseEntity<Boolean> checkKeyBySysRole(@PathVariable("sysrole_id") String sysrole_id, @RequestBody SysRolePermissionDTO sysrolepermissiondto) {
...@@ -377,33 +403,7 @@ public class SysRolePermissionResource { ...@@ -377,33 +403,7 @@ public class SysRolePermissionResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@VersionCheck(entity = "sysrolepermission" , versionfield = "updatedate") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-searchDefault-all') and hasPermission(#context,'ibzuaa-SysRolePermission-Get')")
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Update-all')")
@ApiOperation(value = "根据系统角色更新角色权限关系", tags = {"角色权限关系" }, notes = "根据系统角色更新角色权限关系")
@RequestMapping(method = RequestMethod.PUT, value = "/sysroles/{sysrole_id}/sysrolepermissions/{sysrolepermission_id}")
@Transactional
public ResponseEntity<SysRolePermissionDTO> updateBySysRole(@PathVariable("sysrole_id") String sysrole_id, @PathVariable("sysrolepermission_id") String sysrolepermission_id, @RequestBody SysRolePermissionDTO sysrolepermissiondto) {
SysRolePermission domain = sysrolepermissionMapping.toDomain(sysrolepermissiondto);
domain.setRoleid(sysrole_id);
domain.setRolepermissionid(sysrolepermission_id);
sysrolepermissionService.update(domain);
SysRolePermissionDTO dto = sysrolepermissionMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-Update-all')")
@ApiOperation(value = "根据系统角色批量更新角色权限关系", tags = {"角色权限关系" }, notes = "根据系统角色批量更新角色权限关系")
@RequestMapping(method = RequestMethod.PUT, value = "/sysroles/{sysrole_id}/sysrolepermissions/batch")
public ResponseEntity<Boolean> updateBatchBySysRole(@PathVariable("sysrole_id") String sysrole_id, @RequestBody List<SysRolePermissionDTO> sysrolepermissiondtos) {
List<SysRolePermission> domainlist=sysrolepermissionMapping.toDomain(sysrolepermissiondtos);
for(SysRolePermission domain:domainlist){
domain.setRoleid(sysrole_id);
}
sysrolepermissionService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-searchDefault-all')")
@ApiOperation(value = "根据系统角色获取DEFAULT", tags = {"角色权限关系" } ,notes = "根据系统角色获取DEFAULT") @ApiOperation(value = "根据系统角色获取DEFAULT", tags = {"角色权限关系" } ,notes = "根据系统角色获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sysroles/{sysrole_id}/sysrolepermissions/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/sysroles/{sysrole_id}/sysrolepermissions/fetchdefault")
public ResponseEntity<List<SysRolePermissionDTO>> fetchSysRolePermissionDefaultBySysRole(@PathVariable("sysrole_id") String sysrole_id,SysRolePermissionSearchContext context) { public ResponseEntity<List<SysRolePermissionDTO>> fetchSysRolePermissionDefaultBySysRole(@PathVariable("sysrole_id") String sysrole_id,SysRolePermissionSearchContext context) {
...@@ -417,7 +417,7 @@ public class SysRolePermissionResource { ...@@ -417,7 +417,7 @@ public class SysRolePermissionResource {
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRolePermission-searchDefault-all') and hasPermission(#context,'ibzuaa-SysRolePermission-Get')")
@ApiOperation(value = "根据系统角色查询DEFAULT", tags = {"角色权限关系" } ,notes = "根据系统角色查询DEFAULT") @ApiOperation(value = "根据系统角色查询DEFAULT", tags = {"角色权限关系" } ,notes = "根据系统角色查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sysroles/{sysrole_id}/sysrolepermissions/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/sysroles/{sysrole_id}/sysrolepermissions/searchdefault")
public ResponseEntity<Page<SysRolePermissionDTO>> searchSysRolePermissionDefaultBySysRole(@PathVariable("sysrole_id") String sysrole_id, @RequestBody SysRolePermissionSearchContext context) { public ResponseEntity<Page<SysRolePermissionDTO>> searchSysRolePermissionDefaultBySysRole(@PathVariable("sysrole_id") String sysrole_id, @RequestBody SysRolePermissionSearchContext context) {
......
...@@ -47,18 +47,22 @@ public class SysRoleResource { ...@@ -47,18 +47,22 @@ public class SysRoleResource {
@Lazy @Lazy
public SysRoleMapping sysroleMapping; public SysRoleMapping sysroleMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Save-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Create-all')")
@ApiOperation(value = "保存系统角色", tags = {"系统角色" }, notes = "保存系统角色") @ApiOperation(value = "新建系统角色", tags = {"系统角色" }, notes = "新建系统角色")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles/save") @RequestMapping(method = RequestMethod.POST, value = "/sysroles")
public ResponseEntity<Boolean> save(@RequestBody SysRoleDTO sysroledto) { @Transactional
return ResponseEntity.status(HttpStatus.OK).body(sysroleService.save(sysroleMapping.toDomain(sysroledto))); public ResponseEntity<SysRoleDTO> create(@RequestBody SysRoleDTO sysroledto) {
SysRole domain = sysroleMapping.toDomain(sysroledto);
sysroleService.create(domain);
SysRoleDTO dto = sysroleMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Save-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Create-all')")
@ApiOperation(value = "批量保存系统角色", tags = {"系统角色" }, notes = "批量保存系统角色") @ApiOperation(value = "批量新建系统角色", tags = {"系统角色" }, notes = "批量新建系统角色")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles/savebatch") @RequestMapping(method = RequestMethod.POST, value = "/sysroles/batch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<SysRoleDTO> sysroledtos) { public ResponseEntity<Boolean> createBatch(@RequestBody List<SysRoleDTO> sysroledtos) {
sysroleService.saveBatch(sysroleMapping.toDomain(sysroledtos)); sysroleService.createBatch(sysroleMapping.toDomain(sysroledtos));
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
...@@ -83,34 +87,6 @@ public class SysRoleResource { ...@@ -83,34 +87,6 @@ public class SysRoleResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Create-all')")
@ApiOperation(value = "新建系统角色", tags = {"系统角色" }, notes = "新建系统角色")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles")
@Transactional
public ResponseEntity<SysRoleDTO> create(@RequestBody SysRoleDTO sysroledto) {
SysRole domain = sysroleMapping.toDomain(sysroledto);
sysroleService.create(domain);
SysRoleDTO dto = sysroleMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Create-all')")
@ApiOperation(value = "批量新建系统角色", tags = {"系统角色" }, notes = "批量新建系统角色")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysRoleDTO> sysroledtos) {
sysroleService.createBatch(sysroleMapping.toDomain(sysroledtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Get-all')")
@ApiOperation(value = "获取系统角色", tags = {"系统角色" }, notes = "获取系统角色")
@RequestMapping(method = RequestMethod.GET, value = "/sysroles/{sysrole_id}")
public ResponseEntity<SysRoleDTO> get(@PathVariable("sysrole_id") String sysrole_id) {
SysRole domain = sysroleService.get(sysrole_id);
SysRoleDTO dto = sysroleMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Remove-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Remove-all')")
@ApiOperation(value = "删除系统角色", tags = {"系统角色" }, notes = "删除系统角色") @ApiOperation(value = "删除系统角色", tags = {"系统角色" }, notes = "删除系统角色")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysroles/{sysrole_id}") @RequestMapping(method = RequestMethod.DELETE, value = "/sysroles/{sysrole_id}")
...@@ -127,6 +103,15 @@ public class SysRoleResource { ...@@ -127,6 +103,15 @@ public class SysRoleResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Get-all')")
@ApiOperation(value = "获取系统角色", tags = {"系统角色" }, notes = "获取系统角色")
@RequestMapping(method = RequestMethod.GET, value = "/sysroles/{sysrole_id}")
public ResponseEntity<SysRoleDTO> get(@PathVariable("sysrole_id") String sysrole_id) {
SysRole domain = sysroleService.get(sysrole_id);
SysRoleDTO dto = sysroleMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取系统角色草稿", tags = {"系统角色" }, notes = "获取系统角色草稿") @ApiOperation(value = "获取系统角色草稿", tags = {"系统角色" }, notes = "获取系统角色草稿")
@RequestMapping(method = RequestMethod.GET, value = "/sysroles/getdraft") @RequestMapping(method = RequestMethod.GET, value = "/sysroles/getdraft")
public ResponseEntity<SysRoleDTO> getDraft() { public ResponseEntity<SysRoleDTO> getDraft() {
...@@ -139,7 +124,22 @@ public class SysRoleResource { ...@@ -139,7 +124,22 @@ public class SysRoleResource {
return ResponseEntity.status(HttpStatus.OK).body(sysroleService.checkKey(sysroleMapping.toDomain(sysroledto))); return ResponseEntity.status(HttpStatus.OK).body(sysroleService.checkKey(sysroleMapping.toDomain(sysroledto)));
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Save-all')")
@ApiOperation(value = "保存系统角色", tags = {"系统角色" }, notes = "保存系统角色")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles/save")
public ResponseEntity<Boolean> save(@RequestBody SysRoleDTO sysroledto) {
return ResponseEntity.status(HttpStatus.OK).body(sysroleService.save(sysroleMapping.toDomain(sysroledto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-Save-all')")
@ApiOperation(value = "批量保存系统角色", tags = {"系统角色" }, notes = "批量保存系统角色")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<SysRoleDTO> sysroledtos) {
sysroleService.saveBatch(sysroleMapping.toDomain(sysroledtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-searchDefault-all') and hasPermission(#context,'ibzuaa-SysRole-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"系统角色" } ,notes = "获取DEFAULT") @ApiOperation(value = "获取DEFAULT", tags = {"系统角色" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sysroles/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/sysroles/fetchdefault")
public ResponseEntity<List<SysRoleDTO>> fetchDefault(SysRoleSearchContext context) { public ResponseEntity<List<SysRoleDTO>> fetchDefault(SysRoleSearchContext context) {
...@@ -152,7 +152,7 @@ public class SysRoleResource { ...@@ -152,7 +152,7 @@ public class SysRoleResource {
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysRole-searchDefault-all') and hasPermission(#context,'ibzuaa-SysRole-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"系统角色" } ,notes = "查询DEFAULT") @ApiOperation(value = "查询DEFAULT", tags = {"系统角色" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sysroles/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/sysroles/searchdefault")
public ResponseEntity<Page<SysRoleDTO>> searchDefault(@RequestBody SysRoleSearchContext context) { public ResponseEntity<Page<SysRoleDTO>> searchDefault(@RequestBody SysRoleSearchContext context) {
......
...@@ -47,19 +47,22 @@ public class SysUserResource { ...@@ -47,19 +47,22 @@ public class SysUserResource {
@Lazy @Lazy
public SysUserMapping sysuserMapping; public SysUserMapping sysuserMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Remove-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Create-all')")
@ApiOperation(value = "删除系统用户", tags = {"系统用户" }, notes = "删除系统用户") @ApiOperation(value = "新建系统用户", tags = {"系统用户" }, notes = "新建系统用户")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysusers/{sysuser_id}") @RequestMapping(method = RequestMethod.POST, value = "/sysusers")
@Transactional @Transactional
public ResponseEntity<Boolean> remove(@PathVariable("sysuser_id") String sysuser_id) { public ResponseEntity<SysUserDTO> create(@RequestBody SysUserDTO sysuserdto) {
return ResponseEntity.status(HttpStatus.OK).body(sysuserService.remove(sysuser_id)); SysUser domain = sysuserMapping.toDomain(sysuserdto);
sysuserService.create(domain);
SysUserDTO dto = sysuserMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Remove-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Create-all')")
@ApiOperation(value = "批量删除系统用户", tags = {"系统用户" }, notes = "批量删除系统用户") @ApiOperation(value = "批量新建系统用户", tags = {"系统用户" }, notes = "批量新建系统用户")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysusers/batch") @RequestMapping(method = RequestMethod.POST, value = "/sysusers/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) { public ResponseEntity<Boolean> createBatch(@RequestBody List<SysUserDTO> sysuserdtos) {
sysuserService.removeBatch(ids); sysuserService.createBatch(sysuserMapping.toDomain(sysuserdtos));
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
...@@ -83,10 +86,20 @@ public class SysUserResource { ...@@ -83,10 +86,20 @@ public class SysUserResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@ApiOperation(value = "检查系统用户", tags = {"系统用户" }, notes = "检查系统用户") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Remove-all')")
@RequestMapping(method = RequestMethod.POST, value = "/sysusers/checkkey") @ApiOperation(value = "删除系统用户", tags = {"系统用户" }, notes = "删除系统用户")
public ResponseEntity<Boolean> checkKey(@RequestBody SysUserDTO sysuserdto) { @RequestMapping(method = RequestMethod.DELETE, value = "/sysusers/{sysuser_id}")
return ResponseEntity.status(HttpStatus.OK).body(sysuserService.checkKey(sysuserMapping.toDomain(sysuserdto))); @Transactional
public ResponseEntity<Boolean> remove(@PathVariable("sysuser_id") String sysuser_id) {
return ResponseEntity.status(HttpStatus.OK).body(sysuserService.remove(sysuser_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Remove-all')")
@ApiOperation(value = "批量删除系统用户", tags = {"系统用户" }, notes = "批量删除系统用户")
@RequestMapping(method = RequestMethod.DELETE, value = "/sysusers/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
sysuserService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Get-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Get-all')")
...@@ -98,6 +111,18 @@ public class SysUserResource { ...@@ -98,6 +111,18 @@ public class SysUserResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@ApiOperation(value = "获取系统用户草稿", tags = {"系统用户" }, notes = "获取系统用户草稿")
@RequestMapping(method = RequestMethod.GET, value = "/sysusers/getdraft")
public ResponseEntity<SysUserDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(sysuserMapping.toDto(sysuserService.getDraft(new SysUser())));
}
@ApiOperation(value = "检查系统用户", tags = {"系统用户" }, notes = "检查系统用户")
@RequestMapping(method = RequestMethod.POST, value = "/sysusers/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody SysUserDTO sysuserdto) {
return ResponseEntity.status(HttpStatus.OK).body(sysuserService.checkKey(sysuserMapping.toDomain(sysuserdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Save-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Save-all')")
@ApiOperation(value = "保存系统用户", tags = {"系统用户" }, notes = "保存系统用户") @ApiOperation(value = "保存系统用户", tags = {"系统用户" }, notes = "保存系统用户")
@RequestMapping(method = RequestMethod.POST, value = "/sysusers/save") @RequestMapping(method = RequestMethod.POST, value = "/sysusers/save")
...@@ -113,32 +138,7 @@ public class SysUserResource { ...@@ -113,32 +138,7 @@ public class SysUserResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@ApiOperation(value = "获取系统用户草稿", tags = {"系统用户" }, notes = "获取系统用户草稿") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-searchDefault-all') and hasPermission(#context,'ibzuaa-SysUser-Get')")
@RequestMapping(method = RequestMethod.GET, value = "/sysusers/getdraft")
public ResponseEntity<SysUserDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(sysuserMapping.toDto(sysuserService.getDraft(new SysUser())));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Create-all')")
@ApiOperation(value = "新建系统用户", tags = {"系统用户" }, notes = "新建系统用户")
@RequestMapping(method = RequestMethod.POST, value = "/sysusers")
@Transactional
public ResponseEntity<SysUserDTO> create(@RequestBody SysUserDTO sysuserdto) {
SysUser domain = sysuserMapping.toDomain(sysuserdto);
sysuserService.create(domain);
SysUserDTO dto = sysuserMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-Create-all')")
@ApiOperation(value = "批量新建系统用户", tags = {"系统用户" }, notes = "批量新建系统用户")
@RequestMapping(method = RequestMethod.POST, value = "/sysusers/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysUserDTO> sysuserdtos) {
sysuserService.createBatch(sysuserMapping.toDomain(sysuserdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-searchDefault-all')")
@ApiOperation(value = "获取DEFAULT", tags = {"系统用户" } ,notes = "获取DEFAULT") @ApiOperation(value = "获取DEFAULT", tags = {"系统用户" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sysusers/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/sysusers/fetchdefault")
public ResponseEntity<List<SysUserDTO>> fetchDefault(SysUserSearchContext context) { public ResponseEntity<List<SysUserDTO>> fetchDefault(SysUserSearchContext context) {
...@@ -151,7 +151,7 @@ public class SysUserResource { ...@@ -151,7 +151,7 @@ public class SysUserResource {
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUser-searchDefault-all') and hasPermission(#context,'ibzuaa-SysUser-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"系统用户" } ,notes = "查询DEFAULT") @ApiOperation(value = "查询DEFAULT", tags = {"系统用户" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sysusers/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/sysusers/searchdefault")
public ResponseEntity<Page<SysUserDTO>> searchDefault(@RequestBody SysUserSearchContext context) { public ResponseEntity<Page<SysUserDTO>> searchDefault(@RequestBody SysUserSearchContext context) {
......
...@@ -47,16 +47,23 @@ public class SysUserRoleResource { ...@@ -47,16 +47,23 @@ public class SysUserRoleResource {
@Lazy @Lazy
public SysUserRoleMapping sysuserroleMapping; public SysUserRoleMapping sysuserroleMapping;
@ApiOperation(value = "检查用户角色关系", tags = {"用户角色关系" }, notes = "检查用户角色关系") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Create-all')")
@RequestMapping(method = RequestMethod.POST, value = "/sysuserroles/checkkey") @ApiOperation(value = "新建用户角色关系", tags = {"用户角色关系" }, notes = "新建用户角色关系")
public ResponseEntity<Boolean> checkKey(@RequestBody SysUserRoleDTO sysuserroledto) { @RequestMapping(method = RequestMethod.POST, value = "/sysuserroles")
return ResponseEntity.status(HttpStatus.OK).body(sysuserroleService.checkKey(sysuserroleMapping.toDomain(sysuserroledto))); @Transactional
public ResponseEntity<SysUserRoleDTO> create(@RequestBody SysUserRoleDTO sysuserroledto) {
SysUserRole domain = sysuserroleMapping.toDomain(sysuserroledto);
sysuserroleService.create(domain);
SysUserRoleDTO dto = sysuserroleMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@ApiOperation(value = "获取用户角色关系草稿", tags = {"用户角色关系" }, notes = "获取用户角色关系草稿") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Create-all')")
@RequestMapping(method = RequestMethod.GET, value = "/sysuserroles/getdraft") @ApiOperation(value = "批量新建用户角色关系", tags = {"用户角色关系" }, notes = "批量新建用户角色关系")
public ResponseEntity<SysUserRoleDTO> getDraft() { @RequestMapping(method = RequestMethod.POST, value = "/sysuserroles/batch")
return ResponseEntity.status(HttpStatus.OK).body(sysuserroleMapping.toDto(sysuserroleService.getDraft(new SysUserRole()))); public ResponseEntity<Boolean> createBatch(@RequestBody List<SysUserRoleDTO> sysuserroledtos) {
sysuserroleService.createBatch(sysuserroleMapping.toDomain(sysuserroledtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@VersionCheck(entity = "sysuserrole" , versionfield = "updatedate") @VersionCheck(entity = "sysuserrole" , versionfield = "updatedate")
...@@ -96,25 +103,6 @@ public class SysUserRoleResource { ...@@ -96,25 +103,6 @@ public class SysUserRoleResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Create-all')")
@ApiOperation(value = "新建用户角色关系", tags = {"用户角色关系" }, notes = "新建用户角色关系")
@RequestMapping(method = RequestMethod.POST, value = "/sysuserroles")
@Transactional
public ResponseEntity<SysUserRoleDTO> create(@RequestBody SysUserRoleDTO sysuserroledto) {
SysUserRole domain = sysuserroleMapping.toDomain(sysuserroledto);
sysuserroleService.create(domain);
SysUserRoleDTO dto = sysuserroleMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Create-all')")
@ApiOperation(value = "批量新建用户角色关系", tags = {"用户角色关系" }, notes = "批量新建用户角色关系")
@RequestMapping(method = RequestMethod.POST, value = "/sysuserroles/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<SysUserRoleDTO> sysuserroledtos) {
sysuserroleService.createBatch(sysuserroleMapping.toDomain(sysuserroledtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Get-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Get-all')")
@ApiOperation(value = "获取用户角色关系", tags = {"用户角色关系" }, notes = "获取用户角色关系") @ApiOperation(value = "获取用户角色关系", tags = {"用户角色关系" }, notes = "获取用户角色关系")
@RequestMapping(method = RequestMethod.GET, value = "/sysuserroles/{sysuserrole_id}") @RequestMapping(method = RequestMethod.GET, value = "/sysuserroles/{sysuserrole_id}")
...@@ -124,6 +112,18 @@ public class SysUserRoleResource { ...@@ -124,6 +112,18 @@ public class SysUserRoleResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@ApiOperation(value = "获取用户角色关系草稿", tags = {"用户角色关系" }, notes = "获取用户角色关系草稿")
@RequestMapping(method = RequestMethod.GET, value = "/sysuserroles/getdraft")
public ResponseEntity<SysUserRoleDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(sysuserroleMapping.toDto(sysuserroleService.getDraft(new SysUserRole())));
}
@ApiOperation(value = "检查用户角色关系", tags = {"用户角色关系" }, notes = "检查用户角色关系")
@RequestMapping(method = RequestMethod.POST, value = "/sysuserroles/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody SysUserRoleDTO sysuserroledto) {
return ResponseEntity.status(HttpStatus.OK).body(sysuserroleService.checkKey(sysuserroleMapping.toDomain(sysuserroledto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Save-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Save-all')")
@ApiOperation(value = "保存用户角色关系", tags = {"用户角色关系" }, notes = "保存用户角色关系") @ApiOperation(value = "保存用户角色关系", tags = {"用户角色关系" }, notes = "保存用户角色关系")
@RequestMapping(method = RequestMethod.POST, value = "/sysuserroles/save") @RequestMapping(method = RequestMethod.POST, value = "/sysuserroles/save")
...@@ -139,7 +139,7 @@ public class SysUserRoleResource { ...@@ -139,7 +139,7 @@ public class SysUserRoleResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-searchDefault-all') and hasPermission(#context,'ibzuaa-SysUserRole-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"用户角色关系" } ,notes = "获取DEFAULT") @ApiOperation(value = "获取DEFAULT", tags = {"用户角色关系" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sysuserroles/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/sysuserroles/fetchdefault")
public ResponseEntity<List<SysUserRoleDTO>> fetchDefault(SysUserRoleSearchContext context) { public ResponseEntity<List<SysUserRoleDTO>> fetchDefault(SysUserRoleSearchContext context) {
...@@ -152,7 +152,7 @@ public class SysUserRoleResource { ...@@ -152,7 +152,7 @@ public class SysUserRoleResource {
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-searchDefault-all') and hasPermission(#context,'ibzuaa-SysUserRole-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"用户角色关系" } ,notes = "查询DEFAULT") @ApiOperation(value = "查询DEFAULT", tags = {"用户角色关系" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sysuserroles/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/sysuserroles/searchdefault")
public ResponseEntity<Page<SysUserRoleDTO>> searchDefault(@RequestBody SysUserRoleSearchContext context) { public ResponseEntity<Page<SysUserRoleDTO>> searchDefault(@RequestBody SysUserRoleSearchContext context) {
...@@ -160,18 +160,28 @@ public class SysUserRoleResource { ...@@ -160,18 +160,28 @@ public class SysUserRoleResource {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(sysuserroleMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(sysuserroleMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
} }
@ApiOperation(value = "根据系统角色检查用户角色关系", tags = {"用户角色关系" }, notes = "根据系统角色检查用户角色关系") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Create-all')")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles/{sysrole_id}/sysuserroles/checkkey") @ApiOperation(value = "根据系统角色建立用户角色关系", tags = {"用户角色关系" }, notes = "根据系统角色建立用户角色关系")
public ResponseEntity<Boolean> checkKeyBySysRole(@PathVariable("sysrole_id") String sysrole_id, @RequestBody SysUserRoleDTO sysuserroledto) { @RequestMapping(method = RequestMethod.POST, value = "/sysroles/{sysrole_id}/sysuserroles")
return ResponseEntity.status(HttpStatus.OK).body(sysuserroleService.checkKey(sysuserroleMapping.toDomain(sysuserroledto))); @Transactional
public ResponseEntity<SysUserRoleDTO> createBySysRole(@PathVariable("sysrole_id") String sysrole_id, @RequestBody SysUserRoleDTO sysuserroledto) {
SysUserRole domain = sysuserroleMapping.toDomain(sysuserroledto);
domain.setRoleid(sysrole_id);
sysuserroleService.create(domain);
SysUserRoleDTO dto = sysuserroleMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@ApiOperation(value = "根据系统角色获取用户角色关系草稿", tags = {"用户角色关系" }, notes = "根据系统角色获取用户角色关系草稿") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Create-all')")
@RequestMapping(method = RequestMethod.GET, value = "/sysroles/{sysrole_id}/sysuserroles/getdraft") @ApiOperation(value = "根据系统角色批量建立用户角色关系", tags = {"用户角色关系" }, notes = "根据系统角色批量建立用户角色关系")
public ResponseEntity<SysUserRoleDTO> getDraftBySysRole(@PathVariable("sysrole_id") String sysrole_id) { @RequestMapping(method = RequestMethod.POST, value = "/sysroles/{sysrole_id}/sysuserroles/batch")
SysUserRole domain = new SysUserRole(); public ResponseEntity<Boolean> createBatchBySysRole(@PathVariable("sysrole_id") String sysrole_id, @RequestBody List<SysUserRoleDTO> sysuserroledtos) {
List<SysUserRole> domainlist=sysuserroleMapping.toDomain(sysuserroledtos);
for(SysUserRole domain:domainlist){
domain.setRoleid(sysrole_id); domain.setRoleid(sysrole_id);
return ResponseEntity.status(HttpStatus.OK).body(sysuserroleMapping.toDto(sysuserroleService.getDraft(domain))); }
sysuserroleService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@VersionCheck(entity = "sysuserrole" , versionfield = "updatedate") @VersionCheck(entity = "sysuserrole" , versionfield = "updatedate")
...@@ -216,30 +226,6 @@ public class SysUserRoleResource { ...@@ -216,30 +226,6 @@ public class SysUserRoleResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Create-all')")
@ApiOperation(value = "根据系统角色建立用户角色关系", tags = {"用户角色关系" }, notes = "根据系统角色建立用户角色关系")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles/{sysrole_id}/sysuserroles")
@Transactional
public ResponseEntity<SysUserRoleDTO> createBySysRole(@PathVariable("sysrole_id") String sysrole_id, @RequestBody SysUserRoleDTO sysuserroledto) {
SysUserRole domain = sysuserroleMapping.toDomain(sysuserroledto);
domain.setRoleid(sysrole_id);
sysuserroleService.create(domain);
SysUserRoleDTO dto = sysuserroleMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Create-all')")
@ApiOperation(value = "根据系统角色批量建立用户角色关系", tags = {"用户角色关系" }, notes = "根据系统角色批量建立用户角色关系")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles/{sysrole_id}/sysuserroles/batch")
public ResponseEntity<Boolean> createBatchBySysRole(@PathVariable("sysrole_id") String sysrole_id, @RequestBody List<SysUserRoleDTO> sysuserroledtos) {
List<SysUserRole> domainlist=sysuserroleMapping.toDomain(sysuserroledtos);
for(SysUserRole domain:domainlist){
domain.setRoleid(sysrole_id);
}
sysuserroleService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Get-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Get-all')")
@ApiOperation(value = "根据系统角色获取用户角色关系", tags = {"用户角色关系" }, notes = "根据系统角色获取用户角色关系") @ApiOperation(value = "根据系统角色获取用户角色关系", tags = {"用户角色关系" }, notes = "根据系统角色获取用户角色关系")
@RequestMapping(method = RequestMethod.GET, value = "/sysroles/{sysrole_id}/sysuserroles/{sysuserrole_id}") @RequestMapping(method = RequestMethod.GET, value = "/sysroles/{sysrole_id}/sysuserroles/{sysuserrole_id}")
...@@ -249,6 +235,20 @@ public class SysUserRoleResource { ...@@ -249,6 +235,20 @@ public class SysUserRoleResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@ApiOperation(value = "根据系统角色获取用户角色关系草稿", tags = {"用户角色关系" }, notes = "根据系统角色获取用户角色关系草稿")
@RequestMapping(method = RequestMethod.GET, value = "/sysroles/{sysrole_id}/sysuserroles/getdraft")
public ResponseEntity<SysUserRoleDTO> getDraftBySysRole(@PathVariable("sysrole_id") String sysrole_id) {
SysUserRole domain = new SysUserRole();
domain.setRoleid(sysrole_id);
return ResponseEntity.status(HttpStatus.OK).body(sysuserroleMapping.toDto(sysuserroleService.getDraft(domain)));
}
@ApiOperation(value = "根据系统角色检查用户角色关系", tags = {"用户角色关系" }, notes = "根据系统角色检查用户角色关系")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles/{sysrole_id}/sysuserroles/checkkey")
public ResponseEntity<Boolean> checkKeyBySysRole(@PathVariable("sysrole_id") String sysrole_id, @RequestBody SysUserRoleDTO sysuserroledto) {
return ResponseEntity.status(HttpStatus.OK).body(sysuserroleService.checkKey(sysuserroleMapping.toDomain(sysuserroledto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Save-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Save-all')")
@ApiOperation(value = "根据系统角色保存用户角色关系", tags = {"用户角色关系" }, notes = "根据系统角色保存用户角色关系") @ApiOperation(value = "根据系统角色保存用户角色关系", tags = {"用户角色关系" }, notes = "根据系统角色保存用户角色关系")
@RequestMapping(method = RequestMethod.POST, value = "/sysroles/{sysrole_id}/sysuserroles/save") @RequestMapping(method = RequestMethod.POST, value = "/sysroles/{sysrole_id}/sysuserroles/save")
...@@ -270,7 +270,7 @@ public class SysUserRoleResource { ...@@ -270,7 +270,7 @@ public class SysUserRoleResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-searchDefault-all') and hasPermission(#context,'ibzuaa-SysUserRole-Get')")
@ApiOperation(value = "根据系统角色获取DEFAULT", tags = {"用户角色关系" } ,notes = "根据系统角色获取DEFAULT") @ApiOperation(value = "根据系统角色获取DEFAULT", tags = {"用户角色关系" } ,notes = "根据系统角色获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sysroles/{sysrole_id}/sysuserroles/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/sysroles/{sysrole_id}/sysuserroles/fetchdefault")
public ResponseEntity<List<SysUserRoleDTO>> fetchSysUserRoleDefaultBySysRole(@PathVariable("sysrole_id") String sysrole_id,SysUserRoleSearchContext context) { public ResponseEntity<List<SysUserRoleDTO>> fetchSysUserRoleDefaultBySysRole(@PathVariable("sysrole_id") String sysrole_id,SysUserRoleSearchContext context) {
...@@ -284,7 +284,7 @@ public class SysUserRoleResource { ...@@ -284,7 +284,7 @@ public class SysUserRoleResource {
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-searchDefault-all') and hasPermission(#context,'ibzuaa-SysUserRole-Get')")
@ApiOperation(value = "根据系统角色查询DEFAULT", tags = {"用户角色关系" } ,notes = "根据系统角色查询DEFAULT") @ApiOperation(value = "根据系统角色查询DEFAULT", tags = {"用户角色关系" } ,notes = "根据系统角色查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sysroles/{sysrole_id}/sysuserroles/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/sysroles/{sysrole_id}/sysuserroles/searchdefault")
public ResponseEntity<Page<SysUserRoleDTO>> searchSysUserRoleDefaultBySysRole(@PathVariable("sysrole_id") String sysrole_id, @RequestBody SysUserRoleSearchContext context) { public ResponseEntity<Page<SysUserRoleDTO>> searchSysUserRoleDefaultBySysRole(@PathVariable("sysrole_id") String sysrole_id, @RequestBody SysUserRoleSearchContext context) {
...@@ -293,18 +293,28 @@ public class SysUserRoleResource { ...@@ -293,18 +293,28 @@ public class SysUserRoleResource {
return ResponseEntity.status(HttpStatus.OK) return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(sysuserroleMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements())); .body(new PageImpl(sysuserroleMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
} }
@ApiOperation(value = "根据系统用户检查用户角色关系", tags = {"用户角色关系" }, notes = "根据系统用户检查用户角色关系") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Create-all')")
@RequestMapping(method = RequestMethod.POST, value = "/sysusers/{sysuser_id}/sysuserroles/checkkey") @ApiOperation(value = "根据系统用户建立用户角色关系", tags = {"用户角色关系" }, notes = "根据系统用户建立用户角色关系")
public ResponseEntity<Boolean> checkKeyBySysUser(@PathVariable("sysuser_id") String sysuser_id, @RequestBody SysUserRoleDTO sysuserroledto) { @RequestMapping(method = RequestMethod.POST, value = "/sysusers/{sysuser_id}/sysuserroles")
return ResponseEntity.status(HttpStatus.OK).body(sysuserroleService.checkKey(sysuserroleMapping.toDomain(sysuserroledto))); @Transactional
public ResponseEntity<SysUserRoleDTO> createBySysUser(@PathVariable("sysuser_id") String sysuser_id, @RequestBody SysUserRoleDTO sysuserroledto) {
SysUserRole domain = sysuserroleMapping.toDomain(sysuserroledto);
domain.setUserid(sysuser_id);
sysuserroleService.create(domain);
SysUserRoleDTO dto = sysuserroleMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@ApiOperation(value = "根据系统用户获取用户角色关系草稿", tags = {"用户角色关系" }, notes = "根据系统用户获取用户角色关系草稿") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Create-all')")
@RequestMapping(method = RequestMethod.GET, value = "/sysusers/{sysuser_id}/sysuserroles/getdraft") @ApiOperation(value = "根据系统用户批量建立用户角色关系", tags = {"用户角色关系" }, notes = "根据系统用户批量建立用户角色关系")
public ResponseEntity<SysUserRoleDTO> getDraftBySysUser(@PathVariable("sysuser_id") String sysuser_id) { @RequestMapping(method = RequestMethod.POST, value = "/sysusers/{sysuser_id}/sysuserroles/batch")
SysUserRole domain = new SysUserRole(); public ResponseEntity<Boolean> createBatchBySysUser(@PathVariable("sysuser_id") String sysuser_id, @RequestBody List<SysUserRoleDTO> sysuserroledtos) {
List<SysUserRole> domainlist=sysuserroleMapping.toDomain(sysuserroledtos);
for(SysUserRole domain:domainlist){
domain.setUserid(sysuser_id); domain.setUserid(sysuser_id);
return ResponseEntity.status(HttpStatus.OK).body(sysuserroleMapping.toDto(sysuserroleService.getDraft(domain))); }
sysuserroleService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@VersionCheck(entity = "sysuserrole" , versionfield = "updatedate") @VersionCheck(entity = "sysuserrole" , versionfield = "updatedate")
...@@ -349,30 +359,6 @@ public class SysUserRoleResource { ...@@ -349,30 +359,6 @@ public class SysUserRoleResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Create-all')")
@ApiOperation(value = "根据系统用户建立用户角色关系", tags = {"用户角色关系" }, notes = "根据系统用户建立用户角色关系")
@RequestMapping(method = RequestMethod.POST, value = "/sysusers/{sysuser_id}/sysuserroles")
@Transactional
public ResponseEntity<SysUserRoleDTO> createBySysUser(@PathVariable("sysuser_id") String sysuser_id, @RequestBody SysUserRoleDTO sysuserroledto) {
SysUserRole domain = sysuserroleMapping.toDomain(sysuserroledto);
domain.setUserid(sysuser_id);
sysuserroleService.create(domain);
SysUserRoleDTO dto = sysuserroleMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Create-all')")
@ApiOperation(value = "根据系统用户批量建立用户角色关系", tags = {"用户角色关系" }, notes = "根据系统用户批量建立用户角色关系")
@RequestMapping(method = RequestMethod.POST, value = "/sysusers/{sysuser_id}/sysuserroles/batch")
public ResponseEntity<Boolean> createBatchBySysUser(@PathVariable("sysuser_id") String sysuser_id, @RequestBody List<SysUserRoleDTO> sysuserroledtos) {
List<SysUserRole> domainlist=sysuserroleMapping.toDomain(sysuserroledtos);
for(SysUserRole domain:domainlist){
domain.setUserid(sysuser_id);
}
sysuserroleService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Get-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Get-all')")
@ApiOperation(value = "根据系统用户获取用户角色关系", tags = {"用户角色关系" }, notes = "根据系统用户获取用户角色关系") @ApiOperation(value = "根据系统用户获取用户角色关系", tags = {"用户角色关系" }, notes = "根据系统用户获取用户角色关系")
@RequestMapping(method = RequestMethod.GET, value = "/sysusers/{sysuser_id}/sysuserroles/{sysuserrole_id}") @RequestMapping(method = RequestMethod.GET, value = "/sysusers/{sysuser_id}/sysuserroles/{sysuserrole_id}")
...@@ -382,6 +368,20 @@ public class SysUserRoleResource { ...@@ -382,6 +368,20 @@ public class SysUserRoleResource {
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
} }
@ApiOperation(value = "根据系统用户获取用户角色关系草稿", tags = {"用户角色关系" }, notes = "根据系统用户获取用户角色关系草稿")
@RequestMapping(method = RequestMethod.GET, value = "/sysusers/{sysuser_id}/sysuserroles/getdraft")
public ResponseEntity<SysUserRoleDTO> getDraftBySysUser(@PathVariable("sysuser_id") String sysuser_id) {
SysUserRole domain = new SysUserRole();
domain.setUserid(sysuser_id);
return ResponseEntity.status(HttpStatus.OK).body(sysuserroleMapping.toDto(sysuserroleService.getDraft(domain)));
}
@ApiOperation(value = "根据系统用户检查用户角色关系", tags = {"用户角色关系" }, notes = "根据系统用户检查用户角色关系")
@RequestMapping(method = RequestMethod.POST, value = "/sysusers/{sysuser_id}/sysuserroles/checkkey")
public ResponseEntity<Boolean> checkKeyBySysUser(@PathVariable("sysuser_id") String sysuser_id, @RequestBody SysUserRoleDTO sysuserroledto) {
return ResponseEntity.status(HttpStatus.OK).body(sysuserroleService.checkKey(sysuserroleMapping.toDomain(sysuserroledto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Save-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-Save-all')")
@ApiOperation(value = "根据系统用户保存用户角色关系", tags = {"用户角色关系" }, notes = "根据系统用户保存用户角色关系") @ApiOperation(value = "根据系统用户保存用户角色关系", tags = {"用户角色关系" }, notes = "根据系统用户保存用户角色关系")
@RequestMapping(method = RequestMethod.POST, value = "/sysusers/{sysuser_id}/sysuserroles/save") @RequestMapping(method = RequestMethod.POST, value = "/sysusers/{sysuser_id}/sysuserroles/save")
...@@ -403,7 +403,7 @@ public class SysUserRoleResource { ...@@ -403,7 +403,7 @@ public class SysUserRoleResource {
return ResponseEntity.status(HttpStatus.OK).body(true); return ResponseEntity.status(HttpStatus.OK).body(true);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-searchDefault-all') and hasPermission(#context,'ibzuaa-SysUserRole-Get')")
@ApiOperation(value = "根据系统用户获取DEFAULT", tags = {"用户角色关系" } ,notes = "根据系统用户获取DEFAULT") @ApiOperation(value = "根据系统用户获取DEFAULT", tags = {"用户角色关系" } ,notes = "根据系统用户获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/sysusers/{sysuser_id}/sysuserroles/fetchdefault") @RequestMapping(method= RequestMethod.GET , value="/sysusers/{sysuser_id}/sysuserroles/fetchdefault")
public ResponseEntity<List<SysUserRoleDTO>> fetchSysUserRoleDefaultBySysUser(@PathVariable("sysuser_id") String sysuser_id,SysUserRoleSearchContext context) { public ResponseEntity<List<SysUserRoleDTO>> fetchSysUserRoleDefaultBySysUser(@PathVariable("sysuser_id") String sysuser_id,SysUserRoleSearchContext context) {
...@@ -417,7 +417,7 @@ public class SysUserRoleResource { ...@@ -417,7 +417,7 @@ public class SysUserRoleResource {
.body(list); .body(list);
} }
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-searchDefault-all')") @PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibzuaa-SysUserRole-searchDefault-all') and hasPermission(#context,'ibzuaa-SysUserRole-Get')")
@ApiOperation(value = "根据系统用户查询DEFAULT", tags = {"用户角色关系" } ,notes = "根据系统用户查询DEFAULT") @ApiOperation(value = "根据系统用户查询DEFAULT", tags = {"用户角色关系" } ,notes = "根据系统用户查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/sysusers/{sysuser_id}/sysuserroles/searchdefault") @RequestMapping(method= RequestMethod.POST , value="/sysusers/{sysuser_id}/sysuserroles/searchdefault")
public ResponseEntity<Page<SysUserRoleDTO>> searchSysUserRoleDefaultBySysUser(@PathVariable("sysuser_id") String sysuser_id, @RequestBody SysUserRoleSearchContext context) { public ResponseEntity<Page<SysUserRoleDTO>> searchSysUserRoleDefaultBySysUser(@PathVariable("sysuser_id") String sysuser_id, @RequestBody SysUserRoleSearchContext context) {
......
package cn.ibizlab.util.security; package cn.ibizlab.util.security;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.SneakyThrows;
import cn.ibizlab.util.annotation.DEField; import cn.ibizlab.util.annotation.DEField;
import cn.ibizlab.util.domain.EntityBase; import cn.ibizlab.util.domain.EntityBase;
import cn.ibizlab.util.enums.DEPredefinedFieldType; import cn.ibizlab.util.enums.DEPredefinedFieldType;
import cn.ibizlab.util.filter.QueryWrapperContext;
import cn.ibizlab.util.helper.DEFieldCacheMap; import cn.ibizlab.util.helper.DEFieldCacheMap;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.PermissionEvaluator; import org.springframework.security.access.PermissionEvaluator;
...@@ -11,7 +14,10 @@ import org.springframework.security.core.GrantedAuthority; ...@@ -11,7 +14,10 @@ import org.springframework.security.core.GrantedAuthority;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.io.Serializable; import java.io.Serializable;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.*; import java.util.*;
import java.util.function.Consumer;
/** /**
* spring security 权限管理类 * spring security 权限管理类
...@@ -23,44 +29,144 @@ public class AuthPermissionEvaluator implements PermissionEvaluator { ...@@ -23,44 +29,144 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
@Value("${ibiz.enablePermissionValid:false}") @Value("${ibiz.enablePermissionValid:false}")
boolean enablePermissionValid; //是否开启权限校验 boolean enablePermissionValid; //是否开启权限校验
/** /**
* 实体行为鉴权 * 服务接口鉴权
* @param authentication * @param authentication 用户
* @param entity * @param entity 实体
* @param action * @param action 操作
* @return * @return
*/ */
@Override @Override
@SneakyThrows
public boolean hasPermission(Authentication authentication, Object entity, Object action) { public boolean hasPermission(Authentication authentication, Object entity, Object action) {
if(!enablePermissionValid)
//未开启权限校验、超级管理员则不进行权限检查 return true;
if(AuthenticationUser.getAuthenticationUser().getSuperuser()==1 || !enablePermissionValid) Object principal = authentication.getPrincipal();
if(ObjectUtils.isEmpty(principal))
return false;
AuthenticationUser authenticationUser= (AuthenticationUser) authentication.getPrincipal();
if(authenticationUser.getSuperuser()==1)
return true; return true;
String strAction=String.valueOf(action); String strAction=String.valueOf(action);
Set<String> userAuthorities = getAuthorities(authentication,strAction); Set<String> userAuthorities = getAuthorities(authentication,strAction);
if(userAuthorities.size()==0) if(userAuthorities.size()==0)
return false; return false;
//拥有全部数据访问权限时,则跳过权限检查
if(isAllData(strAction,userAuthorities)){ if(isAllData(strAction,userAuthorities)){
return true; return true;
} }
if(entity instanceof ArrayList){ if(entity instanceof ArrayList){
List<EntityBase> entities= (List<EntityBase>) entity; List<EntityBase> entities= (List<EntityBase>) entity;
for(EntityBase entityBase: entities){ for(EntityBase entityBase: entities){
boolean result=actionValid(entityBase, strAction ,userAuthorities); boolean result=actionValid(entityBase, strAction ,userAuthorities,authenticationUser);
if(!result){ if(!result){
return false; return false;
} }
} }
} }
else if (entity instanceof QueryWrapperContext){
QueryWrapperContext queryWrapperContext= (QueryWrapperContext) entity;
setPermissionCondToSearchContext(getEntity(queryWrapperContext),queryWrapperContext,userAuthorities,authenticationUser);
}
else{ else{
EntityBase entityBase= (EntityBase) entity; EntityBase entityBase= (EntityBase) entity;
return actionValid(entityBase , strAction ,userAuthorities); return actionValid(entityBase , strAction ,userAuthorities,authenticationUser);
} }
return true; return true;
} }
/**
* 获取实体信息
* @param qc
* @return
*/
@SneakyThrows
private EntityBase getEntity(QueryWrapperContext qc){
EntityBase entity=null;
Type type =qc.getClass().getGenericSuperclass();
if(type instanceof ParameterizedType){
ParameterizedType parameterizedType= (ParameterizedType) qc.getClass().getGenericSuperclass();
Type [] typeArr= parameterizedType.getActualTypeArguments();
if(typeArr.length>0){
Class<EntityBase> entityClass = (Class) typeArr[0];
return entityClass.newInstance();
}
}
return entity;
}
/**
* 在searchContext中拼接权限条件
* @param entity 实体
* @param qc 查询上下文
* @param userAuthorities 用户权限
* @param authenticationUser 当前用户
*/
@SneakyThrows
private void setPermissionCondToSearchContext(EntityBase entity, QueryWrapperContext qc , Set<String> userAuthorities ,AuthenticationUser authenticationUser){
if(entity==null)
return ;
Map<String,String> permissionField=getPermissionField(entity);//获取组织、部门预置属性
String orgField=permissionField.get("orgfield");
String orgDeptField=permissionField.get("orgsecfield");
String createManField=permissionField.get("createmanfield");
Map<String, Set<String>> userInfo = authenticationUser.getOrgInfo();
Set<String> orgParent = userInfo.get("parentorg");
Set<String> orgChild = userInfo.get("suborg");
Set<String> orgDeptParent = userInfo.get("parentdept");
Set<String> orgDeptChild = userInfo.get("subdept");
Set<String> userOrg = new HashSet<>();
Set<String> userOrgDept = new HashSet<>();
Set<String> userCreateMan = new HashSet<>();
for(String authority:userAuthorities){
if(authority.endsWith("curorg")){ //本单位
userOrg.add(authenticationUser.getOrgid());
}
else if(authority.endsWith("porg")){//上级单位
userOrg.addAll(orgParent);
}
else if(authority.endsWith("sorg")){//下级单位
userOrg.addAll(orgChild);
}
else if(authority.endsWith("curorgdept")){//本部门
userOrgDept.add(authenticationUser.getMdeptid());
}
else if(authority.endsWith("porgdept")){//上级部门
userOrgDept.addAll(orgDeptParent);
}
else if(authority.endsWith("sorgdept")){//下级部门
userOrgDept.addAll(orgDeptChild);
}
else if (authority.endsWith("createman")){
userCreateMan.add(authority);
}
}
if(userOrg.size()==0 && userOrgDept.size()==0 && userCreateMan.size()==0){
qc.getSelectCond().apply("1<>1");
}
else{
Consumer<QueryWrapper> consumer = qw -> {
if(userOrg.size()>0){
Consumer<QueryWrapper> org = orgQw -> {
orgQw.in(orgField,userOrg);
};
qw.or(org);
}
if(userOrgDept.size()>0){
Consumer<QueryWrapper> dept = deptQw -> {
deptQw.in(orgDeptField,userOrgDept);
};
qw.or(dept);
}
if(userCreateMan.size()>0){
Consumer<QueryWrapper> createMan = createManQw -> {
createManQw.eq(createManField,authenticationUser.getUserid());
};
qw.or(createMan);
}
};
qc.getSelectCond().and(consumer);
}
}
@Override @Override
public boolean hasPermission(Authentication authentication, Serializable id, String action, Object params) { public boolean hasPermission(Authentication authentication, Serializable id, String action, Object params) {
...@@ -106,13 +212,12 @@ public class AuthPermissionEvaluator implements PermissionEvaluator { ...@@ -106,13 +212,12 @@ public class AuthPermissionEvaluator implements PermissionEvaluator {
* @param userAuthorities * @param userAuthorities
* @return * @return
*/ */
private boolean actionValid(EntityBase entity, String action , Set<String> userAuthorities){ private boolean actionValid(EntityBase entity, String action , Set<String> userAuthorities ,AuthenticationUser authenticationUser){
Map<String,String> permissionField=getPermissionField(entity);//获取组织、部门预置属性 Map<String,String> permissionField=getPermissionField(entity);//获取组织、部门预置属性
String orgField=permissionField.get("orgfield"); String orgField=permissionField.get("orgfield");
String orgDeptField=permissionField.get("orgsecfield"); String orgDeptField=permissionField.get("orgsecfield");
String createManField=permissionField.get("createmanfield"); String createManField=permissionField.get("createmanfield");
AuthenticationUser authenticationUser = AuthenticationUser.getAuthenticationUser();
Map<String, Set<String>> userInfo = authenticationUser.getOrgInfo(); Map<String, Set<String>> userInfo = authenticationUser.getOrgInfo();
Set<String> orgParent = userInfo.get("parentorg"); Set<String> orgParent = userInfo.get("parentorg");
Set<String> orgChild = userInfo.get("suborg"); Set<String> orgChild = userInfo.get("suborg");
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册