Skip to content

Commit

Permalink
refactor: utilModule 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
niamu01 committed Dec 8, 2023
1 parent 4233311 commit 14d30a2
Show file tree
Hide file tree
Showing 16 changed files with 37 additions and 42 deletions.
2 changes: 1 addition & 1 deletion src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
ApiResponse,
ApiTags,
} from '@nestjs/swagger';
import { GoogleApi } from 'src/utils/google-api.component';
import { GoogleApi } from 'src/google-api/google-api.component';
import { FtOAuthGuard } from './guard/ft-oauth.guard';
import { JWTSignGuard } from './guard/jwt-sign.guard';
import { UserAuthGuard } from './guard/user-auth.guard';
Expand Down
4 changes: 2 additions & 2 deletions src/auth/auth.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { JwtModule } from '@nestjs/jwt';
import { PassportModule } from '@nestjs/passport';
import { TypeOrmModule } from '@nestjs/typeorm';
import { UserInfo } from 'src/entities/user-info.entity';
import { UtilsModule } from 'src/utils/utils.module';
import { GoogleModule } from 'src/google-api/google-api.module';
import { Auth42Controller } from './auth.controller';
import { AuthService } from './auth.service';
import { AuthRepository } from './repository/auth.repository';
Expand All @@ -21,7 +21,7 @@ const repo = {
@Module({
imports: [
TypeOrmModule.forFeature([UserInfo]),
UtilsModule,
GoogleModule,
PassportModule,
JwtModule.registerAsync({
useFactory: async (configService: ConfigService) => ({
Expand Down
8 changes: 8 additions & 0 deletions src/data-calculator/data-calculator.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Module } from '@nestjs/common';
import { DateCalculator } from './date-calculator.component';

@Module({
providers: [DateCalculator],
exports: [DateCalculator],
})
export class DateCalculatorModule {}
File renamed without changes.
File renamed without changes.
9 changes: 1 addition & 8 deletions src/ext/ext.module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AuthModule } from 'src/auth/auth.module';
import { DeviceInfo } from 'src/entities/device-info.entity';
import { TagLog } from 'src/entities/tag-log.entity';
import { TagLogRepository } from 'src/tag-log-v1/repository/mysql/tag-log.repository';
import { TagLogModule } from 'src/tag-log-v1/tag-log.module';
import { UserModule } from 'src/user/user.module';
import { ExtService } from './ext.service';
import { DeviceInfoRepository } from './repository/mysql/device-info.repository';
Expand All @@ -24,12 +22,7 @@ const deviceInfoRepo = {
* 24Hane 기능 외 다른 서비스에서 사용하는 외부 API 모듈
*/
@Module({
imports: [
AuthModule,
UserModule,
TagLogModule,
TypeOrmModule.forFeature([DeviceInfo, TagLog]),
],
imports: [UserModule, TypeOrmModule.forFeature([DeviceInfo, TagLog])],
controllers: [Where42Controller],
providers: [tagLogRepo, deviceInfoRepo, ExtService],
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { auth, sheets } from '@googleapis/sheets';
import { Inject, Injectable, Logger } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { sheets, auth } from '@googleapis/sheets';

/**
* doosoo 팀장님의 요청에 따라 Google API를 이용해서 Spread Sheet로 Data를 송부하기 위한 컴포넌트입니다.
Expand Down
8 changes: 8 additions & 0 deletions src/google-api/google-api.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Module } from '@nestjs/common';
import { GoogleApi } from './google-api.component';

@Module({
providers: [GoogleApi],
exports: [GoogleApi],
})
export class GoogleModule {}
2 changes: 1 addition & 1 deletion src/tag-log-v1/tag-log-admin.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable, Logger } from '@nestjs/common';
import { DateCalculator } from 'src/data-calculator/date-calculator.component';
import { UserService } from 'src/user/user.service';
import { DateCalculator } from 'src/utils/date-calculator.component';
import { UserAccumulationDayType } from './dto/admin/user-accumulation-day.type';
import { UserAccumulationMonthType } from './dto/admin/user-accumulation-month.type';
import { TagLogService } from './tag-log.service';
Expand Down
6 changes: 2 additions & 4 deletions src/tag-log-v1/tag-log.module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AuthModule } from 'src/auth/auth.module';
import { DateCalculatorModule } from 'src/data-calculator/data-calculator.module';
import { PairInfo } from 'src/entities/pair-info.entity';
import { TagLog } from 'src/entities/tag-log.entity';
import { UserModule } from 'src/user/user.module';
import { UtilsModule } from 'src/utils/utils.module';
import { PairInfoRepository } from './repository/mysql/pair-info.repository';
import { TagLogRepository } from './repository/mysql/tag-log.repository';
import { TagLogAdminController } from './tag-log-admin.controller';
Expand All @@ -24,9 +23,8 @@ const pairInfoRepo = {

@Module({
imports: [
AuthModule,
TypeOrmModule.forFeature([TagLog, PairInfo]),
UtilsModule,
DateCalculatorModule,
UserModule,
],
exports: [TypeOrmModule],
Expand Down
2 changes: 1 addition & 1 deletion src/tag-log-v1/tag-log.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Inject, Injectable, Logger } from '@nestjs/common';
import InOut from 'src/enums/inout.enum';
import { UserService } from 'src/user/user.service';
import { DateCalculator } from 'src/utils/date-calculator.component';
import { DateCalculator } from 'src/data-calculator/date-calculator.component';
import { InOutDto } from './dto/inout.dto';
import { TagLogDto } from './dto/tag-log.dto';
import { PairInfoDto } from './dto/pair-info.dto';
Expand Down
2 changes: 1 addition & 1 deletion src/tag-log-v2/tag-log-v2-admin.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable, Logger } from '@nestjs/common';
import { UserService } from 'src/user/user.service';
import { DateCalculator } from 'src/utils/date-calculator.component';
import { DateCalculator } from 'src/data-calculator/date-calculator.component';
import { UserAccumulationDayType } from './dto/admin/user-accumulation-day.type';
import { UserAccumulationMonthType } from './dto/admin/user-accumulation-month.type';
import { TagLogService } from './tag-log-v2.service';
Expand Down
7 changes: 2 additions & 5 deletions src/tag-log-v2/tag-log-v2.module.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AuthModule } from 'src/auth/auth.module';
import { DateCalculatorModule } from 'src/data-calculator/data-calculator.module';
import { DeviceInfo } from 'src/entities/device-info.entity';
import { PairInfo } from 'src/entities/pair-info.entity';
import { TagLog } from 'src/entities/tag-log.entity';
import { StatisticsModule } from 'src/statistics/statictics.module';
import { UserModule } from 'src/user/user.module';
import { UtilsModule } from 'src/utils/utils.module';
import { Cabi42Controller } from '../ext/cabi42.controller';
import { DeviceInfoRepository } from './repository/mysql/device-info.repository';
import { PairInfoRepository } from './repository/mysql/pair-info.repository';
import { TagLogRepository } from './repository/mysql/tag-log.repository';
import { TagLogAdminController } from './tag-log-v2-admin.controller';
import { TagLogAdminService } from './tag-log-v2-admin.service';

import { TagLogController } from './tag-log-v2.controller';
import { TagLogService } from './tag-log-v2.service';

Expand All @@ -34,9 +32,8 @@ const deviceInfoRepo = {

@Module({
imports: [
AuthModule,
TypeOrmModule.forFeature([TagLog, PairInfo, DeviceInfo]),
UtilsModule,
DateCalculatorModule,
UserModule,
StatisticsModule,
],
Expand Down
6 changes: 3 additions & 3 deletions src/tag-log-v2/tag-log-v2.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Test, TestingModule } from '@nestjs/testing';
import { TagLogService } from './tag-log-v2.service';
import { DateCalculator } from 'src/data-calculator/date-calculator.component';
import { UserService } from 'src/user/user.service';
import { PairInfoDto } from './dto/pair-info.dto';
import { TagLogDto } from './dto/tag-log.dto';
import { DateCalculator } from 'src/utils/date-calculator.component';
import { UserService } from 'src/user/user.service';
import { TagLogService } from './tag-log-v2.service';

const mocks = [
{
Expand Down
12 changes: 6 additions & 6 deletions src/tag-log-v2/tag-log-v2.service.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Inject, Injectable, Logger } from '@nestjs/common';
import { DateCalculator } from 'src/data-calculator/date-calculator.component';
import InOut from 'src/enums/inout.enum';
import { CardDto } from 'src/user/dto/card.dto';
import { UserService } from 'src/user/user.service';
import { DateCalculator } from 'src/utils/date-calculator.component';
import { DeviceInfoDto } from './dto/device-info.dto';
import { InOutDto } from './dto/inout.dto';
import { TagLogDto } from './dto/tag-log.dto';
import { PairInfoDto } from './dto/pair-info.dto';
import { InOutLogType } from './dto/subType/InOutLog.type';
import { ITagLogRepository } from './repository/interface/tag-log-repository.interface';
import { IPairInfoRepository } from './repository/interface/pair-info-repository.interface';
import { CardDto } from 'src/user/dto/card.dto';
import { TagLogDto } from './dto/tag-log.dto';
import { IDeviceInfoRepository } from './repository/interface/device-info-repository.interface';
import { DeviceInfoDto } from './dto/device-info.dto';
import { IPairInfoRepository } from './repository/interface/pair-info-repository.interface';
import { ITagLogRepository } from './repository/interface/tag-log-repository.interface';

@Injectable()
export class TagLogService {
Expand Down
9 changes: 0 additions & 9 deletions src/utils/utils.module.ts

This file was deleted.

0 comments on commit 14d30a2

Please sign in to comment.