Skip to content

Commit

Permalink
deploy: cfa117b
Browse files Browse the repository at this point in the history
  • Loading branch information
surmon-china committed May 20, 2024
1 parent 0bead07 commit aae0bd0
Show file tree
Hide file tree
Showing 41 changed files with 656 additions and 656 deletions.
4 changes: 2 additions & 2 deletions classes/ArticleCalendarQueryDTO.html
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,14 @@ <h3 id="inputs">
timezone?: string
}

export class ArticleIDsDTO {
export class ArticleIdsDTO {
@ArrayNotEmpty()
@ArrayUnique()
@IsArray()
article_ids: string[]
}

export class ArticlesStateDTO extends ArticleIDsDTO {
export class ArticlesStateDTO extends ArticleIdsDTO {
@IsIn(ARTICLE_PUBLISH_STATES)
@IsInt()
@IsDefined()
Expand Down
8 changes: 4 additions & 4 deletions classes/ArticleIDsDTO.html → classes/ArticleIdsDTO.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@

<ol class="breadcrumb">
<li class="breadcrumb-item">Classes</li>
<li class="breadcrumb-item" >ArticleIDsDTO</li>
<li class="breadcrumb-item" >ArticleIdsDTO</li>
</ol>

<ul class="nav nav-tabs" role="tablist">
Expand Down Expand Up @@ -296,14 +296,14 @@ <h3 id="inputs">
timezone?: string
}

export class ArticleIDsDTO {
export class ArticleIdsDTO {
@ArrayNotEmpty()
@ArrayUnique()
@IsArray()
article_ids: string[]
}

export class ArticlesStateDTO extends ArticleIDsDTO {
export class ArticlesStateDTO extends ArticleIdsDTO {
@IsIn(ARTICLE_PUBLISH_STATES)
@IsInt()
@IsDefined()
Expand Down Expand Up @@ -347,7 +347,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
<script>
var COMPODOC_CURRENT_PAGE_DEPTH = 1;
var COMPODOC_CURRENT_PAGE_CONTEXT = 'class';
var COMPODOC_CURRENT_PAGE_URL = 'ArticleIDsDTO.html';
var COMPODOC_CURRENT_PAGE_URL = 'ArticleIdsDTO.html';
var MAX_SEARCH_RESULTS = 15;
</script>

Expand Down
4 changes: 2 additions & 2 deletions classes/ArticlePaginateQueryDTO.html
Original file line number Diff line number Diff line change
Expand Up @@ -602,14 +602,14 @@ <h3 id="inputs">
timezone?: string
}

export class ArticleIDsDTO {
export class ArticleIdsDTO {
@ArrayNotEmpty()
@ArrayUnique()
@IsArray()
article_ids: string[]
}

export class ArticlesStateDTO extends ArticleIDsDTO {
export class ArticlesStateDTO extends ArticleIdsDTO {
@IsIn(ARTICLE_PUBLISH_STATES)
@IsInt()
@IsDefined()
Expand Down
10 changes: 5 additions & 5 deletions classes/ArticlesStateDTO.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ <h3>File</h3>
<h3>Extends</h3>
</p>
<p class="comment">
<code><a href="../classes/ArticleIDsDTO.html" target="_self" >ArticleIDsDTO</a></code>
<code><a href="../classes/ArticleIdsDTO.html" target="_self" >ArticleIdsDTO</a></code>
</p>


Expand Down Expand Up @@ -243,13 +243,13 @@ <h3 id="inputs">
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Inherited from <code><a href="../classes/ArticleIDsDTO.html" target="_self" >ArticleIDsDTO</a></code>
<div class="io-line">Inherited from <code><a href="../classes/ArticleIdsDTO.html" target="_self" >ArticleIdsDTO</a></code>
</div>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <code><a href="../classes/ArticleIDsDTO.html#source" target="_self" >ArticleIDsDTO:95</a></code>
<div class="io-line">Defined in <code><a href="../classes/ArticleIdsDTO.html#source" target="_self" >ArticleIdsDTO:95</a></code>
</div>
</td>
</tr>
Expand Down Expand Up @@ -353,14 +353,14 @@ <h3 id="inputs">
timezone?: string
}

export class ArticleIDsDTO {
export class ArticleIdsDTO {
@ArrayNotEmpty()
@ArrayUnique()
@IsArray()
article_ids: string[]
}

export class ArticlesStateDTO extends ArticleIDsDTO {
export class ArticlesStateDTO extends ArticleIdsDTO {
@IsIn(ARTICLE_PUBLISH_STATES)
@IsInt()
@IsDefined()
Expand Down
20 changes: 10 additions & 10 deletions controllers/ArticleController.html
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ <h3 id="methods">
<tr>
<td class="col-md-4">
<span class="modifier-icon icon ion-ios-reset"></span>
<code>delArticles(body: <a href="../classes/ArticleIDsDTO.html" target="_self">ArticleIDsDTO</a>)</code>
<code>delArticles(body: <a href="../classes/ArticleIdsDTO.html" target="_self">ArticleIdsDTO</a>)</code>
</td>
</tr>

Expand Down Expand Up @@ -421,7 +421,7 @@ <h3 id="methods">
<tr>
<td>body</td>
<td>
<code><a href="../classes/ArticleIDsDTO.html" target="_self" >ArticleIDsDTO</a></code>
<code><a href="../classes/ArticleIdsDTO.html" target="_self" >ArticleIdsDTO</a></code>
</td>

<td>
Expand Down Expand Up @@ -957,7 +957,7 @@ <h3 id="methods">
import { TagService } from &#x27;@app/modules/tag/tag.service&#x27;
import { CategoryService } from &#x27;@app/modules/category/category.service&#x27;
import { PaginateResult, PaginateQuery, PaginateOptions } from &#x27;@app/utils/paginate&#x27;
import { ArticlePaginateQueryDTO, ArticleCalendarQueryDTO, ArticleIDsDTO, ArticlesStateDTO } from &#x27;./article.dto&#x27;
import { ArticlePaginateQueryDTO, ArticleCalendarQueryDTO, ArticleIdsDTO, ArticlesStateDTO } from &#x27;./article.dto&#x27;
import { ARTICLE_HOTTEST_SORT_PARAMS } from &#x27;./article.model&#x27;
import { ArticleService } from &#x27;./article.service&#x27;
import { Article } from &#x27;./article.model&#x27;
Expand Down Expand Up @@ -1054,12 +1054,12 @@ <h3 id="methods">
@Get(&#x27;:id/context&#x27;)
@Responser.handle(&#x27;Get context articles&#x27;)
async getArticleContext(@QueryParams() { params }: QueryParamsResult) {
const articleID &#x3D; Number(params.id)
const articleId &#x3D; Number(params.id)
const [prevArticles, nextArticles, relatedArticles] &#x3D; await Promise.all([
this.articleService.getNearArticles(articleID, &#x27;early&#x27;, 1),
this.articleService.getNearArticles(articleID, &#x27;later&#x27;, 1),
this.articleService.getNearArticles(articleId, &#x27;early&#x27;, 1),
this.articleService.getNearArticles(articleId, &#x27;later&#x27;, 1),
this.articleService
.getDetailByNumberIDOrSlug({ idOrSlug: articleID, publicOnly: true })
.getDetailByNumberIdOrSlug({ idOrSlug: articleId, publicOnly: true })
.then((article) &#x3D;&gt; this.articleService.getRelatedArticles(article, 20))
])
return {
Expand All @@ -1083,8 +1083,8 @@ <h3 id="methods">
}
// admin user &gt; Object ID | number ID
return Types.ObjectId.isValid(params.id)
? this.articleService.getDetailByObjectID(params.id)
: this.articleService.getDetailByNumberIDOrSlug({ idOrSlug: Number(params.id) })
? this.articleService.getDetailByObjectId(params.id)
: this.articleService.getDetailByNumberIdOrSlug({ idOrSlug: Number(params.id) })
}

@Post()
Expand Down Expand Up @@ -1118,7 +1118,7 @@ <h3 id="methods">
@Delete()
@UseGuards(AdminOnlyGuard)
@Responser.handle(&#x27;Delete articles&#x27;)
delArticles(@Body() body: ArticleIDsDTO) {
delArticles(@Body() body: ArticleIdsDTO) {
return this.articleService.batchDelete(body.article_ids)
}
}
Expand Down
2 changes: 1 addition & 1 deletion controllers/CommentController.html
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ <h3 id="methods">
@UseGuards(AdminOnlyGuard)
@Responser.handle({ message: &#x27;Get comment detail&#x27;, error: HttpStatus.NOT_FOUND })
getComment(@QueryParams() { params }: QueryParamsResult): Promise&lt;Comment&gt; {
return this.commentService.getDetailByObjectID(params.id).then((comment) &#x3D;&gt; {
return this.commentService.getDetailByObjectId(params.id).then((comment) &#x3D;&gt; {
return comment ? comment : Promise.reject(&#x27;Comment not found&#x27;)
})
}
Expand Down
16 changes: 8 additions & 8 deletions controllers/VoteController.html
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ <h3 id="methods">
import { DisqusToken } from &#x27;@app/modules/disqus/disqus.token&#x27;
import { AccessToken } from &#x27;@app/utils/disqus&#x27;
import { GUESTBOOK_POST_ID } from &#x27;@app/constants/biz.constant&#x27;
import { getPermalinkByID } from &#x27;@app/transformers/urlmap.transformer&#x27;
import { getPermalinkById } from &#x27;@app/transformers/urlmap.transformer&#x27;
import { CommentVoteDTO, PostVoteDTO, VotePaginateQueryDTO, VotesDTO } from &#x27;./vote.dto&#x27;
import { Vote, VoteTarget, VoteAuthorType, voteTypeMap } from &#x27;./vote.model&#x27;
import { VoteService } from &#x27;./vote.service&#x27;
Expand All @@ -1066,7 +1066,7 @@ <h3 id="methods">
if (postId &#x3D;&#x3D;&#x3D; GUESTBOOK_POST_ID) {
return &#x27;guestbook&#x27;
} else {
const article &#x3D; await this.articleService.getDetailByNumberIDOrSlug({ idOrSlug: postId })
const article &#x3D; await this.articleService.getDetailByNumberIdOrSlug({ idOrSlug: postId })
return article.toObject().title
}
}
Expand Down Expand Up @@ -1251,7 +1251,7 @@ <h3 id="methods">
author: this.getAuthorString(voteAuthor),
userAgent: visitor.ua,
location: ipLocation,
link: getPermalinkByID(voteBody.post_id)
link: getPermalinkById(voteBody.post_id)
})
}
)
Expand All @@ -1273,11 +1273,11 @@ <h3 id="methods">
// Disqus only logged-in user
if (token) {
try {
const postID &#x3D; await this.disqusPublicService.getDisqusPostIDByCommentID(voteBody.comment_id)
if (postID) {
const postId &#x3D; await this.disqusPublicService.getDisqusPostIdByCommentId(voteBody.comment_id)
if (postId) {
await this.disqusPublicService.votePost({
access_token: token.access_token,
post: postID,
post: postId,
vote: voteBody.vote
})
// console.info(&#x60;Disqus like post ${voteBody.comment_id}&#x60;, result)
Expand All @@ -1301,7 +1301,7 @@ <h3 id="methods">
ip: visitor.ip,
ip_location: ipLocation
})
const comment &#x3D; await this.commentService.getDetailByNumberID(voteBody.comment_id)
const comment &#x3D; await this.commentService.getDetailByNumberId(voteBody.comment_id)
const targetTitle &#x3D; await this.getPostTitle(comment.post_id)
// email to author and admin
const mailPayload &#x3D; {
Expand All @@ -1310,7 +1310,7 @@ <h3 id="methods">
author: this.getAuthorString(voteAuthor),
userAgent: visitor.ua,
location: ipLocation,
link: getPermalinkByID(comment.post_id) + &#x60;#comment-${comment.id}&#x60;
link: getPermalinkById(comment.post_id) + &#x60;#comment-${comment.id}&#x60;
}
// email to admin
this.emailToTargetVoteMessage({
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ <h1>NodePress</h1>
<p><strong>Related <a href="https://github.com/stars/surmon-china/lists/surmon-me">Projects</a></strong></p>
<ul>
<li><strong>SSR Blog:</strong> <a href="https://github.com/surmon-china/surmon.me"><code>surmon.me</code></a> powered by Vue(3)</li>
<li><strong>Blog admin:</strong> <a href="https://github.com/surmon-china/veact-admin"><code>veact-admin</code></a> powered by React &amp; <a href="https://github.com/veactjs/veact"><code>Veact</code></a></li>
<li><strong>Blog admin:</strong> <a href="https://github.com/surmon-china/surmon.admin"><code>surmon.admin</code></a> powered by React &amp; <a href="https://github.com/veactjs/veact"><code>Veact</code></a></li>
<li><strong>Blog native app:</strong> <a href="https://github.com/surmon-china/surmon.me.native"><code>surmon.me.native</code></a> powered by react-native</li>
</ul>
<hr>
Expand Down
36 changes: 18 additions & 18 deletions injectables/AnnouncementService.html
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ <h3 id="methods">
<tr>
<td class="col-md-4">
<span class="modifier-icon icon ion-ios-reset"></span>
<code>batchDelete(announcementIDs: <a href="../undefineds/MongooseID.html" target="_self">MongooseID[]</a>)</code>
<code>batchDelete(announcementIds: <a href="../undefineds/MongooseId.html" target="_self">MongooseId[]</a>)</code>
</td>
</tr>

Expand Down Expand Up @@ -263,9 +263,9 @@ <h3 id="methods">
</thead>
<tbody>
<tr>
<td>announcementIDs</td>
<td>announcementIds</td>
<td>
<code><a href="../miscellaneous/typealiases.html#MongooseID" target="_self" >MongooseID[]</a></code>
<code><a href="../miscellaneous/typealiases.html#MongooseId" target="_self" >MongooseId[]</a></code>
</td>

<td>
Expand Down Expand Up @@ -372,7 +372,7 @@ <h3 id="methods">
<tr>
<td class="col-md-4">
<span class="modifier-icon icon ion-ios-reset"></span>
<code>delete(announcementID: <a href="../undefineds/MongooseID.html" target="_self">MongooseID</a>)</code>
<code>delete(announcementId: <a href="../undefineds/MongooseId.html" target="_self">MongooseId</a>)</code>
</td>
</tr>

Expand Down Expand Up @@ -401,9 +401,9 @@ <h3 id="methods">
</thead>
<tbody>
<tr>
<td>announcementID</td>
<td>announcementId</td>
<td>
<code><a href="../miscellaneous/typealiases.html#MongooseID" target="_self" >MongooseID</a></code>
<code><a href="../miscellaneous/typealiases.html#MongooseId" target="_self" >MongooseId</a></code>
</td>

<td>
Expand Down Expand Up @@ -522,7 +522,7 @@ <h3 id="methods">
<tr>
<td class="col-md-4">
<span class="modifier-icon icon ion-ios-reset"></span>
<code>update(announcementID: <a href="../undefineds/MongooseID.html" target="_self">MongooseID</a>, announcement: <a href="../classes/Announcement.html" target="_self">Announcement</a>)</code>
<code>update(announcementId: <a href="../undefineds/MongooseId.html" target="_self">MongooseId</a>, announcement: <a href="../classes/Announcement.html" target="_self">Announcement</a>)</code>
</td>
</tr>

Expand Down Expand Up @@ -551,9 +551,9 @@ <h3 id="methods">
</thead>
<tbody>
<tr>
<td>announcementID</td>
<td>announcementId</td>
<td>
<code><a href="../miscellaneous/typealiases.html#MongooseID" target="_self" >MongooseID</a></code>
<code><a href="../miscellaneous/typealiases.html#MongooseId" target="_self" >MongooseId</a></code>
</td>

<td>
Expand Down Expand Up @@ -596,7 +596,7 @@ <h3 id="methods">
<div class="tab-pane fade tab-source-code" id="source">
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Injectable } from &#x27;@nestjs/common&#x27;
import { InjectModel } from &#x27;@app/transformers/model.transformer&#x27;
import { MongooseModel, MongooseDoc, MongooseID } from &#x27;@app/interfaces/mongoose.interface&#x27;
import { MongooseModel, MongooseDoc, MongooseId } from &#x27;@app/interfaces/mongoose.interface&#x27;
import { PaginateResult, PaginateOptions, PaginateQuery } from &#x27;@app/utils/paginate&#x27;
import { Announcement } from &#x27;./announcement.model&#x27;

Expand All @@ -615,24 +615,24 @@ <h3 id="methods">
return this.announcementModel.create(announcement)
}

public update(announcementID: MongooseID, announcement: Announcement): Promise&lt;MongooseDoc&lt;Announcement&gt;&gt; {
public update(announcementId: MongooseId, announcement: Announcement): Promise&lt;MongooseDoc&lt;Announcement&gt;&gt; {
return this.announcementModel
.findByIdAndUpdate(announcementID, announcement, { new: true })
.findByIdAndUpdate(announcementId, announcement, { new: true })
.exec()
.then((result) &#x3D;&gt; result || Promise.reject(&#x60;Announcement &#x27;${announcementID}&#x27; not found&#x60;))
.then((result) &#x3D;&gt; result || Promise.reject(&#x60;Announcement &#x27;${announcementId}&#x27; not found&#x60;))
}

public delete(announcementID: MongooseID) {
public delete(announcementId: MongooseId) {
return this.announcementModel
.findByIdAndDelete(announcementID, null)
.findByIdAndDelete(announcementId, null)
.exec()
.then((result) &#x3D;&gt; {
return result ?? Promise.reject(&#x60;Announcement &#x27;${announcementID}&#x27; not found&#x60;)
return result ?? Promise.reject(&#x60;Announcement &#x27;${announcementId}&#x27; not found&#x60;)
})
}

public batchDelete(announcementIDs: MongooseID[]) {
return this.announcementModel.deleteMany({ _id: { $in: announcementIDs } }).exec()
public batchDelete(announcementIds: MongooseId[]) {
return this.announcementModel.deleteMany({ _id: { $in: announcementIds } }).exec()
}
}
</code></pre>
Expand Down
Loading

0 comments on commit aae0bd0

Please sign in to comment.