mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2025-12-10 16:12:50 +00:00
增加初始化快捷方式
This commit is contained in:
parent
5bf31344f7
commit
099f133ee7
10
.vscode/service.code-snippets
vendored
10
.vscode/service.code-snippets
vendored
@ -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';",
|
||||
@ -14,6 +14,12 @@
|
||||
"export class XxxService extends BaseService {",
|
||||
" @InjectEntityModel(实体)",
|
||||
" xxxEntity: Repository<实体>;",
|
||||
""
|
||||
" @Init()"
|
||||
" async init() {",
|
||||
" await super.init();",
|
||||
" this.setEntity(this.xxxEntity);",
|
||||
" }",
|
||||
"",
|
||||
" /**",
|
||||
" * 描述",
|
||||
@ -24,4 +30,4 @@
|
||||
],
|
||||
"description": "cool-admin service代码片段"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user