import { DbSchema, createDbSchemas } from '@vmm/api'; /** * @db 数据 Hello * ```ts * { * name:string, //名称 * } * ``` */ // Resource定义 export interface IResource { id: string; // 资源编号 name: string; // 资源名称 path: string; // 文件存储路径 previewPath: string; // 文件存预览存储路径 preview: { url: string; time: string }[]; // 预览图 cid: string[]; // 所属栏目 scid: string[]; // 所属子栏目 fileType: '图片' | '视频' | '文档' | '其它'; fileSize: number; // 文件大小 long?: string; // 视频资源时长 uploadBy: string; // 上传人 uploaderId: string; // 上传人的id编号 createAt: number; // 创建时间,1970 起毫秒数 updated: number; // 更改时间,1970 起毫秒数 detailDesc: string; // 资源详情描述 resourceGroup: string; // 资源组名 contentDesc: string; // 内容描述 resourceNo: string; // 编目号 tags: string; // 属性标签 author: string; // 版权人 version: string; // 版本号 status: string; // 未审核 已审核 start?: string; // 开始日期 YYYY-MM-DD end?: string; // 结束日期 YYYY-MM-DD uploadStatus: string; // 西北大学 contentValue: string; deptValue: string; } export interface ITask { id: string; // taskId devices: string[]; resource: string; content: string; } export interface ILedContent { id: string; content: string; start?: string; end?: string; typeValue: string; level: string; createAt: number; // 创建时间,1970 起毫秒数 updated: number; // 更改时间,1970 起毫秒数 status: string; // 未审核 已审核 uploadStatus: string, uploaderId: string; // 上传人的id编号 contentValue: string; deptValue: string; } export interface ILedManage { id: string; name: string; ip: string; width: string; height: string; size: string; speed: string; push: string; send: string; status: string; createAt: number; // 创建时间,1970 起毫秒数 updated: number; // 更改时间,1970 起毫秒数 spacing: number; } export interface IArticle { id: string; title: string; content: string; status: string; // 未审核 已审核 cid: string[]; // 所属栏目 scid: string[]; // 所属子栏目 uploaderId: string; // 上传人的id编号 resourceList: string[]; createAt: Date; // 创建时间,1970 起毫秒数 updated: Date; // 更改时间,1970 起毫秒数 } export interface ISchedule { id: string; title: string; content: string; resourceList: string[]; createAt: Date; // 创建时间,1970 起毫秒数 updated: Date; // 更改时间,1970 起毫秒数 date: string } export interface ISFileManage { id: string; name: string; type: string; introduce: string; person: string; size: string; number: number; path:string; img:string; createAt: Date; time: Date; } export const schemas = createDbSchemas({ // 设备使用日志的数据结构 resource: new DbSchema( // 数据库创建参数: {}, // 数据库索引: { id: { fields: { id: 1 }, options: { unique: true, sparse: false, dropDups: true }, }, }, ), task: new DbSchema( // 数据库创建参数: {}, // 数据库索引: { id: { fields: { id: 1 }, options: { unique: true, sparse: false, dropDups: true }, }, }, ), ledContent: new DbSchema( // 数据库创建参数: {}, // 数据库索引: { id: { fields: { id: 1 }, options: { unique: true, sparse: false, dropDups: true }, }, }, ), ledManage: new DbSchema( // 数据库创建参数: {}, // 数据库索引: { id: { fields: { id: 1 }, options: { unique: true, sparse: false, dropDups: true }, }, }, ), article: new DbSchema( // 数据库创建参数: {}, // 数据库索引: { id: { fields: { id: 1 }, options: { unique: true, sparse: false, dropDups: true }, }, }, ), schedule: new DbSchema( // 数据库创建参数: {}, // 数据库索引: { id: { fields: { id: 1 }, options: { unique: true, sparse: false, dropDups: true }, }, }, ), fileManage: new DbSchema( // 数据库创建参数: {}, // 数据库索引: { id: { fields: { id: 1 }, options: { unique: true, sparse: false, dropDups: true }, }, }, ), });