Merge branch 'main' of http://113.45.157.195:3003/insiinc/re-mooc
This commit is contained in:
commit
2769bac7f8
|
@ -52,7 +52,7 @@ export abstract class RowModelService {
|
||||||
]);
|
]);
|
||||||
SQL = await this.getRowsSqlWrapper(SQL, request, staff);
|
SQL = await this.getRowsSqlWrapper(SQL, request, staff);
|
||||||
|
|
||||||
this.logger.debug('getrows', SQL);
|
// this.logger.debug('getrows', SQL);
|
||||||
|
|
||||||
const results: any[] = (await db?.$queryRawUnsafe(SQL)) || [];
|
const results: any[] = (await db?.$queryRawUnsafe(SQL)) || [];
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,6 @@ export class GenDevService {
|
||||||
deptStaffRecord: Record<string, Staff[]> = {};
|
deptStaffRecord: Record<string, Staff[]> = {};
|
||||||
terms: Record<TaxonomySlug, Term[]> = {
|
terms: Record<TaxonomySlug, Term[]> = {
|
||||||
[TaxonomySlug.CATEGORY]: [],
|
[TaxonomySlug.CATEGORY]: [],
|
||||||
[TaxonomySlug.UNIT]: [],
|
|
||||||
[TaxonomySlug.TAG]: [],
|
[TaxonomySlug.TAG]: [],
|
||||||
[TaxonomySlug.LEVEL]: [],
|
[TaxonomySlug.LEVEL]: [],
|
||||||
};
|
};
|
||||||
|
@ -62,7 +61,7 @@ export class GenDevService {
|
||||||
const domains = this.depts.filter((item) => item.isDomain);
|
const domains = this.depts.filter((item) => item.isDomain);
|
||||||
for (const domain of domains) {
|
for (const domain of domains) {
|
||||||
await this.createTerms(domain, TaxonomySlug.CATEGORY, depth, count);
|
await this.createTerms(domain, TaxonomySlug.CATEGORY, depth, count);
|
||||||
await this.createTerms(domain, TaxonomySlug.UNIT, depth, count);
|
// await this.createTerms(domain, TaxonomySlug.UNIT, depth, count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const termCount = await db.term.count();
|
const termCount = await db.term.count();
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
VITE_APP_TUS_URL=http://localhost:8080
|
|
||||||
VITE_APP_API_URL=http://localhost:3000
|
|
||||||
VITE_APP_SERVER_IP=192.168.252.239
|
VITE_APP_SERVER_IP=192.168.252.239
|
||||||
VITE_APP_SERVER_PORT=3000
|
VITE_APP_SERVER_PORT=3000
|
||||||
VITE_APP_UPLOAD_PORT=80
|
VITE_APP_FILE_PORT=80
|
||||||
VITE_APP_VERSION=0.3.0
|
VITE_APP_VERSION=0.3.0
|
||||||
VITE_APP_APP_NAME=MOOC
|
VITE_APP_APP_NAME=MOOC
|
||||||
|
|
|
@ -14,7 +14,6 @@ import { Toaster } from 'react-hot-toast';
|
||||||
|
|
||||||
dayjs.locale("zh-cn");
|
dayjs.locale("zh-cn");
|
||||||
function App() {
|
function App() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AuthProvider>
|
<AuthProvider>
|
||||||
|
|
|
@ -1,11 +1,41 @@
|
||||||
|
/**
|
||||||
|
* 错误处理模块 - 全局路由级错误展示组件
|
||||||
|
* 功能: 捕获React Router路由层级错误并展示可视化错误信息
|
||||||
|
* 特性:
|
||||||
|
* - 自动解析路由错误对象
|
||||||
|
* - 自适应错误信息展示
|
||||||
|
* - 响应式布局设计
|
||||||
|
*/
|
||||||
import { useRouteError } from "react-router-dom";
|
import { useRouteError } from "react-router-dom";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误展示页面组件
|
||||||
|
* @核心功能 呈现标准化错误界面,用于处理应用程序的路由层级错误
|
||||||
|
* @设计模式 采用展示型组件模式,完全解耦业务逻辑实现纯UI展示
|
||||||
|
* @使用示例 在React Router的RouterProvider中配置errorElement={<ErrorPage/>}
|
||||||
|
*/
|
||||||
export default function ErrorPage() {
|
export default function ErrorPage() {
|
||||||
|
// 使用React Router提供的Hook获取路由错误对象
|
||||||
|
// 类型定义为any以兼容React Router不同版本的类型差异
|
||||||
const error: any = useRouteError();
|
const error: any = useRouteError();
|
||||||
return <div className=" flex justify-center items-center pt-64 ">
|
|
||||||
|
return (
|
||||||
|
// 主容器: 基于Flex的垂直水平双居中布局
|
||||||
|
// pt-64: 顶部留白实现视觉层次结构
|
||||||
|
<div className="flex justify-center items-center pt-64">
|
||||||
|
{/* 内容区块: 采用纵向弹性布局控制内部元素间距 */}
|
||||||
<div className="flex flex-col gap-4">
|
<div className="flex flex-col gap-4">
|
||||||
<div className=" text-xl font-bold text-primary">哦?页面似乎出错了...</div>
|
{/* 主标题: 强调性文字样式配置 */}
|
||||||
<div className=" text-tertiary" >{error?.statusText || error?.message}</div>
|
<div className="text-xl font-bold text-primary">
|
||||||
|
哦?页面似乎出错了...
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* 错误详情: 动态渲染错误信息,实现优雅降级策略 */}
|
||||||
|
{/* 使用可选链操作符防止未定义错误,信息优先级: statusText > message */}
|
||||||
|
<div className="text-tertiary">
|
||||||
|
{error?.statusText || error?.message}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
}
|
}
|
|
@ -5,6 +5,7 @@ import CourseList from "./components/CourseList";
|
||||||
import { api } from "@nice/client";
|
import { api } from "@nice/client";
|
||||||
import { LectureType, PostType } from "@nice/common";
|
import { LectureType, PostType } from "@nice/common";
|
||||||
|
|
||||||
|
|
||||||
export default function CoursesPage() {
|
export default function CoursesPage() {
|
||||||
const [currentPage, setCurrentPage] = useState(1);
|
const [currentPage, setCurrentPage] = useState(1);
|
||||||
const [selectedCategory, setSelectedCategory] = useState("");
|
const [selectedCategory, setSelectedCategory] = useState("");
|
||||||
|
|
|
@ -2,6 +2,7 @@ import HeroSection from './components/HeroSection';
|
||||||
import CategorySection from './components/CategorySection';
|
import CategorySection from './components/CategorySection';
|
||||||
import CoursesSection from './components/CoursesSection';
|
import CoursesSection from './components/CoursesSection';
|
||||||
import FeaturedTeachersSection from './components/FeaturedTeachersSection';
|
import FeaturedTeachersSection from './components/FeaturedTeachersSection';
|
||||||
|
import { TusUploader } from '@web/src/components/common/uploader/TusUploader';
|
||||||
const HomePage = () => {
|
const HomePage = () => {
|
||||||
const mockCourses = [
|
const mockCourses = [
|
||||||
{
|
{
|
||||||
|
@ -105,6 +106,7 @@ const HomePage = () => {
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen">
|
<div className="min-h-screen">
|
||||||
<HeroSection />
|
<HeroSection />
|
||||||
|
<TusUploader></TusUploader>
|
||||||
<CoursesSection
|
<CoursesSection
|
||||||
title="推荐课程"
|
title="推荐课程"
|
||||||
description="最受欢迎的精品课程,助你快速成长"
|
description="最受欢迎的精品课程,助你快速成长"
|
||||||
|
|
|
@ -2,5 +2,5 @@ import MindEditor from "@web/src/components/common/editor/MindEditor";
|
||||||
// import MindElixir, { MindElixirInstance } from "mind-elixir";
|
// import MindElixir, { MindElixirInstance } from "mind-elixir";
|
||||||
import { useEffect, useRef } from "react";
|
import { useEffect, useRef } from "react";
|
||||||
export default function PathsPage() {
|
export default function PathsPage() {
|
||||||
// return <MindEditor></MindEditor>
|
return <MindEditor></MindEditor>
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,27 +1,26 @@
|
||||||
// import { MindElixirInstance } from "packages/mind-elixir-core/dist/types";
|
import { MindElixirInstance } from "mind-elixir";
|
||||||
import { useRef, useEffect } from "react";
|
import { useRef, useEffect } from "react";
|
||||||
// import MindElixir from "mind-elixir";
|
import MindElixir from "mind-elixir";
|
||||||
|
|
||||||
export default function MindEditor() {
|
export default function MindEditor() {
|
||||||
// const me = useRef<MindElixirInstance>();
|
const me = useRef<MindElixirInstance>();
|
||||||
// useEffect(() => {
|
useEffect(() => {
|
||||||
// const instance = new MindElixir({
|
const instance = new MindElixir({
|
||||||
// el: "#map",
|
el: "#map",
|
||||||
// direction: MindElixir.SIDE,
|
direction: MindElixir.SIDE,
|
||||||
// draggable: true, // default true
|
draggable: true, // default true
|
||||||
// contextMenu: true, // default true
|
contextMenu: true, // default true
|
||||||
// toolBar: true, // default true
|
toolBar: true, // default true
|
||||||
// nodeMenu: true, // default true
|
nodeMenu: true, // default true
|
||||||
// keypress: true, // default true
|
keypress: true // default true
|
||||||
// });
|
|
||||||
// // instance.install(NodeMenu);
|
});
|
||||||
// instance.init(MindElixir.new("新主题"));
|
// instance.install(NodeMenu);
|
||||||
// me.current = instance;
|
instance.init(MindElixir.new("新主题"));
|
||||||
// }, []);
|
me.current = instance;
|
||||||
// return (
|
}, []);
|
||||||
// <div>
|
return <div >
|
||||||
// <div>1</div>
|
|
||||||
// <div id="map" style={{ width: "100%" }} />
|
<div id="map" style={{ width: "100%" }} />
|
||||||
// </div>
|
</div>
|
||||||
// );
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,12 +5,8 @@ import {
|
||||||
DeleteOutlined,
|
DeleteOutlined,
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { Upload, Progress, Button } from "antd";
|
import { Upload, Progress, Button } from "antd";
|
||||||
import type { UploadFile } from "antd";
|
|
||||||
import { useTusUpload } from "@web/src/hooks/useTusUpload";
|
import { useTusUpload } from "@web/src/hooks/useTusUpload";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import { getCompressedImageUrl } from "@nice/utils";
|
|
||||||
import { api } from "@nice/client";
|
|
||||||
|
|
||||||
export interface TusUploaderProps {
|
export interface TusUploaderProps {
|
||||||
value?: string[];
|
value?: string[];
|
||||||
onChange?: (value: string[]) => void;
|
onChange?: (value: string[]) => void;
|
||||||
|
@ -30,16 +26,7 @@ export const TusUploader = ({
|
||||||
onChange,
|
onChange,
|
||||||
multiple = true,
|
multiple = true,
|
||||||
}: TusUploaderProps) => {
|
}: TusUploaderProps) => {
|
||||||
const { data: files } = api.resource.findMany.useQuery({
|
|
||||||
where: {
|
|
||||||
fileId: { in: value },
|
|
||||||
},
|
|
||||||
select: {
|
|
||||||
id: true,
|
|
||||||
fileId: true,
|
|
||||||
title: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const { handleFileUpload, uploadProgress } = useTusUpload();
|
const { handleFileUpload, uploadProgress } = useTusUpload();
|
||||||
const [uploadingFiles, setUploadingFiles] = useState<UploadingFile[]>([]);
|
const [uploadingFiles, setUploadingFiles] = useState<UploadingFile[]>([]);
|
||||||
const [completedFiles, setCompletedFiles] = useState<UploadingFile[]>(
|
const [completedFiles, setCompletedFiles] = useState<UploadingFile[]>(
|
||||||
|
@ -74,6 +61,7 @@ export const TusUploader = ({
|
||||||
|
|
||||||
const handleBeforeUpload = useCallback(
|
const handleBeforeUpload = useCallback(
|
||||||
(file: File) => {
|
(file: File) => {
|
||||||
|
|
||||||
const fileKey = `${file.name}-${Date.now()}`;
|
const fileKey = `${file.name}-${Date.now()}`;
|
||||||
|
|
||||||
setUploadingFiles((prev) => [
|
setUploadingFiles((prev) => [
|
||||||
|
@ -151,7 +139,7 @@ export const TusUploader = ({
|
||||||
name="files"
|
name="files"
|
||||||
multiple={multiple}
|
multiple={multiple}
|
||||||
showUploadList={false}
|
showUploadList={false}
|
||||||
style={{ background: "transparent", borderStyle: "none" }}
|
|
||||||
beforeUpload={handleBeforeUpload}>
|
beforeUpload={handleBeforeUpload}>
|
||||||
<p className="ant-upload-drag-icon">
|
<p className="ant-upload-drag-icon">
|
||||||
<UploadOutlined />
|
<UploadOutlined />
|
||||||
|
|
|
@ -33,15 +33,9 @@ import {
|
||||||
useSortable,
|
useSortable,
|
||||||
verticalListSortingStrategy,
|
verticalListSortingStrategy,
|
||||||
} from "@dnd-kit/sortable";
|
} from "@dnd-kit/sortable";
|
||||||
import { CSS } from "@dnd-kit/utilities";
|
|
||||||
import QuillEditor from "@web/src/components/common/editor/quill/QuillEditor";
|
|
||||||
import { TusUploader } from "@web/src/components/common/uploader/TusUploader";
|
|
||||||
import { Lecture, LectureType, PostType } from "@nice/common";
|
import { Lecture, LectureType, PostType } from "@nice/common";
|
||||||
import { useCourseEditor } from "../../context/CourseEditorContext";
|
import { useCourseEditor } from "../../context/CourseEditorContext";
|
||||||
import { usePost } from "@nice/client";
|
import { usePost } from "@nice/client";
|
||||||
import toast from "react-hot-toast";
|
|
||||||
import { CourseContentFormHeader } from "./CourseContentFormHeader";
|
|
||||||
import { CourseSectionEmpty } from "./CourseSectionEmpty";
|
|
||||||
import { LectureData, SectionData } from "./interface";
|
import { LectureData, SectionData } from "./interface";
|
||||||
import { SortableLecture } from "./SortableLecture";
|
import { SortableLecture } from "./SortableLecture";
|
||||||
|
|
||||||
|
|
|
@ -17,31 +17,12 @@ import {
|
||||||
} from "antd";
|
} from "antd";
|
||||||
import React, { useCallback, useEffect, useState } from "react";
|
import React, { useCallback, useEffect, useState } from "react";
|
||||||
import {
|
import {
|
||||||
DndContext,
|
|
||||||
closestCenter,
|
|
||||||
KeyboardSensor,
|
|
||||||
PointerSensor,
|
|
||||||
useSensor,
|
|
||||||
useSensors,
|
|
||||||
DragEndEvent,
|
|
||||||
} from "@dnd-kit/core";
|
|
||||||
import { api, emitDataChange } from "@nice/client";
|
|
||||||
import {
|
|
||||||
arrayMove,
|
|
||||||
SortableContext,
|
|
||||||
sortableKeyboardCoordinates,
|
|
||||||
useSortable,
|
useSortable,
|
||||||
verticalListSortingStrategy,
|
|
||||||
} from "@dnd-kit/sortable";
|
} from "@dnd-kit/sortable";
|
||||||
import { CSS } from "@dnd-kit/utilities";
|
import { CSS } from "@dnd-kit/utilities";
|
||||||
import QuillEditor from "@web/src/components/common/editor/quill/QuillEditor";
|
|
||||||
import { TusUploader } from "@web/src/components/common/uploader/TusUploader";
|
|
||||||
import { Lecture, LectureType, PostType } from "@nice/common";
|
import { Lecture, LectureType, PostType } from "@nice/common";
|
||||||
import { useCourseEditor } from "../../context/CourseEditorContext";
|
|
||||||
import { usePost } from "@nice/client";
|
import { usePost } from "@nice/client";
|
||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import { CourseContentFormHeader } from "./CourseContentFormHeader";
|
|
||||||
import { CourseSectionEmpty } from "./CourseSectionEmpty";
|
|
||||||
import { LectureData, SectionData } from "./interface";
|
import { LectureData, SectionData } from "./interface";
|
||||||
interface SortableSectionProps {
|
interface SortableSectionProps {
|
||||||
courseId?: string;
|
courseId?: string;
|
||||||
|
|
|
@ -2,7 +2,7 @@ export const env: {
|
||||||
APP_NAME: string;
|
APP_NAME: string;
|
||||||
SERVER_IP: string;
|
SERVER_IP: string;
|
||||||
VERSION: string;
|
VERSION: string;
|
||||||
UPLOAD_PORT: string;
|
FILE_PORT: string;
|
||||||
SERVER_PORT: string;
|
SERVER_PORT: string;
|
||||||
} = {
|
} = {
|
||||||
APP_NAME: import.meta.env.PROD
|
APP_NAME: import.meta.env.PROD
|
||||||
|
@ -11,9 +11,9 @@ export const env: {
|
||||||
SERVER_IP: import.meta.env.PROD
|
SERVER_IP: import.meta.env.PROD
|
||||||
? (window as any).env.VITE_APP_SERVER_IP
|
? (window as any).env.VITE_APP_SERVER_IP
|
||||||
: import.meta.env.VITE_APP_SERVER_IP,
|
: import.meta.env.VITE_APP_SERVER_IP,
|
||||||
UPLOAD_PORT: import.meta.env.PROD
|
FILE_PORT: import.meta.env.PROD
|
||||||
? (window as any).env.VITE_APP_UPLOAD_PORT
|
? (window as any).env.VITE_APP_FILE_PORT
|
||||||
: import.meta.env.VITE_APP_UPLOAD_PORT,
|
: import.meta.env.VITE_APP_FILE_PORT,
|
||||||
SERVER_PORT: import.meta.env.PROD
|
SERVER_PORT: import.meta.env.PROD
|
||||||
? (window as any).env.VITE_APP_SERVER_PORT
|
? (window as any).env.VITE_APP_SERVER_PORT
|
||||||
: import.meta.env.VITE_APP_SERVER_PORT,
|
: import.meta.env.VITE_APP_SERVER_PORT,
|
||||||
|
|
|
@ -2,11 +2,6 @@ import { useState } from "react";
|
||||||
import * as tus from "tus-js-client";
|
import * as tus from "tus-js-client";
|
||||||
import { env } from "../env";
|
import { env } from "../env";
|
||||||
import { getCompressedImageUrl } from "@nice/utils";
|
import { getCompressedImageUrl } from "@nice/utils";
|
||||||
// useTusUpload.ts
|
|
||||||
interface UploadProgress {
|
|
||||||
fileId: string;
|
|
||||||
progress: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface UploadResult {
|
interface UploadResult {
|
||||||
compressedUrl: string;
|
compressedUrl: string;
|
||||||
|
@ -35,8 +30,7 @@ export function useTusUpload() {
|
||||||
if (uploadIndex === -1 || uploadIndex + 4 >= parts.length) {
|
if (uploadIndex === -1 || uploadIndex + 4 >= parts.length) {
|
||||||
throw new Error("Invalid upload URL format");
|
throw new Error("Invalid upload URL format");
|
||||||
}
|
}
|
||||||
const resUrl = `http://${env.SERVER_IP}:${env.UPLOAD_PORT}/uploads/${parts.slice(uploadIndex + 1, uploadIndex + 6).join("/")}`;
|
const resUrl = `http://${env.SERVER_IP}:${env.FILE_PORT}/uploads/${parts.slice(uploadIndex + 1, uploadIndex + 6).join("/")}`;
|
||||||
|
|
||||||
return resUrl;
|
return resUrl;
|
||||||
};
|
};
|
||||||
const handleFileUpload = async (
|
const handleFileUpload = async (
|
||||||
|
@ -45,11 +39,13 @@ export function useTusUpload() {
|
||||||
onError: (error: Error) => void,
|
onError: (error: Error) => void,
|
||||||
fileKey: string // 添加文件唯一标识
|
fileKey: string // 添加文件唯一标识
|
||||||
) => {
|
) => {
|
||||||
|
// console.log()
|
||||||
setIsUploading(true);
|
setIsUploading(true);
|
||||||
setUploadProgress((prev) => ({ ...prev, [fileKey]: 0 }));
|
setUploadProgress((prev) => ({ ...prev, [fileKey]: 0 }));
|
||||||
setUploadError(null);
|
setUploadError(null);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
console.log(`http://${env.SERVER_IP}:${env.SERVER_PORT}/upload`);
|
||||||
const upload = new tus.Upload(file, {
|
const upload = new tus.Upload(file, {
|
||||||
endpoint: `http://${env.SERVER_IP}:${env.SERVER_PORT}/upload`,
|
endpoint: `http://${env.SERVER_IP}:${env.SERVER_PORT}/upload`,
|
||||||
retryDelays: [0, 1000, 3000, 5000],
|
retryDelays: [0, 1000, 3000, 5000],
|
||||||
|
@ -96,6 +92,7 @@ export function useTusUpload() {
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
setIsUploading(false);
|
setIsUploading(false);
|
||||||
setUploadError(error.message);
|
setUploadError(error.message);
|
||||||
|
console.log(error);
|
||||||
onError(error);
|
onError(error);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -129,3 +129,4 @@
|
||||||
height: 600px;
|
height: 600px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,13 +3,9 @@ import React from "react";
|
||||||
import ReactDOM from "react-dom/client";
|
import ReactDOM from "react-dom/client";
|
||||||
import App from "./App.js";
|
import App from "./App.js";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
import { ModuleRegistry } from "@ag-grid-community/core";
|
import { ModuleRegistry } from "@ag-grid-community/core";
|
||||||
import { LicenseManager } from "@ag-grid-enterprise/core";
|
import { LicenseManager } from "@ag-grid-enterprise/core";
|
||||||
|
|
||||||
import { ClientSideRowModelModule } from "@ag-grid-community/client-side-row-model";
|
import { ClientSideRowModelModule } from "@ag-grid-community/client-side-row-model";
|
||||||
|
|
||||||
|
|
||||||
ModuleRegistry.registerModules([ClientSideRowModelModule]);
|
ModuleRegistry.registerModules([ClientSideRowModelModule]);
|
||||||
|
|
||||||
LicenseManager.setLicenseKey(
|
LicenseManager.setLicenseKey(
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"dev": "pnpm run --parallel dev"
|
"dev": "pnpm run --parallel dev",
|
||||||
|
"db:clear": "pnpm --filter common run db:clear"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "insiinc",
|
"author": "insiinc",
|
||||||
|
|
|
@ -45,6 +45,7 @@ model Term {
|
||||||
depts Department[] @relation("department_term")
|
depts Department[] @relation("department_term")
|
||||||
hasChildren Boolean? @default(false) @map("has_children")
|
hasChildren Boolean? @default(false) @map("has_children")
|
||||||
posts Post[] @relation("post_term")
|
posts Post[] @relation("post_term")
|
||||||
|
|
||||||
@@index([name]) // 对name字段建立索引,以加快基于name的查找速度
|
@@index([name]) // 对name字段建立索引,以加快基于name的查找速度
|
||||||
@@index([parentId]) // 对parentId字段建立索引,以加快基于parentId的查找速度
|
@@index([parentId]) // 对parentId字段建立索引,以加快基于parentId的查找速度
|
||||||
@@map("term")
|
@@map("term")
|
||||||
|
@ -222,6 +223,7 @@ model Post {
|
||||||
watchableStaffs Staff[] @relation("post_watch_staff") // 可观看的员工列表,关联 Staff 模型
|
watchableStaffs Staff[] @relation("post_watch_staff") // 可观看的员工列表,关联 Staff 模型
|
||||||
watchableDepts Department[] @relation("post_watch_dept") // 可观看的部门列表,关联 Department 模型
|
watchableDepts Department[] @relation("post_watch_dept") // 可观看的部门列表,关联 Department 模型
|
||||||
meta Json? // 封面url 视频url objectives具体的学习目标 rating评分Int
|
meta Json? // 封面url 视频url objectives具体的学习目标 rating评分Int
|
||||||
|
|
||||||
// 索引
|
// 索引
|
||||||
@@index([type, domainId])
|
@@index([type, domainId])
|
||||||
@@index([authorId, type])
|
@@index([authorId, type])
|
||||||
|
@ -302,8 +304,6 @@ model Visit {
|
||||||
@@map("visit")
|
@@map("visit")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
model Enrollment {
|
model Enrollment {
|
||||||
id String @id @default(cuid()) @map("id")
|
id String @id @default(cuid()) @map("id")
|
||||||
status String @map("status")
|
status String @map("status")
|
||||||
|
@ -404,3 +404,19 @@ model NodeEdge {
|
||||||
@@index([targetId])
|
@@index([targetId])
|
||||||
@@map("node_edge")
|
@@map("node_edge")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model Animal {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
name String
|
||||||
|
age Int
|
||||||
|
gender Boolean
|
||||||
|
personId String?
|
||||||
|
person Person? @relation(fields: [personId], references: [id])
|
||||||
|
}
|
||||||
|
model Person {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
name String
|
||||||
|
age Int
|
||||||
|
gender Boolean
|
||||||
|
animals Animal[]
|
||||||
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@ export enum LectureType {
|
||||||
}
|
}
|
||||||
export enum TaxonomySlug {
|
export enum TaxonomySlug {
|
||||||
CATEGORY = "category",
|
CATEGORY = "category",
|
||||||
UNIT = "unit",
|
|
||||||
TAG = "tag",
|
TAG = "tag",
|
||||||
LEVEL = "level",
|
LEVEL = "level",
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ importers:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@nestjs/bullmq':
|
'@nestjs/bullmq':
|
||||||
specifier: ^10.2.0
|
specifier: ^10.2.0
|
||||||
version: 10.2.3(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.15)(@nestjs/websockets@10.4.15)(reflect-metadata@0.2.2)(rxjs@7.8.1))(bullmq@5.34.8)
|
version: 10.2.3(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.15)(bullmq@5.34.8)
|
||||||
'@nestjs/common':
|
'@nestjs/common':
|
||||||
specifier: ^10.3.10
|
specifier: ^10.3.10
|
||||||
version: 10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
version: 10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
||||||
|
@ -33,7 +33,7 @@ importers:
|
||||||
version: 10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/websockets@10.4.15)(rxjs@7.8.1)
|
version: 10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/websockets@10.4.15)(rxjs@7.8.1)
|
||||||
'@nestjs/schedule':
|
'@nestjs/schedule':
|
||||||
specifier: ^4.1.0
|
specifier: ^4.1.0
|
||||||
version: 4.1.2(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.15)(@nestjs/websockets@10.4.15)(reflect-metadata@0.2.2)(rxjs@7.8.1))
|
version: 4.1.2(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.15)
|
||||||
'@nestjs/websockets':
|
'@nestjs/websockets':
|
||||||
specifier: ^10.3.10
|
specifier: ^10.3.10
|
||||||
version: 10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.15)(@nestjs/platform-socket.io@10.4.15)(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
version: 10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.15)(@nestjs/platform-socket.io@10.4.15)(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
||||||
|
@ -148,7 +148,7 @@ importers:
|
||||||
version: 10.2.3(chokidar@3.6.0)(typescript@5.7.2)
|
version: 10.2.3(chokidar@3.6.0)(typescript@5.7.2)
|
||||||
'@nestjs/testing':
|
'@nestjs/testing':
|
||||||
specifier: ^10.0.0
|
specifier: ^10.0.0
|
||||||
version: 10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.15)(@nestjs/websockets@10.4.15)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.15))
|
version: 10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.15)(@nestjs/platform-express@10.4.15)
|
||||||
'@types/exceljs':
|
'@types/exceljs':
|
||||||
specifier: ^1.3.0
|
specifier: ^1.3.0
|
||||||
version: 1.3.2
|
version: 1.3.2
|
||||||
|
@ -673,7 +673,7 @@ importers:
|
||||||
specifier: ^5.62.0
|
specifier: ^5.62.0
|
||||||
version: 5.62.0(eslint@8.57.1)(typescript@5.7.2)
|
version: 5.62.0(eslint@8.57.1)(typescript@5.7.2)
|
||||||
'@viselect/vanilla':
|
'@viselect/vanilla':
|
||||||
specifier: ^3.5.1
|
specifier: ^3.9.0
|
||||||
version: 3.9.0
|
version: 3.9.0
|
||||||
eslint:
|
eslint:
|
||||||
specifier: ^8.57.0
|
specifier: ^8.57.0
|
||||||
|
@ -9665,15 +9665,15 @@ snapshots:
|
||||||
'@msgpackr-extract/msgpackr-extract-win32-x64@3.0.3':
|
'@msgpackr-extract/msgpackr-extract-win32-x64@3.0.3':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
'@nestjs/bull-shared@10.2.3(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.15)(@nestjs/websockets@10.4.15)(reflect-metadata@0.2.2)(rxjs@7.8.1))':
|
'@nestjs/bull-shared@10.2.3(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.15)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@nestjs/common': 10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
'@nestjs/common': 10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
||||||
'@nestjs/core': 10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.15)(@nestjs/websockets@10.4.15)(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
'@nestjs/core': 10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.15)(@nestjs/websockets@10.4.15)(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
||||||
tslib: 2.8.1
|
tslib: 2.8.1
|
||||||
|
|
||||||
'@nestjs/bullmq@10.2.3(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.15)(@nestjs/websockets@10.4.15)(reflect-metadata@0.2.2)(rxjs@7.8.1))(bullmq@5.34.8)':
|
'@nestjs/bullmq@10.2.3(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.15)(bullmq@5.34.8)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@nestjs/bull-shared': 10.2.3(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.15)(@nestjs/websockets@10.4.15)(reflect-metadata@0.2.2)(rxjs@7.8.1))
|
'@nestjs/bull-shared': 10.2.3(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.15)
|
||||||
'@nestjs/common': 10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
'@nestjs/common': 10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
||||||
'@nestjs/core': 10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.15)(@nestjs/websockets@10.4.15)(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
'@nestjs/core': 10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.15)(@nestjs/websockets@10.4.15)(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
||||||
bullmq: 5.34.8
|
bullmq: 5.34.8
|
||||||
|
@ -9770,7 +9770,7 @@ snapshots:
|
||||||
- supports-color
|
- supports-color
|
||||||
- utf-8-validate
|
- utf-8-validate
|
||||||
|
|
||||||
'@nestjs/schedule@4.1.2(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.15)(@nestjs/websockets@10.4.15)(reflect-metadata@0.2.2)(rxjs@7.8.1))':
|
'@nestjs/schedule@4.1.2(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.15)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@nestjs/common': 10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
'@nestjs/common': 10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
||||||
'@nestjs/core': 10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.15)(@nestjs/websockets@10.4.15)(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
'@nestjs/core': 10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.15)(@nestjs/websockets@10.4.15)(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
||||||
|
@ -9788,7 +9788,7 @@ snapshots:
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- chokidar
|
- chokidar
|
||||||
|
|
||||||
'@nestjs/testing@10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.15)(@nestjs/websockets@10.4.15)(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.15))':
|
'@nestjs/testing@10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/core@10.4.15)(@nestjs/platform-express@10.4.15)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@nestjs/common': 10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
'@nestjs/common': 10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
||||||
'@nestjs/core': 10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.15)(@nestjs/websockets@10.4.15)(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
'@nestjs/core': 10.4.15(@nestjs/common@10.4.15(reflect-metadata@0.2.2)(rxjs@7.8.1))(@nestjs/platform-express@10.4.15)(@nestjs/websockets@10.4.15)(reflect-metadata@0.2.2)(rxjs@7.8.1)
|
||||||
|
|
Loading…
Reference in New Issue