core: add projection for discussion

This commit is contained in:
undefined committed 2021-03-08 14:07:26 +08:00
1 parent 71aabe38b5
commit 2344a41816
5 files changed
+99 -46

No files matched your search

+26 -25
View File
@@ -162,13 +162,19 @@ export interface SampleContentNode {
export type ContentNode = PlainContentNode | TextContentNode | SampleContentNode;
export type Content = string | ContentNode[] | Record<string, ContentNode[]>;
export interface Document {
_id: ObjectID,
docId: any,
docType: number,
domainId: string,
owner: number,
}
declare module './model/problem' {
interface Pdoc {
domainId: string,
docType: 10,
docType: document['TYPE_PROBLEM'],
docId: number,
pid: string,
owner: number,
title: string,
content: Content,
nSubmit: number,
@@ -202,14 +208,6 @@ export interface StatusDoc {
uid: number,
}
export interface Document {
_id: ObjectID,
docId: any,
docType: number,
domainId: string,
owner: number,
}
export interface ProblemStatusDoc extends StatusDoc {
docId: number,
docType: 10,
@@ -339,20 +337,23 @@ export interface HistoryDoc {
}
// Discussion
export interface Ddoc extends Document {
docType: document['TYPE_DISCUSSION'],
docId: ObjectID,
parentType: number,
parentId: ObjectID | number | string,
title: string,
content: string,
ip: string,
pin: boolean,
highlight: boolean,
updateAt: Date,
nReply: number,
views: number,
history: HistoryDoc[],
export { Ddoc } from './model/discussion';
declare module './model/discussion' {
interface Ddoc {
docType: document['TYPE_DISCUSSION'],
docId: ObjectID,
parentType: number,
parentId: ObjectID | number | string,
title: string,
content: string,
ip: string,
pin: boolean,
highlight: boolean,
updateAt: Date,
nReply: number,
views: number,
history: HistoryDoc[],
}
}
// Discussion reply