* feat(migration): add isPublished field to posts and notes collections * feat(note, post): add publish status management for notes and posts * build(tsup): 添加 import.meta.url 支持 - 在 tsup 配置中添加 platform: 'node' 设置 - 注入 import.meta.url 兼容层,以支持不同模块格式 * build(core): 修改 mx-server 启动脚本路径 * feat(migration): 添加 v8.4.0 版本迁移脚本至history * feat(core): 修复未认证用户可查看未发布内容的安全问题 - 在 Note 和 Post 模块中添加了对未认证用户的访问限制 * fix(core): 回滚 mx-server 启动脚本路径 * feat(migration): 添加 v8.4.0 数据库脚本以更新 notes 集合字段 * feat(migration): 更新 v8.4.0 修复脚本以重命名 hide 字段并互换其值 * feat(note): 替换 hide 字段为 isPublished,更新相关查询和条件 * feat(note): 将 hide 字段替换为 isPublished,更新相关数据模型 * feat(migration): 添加 v8.4.0 fix2修复脚本以更新 posts 集合中的 isPublished 字段为true
42 lines
761 B
TypeScript
42 lines
761 B
TypeScript
import type { ModelWithLiked, TextBaseModel } from './base'
|
|
import type { TopicModel } from './topic'
|
|
|
|
export interface NoteModel extends TextBaseModel {
|
|
isPublished: boolean
|
|
count: {
|
|
read: number
|
|
like: number
|
|
}
|
|
|
|
mood?: string
|
|
weather?: string
|
|
bookmark?: boolean
|
|
|
|
publicAt?: Date
|
|
password?: string | null
|
|
nid: number
|
|
|
|
location?: string
|
|
|
|
coordinates?: Coordinate
|
|
topic?: TopicModel
|
|
topicId?: string
|
|
}
|
|
|
|
export interface Coordinate {
|
|
latitude: number
|
|
longitude: number
|
|
}
|
|
|
|
export interface NoteWrappedPayload {
|
|
data: NoteModel
|
|
next?: Partial<NoteModel>
|
|
prev?: Partial<NoteModel>
|
|
}
|
|
|
|
export interface NoteWrappedWithLikedPayload {
|
|
data: ModelWithLiked<NoteModel>
|
|
next?: Partial<NoteModel>
|
|
prev?: Partial<NoteModel>
|
|
}
|