Skip to content

Commit

Permalink
feat: 添加登录日志
Browse files Browse the repository at this point in the history
  • Loading branch information
WangJunZzz committed Oct 9, 2023
1 parent 5dda1dd commit 364ec4f
Show file tree
Hide file tree
Showing 2 changed files with 708 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable */
//----------------------
// <auto-generated>
// Generated using the NSwag toolchain v13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
// Generated using the NSwag toolchain v13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------
// ReSharper disable InconsistentNaming
Expand Down Expand Up @@ -1471,6 +1471,119 @@ export class DataDictionaryServiceProxy extends ServiceProxyBase {
}
}

export class IdentitySecurityLogsServiceProxy 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 : "";
}

/**
* 分页获取登录日志信息
* @param body (optional)
* @return Success
*/
page(body: PagingIdentitySecurityLogInput | undefined , cancelToken?: CancelToken | undefined): Promise<PagingIdentitySecurityLogOutputPagedResultDto> {
let url_ = this.baseUrl + "/IdentitySecurityLogs/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<PagingIdentitySecurityLogOutputPagedResultDto> {
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 = PagingIdentitySecurityLogOutputPagedResultDto.fromJS(resultData200);
return Promise.resolve<PagingIdentitySecurityLogOutputPagedResultDto>(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<PagingIdentitySecurityLogOutputPagedResultDto>(null as any);
}
}

export class LanguagesServiceProxy extends ServiceProxyBase {
private instance: AxiosInstance;
private baseUrl: string;
Expand Down Expand Up @@ -13822,6 +13935,246 @@ export interface IPagingEntityPropertyChangeOutput {
propertyTypeFullName: string | undefined;
}

export class PagingIdentitySecurityLogInput implements IPagingIdentitySecurityLogInput {
/** 当前页面.默认从1开始 */
pageIndex!: number;
/** 每页多少条.每页显示多少记录 */
pageSize!: number;
/** 跳过多少条 */
readonly skipCount!: number;
/** 排序 */
sorting!: string | undefined;
/** 开始时间 */
startTime!: dayjs.Dayjs | undefined;
/** 结束时间 */
endTime!: dayjs.Dayjs | undefined;
identity!: string | undefined;
/** 请求地址 */
action!: string | undefined;
/** 用户Id */
userId!: string | undefined;
/** 用户名 */
userName!: string | undefined;
/** 应用程序名称 */
applicationName!: string | undefined;
/** RequestId */
correlationId!: string | undefined;
/** ClientId */
clientId!: string | undefined;

constructor(data?: IPagingIdentitySecurityLogInput) {
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.sorting = _data["sorting"];
this.startTime = _data["startTime"] ? dayjs(_data["startTime"].toString()) : <any>undefined;
this.endTime = _data["endTime"] ? dayjs(_data["endTime"].toString()) : <any>undefined;
this.identity = _data["identity"];
this.action = _data["action"];
this.userId = _data["userId"];
this.userName = _data["userName"];
this.applicationName = _data["applicationName"];
this.correlationId = _data["correlationId"];
this.clientId = _data["clientId"];
}
}

static fromJS(data: any): PagingIdentitySecurityLogInput {
data = typeof data === 'object' ? data : {};
let result = new PagingIdentitySecurityLogInput();
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["sorting"] = this.sorting;
data["startTime"] = this.startTime ? this.startTime.toLocaleString() : <any>undefined;
data["endTime"] = this.endTime ? this.endTime.toLocaleString() : <any>undefined;
data["identity"] = this.identity;
data["action"] = this.action;
data["userId"] = this.userId;
data["userName"] = this.userName;
data["applicationName"] = this.applicationName;
data["correlationId"] = this.correlationId;
data["clientId"] = this.clientId;
return data;
}
}

export interface IPagingIdentitySecurityLogInput {
/** 当前页面.默认从1开始 */
pageIndex: number;
/** 每页多少条.每页显示多少记录 */
pageSize: number;
/** 跳过多少条 */
skipCount: number;
/** 排序 */
sorting: string | undefined;
/** 开始时间 */
startTime: dayjs.Dayjs | undefined;
/** 结束时间 */
endTime: dayjs.Dayjs | undefined;
identity: string | undefined;
/** 请求地址 */
action: string | undefined;
/** 用户Id */
userId: string | undefined;
/** 用户名 */
userName: string | undefined;
/** 应用程序名称 */
applicationName: string | undefined;
/** RequestId */
correlationId: string | undefined;
/** ClientId */
clientId: string | undefined;
}

export class PagingIdentitySecurityLogOutput implements IPagingIdentitySecurityLogOutput {
id!: string;
tenantId!: string | undefined;
applicationName!: string | undefined;
identity!: string | undefined;
action!: string | undefined;
userId!: string | undefined;
userName!: string | undefined;
tenantName!: string | undefined;
clientId!: string | undefined;
correlationId!: string | undefined;
clientIpAddress!: string | undefined;
browserInfo!: string | undefined;
creationTime!: dayjs.Dayjs;

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

init(_data?: any) {
if (_data) {
this.id = _data["id"];
this.tenantId = _data["tenantId"];
this.applicationName = _data["applicationName"];
this.identity = _data["identity"];
this.action = _data["action"];
this.userId = _data["userId"];
this.userName = _data["userName"];
this.tenantName = _data["tenantName"];
this.clientId = _data["clientId"];
this.correlationId = _data["correlationId"];
this.clientIpAddress = _data["clientIpAddress"];
this.browserInfo = _data["browserInfo"];
this.creationTime = _data["creationTime"] ? dayjs(_data["creationTime"].toString()) : <any>undefined;
}
}

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

toJSON(data?: any) {
data = typeof data === 'object' ? data : {};
data["id"] = this.id;
data["tenantId"] = this.tenantId;
data["applicationName"] = this.applicationName;
data["identity"] = this.identity;
data["action"] = this.action;
data["userId"] = this.userId;
data["userName"] = this.userName;
data["tenantName"] = this.tenantName;
data["clientId"] = this.clientId;
data["correlationId"] = this.correlationId;
data["clientIpAddress"] = this.clientIpAddress;
data["browserInfo"] = this.browserInfo;
data["creationTime"] = this.creationTime ? this.creationTime.toLocaleString() : <any>undefined;
return data;
}
}

export interface IPagingIdentitySecurityLogOutput {
id: string;
tenantId: string | undefined;
applicationName: string | undefined;
identity: string | undefined;
action: string | undefined;
userId: string | undefined;
userName: string | undefined;
tenantName: string | undefined;
clientId: string | undefined;
correlationId: string | undefined;
clientIpAddress: string | undefined;
browserInfo: string | undefined;
creationTime: dayjs.Dayjs;
}

export class PagingIdentitySecurityLogOutputPagedResultDto implements IPagingIdentitySecurityLogOutputPagedResultDto {
items!: PagingIdentitySecurityLogOutput[] | undefined;
totalCount!: number;

constructor(data?: IPagingIdentitySecurityLogOutputPagedResultDto) {
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(PagingIdentitySecurityLogOutput.fromJS(item));
}
this.totalCount = _data["totalCount"];
}
}

static fromJS(data: any): PagingIdentitySecurityLogOutputPagedResultDto {
data = typeof data === 'object' ? data : {};
let result = new PagingIdentitySecurityLogOutputPagedResultDto();
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 IPagingIdentitySecurityLogOutputPagedResultDto {
items: PagingIdentitySecurityLogOutput[] | undefined;
totalCount: number;
}

export class PagingNotificationListInput implements IPagingNotificationListInput {
/** 当前页面.默认从1开始 */
pageIndex!: number;
Expand Down
Loading

0 comments on commit 364ec4f

Please sign in to comment.