fix(parser): 完善内容解析

This commit is contained in:
BTMuli
2023-04-01 15:32:39 +08:00
parent e2aee5185d
commit 3cc71a8921
4 changed files with 139 additions and 31 deletions

View File

@@ -2,7 +2,7 @@
* @file plugins Mys interface post.ts
* @description Mys 插件帖子接口
* @author BTMuli<bt-muli@outlook.com>
* @since Alpha
* @since Alpha v0.1.1
*/
import { MysResponse } from "./base";
@@ -226,6 +226,20 @@ export interface PostStat {
forward_num: number;
}
/**
* @description 帖子内容-结构化
* @description 当用户发帖时,解析内容用这个,为 post.content 的反序列化
* @since Alpha v0.1.1
* @interface PostContent
* @property {string} describe 描述
* @property {string[]} imgs 图片 URL
* @return {PostContent}
*/
export interface PostContent {
describe: string;
imgs?: string[];
}
/**
* @description 帖子结构化内容
* @since Alpha v0.1.1
@@ -233,6 +247,7 @@ export interface PostStat {
* @property {string|object} insert 插入内容
* @property {string} insert.image 图片 URL
* @property {PostStructuredContentVod} insert.vod 视频信息
* @property {string} insert.video 外部视频 URL
* @property {string} insert.backup_text 折叠文本
* @property {object} insert.lottery 抽奖,当 backup_text 为 [抽奖]
* @property {string} insert.lottery.id 抽奖 ID
@@ -256,6 +271,7 @@ export interface PostStructuredContent {
insert:
| {
image?: string;
video?: string;
vod?: PostStructuredContentVod;
backup_text?: string;
lottery?: {