max 4cdbad5d52 添加Ollama集成功能,包括聊天、文本生成、模型列表获取和服务状态检查的API端点,同时更新相关服务和DTO,新增axios依赖。 4 minuti fa
..
src 4cdbad5d52 添加Ollama集成功能,包括聊天、文本生成、模型列表获取和服务状态检查的API端点,同时更新相关服务和DTO,新增axios依赖。 4 minuti fa
test 88282c57e5 init 1 settimana fa
uploads 45b4b185e5 接口初始化 5 giorni fa
.gitignore 88282c57e5 init 1 settimana fa
.prettierrc 88282c57e5 init 1 settimana fa
AUTHOR_BOOK_RELATIONSHIP.md 9cebfc91c5 添加作者,书籍,内容之间的关联关系 4 giorni fa
ESLINT_FIXES.md 45b4b185e5 接口初始化 5 giorni fa
FILE_UPLOAD_README.md 45b4b185e5 接口初始化 5 giorni fa
README.md 9c1fa6490d 添加swagger 5 giorni fa
eslint.config.mjs 88282c57e5 init 1 settimana fa
nest-cli.json 88282c57e5 init 1 settimana fa
package.json 4cdbad5d52 添加Ollama集成功能,包括聊天、文本生成、模型列表获取和服务状态检查的API端点,同时更新相关服务和DTO,新增axios依赖。 4 minuti fa
pnpm-lock.yaml 4cdbad5d52 添加Ollama集成功能,包括聊天、文本生成、模型列表获取和服务状态检查的API端点,同时更新相关服务和DTO,新增axios依赖。 4 minuti fa
test-author-book-relationship.md 9cebfc91c5 添加作者,书籍,内容之间的关联关系 4 giorni fa
test-file-upload.md 45b4b185e5 接口初始化 5 giorni fa
test-ollama.md 4cdbad5d52 添加Ollama集成功能,包括聊天、文本生成、模型列表获取和服务状态检查的API端点,同时更新相关服务和DTO,新增axios依赖。 4 minuti fa
test-swagger.md 21edad0adf 添加swagger 5 giorni fa
tsconfig.build.json 88282c57e5 init 1 settimana fa
tsconfig.json 88282c57e5 init 1 settimana fa

README.md

LMS-NodeJs

一个基于NestJS框架的图书管理系统后端API。

环境配置

在项目根目录创建 .env 文件,添加以下配置:

# 服务器配置
SERVER_URL=http://localhost:3000
FILE_PATH=./uploads
PORT=3000

# 数据库配置
DB_HOST=localhost
DB_PORT=3306
DB_USERNAME=root
DB_PASSWORD=123456
DB_DATABASE=books

# 其他配置
NODE_ENV=development

环境变量说明

  • SERVER_URL: 服务器地址,用于生成文件访问URL(默认:http://localhost:3000)
  • FILE_PATH: 文件存储路径(默认:./uploads)
  • PORT: 服务器端口(默认:3000)
  • DB_HOST: 数据库主机地址
  • DB_PORT: 数据库端口
  • DB_USERNAME: 数据库用户名
  • DB_PASSWORD: 数据库密码
  • DB_DATABASE: 数据库名称

API 文档

项目集成了 Swagger API 文档,启动服务后可以通过以下地址访问:

Swagger UI: http://localhost:3000/api

API 文档包含以下模块:

  • books: 图书相关接口
  • authors: 作者相关接口
  • tags: 标签相关接口
  • chapters: 章节相关接口
  • hot: 热门相关接口
  • aide: 助手相关接口
  • line: 线路相关接口
  • file: 文件相关接口

功能特性

  • 文件管理: 支持文件上传、下载和去重
  • 图书管理: 完整的图书CRUD操作
  • 作者管理: 作者信息管理
  • 标签管理: 标签分类管理
  • 章节管理: 图书章节管理
  • 热门管理: 热门内容管理
  • 辅助功能: 辅助工具管理
  • 行管理: 文本行管理

文件上传功能

上传文件

curl -X POST http://localhost:3000/file/upload -F "file=@test.jpg"

访问文件

curl -X GET http://localhost:3000/file/download/[fileId]

或在浏览器中访问:http://localhost:3000/file/download/[fileId]


Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

<p align="center">

NPM Version Package License NPM Downloads CircleCI Discord Backers on Open Collective Sponsors on Open Collective Donate us

<a href="https://opencollective.com/nest#sponsor"  target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>

Follow us on Twitter

Description

Nest framework TypeScript starter repository.

Project setup

$ pnpm install

Compile and run the project

# development
$ pnpm run start

# watch mode
$ pnpm run start:dev

# production mode
$ pnpm run start:prod

Run tests

# unit tests
$ pnpm run test

# e2e tests
$ pnpm run test:e2e

# test coverage
$ pnpm run test:cov

Deployment

When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the deployment documentation for more information.

If you are looking for a cloud-based platform to deploy your NestJS application, check out Mau, our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps:

$ pnpm install -g @nestjs/mau
$ mau deploy

With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure.

Resources

Check out a few resources that may come in handy when working with NestJS:

  • Visit the NestJS Documentation to learn more about the framework.
  • For questions and support, please visit our Discord channel.
  • To dive deeper and get more hands-on experience, check out our official video courses.
  • Deploy your application to AWS with the help of NestJS Mau in just a few clicks.
  • Visualize your application graph and interact with the NestJS application in real-time using NestJS Devtools.
  • Need help with your project (part-time to full-time)? Check out our official enterprise support.
  • To stay in the loop and get updates, follow us on X and LinkedIn.
  • Looking for a job, or have a job to offer? Check out our official Jobs board.

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

https://www.cnblogs.com/bluecobra/archive/2012/01/11/2318922.html