接口调整,对接后端部分的v2版本

This commit is contained in:
禾几海
2020-05-27 16:41:06 +08:00
parent deb8646bda
commit dba21730ca
22 changed files with 153 additions and 148 deletions

View File

@@ -111,7 +111,7 @@ export class ApiService extends HttpService {
}
categories() {
return super.Service<Category[]>({
return super.Service<PageList<Category>>({
path: '/categories',
method: 'GET'
});
@@ -183,10 +183,9 @@ export class ApiService extends HttpService {
});
}
getCommentByPid(pid: number, pageNumber: number = 1, pageSize: number = 10) {
return super.Service<Comment[]>({
path: `/comment/pid/${pid}`,
getCommentByTypeForAdmin(pagePath: string, pageNumber: number = 1, pageSize: number = 10) {
return super.Service<PageList<Comment>>({
path: `/admin/comment/pagePath/${pagePath}`,
method: 'GET',
queryParam: {
page: pageNumber,
@@ -195,20 +194,9 @@ export class ApiService extends HttpService {
});
}
getCommentByTypeForAdmin(isComment: boolean, pageNumber: number = 1, pageSize: number = 10) {
getCommentByTypeForUser(pagePath: string, pageNumber: number = 1, pageSize: number = 10) {
return super.Service<PageList<Comment>>({
path: `/admin/comment/type/${isComment ? 1 : 0}`,
method: 'GET',
queryParam: {
page: pageNumber,
count: pageSize
}
});
}
getCommentByTypeForUser(isComment: boolean, pageNumber: number = 1, pageSize: number = 10) {
return super.Service<PageList<Comment>>({
path: `/user/comment/type/${isComment ? 1 : 0}`,
path: `/user/comment/pagePath/${pagePath}`,
method: 'GET',
queryParam: {
page: pageNumber,
@@ -234,21 +222,9 @@ export class ApiService extends HttpService {
});
}
comments(articleID: number, pageSize: number = 10, pageNumber: number = 1) {
comments(pagePath: string, pageSize: number = 10, pageNumber: number = 1) {
return super.Service<PageList<Comment>>({
path: '/comments',
method: 'GET',
queryParam: {
articleId: articleID,
count: pageSize,
page: pageNumber
}
});
}
leaveMsg(pageSize: number = 10, pageNumber: number = 1) {
return super.Service<PageList<Comment>>({
path: '/leaveMsg',
path: `/comment/pagePath/${pagePath}`,
method: 'GET',
queryParam: {
count: pageSize,
@@ -272,7 +248,6 @@ export class ApiService extends HttpService {
articleCount: number,
visitorCount: number,
categoryCount: number,
leaveMsgCount: number,
tagCount: number,
commentCount: number
}>({

View File

@@ -1,3 +1,6 @@
import {Tag} from './Tag';
import {User} from './User';
export class Article {
id: number;
title: string;
@@ -5,16 +8,16 @@ export class Article {
mdContent?: string;
original?: boolean;
url?: string;
publishDateFormat?: string;
publishDateFormat: string;
updateDateFormat?: string;
category?: string;
tags?: string[];
authorName?: string;
preArticleId?: number;
nextArticleId?: number;
preArticleTitle?: string;
nextArticleTitle?: string;
readingNumber?: number;
tags?: Tag[];
author: User;
preArticle?: Article;
nextArticle?: Article;
readingNumber: number;
likeCount: number;
dislikeCount: number;
open?: string;
}
@@ -24,7 +27,7 @@ export class ArticleReq {
id?: number;
mdContent: string;
open: boolean;
tags: string;
tags: string[];
title: string;
type: boolean;
url?: string;

View File

@@ -1,33 +1,26 @@
import {User} from './User';
export class Comment {
id?: number;
authorName?: string;
authorAvatarImgUrl?: string;
fromUser: User;
toUser?: User;
content: string;
articleID: number;
articleTitle: string;
pagePath: string;
date?: string;
responseId: string;
pid: number;
comment: boolean;
respComment: Comment[];
status: number;
}
export class CommentReq {
id?: number;
comment: boolean;
content: string;
pid: number;
articleID: number;
responseId: string;
pid: number = -1;
toUserId: number;
pagePath: string;
constructor(comment: boolean) {
this.comment = comment;
this.responseId = '';
if (!comment) {
this.articleID = -1;
}
this.pid = -1;
this.id = null;
constructor(pagePath: string) {
this.pagePath = pagePath;
}
}

View File

@@ -15,7 +15,6 @@ export class Response<T> {
code: number;
msg: string;
result: T;
date: number;
constructor(t: T) {
this.code = 0;
@@ -28,18 +27,4 @@ export class PageList<T> {
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

@@ -3,4 +3,6 @@ export class Link {
name: string;
url: string;
open?: boolean;
iconPath: string;
desc: string;
}

View File

@@ -1,12 +1,14 @@
import {Article} from './Article';
export class Category {
id: number;
name: string;
articles?: number[];
articles?: Article[];
}
export class Tag {
id: number;
name: string;
articles?: number[];
articles?: Article[];
}

View File

@@ -2,10 +2,10 @@ export class User {
id: number;
email: string;
displayName: string;
emailStatus: boolean;
avatarImgUrl?: string;
emailStatus?: boolean;
avatarImgUrl: string;
desc: string;
role: string;
role?: string;
token?: string;
pwd?: string;
recentlyLandedDate?: string

View File

@@ -1,14 +1,22 @@
<div class="inner-content">
<nz-card nzTitle="文章管理" nzSize="small">
<nz-table #table [nzData]="pageList.list" [nzTotal]="pageList.total" [(nzPageIndex)]="page"
[nzPageSize]="pageSize" [nzLoading]="loading" [nzScroll]="{x:'1100px'}"
(nzPageIndexChange)="getArticle()" nzFrontPagination="false">
<nz-card nzTitle="文章管理" nzSize="small" [nzExtra]="reload">
<nz-table #table [nzData]="pageList.list"
[nzTotal]="pageList.total"
[(nzPageIndex)]="page"
[nzPageSize]="pageSize"
[nzLoading]="loading"
[nzScroll]="{x:'1100px'}"
(nzPageIndexChange)="getArticle()"
nzFrontPagination="false"
nzTableLayout="fixed">
<thead>
<th>标题</th>
<th>发布日期</th>
<th>更新日期</th>
<th>文章类型</th>
<th>阅读量</th>
<th>👍赞</th>
<th>👎踩</th>
<th>是否可见</th>
<th>操作</th>
</thead>
@@ -25,6 +33,12 @@
<td>
<nz-tag [nzColor]="'purple'">{{data.readingNumber}}</nz-tag>
</td>
<td>
<nz-tag [nzColor]="'blue'">{{data.likeCount}}</nz-tag>
</td>
<td>
<nz-tag [nzColor]="'magenta'">{{data.dislikeCount}}</nz-tag>
</td>
<td><input type="checkbox" [checked]="data.open" disabled></td>
<td>
<a routerLink="/write" [queryParams]="{id:data.id}" class="edit-opr">编辑</a>
@@ -36,6 +50,10 @@
</td>
</tr>
</tbody>
<ng-template #reload>
<a (click)="getArticle()" title="刷新"><i nz-icon nzType="reload" nzTheme="outline"></i></a>
</ng-template>
</nz-table>
</nz-card>
</div>

View File

@@ -4,7 +4,7 @@ import {RouterModule} from '@angular/router';
import {AdminArticleComponent} from './admin-article.component';
import {
NzCardModule,
NzDividerModule,
NzDividerModule, NzIconModule,
NzPopconfirmModule,
NzTableModule, NzTagModule,
NzToolTipModule,
@@ -25,6 +25,7 @@ import {
NzDividerModule,
NzPopconfirmModule,
NzTagModule,
NzIconModule,
]
})
export class AdminArticleModule {

View File

@@ -1,20 +1,25 @@
<div class="inner-content">
<nz-card nzTitle="评论管理" nzSize="small">
<nz-table #table [nzData]="pageList.list" [nzTotal]="pageList.total" [(nzPageIndex)]="pageIndex"
[nzPageSize]="pageSize" [nzLoading]="loading" [nzScroll]="{x:'800px'}"
(nzPageIndexChange)="getComment()" nzFrontPagination="false">
<nz-card nzTitle="评论管理" nzSize="small" [nzExtra]="reload">
<nz-table #table [nzData]="pageList.list"
[nzTotal]="pageList.total"
[(nzPageIndex)]="pageIndex"
[nzPageSize]="pageSize"
[nzLoading]="loading"
[nzScroll]="{x:'800px'}"
(nzPageIndexChange)="getComment()"
nzFrontPagination="false"
nzTableLayout="fixed">
<thead>
<th>文章标题</th>
<th>评论内容</th>
<th>评论</th>
<th>评论日期</th>
<th>操作</th>
<th nzAlign="center">评论页面</th>
<th nzAlign="center">评论内容</th>
<th nzAlign="center">评论日期</th>
<th nzAlign="center">操作</th>
</thead>
<tbody>
<tr *ngFor="let data of table.data">
<td nz-typography nzEllipsis="true" [nzTooltipTitle]="data.articleTitle" nzTooltipPlacement="right"
nz-tooltip>{{data.articleTitle}}</td>
<td nz-typography nzEllipsis="true" [nzTooltipTitle]="data.content" nzTooltipPlacement="right"
<td nzAlign="center"><a [href]="data.pagePath">{{data.pagePath}}</a></td>
<td nzAlign="center" nzEllipsis="true" [nzTooltipTitle]="data.content"
nzTooltipPlacement="right"
nz-tooltip style="min-width: 100px;max-width: 400px">
<span *ngIf="!editInfo.editFocus||data.id!==editInfo.id">{{data.content}}</span>
<nz-input-group *ngIf="editInfo.editFocus&&data.id===editInfo.id"
@@ -26,9 +31,8 @@
<button nz-button (click)="editInfo.editFocus=false" nzSize="small">取消</button>
</nz-input-group>
</td>
<td>{{data.authorName}}</td>
<td>{{data.date}}</td>
<td>
<td nzAlign="center">{{data.date}}</td>
<td nzAlign="center">
<a (click)="editFocus(data)" class="edit-opr">编辑</a>
<nz-divider nzType="vertical"></nz-divider>
<a nz-popconfirm nzPopconfirmTitle="确定要删除这篇文章吗?" nzOkText="删除" nzCancelText="点错了"
@@ -40,3 +44,6 @@
</nz-card>
</div>
<ng-template #tagIcon><i nz-icon nzType="message" nzTheme="outline"></i></ng-template>
<ng-template #reload>
<a (click)="getComment()" title="刷新"><i nz-icon nzType="reload" nzTheme="outline"></i></a>
</ng-template>

View File

@@ -27,7 +27,9 @@ export class AdminCommentComponent implements OnInit {
} else {
this.getComment = this.getCommentForUser;
}
if (this.requested) return;
this.getComment()
this.requested = true
},
error: null,
complete: null
@@ -40,23 +42,25 @@ export class AdminCommentComponent implements OnInit {
pageList: PageList<Comment> = new PageList<Comment>();
editInfo = {
id: null,
content: new CommentReq(true),
content: new CommentReq(null),
editFocus: false,
}
getComment: any;// 存放获取评论的方法
private requested: boolean = false;
ngOnInit(): void {
}
getCommentForAdmin = () => this.apiService.getCommentByTypeForAdmin(true, this.pageIndex, this.pageSize).subscribe({
// TODO:: pagePath
getCommentForAdmin = () => this.apiService.getCommentByTypeForAdmin('*', this.pageIndex, this.pageSize).subscribe({
next: data => this.pageList = data.result,
complete: () => this.loading = false,
error: err => this.loading = false
})
getCommentForUser = () => this.apiService.getCommentByTypeForUser(true, this.pageIndex, this.pageSize).subscribe({
getCommentForUser = () => this.apiService.getCommentByTypeForUser('*', this.pageIndex, this.pageSize).subscribe({
next: data => this.pageList = data.result,
complete: () => this.loading = false,
error: err => this.loading = false
@@ -97,9 +101,9 @@ export class AdminCommentComponent implements OnInit {
this.editInfo.id = data.id;
this.editInfo.content.content = data.content;
this.editInfo.content.id = data.id;
this.editInfo.content.articleID = data.articleID;
// this.editInfo.content.articleID = data.articleID;
this.editInfo.content.pid = data.pid;
this.editInfo.content.responseId = data.responseId;
// this.editInfo.content.responseId = data.responseId;
this.editInfo.editFocus = true;
}
}

View File

@@ -23,10 +23,9 @@ export class AdminDashboardComponent implements OnInit {
articleCount: number,
visitorCount: number,
categoryCount: number,
leaveMsgCount: number,
tagCount: number,
commentCount: number
} = {articleCount: 0, visitorCount: 0, categoryCount: 0, tagCount: 0, commentCount: 0, leaveMsgCount: 0}
} = {articleCount: 0, visitorCount: 0, categoryCount: 0, tagCount: 0, commentCount: 0}
dayVisitCount: number = 0;
userInfo: User = new User();

View File

@@ -6,7 +6,7 @@ import {
NzButtonModule,
NzCardModule,
NzDividerModule,
NzFormModule, NzInputModule,
NzFormModule, NzIconModule, NzInputModule,
NzModalModule,
NzPopconfirmModule, NzSelectModule,
NzTableModule
@@ -30,7 +30,8 @@ import {ReactiveFormsModule} from '@angular/forms';
ReactiveFormsModule,
NzInputModule,
NzSelectModule,
NzButtonModule
NzButtonModule,
NzIconModule
]
})
export class AdminLinkModule {

View File

@@ -6,7 +6,7 @@
<!-- 文章版权 -->
<div id="copyright">
<p>本文作者:{{article.authorName}} </p>
<p>本文作者:{{article.author.displayName}} </p>
<p>{{article.original ? "本文" : "原文"}}链接:{{article.original ? copyRightUrl : article.url}}</p>
<p>版权声明:转载请注明出处</p>
</div>
@@ -16,17 +16,19 @@
<!-- TODO -->
<span *ngFor="let item of (article.tags||'')" class="tag">
<i nz-icon nzType="tag" nzTheme="fill"></i>
<a class="tag" [routerLink]="['/tags']" [queryParams]="{name:item}">{{item}}</a>
<a class="tag" [routerLink]="['/tags/'+item.name]">{{item.name}}</a>
</span>
</div>
<div class="article-bAnda">
<a (click)="toArticle(article.nextArticleId)" [class.disabled]="article.nextArticleId==-1">
<i nz-icon nzType="left" nzTheme="outline"></i> {{article.nextArticleTitle}}
<a (click)="toArticle(article.nextArticle.id)" [class.disabled]="!article.nextArticle">
<i nz-icon nzType="left" nzTheme="outline"></i>
{{(article.nextArticle && article.nextArticle.title) || '无'}}
</a>
<a (click)="toArticle(article.preArticleId)" [class.disabled]="article.preArticleId==-1"
<a (click)="toArticle(article.preArticle.id)" [class.disabled]="!article.preArticle"
style="float: right" id="pre">
{{article.preArticleTitle}} <i nz-icon nzType="right" nzTheme="outline"></i>
{{(article.preArticle && article.preArticle.title) || '无'}}
<i nz-icon nzType="right" nzTheme="outline"></i>
</a>
</div>
@@ -58,19 +60,30 @@
<nz-list [nzLoading]="!commentPage">
<nz-list-item *ngFor="let comment of commentPage.list">
<nz-comment [nzAuthor]="comment.authorName" [nzDatetime]="comment.date" style="width: 100%">
<nz-avatar nz-comment-avatar nzIcon="user" [nzSrc]="comment.authorAvatarImgUrl"></nz-avatar>
<nz-comment [nzAuthor]="comment.fromUser.displayName" [nzDatetime]="comment.date" style="width: 100%">
<nz-avatar nz-comment-avatar nzIcon="user" [nzSrc]="comment.fromUser.avatarImgUrl"
*ngIf="comment.fromUser.avatarImgUrl">
</nz-avatar>
<nz-avatar nz-comment-avatar nzIcon="user" [nzText]="comment.fromUser.displayName"
*ngIf="!comment.fromUser.avatarImgUrl">
</nz-avatar>
<nz-comment-content>
<p style="font-size: larger">{{ comment.content }}</p>
</nz-comment-content>
<nz-comment-action>
<i nz-icon nzType="message" nzTheme="outline"></i>
<button nz-button nzType="link" (click)="resp(comment.id,comment.authorName)">回复</button>
<button nz-button nzType="link" (click)="resp(comment.id,comment.fromUser.displayName)">回复
</button>
</nz-comment-action>
<nz-list-item *ngFor="let com of comment.respComment">
<nz-comment [nzAuthor]="com.authorName" [nzDatetime]="com.date">
<nz-avatar nz-comment-avatar nzIcon="user" [nzSrc]="com.authorAvatarImgUrl"></nz-avatar>
<nz-comment [nzAuthor]="com.fromUser.displayName" [nzDatetime]="com.date">
<nz-avatar nz-comment-avatar nzIcon="user" [nzSrc]="com.fromUser.avatarImgUrl"
*ngIf="com.fromUser.avatarImgUrl">
</nz-avatar>
<nz-avatar nz-comment-avatar nzIcon="user" [nzText]="com.fromUser.displayName"
*ngIf="!com.fromUser.avatarImgUrl">
</nz-avatar>
<nz-comment-content>
<p style="font-size: larger">{{ com.content }}</p>
</nz-comment-content>

View File

@@ -51,7 +51,7 @@ export class ArticleComponent implements OnInit {
if (data.result) this.avatarImgUrl = data.result.avatarImgUrl;
}
});
this.comment = new CommentReq(true);
this.comment = new CommentReq(`article/${this.articleId}`);
}
parseMd(md: string) {
@@ -73,7 +73,7 @@ export class ArticleComponent implements OnInit {
this.router.navigateByUrl('/article/' + id);
this.apiService.getArticle(id).subscribe({
next: data => {
this.apiService.comments(id).subscribe(commData => {
this.apiService.comments(`article+${id}`).subscribe(commData => {
this.commentPage = commData.result;
});
document.getElementById('article-content').innerHTML = '';
@@ -89,7 +89,6 @@ export class ArticleComponent implements OnInit {
// true ==> 一级评论 false ==>二级评论
submitComment(bool: boolean) {
this.submitting = true;
this.comment.articleID = this.articleId;
if (!bool) {
this.comment.content = this.content;
this.comment.pid = this.pid;

View File

@@ -38,8 +38,8 @@ export class CategoryComponent implements OnInit {
getCategories(needGetArticle: boolean) {
this.apiService.categories().subscribe(data => {
this.categoryList = data.result;
this.category = data.result[0];
this.categoryList = data.result.list;
this.category = this.categoryList[0];
if (needGetArticle) {
this.getArticles(this.category.name);
this.name = this.category.name;

View File

@@ -10,7 +10,7 @@
</span>
<span *ngIf="showMediaArea" class="badge">
<i nz-icon nzType="user" nzTheme="outline"></i>
<span>{{data.authorName}}</span>
<span>{{data.author.displayName}}</span>
</span>
<span *ngIf="showMediaArea" class="badge">
<i nz-icon nzType="file" nzTheme="outline"></i>
@@ -28,7 +28,7 @@
<div>
<span *ngFor="let tag of data.tags">
<i nz-icon nzType="tag" nzTheme="outline"></i>
<a [routerLink]="'/tags/'+tag">{{tag}}</a>
<a [routerLink]="'/tags/'+tag.name">{{tag.name}}</a>
</span>
</div>
</ng-template>

View File

@@ -22,7 +22,7 @@ export class ArticleDetailCardComponent implements OnInit {
}
if (this.showMediaArea == null) {
// 如果作者名不为空 则显示
this.showMediaArea = this.data.authorName != null;
this.showMediaArea = this.data.author.displayName != null;
}
if (this.showTagArea == null) {
this.showTagArea = this.data.tags != null;

View File

@@ -7,7 +7,7 @@ import {PageList} from '../../class/HttpReqAndResp';
import {ErrDispatch} from '../../class/ErrDispatch';
import {RequestObj} from '../../class/HttpReqAndResp';
import {Router} from '@angular/router';
import {Tag} from '../../class/Tag';
import {Category, Tag} from '../../class/Tag';
import {Title} from '@angular/platform-browser';
@Component({
@@ -36,12 +36,11 @@ export class IndexComponent implements OnInit, ErrDispatch {
desc: string;
articles: PageList<Article>;
tagNameAndNumber: { name: string, size: number }[];
categoryList: Tag[];
categoryList: Category[];
counts: {
articleCount: number,
visitorCount: number,
categoryCount: number,
leaveMsgCount: number,
tagCount: number,
commentCount: number
};
@@ -75,7 +74,7 @@ export class IndexComponent implements OnInit, ErrDispatch {
}
});
this.apiService.categories().subscribe({
next: data => this.categoryList = data.result,
next: data => this.categoryList = data.result.list,
error: err => {
}
});

View File

@@ -29,7 +29,7 @@ export class UpdateComponent implements OnInit {
this.lastUpdate = data.result;
});
this.apiService.webUpdate().subscribe(data => {
this.webUpdate = data.result.reverse();
this.webUpdate = data.result;
});
}

View File

@@ -1,6 +1,6 @@
import {Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {Tag} from '../../../../class/Tag';
import {Category, Tag} from '../../../../class/Tag';
@Component({
selector: 'c-publish-form',
@@ -15,9 +15,9 @@ export class PublishFormComponent implements OnInit {
@ViewChild('inputElement', {static: false}) tagInputElement: ElementRef;
@Input() tagNacList: { name: string, size: number }[];
@Input() categoryList: Tag[];
@Input() primaryData: { id: number, type: boolean, tags: string, category: string, url?: string };
@Output() submitEvent = new EventEmitter<{ id: number, type: boolean, tags: string, category: string, url?: string }>();
@Input() categoryList: Category[];
@Input() primaryData: { id: number, type: boolean, tags: string[], category: string, url?: string };
@Output() submitEvent = new EventEmitter<{ id: number, type: boolean, tags: string[], category: string, url?: string }>();
formGroup: FormGroup;
tagTmpList: string[] = [];
@@ -36,8 +36,8 @@ export class PublishFormComponent implements OnInit {
if (this.primaryData) {
this.formGroup.get('type').setValue(this.primaryData.type);
const tags = this.primaryData.tags;
this.formGroup.get('tagList').setValue(tags ? this.primaryData.tags.split(',') : tags);
this.tagTmpList = tags ? this.primaryData.tags.split(',') : [...tags];
this.formGroup.get('tagList').setValue(tags);
this.tagTmpList = tags;
this.formGroup.get('category').setValue(this.primaryData.category);
this.formGroup.get('url').setValue(this.primaryData.url);
}
@@ -47,7 +47,7 @@ export class PublishFormComponent implements OnInit {
const formData = {
id: this.formGroup.value.isUpdate ? this.primaryData.id : null,
type: this.formGroup.value.type,
tags: this.formGroup.value.tagList.toString(),
tags: this.formGroup.value.tagList,
category: this.formGroup.value.category,
url: this.formGroup.value.type ? null : this.formGroup.value.url
};

View File

@@ -81,7 +81,7 @@ export class WriteComponent implements OnInit {
});
this.apiService.categories().subscribe({
next: data => {
this.categoryList = data.result;
this.categoryList = data.result.list;
},
error: err => {
this.message.error('获取分类信息失败');
@@ -109,17 +109,19 @@ export class WriteComponent implements OnInit {
/**
* 文章数据提交
*/
publishArticle(e: { id: number, type: boolean, tags: string, category: string, url?: string }) {
publishArticle(e: { id: number, type: boolean, tags: string[], category: string, url?: string }) {
this.article.type = e.type;
this.article.tags = e.tags;
this.article.category = e.category;
this.article.url = e.url;
this.article.id = e.id;
if (!this.article.id && this.title === this.article.title) {
this.message.error('文章标题未经更改,请修改后再发布');
return;
}
this.modalVisible = false;
// if (!this.article.id && this.title === this.article.title) {
// this.message.error('文章标题未经更改,请修改后再发布');
// return;
// }
// 文章 暂存
localStorage.setItem('tmpArticle', JSON.stringify(this.article));
@@ -182,7 +184,9 @@ export class WriteComponent implements OnInit {
next: data => {
this.article.category = data.result.category;
this.article.mdContent = data.result.mdContent;
this.article.tags = String(data.result.tags);
const tags = []
data.result.tags.forEach(t => tags.push(t.name))
this.article.tags = tags;
this.article.type = data.result.original;
this.article.url = data.result.url;
this.article.title = data.result.title;