Skip to content

Commit

Permalink
feat: 添加ElasticSearch模块
Browse files Browse the repository at this point in the history
  • Loading branch information
WangJunZzz committed Jul 2, 2023
1 parent 92c1670 commit fec8689
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 430 deletions.
20 changes: 0 additions & 20 deletions vben28/src/router/routes/modules/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,6 @@ const admin: AppRouteModule = {
icon: 'ant-design:snippets-twotone',
},
},
{
path: 'esLogs',
name: 'ESLogs',
component: () => import('/@/views/admin/elasticSearch/ElasticSearch.vue'),
meta: {
title: t('routes.admin.esLogs'),
policy: 'AbpIdentity.ES',
icon: 'ant-design:snippets-twotone',
},
},
{
path: 'dataDictionary',
name: 'dataDictionary',
Expand Down Expand Up @@ -104,16 +94,6 @@ const admin: AppRouteModule = {
policy: 'AbpIdentity.LanguageTexts',
},
},
// {
// path: 'files',
// name: 'files',
// component: () => import('/@/views/admin/files/File.vue'),
// meta: {
// title: t('routes.admin.fileNameManagement'),
// icon: 'ant-design:snippets-outlined',
// policy: 'AbpIdentity.FileManagement',
// },
// },
],
};

Expand Down
273 changes: 0 additions & 273 deletions vben28/src/services/ServiceProxies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2485,119 +2485,6 @@ export class LanguageTextsServiceProxy extends ServiceProxyBase {
}
}

export class EsLogServiceProxy extends ServiceProxyBase {
private instance: AxiosInstance;
private baseUrl: string;
protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined;

constructor(baseUrl?: string, instance?: AxiosInstance) {
super();
this.instance = instance ? instance : axios.create();
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "";
}

/**
* 分页获取Es日志
* @param body (optional)
* @return Success
*/
page(body: PagingElasticSearchLogInput | undefined , cancelToken?: CancelToken | undefined): Promise<PagingElasticSearchLogOutputCustomPagedResultDto> {
let url_ = this.baseUrl + "/EsLog/page";
url_ = url_.replace(/[?&]$/, "");

const content_ = JSON.stringify(body);

let options_ = <AxiosRequestConfig>{
data: content_,
method: "POST",
url: url_,
headers: {
"Content-Type": "application/json",
"Accept": "text/plain"
},
cancelToken
};

return this.transformOptions(options_).then(transformedOptions_ => {
return this.instance.request(transformedOptions_);
}).catch((_error: any) => {
if (isAxiosError(_error) && _error.response) {
return _error.response;
} else {
throw _error;
}
}).then((_response: AxiosResponse) => {
return this.transformResult(url_, _response, (_response: AxiosResponse) => this.processPage(_response));
});
}

protected processPage(response: AxiosResponse): Promise<PagingElasticSearchLogOutputCustomPagedResultDto> {
const status = response.status;
let _headers: any = {};
if (response.headers && typeof response.headers === "object") {
for (let k in response.headers) {
if (response.headers.hasOwnProperty(k)) {
_headers[k] = response.headers[k];
}
}
}
if (status === 200) {
const _responseText = response.data;
let result200: any = null;
let resultData200 = _responseText;
result200 = PagingElasticSearchLogOutputCustomPagedResultDto.fromJS(resultData200);
return Promise.resolve<PagingElasticSearchLogOutputCustomPagedResultDto>(result200);

} else if (status === 403) {
const _responseText = response.data;
let result403: any = null;
let resultData403 = _responseText;
result403 = RemoteServiceErrorResponse.fromJS(resultData403);
return throwException("Forbidden", status, _responseText, _headers, result403);

} else if (status === 401) {
const _responseText = response.data;
let result401: any = null;
let resultData401 = _responseText;
result401 = RemoteServiceErrorResponse.fromJS(resultData401);
return throwException("Unauthorized", status, _responseText, _headers, result401);

} else if (status === 400) {
const _responseText = response.data;
let result400: any = null;
let resultData400 = _responseText;
result400 = RemoteServiceErrorResponse.fromJS(resultData400);
return throwException("Bad Request", status, _responseText, _headers, result400);

} else if (status === 404) {
const _responseText = response.data;
let result404: any = null;
let resultData404 = _responseText;
result404 = RemoteServiceErrorResponse.fromJS(resultData404);
return throwException("Not Found", status, _responseText, _headers, result404);

} else if (status === 501) {
const _responseText = response.data;
let result501: any = null;
let resultData501 = _responseText;
result501 = RemoteServiceErrorResponse.fromJS(resultData501);
return throwException("Server Error", status, _responseText, _headers, result501);

} else if (status === 500) {
const _responseText = response.data;
let result500: any = null;
let resultData500 = _responseText;
result500 = RemoteServiceErrorResponse.fromJS(resultData500);
return throwException("Server Error", status, _responseText, _headers, result500);

} else if (status !== 200 && status !== 204) {
const _responseText = response.data;
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
}
return Promise.resolve<PagingElasticSearchLogOutputCustomPagedResultDto>(null as any);
}
}

export class NotificationServiceProxy extends ServiceProxyBase {
private instance: AxiosInstance;
private baseUrl: string;
Expand Down Expand Up @@ -13779,166 +13666,6 @@ export interface IPagingDataDictionaryOutputPagedResultDto {
totalCount: number;
}

export class PagingElasticSearchLogInput implements IPagingElasticSearchLogInput {
/** 当前页面.默认从1开始 */
pageIndex!: number;
/** 每页多少条.每页显示多少记录 */
pageSize!: number;
/** 跳过多少条 */
readonly skipCount!: number;
filter!: string | undefined;
startCreationTime!: dayjs.Dayjs | undefined;
endCreationTime!: dayjs.Dayjs | undefined;

constructor(data?: IPagingElasticSearchLogInput) {
if (data) {
for (var property in data) {
if (data.hasOwnProperty(property))
(<any>this)[property] = (<any>data)[property];
}
}
}

init(_data?: any) {
if (_data) {
this.pageIndex = _data["pageIndex"];
this.pageSize = _data["pageSize"];
(<any>this).skipCount = _data["skipCount"];
this.filter = _data["filter"];
this.startCreationTime = _data["startCreationTime"] ? dayjs(_data["startCreationTime"].toString()) : <any>undefined;
this.endCreationTime = _data["endCreationTime"] ? dayjs(_data["endCreationTime"].toString()) : <any>undefined;
}
}

static fromJS(data: any): PagingElasticSearchLogInput {
data = typeof data === 'object' ? data : {};
let result = new PagingElasticSearchLogInput();
result.init(data);
return result;
}

toJSON(data?: any) {
data = typeof data === 'object' ? data : {};
data["pageIndex"] = this.pageIndex;
data["pageSize"] = this.pageSize;
data["skipCount"] = this.skipCount;
data["filter"] = this.filter;
data["startCreationTime"] = this.startCreationTime ? this.startCreationTime.toISOString() : <any>undefined;
data["endCreationTime"] = this.endCreationTime ? this.endCreationTime.toISOString() : <any>undefined;
return data;
}
}

export interface IPagingElasticSearchLogInput {
/** 当前页面.默认从1开始 */
pageIndex: number;
/** 每页多少条.每页显示多少记录 */
pageSize: number;
/** 跳过多少条 */
skipCount: number;
filter: string | undefined;
startCreationTime: dayjs.Dayjs | undefined;
endCreationTime: dayjs.Dayjs | undefined;
}

export class PagingElasticSearchLogOutput implements IPagingElasticSearchLogOutput {
/** 日志级别 */
level!: string | undefined;
/** 日志内容 */
message!: string | undefined;
/** 创建时间 */
creationTime!: dayjs.Dayjs;

constructor(data?: IPagingElasticSearchLogOutput) {
if (data) {
for (var property in data) {
if (data.hasOwnProperty(property))
(<any>this)[property] = (<any>data)[property];
}
}
}

init(_data?: any) {
if (_data) {
this.level = _data["level"];
this.message = _data["message"];
this.creationTime = _data["creationTime"] ? dayjs(_data["creationTime"].toString()) : <any>undefined;
}
}

static fromJS(data: any): PagingElasticSearchLogOutput {
data = typeof data === 'object' ? data : {};
let result = new PagingElasticSearchLogOutput();
result.init(data);
return result;
}

toJSON(data?: any) {
data = typeof data === 'object' ? data : {};
data["level"] = this.level;
data["message"] = this.message;
data["creationTime"] = this.creationTime ? this.creationTime.toISOString() : <any>undefined;
return data;
}
}

export interface IPagingElasticSearchLogOutput {
/** 日志级别 */
level: string | undefined;
/** 日志内容 */
message: string | undefined;
/** 创建时间 */
creationTime: dayjs.Dayjs;
}

export class PagingElasticSearchLogOutputCustomPagedResultDto implements IPagingElasticSearchLogOutputCustomPagedResultDto {
items!: PagingElasticSearchLogOutput[] | undefined;
totalCount!: number;

constructor(data?: IPagingElasticSearchLogOutputCustomPagedResultDto) {
if (data) {
for (var property in data) {
if (data.hasOwnProperty(property))
(<any>this)[property] = (<any>data)[property];
}
}
}

init(_data?: any) {
if (_data) {
if (Array.isArray(_data["items"])) {
this.items = [] as any;
for (let item of _data["items"])
this.items!.push(PagingElasticSearchLogOutput.fromJS(item));
}
this.totalCount = _data["totalCount"];
}
}

static fromJS(data: any): PagingElasticSearchLogOutputCustomPagedResultDto {
data = typeof data === 'object' ? data : {};
let result = new PagingElasticSearchLogOutputCustomPagedResultDto();
result.init(data);
return result;
}

toJSON(data?: any) {
data = typeof data === 'object' ? data : {};
if (Array.isArray(this.items)) {
data["items"] = [];
for (let item of this.items)
data["items"].push(item.toJSON());
}
data["totalCount"] = this.totalCount;
return data;
}
}

export interface IPagingElasticSearchLogOutputCustomPagedResultDto {
items: PagingElasticSearchLogOutput[] | undefined;
totalCount: number;
}

export class PagingEntityChangeOutput implements IPagingEntityChangeOutput {
id!: string;
auditLogId!: string;
Expand Down
56 changes: 0 additions & 56 deletions vben28/src/views/admin/elasticSearch/ElasticSearch.ts

This file was deleted.

Loading

0 comments on commit fec8689

Please sign in to comment.