Files
Obosky_Ronghua/serve/README.md
2023-10-17 09:15:30 +08:00

93 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 怀励【后端】项目
## 项目准备工作
1. 安装 MySQL
- 参考: https://blog.csdn.net/weixin_43605266/article/details/110477391
2. 开发工具统一使用 VSCode
- 安装 VSCode 插件
- eslint
- Database Client --- VSCode 数据库插件
3. 创建数据库表,具体信息看如下文件
```
src\common\plugins\mysql.ts
```
## 启动
```sh
# 安装以来,注意:不要使用 cnpm可以使用 淘宝镜像源
npm install
# 开发环境下启动
npm run dev
```
## 初始化系统数据
访问: http://127.0.0.1:3000/initialize
## 数据模型转换为class文件
1. 找到 /tools/data.js
2. 输入示例如下
```js
module.exports = [
`
User 用户
name string 姓名
age number 年龄
`,
`
RoleFeature
roleId number 角色
feature number
`,
];
```
3. 执行 ```npm run trans:class```
## 项目介绍
### 目录
```
src:.
├─assessment-evaluation --- 考核测评模块
│ ├─controller
│ ├─dto
│ ├─entities
│ └─service
├─common --- 公共功能包
│ ├─decorator
│ ├─dto
│ ├─entity
│ ├─filters
│ ├─interceptor
│ ├─metadata
│ └─plugins
├─resource --- 文件管理模块
│ ├─controller
│ ├─dto
│ ├─entities
│ └─service
├─online-course --- 在线课程模块
│ ├─controller
│ ├─dto
│ ├─entities
│ └─service
├─online-teaching --- 在线教学模块
│ ├─controller
│ ├─dto
│ ├─entities
│ └─service
└─system --- 系统功能模块:涉及系统权限控制等相关功能
├─controller
├─dto
├─entities
├─jwt
└─service
```