Commit b39dd8a8 authored by guxukai's avatar guxukai

chore: api迁移

parent 9aac6da5
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
- [x] common-service - gxk - [x] common-service - gxk
- [ ] gateway - gxk - [ ] gateway - gxk
- [x] license-service - gxk - [x] license-service - gxk
- [ ] logger-service - gxk - [x] logger-service - gxk
- [ ] monitor-service - gxk - [ ] monitor-service - gxk
- [ ] order-service - jqy - [ ] order-service - jqy
- [ ] pay-service - jqy - [ ] pay-service - jqy
......
import { Model } from '@shared/models/Model'
import { JsonProperty, Serializable } from 'typescript-json-serializer'
@Serializable()
export class ChainLog extends Model<ChainLog> {
@JsonProperty() operateTime: number
@JsonProperty() message: string
}
import { Model } from '@shared/models/Model'
import { JsonProperty, Serializable } from 'typescript-json-serializer'
@Serializable()
export class Component extends Model<Component> {
@JsonProperty() key: string
@JsonProperty() value: string
}
import { Model } from '@shared/models/Model'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Serializable } from 'typescript-json-serializer'
@Serializable()
export class ComponentList extends Model<ComponentList> {
static async get() {
return await api.get<HttpResponse<Comment[]>>('/services/logger-service/components')
}
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { Model } from '@shared/models/Model'
@Serializable()
export class ComponentLog extends Model<ComponentLog> {
@JsonProperty() message: string
@JsonProperty() '@timestamp': string
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { Pagination } from '@shared/models/Pagination'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { PaginationParams } from '@shared/models/PaginationParams'
import { ComponentLog } from '@shared/models/logger-service/ComponentLog'
@Serializable()
export class ComponentLogPage extends Pagination<ComponentLog> {
@JsonProperty({ type: ComponentLog }) data: ComponentLog[]
/**
* 根据关键字检索信息,使用keywords关键字
* @param payload
*/
static async get(payload: ComponentLogPagePostReq) {
return await api.get<HttpResponse<ComponentLogPage>>('/services/logger-service/components/log', {
params: payload,
})
}
}
@Serializable()
export class ComponentLogPagePostReq extends PaginationParams<ComponentLogPagePostReq> {
//开始时间
@JsonProperty() beginDate: string
//组件
@JsonProperty() componentKey: string
//结束时间
@JsonProperty() endDate: string
//搜索关键字
@JsonProperty() keyword: string
//日志等级
@JsonProperty() levels: string[]
}
import { Model } from '@shared/models/Model'
import { api } from '@shared/http/axios'
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { PaginationParams } from '@shared/models/PaginationParams'
@Serializable()
export class LogPage extends Model<LogPage> {
static async get(payload: LogPageGetReq) {
return await api.get('/services/logger-service/log', {
params: payload,
})
}
}
@Serializable()
export class LogPageGetReq extends PaginationParams<LogPageGetReq> {
//节点Ip
@JsonProperty() address: string
//链Id
@JsonProperty() chain: string
//开始日期
@JsonProperty() dateFrom: string
//结束日期
@JsonProperty() dateTo: string
//查询关键字
@JsonProperty() keywords: string
}
import { Model } from '@shared/models/Model'
import { QuickQueryDataTypeEnum } from '@shared/models/logger-service/enums/QuickQueryDataTypeEnum'
import { JsonProperty, Serializable } from 'typescript-json-serializer'
@Serializable()
export class QuickQuery extends Model<QuickQuery> {
//数据ID
@JsonProperty() dataId: string
//数据名称
@JsonProperty() dataName: string
//数据类型
@JsonProperty() dataType: QuickQueryDataTypeEnum
//数据明细信息
@JsonProperty() detail: string
//数据查看所需要的权限
@JsonProperty() objPermission: string[]
//对象ID/控制台ID
@JsonProperty() objectId: string
//数据更新时间
@JsonProperty() updateTime: number
}
import { Model } from '@shared/models/Model'
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { QuickQueryDataTypeEnum } from '@shared/models/logger-service/enums/QuickQueryDataTypeEnum'
@Serializable()
export class QuickQueryNotice extends Model<QuickQueryNotice> {
/**
* 对象数据变更通知
* @param payload
*/
static async get(payload: QuickQueryNoticeGetReq) {
return await api.get('/services/logger-service/quick-query/notice', {
params: payload,
})
}
}
@Serializable()
export class QuickQueryNoticeGetReq {
//对象ID
@JsonProperty() objId: string
//对象类型
@JsonProperty() objType: QuickQueryDataTypeEnum
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { Pagination } from '@shared/models/Pagination'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { PaginationParams } from '@shared/models/PaginationParams'
import { QuickQuery } from '@shared/models/logger-service/QuickQuery'
import { QuickQueryDataTypeEnum } from '@shared/models/logger-service/enums/QuickQueryDataTypeEnum'
@Serializable()
export class QuickQueryPage extends Pagination<QuickQuery> {
@JsonProperty({ type: QuickQuery }) data: QuickQuery[]
/**
* 根据关键字检索信息,使用keywords关键字
* @param payload
*/
static async get(payload: QuickQueryPagePostReq) {
return await api.get<HttpResponse<QuickQueryPage>>('/services/logger-service/quick-query', {
params: payload,
})
}
}
@Serializable()
export class QuickQueryPagePostReq extends PaginationParams<QuickQueryPagePostReq> {
@JsonProperty() dataType: QuickQueryDataTypeEnum
//关键字
@JsonProperty() keywords: string
}
- [ ] xxx - [x] 快速搜索
- [x] 日志检索
export enum QuickQueryDataTypeEnum {
APPSTORE = 'APPSTORE',
CHAIN = 'CHAIN',
CONSORTIUM = 'CONSORTIUM',
EMPTY = 'EMPTY',
FED = 'FED',
ORDER = 'ORDER',
ORG = 'ORG',
PARA = 'PARA',
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment