1.0.7 • Published 5 years ago

egg-typed v1.0.7

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

egg-typed

NPM version build status Test coverage David deps Known Vulnerabilities

An onther style (like C#/java) of egg enterprise app framework.

Quick overview

路由

egg-controller

export class HomeController extends Controller {
  // 如果不需要访问ctx,则不需要继承
  @route("/api/xxx", { name: "获取XXX数据" })
  async getXXX(size: number, page: number) {
    return "homeIndex";
  }
}

依赖注入

egg-aop

export class TestService extends Service {
  get(id: string | number) {
    return {
      id,
      name: this.app.config.test + "_" + id
    };
  }
}

export class HomeController extends Controller {
  @lazyInject()
  testService: TestService;

  @route("/api/xxx", { name: "获取XXX数据" })
  async getXXX(id: string) {
    return this.testService.get(id);
  }
}

ORM

调用链跟踪

场景测试

使用 & 配置方法

  1. use egg-init to initialize a project.

  2. config project.json add:

  "egg": {
    "framework": "egg-typed"
  },
  1. An example of tsconfig.json:
{
  "compilerOptions": {
    "target": "es6",
    "module": "commonjs",
    "moduleResolution": "node",
    "noImplicitAny": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "preserveConstEnums": true,
    "declaration": true,
    "sourceMap": true,
    "rootDir": "src",
    "outDir": "app",
    "pretty": true
  }
}

Questions & Suggestions

Please open an issue here.

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.3.5

6 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.5

6 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago