forked from apitable/apitable
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: split database module to submodules (apitable#152)
Submit a pull request for this project. <!-- If you have an Issue that related to this Pull Request, you can copy this Issue's description --> # Why? <!-- > Related to which issue? > Why we need this pull request? > What is the user story for this pull request? --> use multiple feature modules instead of database module https://github.com/vikadata/vikadata/issues/2659 # What? <!-- > Can you describe this feature in detail? > Who can benefit from it? --> split Database module into multiple submodules. ```mermaid graph TD; Database-->Application; Actuator-->Application; Automation-->Application; Fusion-->Application; Grpc-->Application; User-->Application;; Unit-->Application;; Developer-->Application;; Shared-->Database; Shared-->Actuator; Shared-->Automation; Shared-->Fusion; Shared-->Grpc; Shared-->User; Shared-->Unit; Shared-->Developer; Attachment-->Database; Dashboard-->Database; Datasheet-->Database; Form-->Database; Mirror-->Database; Resource-->Database; Shared-->Attachment; Shared-->Dashboard; Shared-->Datasheet; Shared-->Form; Shared-->Mirror; Shared-->Resource; ``` # How? <!-- > Do you have a simple description of how this pull request is implemented? --> - [x] split Database module into multiple submodules, such as attachment module, dashboard module, datasheet module, etc.
- Loading branch information
Troy(FengJun)
authored
Jan 6, 2023
1 parent
1e10f51
commit 65edd98
Showing
172 changed files
with
1,069 additions
and
484 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* APITable <https://github.com/apitable/apitable> | ||
* Copyright (C) 2022 APITable Ltd. <https://apitable.com> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import { Module } from '@nestjs/common'; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
import { AssetRepository } from 'database/asset/repositories/asset.repository'; | ||
|
||
@Module({ | ||
imports: [ | ||
TypeOrmModule.forFeature([ | ||
AssetRepository, | ||
]), | ||
], | ||
providers: [], | ||
controllers: [], | ||
exports: [], | ||
}) | ||
export class AssetModule {} |
File renamed without changes.
File renamed without changes.
31 changes: 31 additions & 0 deletions
31
packages/room-server/src/database/attachment/attachment.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* APITable <https://github.com/apitable/apitable> | ||
* Copyright (C) 2022 APITable Ltd. <https://apitable.com> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import { Module } from '@nestjs/common'; | ||
import { NodeModule } from 'node/node.module'; | ||
import { ResourceModule } from 'database/resource/resource.module'; | ||
import { AttachmentController } from './controllers/attachment.controller'; | ||
import { AttachmentService } from './services/attachment.service'; | ||
|
||
@Module({ | ||
imports: [ResourceModule, NodeModule], | ||
controllers: [AttachmentController], | ||
providers: [AttachmentService], | ||
exports: [AttachmentService], | ||
}) | ||
export class AttachmentModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
packages/room-server/src/database/command/command.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* APITable <https://github.com/apitable/apitable> | ||
* Copyright (C) 2022 APITable Ltd. <https://apitable.com> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import { Module } from '@nestjs/common'; | ||
import { CommandOptionsService } from './services/command.options.service'; | ||
import { CommandService } from './services/command.service'; | ||
|
||
@Module({ | ||
providers: [CommandService, CommandOptionsService], | ||
exports: [CommandService, CommandOptionsService], | ||
}) | ||
export class CommandModule {} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
packages/room-server/src/database/dashboard/dashboard.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* APITable <https://github.com/apitable/apitable> | ||
* Copyright (C) 2022 APITable Ltd. <https://apitable.com> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import { forwardRef, Module } from '@nestjs/common'; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
import { NodeModule } from 'node/node.module'; | ||
import { ResourceMetaRepository } from 'database/resource/repositories/resource.meta.repository'; | ||
import { ResourceModule } from 'database/resource/resource.module'; | ||
import { UserModule } from 'user/user.module'; | ||
import { DashboardController } from './controllers/dashboard.controller'; | ||
import { DashboardService } from './services/dashboard.service'; | ||
|
||
@Module({ | ||
imports: [ | ||
NodeModule, | ||
UserModule, | ||
forwardRef(()=>ResourceModule), | ||
TypeOrmModule.forFeature([ | ||
// TODO(Troy): stop using other modules's repositories, use service instead, via importing the module | ||
ResourceMetaRepository, | ||
]), | ||
], | ||
controllers: [DashboardController], | ||
providers: [DashboardService], | ||
exports: [DashboardService] | ||
}) | ||
export class DashboardModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.