Skip to content

Commit 9191a92

Browse files
committed
1 parent 217332f commit 9191a92

5 files changed

Lines changed: 9 additions & 26 deletions

File tree

hello-tegg/app/biz/HelloService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
AccessLevel,
33
SingletonProto,
4-
} from '@eggjs/tegg';
4+
} from 'egg';
55

66
@SingletonProto({
77
accessLevel: AccessLevel.PUBLIC,

hello-tegg/app/controller/HelloController.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import {
33
HTTPMethod,
44
HTTPMethodEnum,
55
Context,
6-
type EggContext,
6+
HTTPContext,
77
HTTPQuery,
88
Middleware,
99
Inject,
10-
} from '@eggjs/tegg';
11-
import type { EggLogger } from 'egg';
10+
type Logger,
11+
} from 'egg';
1212

1313
import { traceMethod } from '../middleware/trace_method.ts';
1414
import { HelloService } from '../biz/HelloService.ts';
@@ -20,13 +20,13 @@ export class HelloController {
2020
private readonly helloService: HelloService;
2121

2222
@Inject()
23-
private readonly logger: EggLogger;
23+
private readonly logger: Logger;
2424

2525
@HTTPMethod({
2626
method: HTTPMethodEnum.GET,
2727
path: '/hello',
2828
})
29-
async hello(@Context() ctx: EggContext, @HTTPQuery() name: string) {
29+
async hello(@HTTPContext() ctx: Context, @HTTPQuery() name: string) {
3030
this.logger.info('access url: %s', ctx.url);
3131

3232
const message = await this.helloService.hello(name);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { EggContext, Next } from '@eggjs/tegg';
1+
import type { Context, Next } from 'egg';
22

3-
export async function traceMethod(ctx: EggContext, next: Next) {
3+
export async function traceMethod(ctx: Context, next: Next) {
44
await next();
55
ctx.body.data.message += ` (${ctx.method})`;
66
}

hello-tegg/config/plugin.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
import type { EggPlugin } from 'egg';
22

33
const plugin: EggPlugin = {
4-
tegg: {
5-
enable: true,
6-
package: '@eggjs/tegg-plugin',
7-
},
8-
teggConfig: {
9-
enable: true,
10-
package: '@eggjs/tegg-config',
11-
},
12-
teggController: {
13-
enable: true,
14-
package: '@eggjs/tegg-controller-plugin',
15-
},
164
};
175

186
export default plugin;

hello-tegg/package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
"license": "MIT",
2424
"dependencies": {
2525
"@eggjs/scripts": "beta",
26-
"@eggjs/tegg": "beta",
27-
"@eggjs/tegg-config": "beta",
28-
"@eggjs/tegg-controller-plugin": "beta",
29-
"@eggjs/tegg-plugin": "beta",
3026
"egg": "beta"
3127
},
3228
"devDependencies": {
@@ -37,8 +33,7 @@
3733
"@eggjs/mock": "beta",
3834
"eslint": "8",
3935
"eslint-config-egg": "14",
40-
"typescript": "5",
41-
"koa-compose": "4.1.0"
36+
"typescript": "5"
4237
},
4338
"repository": "git@github.com:eggjs/examples.git",
4439
"engines": {

0 commit comments

Comments
 (0)