mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2025-12-12 01:02:50 +00:00
增加初始化快捷方式
This commit is contained in:
parent
5bf31344f7
commit
099f133ee7
8
.vscode/service.code-snippets
vendored
8
.vscode/service.code-snippets
vendored
@ -2,7 +2,7 @@
|
|||||||
"service": {
|
"service": {
|
||||||
"prefix": "service",
|
"prefix": "service",
|
||||||
"body": [
|
"body": [
|
||||||
"import { Provide } from '@midwayjs/decorator';",
|
"import { Init, Provide } from '@midwayjs/decorator';",
|
||||||
"import { BaseService } from '@cool-midway/core';",
|
"import { BaseService } from '@cool-midway/core';",
|
||||||
"import { InjectEntityModel } from '@midwayjs/typeorm';",
|
"import { InjectEntityModel } from '@midwayjs/typeorm';",
|
||||||
"import { Repository } from 'typeorm';",
|
"import { Repository } from 'typeorm';",
|
||||||
@ -14,6 +14,12 @@
|
|||||||
"export class XxxService extends BaseService {",
|
"export class XxxService extends BaseService {",
|
||||||
" @InjectEntityModel(实体)",
|
" @InjectEntityModel(实体)",
|
||||||
" xxxEntity: Repository<实体>;",
|
" xxxEntity: Repository<实体>;",
|
||||||
|
""
|
||||||
|
" @Init()"
|
||||||
|
" async init() {",
|
||||||
|
" await super.init();",
|
||||||
|
" this.setEntity(this.xxxEntity);",
|
||||||
|
" }",
|
||||||
"",
|
"",
|
||||||
" /**",
|
" /**",
|
||||||
" * 描述",
|
" * 描述",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user