自动识别实体是哪个链接源

This commit is contained in:
cool 2024-03-22 17:57:35 +08:00
parent 61a25cc214
commit fb32283ded
3 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@cool-midway/core", "name": "@cool-midway/core",
"version": "7.1.13", "version": "7.1.14",
"description": "", "description": "",
"main": "dist/index.js", "main": "dist/index.js",
"typings": "index.d.ts", "typings": "index.d.ts",

View File

@ -81,6 +81,7 @@ export abstract class BaseController {
if (entity) { if (entity) {
const dataSourceName = const dataSourceName =
this.typeORMDataSourceManager.getDataSourceNameByModel(entity); this.typeORMDataSourceManager.getDataSourceNameByModel(entity);
this.connectionName = dataSourceName;
let entityModel = this.typeORMDataSourceManager let entityModel = this.typeORMDataSourceManager
.getDataSource(dataSourceName) .getDataSource(dataSourceName)
.getRepository(entity); .getRepository(entity);

View File

@ -1,6 +1,6 @@
{ {
"name": "@cool-midway/core", "name": "@cool-midway/core",
"version": "7.1.13", "version": "7.1.14",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"typings": "index.d.ts", "typings": "index.d.ts",