From 746ce5fdf97497f62fb5414b9d50400771b5438a Mon Sep 17 00:00:00 2001 From: COOL Date: Thu, 24 Mar 2022 15:09:18 +0800 Subject: [PATCH] 5.x --- package.json | 2 +- src/modules/demo/entity/goods-test.ts | 23 +++++++++++++++++++++++ src/modules/demo/service/goods.ts | 6 +----- 3 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 src/modules/demo/entity/goods-test.ts diff --git a/package.json b/package.json index 6bd9ea2..521952c 100755 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "", "private": true, "dependencies": { - "@cool-midway/core": "^5.0.4", + "@cool-midway/core": "^5.0.5", "@cool-midway/es": "^5.0.1", "@cool-midway/file": "^5.0.1", "@cool-midway/pay": "^5.0.0", diff --git a/src/modules/demo/entity/goods-test.ts b/src/modules/demo/entity/goods-test.ts new file mode 100644 index 0000000..e679294 --- /dev/null +++ b/src/modules/demo/entity/goods-test.ts @@ -0,0 +1,23 @@ +// import { EntityModel } from '@midwayjs/orm'; +// import { BaseEntity } from '@cool-midway/core'; +// import { Column } from 'typeorm'; + +// /** +// * 商品(多数据库连接) +// */ +// @EntityModel('demo_goods_1', { +// connectionName: 'test', +// }) +// export class DemoGoodsTestEntity extends BaseEntity { +// @Column({ comment: '标题' }) +// title: string; + +// @Column({ comment: '图片' }) +// pic: string; + +// @Column({ comment: '价格', type: 'decimal', precision: 5, scale: 2 }) +// price: number; + +// @Column({ comment: '分类', type: 'tinyint', default: 0 }) +// type: number; +// } diff --git a/src/modules/demo/service/goods.ts b/src/modules/demo/service/goods.ts index 79075fd..eaf324e 100644 --- a/src/modules/demo/service/goods.ts +++ b/src/modules/demo/service/goods.ts @@ -1,15 +1,11 @@ -import { Inject, Provide } from '@midwayjs/decorator'; +import { Provide } from '@midwayjs/decorator'; import { BaseService } from '@cool-midway/core'; -import { CoolRpc } from '@cool-midway/rpc'; /** * 缓存 */ @Provide() export class DemoGoodsService extends BaseService { - @Inject() - rpc: CoolRpc; - async test() { console.log('调用'); }