add tiptap

This commit is contained in:
Timi
2026-08-21 01:11:23 +08:00
parent 763783b984
commit 68d9946b70
41 changed files with 5845 additions and 35 deletions
+47 -22
View File
@@ -1,27 +1,52 @@
import type { Attachment } from "./Attachment";
import type { Comment } from "./Comment";
import type { Model } from "./Model";
import type { Setting } from "./Setting";
// 文章
export type Article<A> = {
/** 文章业务类型 */
export type ArticleBizType = "BLOG" | "FEEDBACK";
/** 文章正文类型 */
export type ArticleContentType = "TEXT" | "MARKDOWN" | "TIP_TAP";
/** 文章状态 */
export type ArticleStatus = "DART" | "NORMAL" | "HIDDEN";
/** 文章实体 */
export type Article = {
/** 业务类型 */
bizType?: ArticleBizType;
/** 业务 ID */
bizId?: string;
/** 标题 */
title?: string;
type: ArticleType;
digest?: string;
data?: string;
args?: A;
reads: number;
likes: number;
showComment: boolean;
canComment: boolean;
canRanking: boolean;
/** 描述 */
description?: string;
/** 正文类型 */
contentType?: ArticleContentType;
/** 正文内容 */
content?: string;
/** 阅读数量 */
reads?: number;
/** 喜欢数量 */
likes?: number;
/** 文章状态 */
status?: ArticleStatus;
/** 设置列表 */
settingList?: Setting[];
/** 评论列表 */
commentList?: Comment[];
/** 附件列表 */
attachmentList?: Attachment[];
} & Model;
export type ArticleView<A> = {
comments?: number;
attachmentList: Attachment[];
} & Article<A>;
export const ArticleType = "COMMON";
export type ArticleType = (typeof ArticleType)[keyof typeof ArticleType];
export const ArticleAttachType = "COVER";
+19 -2
View File
@@ -8,7 +8,8 @@ export type Attachment = {
title?: string;
name?: string;
mimeType?: string;
metadata?: unknown;
metadata?: Record<string, any>;
accessKey?: AttachmentAccessKey;
size?: number;
md5?: string;
uploaderIp?: string;
@@ -28,4 +29,20 @@ export type BizIdUpdate = {
items: Partial<Attachment>[];
};
export type AttachmentBizType = | "USER" | "GAO_CUSTOMER" | "GAO_REGISTER_RECORD" | "TEMP_FILE" | "MIRROR";
export type AttachmentBizType =
| "ARTICLE"
| "USER"
| "GAO_CUSTOMER"
| "GAO_EVENT_RECORD"
| "GAO_REGISTER_RECORD"
| "TEMP_FILE"
| "MIRROR";
/** 附件访问密钥 */
export type AttachmentAccessKey = {
value: string;
attachmentId: string;
isDisposable: boolean;
expiredAt: number;
createdAt: number;
};