mirror of https://github.com/msgbyte/tailchat
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
628 B
TypeScript
35 lines
628 B
TypeScript
import {
|
|
getModelForClass,
|
|
prop,
|
|
DocumentType,
|
|
modelOptions,
|
|
} from '@typegoose/typegoose';
|
|
import { Base, TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
|
|
import type { Types } from 'mongoose';
|
|
|
|
@modelOptions({
|
|
options: {
|
|
customName: 'p_githubRepo',
|
|
},
|
|
})
|
|
export class Repo extends TimeStamps implements Base {
|
|
_id: Types.ObjectId;
|
|
id: string;
|
|
|
|
@prop({
|
|
unique: true,
|
|
})
|
|
repoName: string; // 完整地址
|
|
|
|
@prop()
|
|
groupId: string;
|
|
}
|
|
|
|
export type RepoDocument = DocumentType<Repo>;
|
|
|
|
const model = getModelForClass(Repo);
|
|
|
|
export type RepoModel = typeof model;
|
|
|
|
export default model;
|