调整class文件,合并部分class到一个文件中

This commit is contained in:
小海
2020-04-16 18:15:13 +08:00
parent a30ee898ba
commit c569f7a63f
25 changed files with 145 additions and 139 deletions

View File

@@ -17,3 +17,19 @@ export class Article {
readingNumber?: number;
open?: string;
}
export class ArticleReq {
category: string;
id?: number;
mdContent: string;
open: boolean;
tags: string;
title: string;
type: boolean;
url?: string;
constructor() {
this.type = true;
}
}

View File

@@ -10,3 +10,23 @@ export class Comment {
comment: boolean;
respComment: Comment[];
}
export class CommentReq {
id?: number;
comment: boolean;
content: string;
pid: number;
articleID: number;
responseId: string;
constructor(comment: boolean) {
this.comment = comment;
this.responseId = '';
if (!comment) {
this.articleID = -1;
}
this.pid = -1;
this.id = null;
}
}

View File

@@ -1,4 +1,4 @@
import {RequestObj} from './Request';
import {RequestObj} from './HttpReqAndResp';
export interface ErrDispatch {
errHandler(code: number, msg: string, request?: RequestObj): void;

View File

@@ -0,0 +1,45 @@
import {HttpHeaders} from '@angular/common/http';
export class RequestObj {
path: string;
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
data?: {};
contentType?: 'application/json' | 'application/x-www-form-urlencoded';
queryParam?: {};
header?: HttpHeaders | {
[header: string]: string | string[];
};
}
export class Response<T> {
code: number;
msg: string;
result: T;
date: number;
constructor(t: T) {
this.code = 0;
this.result = t;
}
}
export class PageList<T> {
total: number;
list: T[];
pageNum: number;
pageSize: number;
size: number;
startRow: number;
endRow: number;
pages: number;
prePage: number;
nextPage: number;
isFirstPage: boolean;
isLastPage: boolean;
hasPreviousPage: boolean;
hasNextPage: boolean;
navigatePages: number;
navigatepageNums: number[];
navigateFirstPage: number;
navigateLastPage: number;
}

View File

@@ -1,12 +0,0 @@
import {HttpHeaders} from '@angular/common/http';
export class RequestObj {
path: string;
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
data?: {};
contentType?: 'application/json' | 'application/x-www-form-urlencoded';
queryParam?: {};
header?: HttpHeaders | {
[header: string]: string | string[];
};
}

View File

@@ -1,11 +0,0 @@
export class Response<T> {
code: number;
msg: string;
result: T;
date: number;
constructor(t: T) {
this.code = 0;
this.result = t;
}
}

View File

@@ -1,5 +1,12 @@
export class Category {
id: number;
name: string;
articles?: number[];
}
export class Category {
id: number;
name: string;
articles?: number[];
}
export class Tag {
id: number;
name: string;
articles?: number[];
}

View File

@@ -1,3 +1,14 @@
export class User {
id: number;
email: string;
displayName: string;
emailStatus: boolean;
avatarImgUrl: string;
desc: string;
role: string;
token?: string;
}
export class LoginReq {
email: string;
isRememberMe: boolean;

View File

@@ -1,14 +0,0 @@
export class ArticleReq {
category: string;
id?: number;
mdContent: string;
open: boolean;
tags: string;
title: string;
type: boolean;
url?: string;
constructor() {
this.type = true;
}
}

View File

@@ -1,18 +0,0 @@
export class CommentReq {
id?: number;
comment: boolean;
content: string;
pid: number;
articleID: number;
responseId: string;
constructor(comment: boolean) {
this.comment = comment;
this.responseId = '';
if (!comment) {
this.articleID = -1;
}
this.pid = -1;
this.id = null;
}
}

View File

@@ -1,20 +0,0 @@
export class PageList<T> {
total: number;
list: T[];
pageNum: number;
pageSize: number;
size: number;
startRow: number;
endRow: number;
pages: number;
prePage: number;
nextPage: number;
isFirstPage: boolean;
isLastPage: boolean;
hasPreviousPage: boolean;
hasNextPage: boolean;
navigatePages: number;
navigatepageNums: number[];
navigateFirstPage: number;
navigateLastPage: number;
}

View File

@@ -1,5 +0,0 @@
export class Tag {
id: number;
name: string;
articles?: number[];
}

View File

@@ -1,10 +0,0 @@
export class User {
id: number;
email: string;
displayName: string;
emailStatus: boolean;
avatarImgUrl: string;
desc: string;
role: string;
token?: string;
}