类型说明

## 文章 Article >字段示例 |字段名|示例| |-|-| |article_id|1| |title|今天,不敢稍忘,不能稍忘!| |author|新华社| |category_id|1 |category_alias|时政| |pubdate|"2021-12-13T01:13:02.000Z" |abstract|\`尾尾和平鸽<br>声声警钟鸣<br>今天是第八个<br>南京大屠杀死难者国家公祭日\` |clicks| 266 |content| 2006年6月30日,南京大屠杀幸存者夏淑琴(前排右四)在日本东京与支持者手持“不许否定南京大屠杀”的横幅走向东京地方法院。新华社记者 吴谷丰 摄| |is_hidden| 0 ```js { "article_id": number, "title": string, "author": string, "category_alias": string, "category_id":number, "pubdate": string<Date>, "abstract": string, "content": string, "is_hidden": number, "clicks": number } ``` ### 文章描述 文章的描述性信息,不包含文章主体内容content > 文章基本信息 ArticleBase ```js { article_id, title, author, category_id, pubdate, abstract, clicks } ### 文章 Article ```js { articleInfo: ? ArticleBase|ArticleOV, content: string, } ``` > [管理员] 文章概览 ArticleOV (article_overview) > 相比游客,多一个隐藏字段 is_hidden,标志对游客是否可见 ```js ArticleOV extends ArticleBase{ is_hidden } ``` ## 用户 User > ```json { "user_id": number, "username": string } ``` ## 类别 Category > 字段示例 |字段名|示例| |-|-| |category_id|1| |category_alias|时政| |article_num|12| > 类别 Category ```js { id, category_alias, } ``` > 类别统计信息 CategoryStatistics { id, article_num } ### 类别统计- ## Date 字符串 string< Date > > 例:let a = "2021-12-13T01:18:26.896Z" ### 转入 ```js let dateString = JSON.stringify( new Date() ); ``` ### 转出 ```js let date = new Date(a); ``` ### 格式化 ```js let a = "2021-12-13T01:18:26.896Z" let b = a.replace(/[T]/,' ').slice(0,19) '2021-12-13 01:18:26' ``` ### 反格式化 ```js let b = '2021-12-13 01:18:26'; let a = `${b.slice(0,10)}T${b.slice(11)}.000Z` ```