From c5c939c6a3fca22bad65f31df3461797e72ef5d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=95=8A=E5=B9=B3?= <951984189@qq.com> Date: Thu, 21 Nov 2019 18:02:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4lib=E9=97=AE=E4=BB=B7?= =?UTF-8?q?=E5=A4=B9=EF=BC=8C=E5=8F=91=E5=B8=83=E5=88=B0npm=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5npm=E5=BC=95=E5=85=A5=E4=BB=A3=E7=A0=81=E6=9B=B4?= =?UTF-8?q?=E4=BC=98=E9=9B=85=EF=BC=8C=E5=8E=BB=E9=99=A4redis=EF=BC=8C?= =?UTF-8?q?=E5=BF=AB=E9=80=9F=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bd13e03..a7219e2 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Node版后台基础框架基于[Egg.js](https://eggjs.org/zh-cn/)(阿里出品) 数据模型必须放在`app/entities/*`下,否则[typeorm](https://typeorm.io "typeorm")无法识别,如: ```js import { Entity, Column, Index } from 'typeorm'; - import { BaseEntity } from '../../lib/base/entity'; + import { BaseEntity } from 'egg-cool-entity'; /** * 系统角色 */ @@ -83,9 +83,9 @@ Node版后台基础框架基于[Egg.js](https://eggjs.org/zh-cn/)(阿里出品) ## 控制器 有了数据表之后,如果希望通过接口对数据表进行操作,我们就必须在`controller`文件夹下新建对应的控制器,如: ```js -import { BaseController } from '../../../lib/base/controller'; +import { BaseController } from 'egg-cool-controller'; import { Context } from 'egg'; -import routerDecorator from '../../../lib/router'; +import routerDecorator from 'egg-cool-router'; import { Brackets } from 'typeorm'; /** * 系统-角色 @@ -125,8 +125,8 @@ export default class SysRoleController extends BaseController { ## 数据缓存 有些业务场景,我们并不希望每次请求接口都需要操作数据库,如:今日推荐、上个月排行榜等,数据存储在`redis`,注:缓存注解只在`service`层有效 ```js -import { BaseService } from '../../lib/base/service'; -import { Cache } from '../../lib/cache'; +import { BaseService } from 'egg-cool-service'; +import { Cache } from 'egg-cool-cache'; /** * 业务-排行榜服务类 */