ecode-common
v0.0.41
Published
ecode 通用定义模块 定义各通用模型
Downloads
7
Readme
EcodeCommon
ecode 通用定义模块 定义各通用模型
export interface IdDatum {
id: string;
}
export interface IQueryParam {
}
export class PageInfo<T>{
total: number = 0;
list: T[] = [];
startRow!: number;
endRow!: number;
size!: number;
prePage!: number;
pages!: number;
pageNum!: number;
pageSize!: number;
nextPage!: number;
navigatepageNums!: number[];
navigatePages!: number;
navigateLastPage!: number;
navigateFirstPage!: number;
isLastPage!: boolean;
isFirstPage!: boolean;
hasPreviousPage!: boolean;
}
export class PageParam {
pageIndex: number = 1;
pageSize: number = 10;
constructor(pageIndex: number = 1, pageSize: number = 10) {
this.pageIndex = pageIndex;
this.pageSize = pageSize;
}
}
export class RequestHeader extends HttpHeaders {
constructor() {
super({
'Content-Type': 'application/json'
});
}
}
export class ResponseResult<T>{
code: string = '1';
message: string = '';
exceptionType: string = '';
data?: T;
}
export class StringIdDatum implements IdDatum {
id: string = '';
}
安装
npm install ecode-common
在moudle里引入模块
@NgModule({
providers: [
],
imports: [
EcodeCommonModule
]
})
引入使用
import { RequestHeader, ResponseResult } from "ecode-common";