Browse Source
Feature/restructure api modules (#706)
* Restructure modules
* Update changelog
pull/701/head
Thomas Kaul
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with
53 additions and
51 deletions
-
CHANGELOG.md
-
apps/api/src/app/access/access.module.ts
-
apps/api/src/app/auth-device/auth-device.module.ts
-
apps/api/src/app/auth/auth.module.ts
-
apps/api/src/app/cache/cache.module.ts
-
apps/api/src/app/import/import.module.ts
-
apps/api/src/app/info/info.module.ts
-
apps/api/src/app/order/order.module.ts
-
apps/api/src/app/portfolio/portfolio.module.ts
-
apps/api/src/app/redis-cache/redis-cache.module.ts
-
apps/api/src/app/subscription/subscription.module.ts
-
apps/api/src/app/user/user.module.ts
|
|
@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
### Changed |
|
|
|
|
|
|
|
- Moved the countries and sectors charts in the position detail dialog |
|
|
|
- Restructured the server modules |
|
|
|
|
|
|
|
## 1.116.0 - 16.02.2022 |
|
|
|
|
|
|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
import { PrismaService } from '@ghostfolio/api/services/prisma.service'; |
|
|
|
import { PrismaModule } from '@ghostfolio/api/services/prisma.module'; |
|
|
|
import { Module } from '@nestjs/common'; |
|
|
|
|
|
|
|
import { AccessController } from './access.controller'; |
|
|
@ -7,7 +7,7 @@ import { AccessService } from './access.service'; |
|
|
|
@Module({ |
|
|
|
controllers: [AccessController], |
|
|
|
exports: [AccessService], |
|
|
|
imports: [], |
|
|
|
providers: [AccessService, PrismaService] |
|
|
|
imports: [PrismaModule], |
|
|
|
providers: [AccessService] |
|
|
|
}) |
|
|
|
export class AccessModule {} |
|
|
|
|
|
@ -1,18 +1,20 @@ |
|
|
|
import { AuthDeviceController } from '@ghostfolio/api/app/auth-device/auth-device.controller'; |
|
|
|
import { AuthDeviceService } from '@ghostfolio/api/app/auth-device/auth-device.service'; |
|
|
|
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service'; |
|
|
|
import { PrismaService } from '@ghostfolio/api/services/prisma.service'; |
|
|
|
import { ConfigurationModule } from '@ghostfolio/api/services/configuration.module'; |
|
|
|
import { PrismaModule } from '@ghostfolio/api/services/prisma.module'; |
|
|
|
import { Module } from '@nestjs/common'; |
|
|
|
import { JwtModule } from '@nestjs/jwt'; |
|
|
|
|
|
|
|
@Module({ |
|
|
|
controllers: [AuthDeviceController], |
|
|
|
imports: [ |
|
|
|
ConfigurationModule, |
|
|
|
JwtModule.register({ |
|
|
|
secret: process.env.JWT_SECRET_KEY, |
|
|
|
signOptions: { expiresIn: '180 days' } |
|
|
|
}) |
|
|
|
}), |
|
|
|
PrismaModule |
|
|
|
], |
|
|
|
providers: [AuthDeviceService, ConfigurationService, PrismaService] |
|
|
|
providers: [AuthDeviceService] |
|
|
|
}) |
|
|
|
export class AuthDeviceModule {} |
|
|
|
|
|
@ -2,8 +2,8 @@ import { AuthDeviceService } from '@ghostfolio/api/app/auth-device/auth-device.s |
|
|
|
import { WebAuthService } from '@ghostfolio/api/app/auth/web-auth.service'; |
|
|
|
import { SubscriptionModule } from '@ghostfolio/api/app/subscription/subscription.module'; |
|
|
|
import { UserModule } from '@ghostfolio/api/app/user/user.module'; |
|
|
|
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service'; |
|
|
|
import { PrismaService } from '@ghostfolio/api/services/prisma.service'; |
|
|
|
import { ConfigurationModule } from '@ghostfolio/api/services/configuration.module'; |
|
|
|
import { PrismaModule } from '@ghostfolio/api/services/prisma.module'; |
|
|
|
import { Module } from '@nestjs/common'; |
|
|
|
import { JwtModule } from '@nestjs/jwt'; |
|
|
|
|
|
|
@ -15,20 +15,20 @@ import { JwtStrategy } from './jwt.strategy'; |
|
|
|
@Module({ |
|
|
|
controllers: [AuthController], |
|
|
|
imports: [ |
|
|
|
ConfigurationModule, |
|
|
|
JwtModule.register({ |
|
|
|
secret: process.env.JWT_SECRET_KEY, |
|
|
|
signOptions: { expiresIn: '180 days' } |
|
|
|
}), |
|
|
|
PrismaModule, |
|
|
|
SubscriptionModule, |
|
|
|
UserModule |
|
|
|
], |
|
|
|
providers: [ |
|
|
|
AuthDeviceService, |
|
|
|
AuthService, |
|
|
|
ConfigurationService, |
|
|
|
GoogleStrategy, |
|
|
|
JwtStrategy, |
|
|
|
PrismaService, |
|
|
|
WebAuthService |
|
|
|
] |
|
|
|
}) |
|
|
|
|
|
@ -1,30 +1,27 @@ |
|
|
|
import { CacheService } from '@ghostfolio/api/app/cache/cache.service'; |
|
|
|
import { RedisCacheModule } from '@ghostfolio/api/app/redis-cache/redis-cache.module'; |
|
|
|
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service'; |
|
|
|
import { ConfigurationModule } from '@ghostfolio/api/services/configuration.module'; |
|
|
|
import { DataGatheringModule } from '@ghostfolio/api/services/data-gathering.module'; |
|
|
|
import { DataGatheringService } from '@ghostfolio/api/services/data-gathering.service'; |
|
|
|
import { DataProviderModule } from '@ghostfolio/api/services/data-provider/data-provider.module'; |
|
|
|
import { ExchangeRateDataModule } from '@ghostfolio/api/services/exchange-rate-data.module'; |
|
|
|
import { PrismaService } from '@ghostfolio/api/services/prisma.service'; |
|
|
|
import { PrismaModule } from '@ghostfolio/api/services/prisma.module'; |
|
|
|
import { SymbolProfileModule } from '@ghostfolio/api/services/symbol-profile.module'; |
|
|
|
import { Module } from '@nestjs/common'; |
|
|
|
|
|
|
|
import { CacheController } from './cache.controller'; |
|
|
|
|
|
|
|
@Module({ |
|
|
|
exports: [CacheService], |
|
|
|
controllers: [CacheController], |
|
|
|
imports: [ |
|
|
|
ConfigurationModule, |
|
|
|
DataGatheringModule, |
|
|
|
DataProviderModule, |
|
|
|
ExchangeRateDataModule, |
|
|
|
PrismaModule, |
|
|
|
RedisCacheModule, |
|
|
|
SymbolProfileModule |
|
|
|
], |
|
|
|
controllers: [CacheController], |
|
|
|
providers: [ |
|
|
|
CacheService, |
|
|
|
ConfigurationService, |
|
|
|
DataGatheringService, |
|
|
|
PrismaService |
|
|
|
] |
|
|
|
providers: [CacheService] |
|
|
|
}) |
|
|
|
export class CacheModule {} |
|
|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
import { CacheService } from '@ghostfolio/api/app/cache/cache.service'; |
|
|
|
import { CacheModule } from '@ghostfolio/api/app/cache/cache.module'; |
|
|
|
import { OrderModule } from '@ghostfolio/api/app/order/order.module'; |
|
|
|
import { RedisCacheModule } from '@ghostfolio/api/app/redis-cache/redis-cache.module'; |
|
|
|
import { ConfigurationModule } from '@ghostfolio/api/services/configuration.module'; |
|
|
@ -11,7 +11,9 @@ import { ImportController } from './import.controller'; |
|
|
|
import { ImportService } from './import.service'; |
|
|
|
|
|
|
|
@Module({ |
|
|
|
controllers: [ImportController], |
|
|
|
imports: [ |
|
|
|
CacheModule, |
|
|
|
ConfigurationModule, |
|
|
|
DataGatheringModule, |
|
|
|
DataProviderModule, |
|
|
@ -19,7 +21,6 @@ import { ImportService } from './import.service'; |
|
|
|
PrismaModule, |
|
|
|
RedisCacheModule |
|
|
|
], |
|
|
|
controllers: [ImportController], |
|
|
|
providers: [CacheService, ImportService] |
|
|
|
providers: [ImportService] |
|
|
|
}) |
|
|
|
export class ImportModule {} |
|
|
|
|
|
@ -1,10 +1,9 @@ |
|
|
|
import { RedisCacheModule } from '@ghostfolio/api/app/redis-cache/redis-cache.module'; |
|
|
|
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service'; |
|
|
|
import { ConfigurationModule } from '@ghostfolio/api/services/configuration.module'; |
|
|
|
import { DataGatheringModule } from '@ghostfolio/api/services/data-gathering.module'; |
|
|
|
import { DataGatheringService } from '@ghostfolio/api/services/data-gathering.service'; |
|
|
|
import { DataProviderModule } from '@ghostfolio/api/services/data-provider/data-provider.module'; |
|
|
|
import { ExchangeRateDataModule } from '@ghostfolio/api/services/exchange-rate-data.module'; |
|
|
|
import { PrismaService } from '@ghostfolio/api/services/prisma.service'; |
|
|
|
import { PrismaModule } from '@ghostfolio/api/services/prisma.module'; |
|
|
|
import { PropertyModule } from '@ghostfolio/api/services/property/property.module'; |
|
|
|
import { SymbolProfileModule } from '@ghostfolio/api/services/symbol-profile.module'; |
|
|
|
import { Module } from '@nestjs/common'; |
|
|
@ -14,7 +13,9 @@ import { InfoController } from './info.controller'; |
|
|
|
import { InfoService } from './info.service'; |
|
|
|
|
|
|
|
@Module({ |
|
|
|
controllers: [InfoController], |
|
|
|
imports: [ |
|
|
|
ConfigurationModule, |
|
|
|
DataGatheringModule, |
|
|
|
DataProviderModule, |
|
|
|
ExchangeRateDataModule, |
|
|
@ -22,16 +23,11 @@ import { InfoService } from './info.service'; |
|
|
|
secret: process.env.JWT_SECRET_KEY, |
|
|
|
signOptions: { expiresIn: '30 days' } |
|
|
|
}), |
|
|
|
PrismaModule, |
|
|
|
PropertyModule, |
|
|
|
RedisCacheModule, |
|
|
|
SymbolProfileModule |
|
|
|
], |
|
|
|
controllers: [InfoController], |
|
|
|
providers: [ |
|
|
|
ConfigurationService, |
|
|
|
DataGatheringService, |
|
|
|
InfoService, |
|
|
|
PrismaService |
|
|
|
] |
|
|
|
providers: [InfoService] |
|
|
|
}) |
|
|
|
export class InfoModule {} |
|
|
|
|
|
@ -1,5 +1,5 @@ |
|
|
|
import { AccountService } from '@ghostfolio/api/app/account/account.service'; |
|
|
|
import { CacheService } from '@ghostfolio/api/app/cache/cache.service'; |
|
|
|
import { CacheModule } from '@ghostfolio/api/app/cache/cache.module'; |
|
|
|
import { RedisCacheModule } from '@ghostfolio/api/app/redis-cache/redis-cache.module'; |
|
|
|
import { UserModule } from '@ghostfolio/api/app/user/user.module'; |
|
|
|
import { ConfigurationModule } from '@ghostfolio/api/services/configuration.module'; |
|
|
@ -15,7 +15,10 @@ import { OrderController } from './order.controller'; |
|
|
|
import { OrderService } from './order.service'; |
|
|
|
|
|
|
|
@Module({ |
|
|
|
controllers: [OrderController], |
|
|
|
exports: [OrderService], |
|
|
|
imports: [ |
|
|
|
CacheModule, |
|
|
|
ConfigurationModule, |
|
|
|
DataGatheringModule, |
|
|
|
DataProviderModule, |
|
|
@ -26,8 +29,6 @@ import { OrderService } from './order.service'; |
|
|
|
SymbolProfileModule, |
|
|
|
UserModule |
|
|
|
], |
|
|
|
controllers: [OrderController], |
|
|
|
providers: [AccountService, CacheService, OrderService], |
|
|
|
exports: [OrderService] |
|
|
|
providers: [AccountService, OrderService] |
|
|
|
}) |
|
|
|
export class OrderModule {} |
|
|
|
|
|
@ -20,6 +20,7 @@ import { PortfolioServiceNew } from './portfolio.service-new'; |
|
|
|
import { RulesService } from './rules.service'; |
|
|
|
|
|
|
|
@Module({ |
|
|
|
controllers: [PortfolioController], |
|
|
|
exports: [PortfolioServiceStrategy], |
|
|
|
imports: [ |
|
|
|
AccessModule, |
|
|
@ -34,7 +35,6 @@ import { RulesService } from './rules.service'; |
|
|
|
SymbolProfileModule, |
|
|
|
UserModule |
|
|
|
], |
|
|
|
controllers: [PortfolioController], |
|
|
|
providers: [ |
|
|
|
AccountService, |
|
|
|
CurrentRateService, |
|
|
|
|
|
@ -1,3 +1,4 @@ |
|
|
|
import { ConfigurationModule } from '@ghostfolio/api/services/configuration.module'; |
|
|
|
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service'; |
|
|
|
import { CacheModule, Module } from '@nestjs/common'; |
|
|
|
import { ConfigModule, ConfigService } from '@nestjs/config'; |
|
|
@ -17,9 +18,10 @@ import { RedisCacheService } from './redis-cache.service'; |
|
|
|
store: redisStore, |
|
|
|
ttl: configurationService.get('CACHE_TTL') |
|
|
|
}) |
|
|
|
}) |
|
|
|
}), |
|
|
|
ConfigurationModule |
|
|
|
], |
|
|
|
providers: [ConfigurationService, RedisCacheService], |
|
|
|
providers: [RedisCacheService], |
|
|
|
exports: [RedisCacheService] |
|
|
|
}) |
|
|
|
export class RedisCacheModule {} |
|
|
|
|
|
@ -1,5 +1,5 @@ |
|
|
|
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service'; |
|
|
|
import { PrismaService } from '@ghostfolio/api/services/prisma.service'; |
|
|
|
import { ConfigurationModule } from '@ghostfolio/api/services/configuration.module'; |
|
|
|
import { PrismaModule } from '@ghostfolio/api/services/prisma.module'; |
|
|
|
import { PropertyModule } from '@ghostfolio/api/services/property/property.module'; |
|
|
|
import { Module } from '@nestjs/common'; |
|
|
|
|
|
|
@ -7,9 +7,9 @@ import { SubscriptionController } from './subscription.controller'; |
|
|
|
import { SubscriptionService } from './subscription.service'; |
|
|
|
|
|
|
|
@Module({ |
|
|
|
imports: [PropertyModule], |
|
|
|
controllers: [SubscriptionController], |
|
|
|
providers: [ConfigurationService, PrismaService, SubscriptionService], |
|
|
|
exports: [SubscriptionService] |
|
|
|
exports: [SubscriptionService], |
|
|
|
imports: [ConfigurationModule, PrismaModule, PropertyModule], |
|
|
|
providers: [SubscriptionService] |
|
|
|
}) |
|
|
|
export class SubscriptionModule {} |
|
|
|
|
|
@ -1,6 +1,6 @@ |
|
|
|
import { SubscriptionModule } from '@ghostfolio/api/app/subscription/subscription.module'; |
|
|
|
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service'; |
|
|
|
import { PrismaService } from '@ghostfolio/api/services/prisma.service'; |
|
|
|
import { ConfigurationModule } from '@ghostfolio/api/services/configuration.module'; |
|
|
|
import { PrismaModule } from '@ghostfolio/api/services/prisma.module'; |
|
|
|
import { PropertyModule } from '@ghostfolio/api/services/property/property.module'; |
|
|
|
import { Module } from '@nestjs/common'; |
|
|
|
import { JwtModule } from '@nestjs/jwt'; |
|
|
@ -9,16 +9,18 @@ import { UserController } from './user.controller'; |
|
|
|
import { UserService } from './user.service'; |
|
|
|
|
|
|
|
@Module({ |
|
|
|
controllers: [UserController], |
|
|
|
exports: [UserService], |
|
|
|
imports: [ |
|
|
|
ConfigurationModule, |
|
|
|
JwtModule.register({ |
|
|
|
secret: process.env.JWT_SECRET_KEY, |
|
|
|
signOptions: { expiresIn: '30 days' } |
|
|
|
}), |
|
|
|
PrismaModule, |
|
|
|
PropertyModule, |
|
|
|
SubscriptionModule |
|
|
|
], |
|
|
|
controllers: [UserController], |
|
|
|
providers: [ConfigurationService, PrismaService, UserService], |
|
|
|
exports: [UserService] |
|
|
|
providers: [UserService] |
|
|
|
}) |
|
|
|
export class UserModule {} |
|
|
|