From cf126405a75962c13256e62f7c0b8a60b0da503c Mon Sep 17 00:00:00 2001 From: super918180 <873668938@qq.com> Date: Thu, 9 Apr 2020 11:25:19 +0800 Subject: [PATCH] docs: fix service path (#463) Co-authored-by: songjiachao --- docs/en/guide.md | 7 +++---- docs/guide.md | 9 ++++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/docs/en/guide.md b/docs/en/guide.md index fe176a2ba444..281ca0cce91a 100644 --- a/docs/en/guide.md +++ b/docs/en/guide.md @@ -51,7 +51,7 @@ The structure of Midway is similar to Eggjs, but there are still differences: * TypeScript code is located in `src/`, and built out `dist/`. * The original `app/` is moved to `src/app/`. -* It is suggested that write your business logic to the `lib/`, such as `lib/service`. +* It is suggested that write your business logic to other directories, such as `/service`. ```plain ➜ midway6-test tree -I node_modules @@ -83,9 +83,8 @@ The structure of Midway is similar to Eggjs, but there are still differences: │   │   ├── config.prod.ts │   │   ├── config.unittest.ts │   │   └── plugin.ts -│   └── lib ---- business logics (user define) +│   └── service ---- business logics (user define) │   │   └── service ---- services (user define) -│   │       └── user.ts │   ├── interface.ts ---- interface definition (user define) │   ├── app.ts (opt) ---- application extend file │   └── agent.ts (opt) ---- agent extend file @@ -757,7 +756,7 @@ describe('test/controller/home.test.ts', () => { Cause Midway suggest use IoC way to write service, so it's coding and testing have obvious difference with Eggjs. -Such as `src/lib/service/user.ts`: +Such as `src/service/user.ts`: ```typescript import { provide } from 'midway'; diff --git a/docs/guide.md b/docs/guide.md index 50a83881768e..0028ecdd526b 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -53,7 +53,7 @@ midway 的目录和 eggjs 目录非常接近,但也有所区别,不同的地 * ts 源码存放于 `/src` 目录下,编译后代码存放于 `/dist` 下 * 以往的 app 等都迁移至 `/src/app` 下,作为 web 层 -* 传统的业务逻辑等,移动到其他目录,比如 `lib/service` +* 传统的业务逻辑等,移动到其他目录,比如 `/service` ```plain ➜ midway6-test tree -I node_modules @@ -85,9 +85,8 @@ midway 的目录和 eggjs 目录非常接近,但也有所区别,不同的地 │   │   ├── config.prod.ts │   │   ├── config.unittest.ts │   │   └── plugin.ts -│   └── lib ---- 业务逻辑层目录,自由定义 -│   │   └── service ---- 业务逻辑层,自由定义 -│   │       └── user.ts +│   └── service ---- 业务逻辑层目录,自由定义 +│   │   └── user.ts ---- 业务逻辑层,自由定义 │   ├── interface.ts ---- 接口定义文件,自由定义 │   ├── app.ts ---- 应用扩展文件,可选 │   └── agent.ts ---- agent 扩展文件,可选 @@ -778,7 +777,7 @@ describe('test/controller/home.test.ts', () => { 由于 midway 提倡使用 IoC 的方式来定义 service,所以编码与测试都与 eggjs 有明显的区别。 -例如 `src/lib/service/user.ts`: +例如 `src/service/user.ts`: ```typescript import { provide } from 'midway';