This article does not have an English body yet. Showing the Chinese version below.
接口
接口服务
接口服务开发流程大致分为以下几个层级
- 接受请求
- 请求数据校验 对应 pipe
- 鉴权 对应 guard
- 路由 对应 controller + interceptor
- 功能逻辑 对应 service
- 数据库操作 对应 repository
- 给出响应
redis
redis 是内存数据库,用于缓存数据,提高查询效率。
首页数据、用户信息、权限数据等都可以缓存到 redis 中。
redis 也可以持久化,将数据保存到磁盘。