Skip to content

Commit

Permalink
增加初始化快捷方式
Browse files Browse the repository at this point in the history
  • Loading branch information
cool-team-official committed Mar 15, 2024
1 parent 5bf3134 commit 099f133
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .vscode/service.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"service": {
"prefix": "service",
"body": [
"import { Provide } from '@midwayjs/decorator';",
"import { Init, Provide } from '@midwayjs/decorator';",
"import { BaseService } from '@cool-midway/core';",
"import { InjectEntityModel } from '@midwayjs/typeorm';",
"import { Repository } from 'typeorm';",
Expand All @@ -14,6 +14,12 @@
"export class XxxService extends BaseService {",
" @InjectEntityModel(实体)",
" xxxEntity: Repository<实体>;",
""
" @Init()"
" async init() {",
" await super.init();",
" this.setEntity(this.xxxEntity);",
" }",
"",
" /**",
" * 描述",
Expand All @@ -24,4 +30,4 @@
],
"description": "cool-admin service代码片段"
}
}
}

0 comments on commit 099f133

Please sign in to comment.