From 92394ec60c0f2aa9fde57fd755fdb0fa7976becf Mon Sep 17 00:00:00 2001 From: snowgitea Date: Wed, 1 Jul 2026 17:55:08 +0800 Subject: [PATCH] chore: .vscode/service.code-snippets --- .vscode/service.code-snippets | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .vscode/service.code-snippets diff --git a/.vscode/service.code-snippets b/.vscode/service.code-snippets new file mode 100644 index 0000000..6ebf77a --- /dev/null +++ b/.vscode/service.code-snippets @@ -0,0 +1,33 @@ +{ + "service": { + "prefix": "service", + "body": [ + "import { Init, Provide } from '@midwayjs/core';", + "import { BaseService } from '@cool-midway/core';", + "import { InjectEntityModel } from '@midwayjs/typeorm';", + "import { Repository } from 'typeorm';", + "", + "/**", + " * 描述", + " */", + "@Provide()", + "export class XxxService extends BaseService {", + " @InjectEntityModel(实体)", + " xxxEntity: Repository<实体>;", + "" + " @Init()" + " async init() {", + " await super.init();", + " this.setEntity(this.xxxEntity);", + " }", + "", + " /**", + " * 描述", + " */", + " async xxx() {}", + "}", + "" + ], + "description": "cool-admin service代码片段" + } +} \ No newline at end of file