장재혁

Add Structure for api

...@@ -6,6 +6,10 @@ import { AppController } from './app.controller'; ...@@ -6,6 +6,10 @@ import { AppController } from './app.controller';
6 import { AppService } from './app.service'; 6 import { AppService } from './app.service';
7 import { MypageModule } from './mypage/mypage.module'; 7 import { MypageModule } from './mypage/mypage.module';
8 import { PostModule } from './post/post.module'; 8 import { PostModule } from './post/post.module';
9 +import { CommentModule } from './comment/comment.module';
10 +import { UserModule } from './user/user.module';
11 +import { LikeableService } from './likeable/likeable.service';
12 +import { LikeableModule } from './likeable/likeable.module';
9 13
10 @Module({ 14 @Module({
11 imports: [ 15 imports: [
...@@ -22,8 +26,11 @@ import { PostModule } from './post/post.module'; ...@@ -22,8 +26,11 @@ import { PostModule } from './post/post.module';
22 }), 26 }),
23 MypageModule, 27 MypageModule,
24 PostModule, 28 PostModule,
29 + CommentModule,
30 + UserModule,
31 + LikeableModule,
25 ], 32 ],
26 controllers: [AppController], 33 controllers: [AppController],
27 - providers: [AppService], 34 + providers: [AppService, LikeableService],
28 }) 35 })
29 export class AppModule {} 36 export class AppModule {}
......
1 +import { Module } from '@nestjs/common';
2 +import { CommentService } from './comment.service';
3 +import { CommentResolver } from './comment.resolver';
4 +
5 +@Module({
6 + providers: [CommentService, CommentResolver],
7 +})
8 +export class CommentModule {}
1 +import { Test, TestingModule } from '@nestjs/testing';
2 +import { CommentResolver } from './comment.resolver';
3 +
4 +describe('CommentResolver', () => {
5 + let resolver: CommentResolver;
6 +
7 + beforeEach(async () => {
8 + const module: TestingModule = await Test.createTestingModule({
9 + providers: [CommentResolver],
10 + }).compile();
11 +
12 + resolver = module.get<CommentResolver>(CommentResolver);
13 + });
14 +
15 + it('should be defined', () => {
16 + expect(resolver).toBeDefined();
17 + });
18 +});
1 +import { Resolver } from '@nestjs/graphql';
2 +
3 +@Resolver()
4 +export class CommentResolver {}
1 +import { Test, TestingModule } from '@nestjs/testing';
2 +import { CommentService } from './comment.service';
3 +
4 +describe('CommentService', () => {
5 + let service: CommentService;
6 +
7 + beforeEach(async () => {
8 + const module: TestingModule = await Test.createTestingModule({
9 + providers: [CommentService],
10 + }).compile();
11 +
12 + service = module.get<CommentService>(CommentService);
13 + });
14 +
15 + it('should be defined', () => {
16 + expect(service).toBeDefined();
17 + });
18 +});
1 +import { Injectable } from '@nestjs/common';
2 +
3 +@Injectable()
4 +export class CommentService {}
1 +import { Module } from '@nestjs/common';
2 +import { LikeableResolver } from './likeable.resolver';
3 +
4 +@Module({
5 + providers: [LikeableResolver],
6 +})
7 +export class LikeableModule {}
1 +import { Test, TestingModule } from '@nestjs/testing';
2 +import { LikeableResolver } from './likeable.resolver';
3 +
4 +describe('LikeableResolver', () => {
5 + let resolver: LikeableResolver;
6 +
7 + beforeEach(async () => {
8 + const module: TestingModule = await Test.createTestingModule({
9 + providers: [LikeableResolver],
10 + }).compile();
11 +
12 + resolver = module.get<LikeableResolver>(LikeableResolver);
13 + });
14 +
15 + it('should be defined', () => {
16 + expect(resolver).toBeDefined();
17 + });
18 +});
1 +import { Resolver } from '@nestjs/graphql';
2 +
3 +@Resolver()
4 +export class LikeableResolver {}
1 +import { Test, TestingModule } from '@nestjs/testing';
2 +import { LikeableService } from './likeable.service';
3 +
4 +describe('LikeableService', () => {
5 + let service: LikeableService;
6 +
7 + beforeEach(async () => {
8 + const module: TestingModule = await Test.createTestingModule({
9 + providers: [LikeableService],
10 + }).compile();
11 +
12 + service = module.get<LikeableService>(LikeableService);
13 + });
14 +
15 + it('should be defined', () => {
16 + expect(service).toBeDefined();
17 + });
18 +});
1 +import { Injectable } from '@nestjs/common';
2 +
3 +@Injectable()
4 +export class LikeableService {}
1 +import { Module } from '@nestjs/common';
2 +import { UserResolver } from './user.resolver';
3 +import { UserService } from './user.service';
4 +
5 +@Module({
6 + providers: [UserResolver, UserService]
7 +})
8 +export class UserModule {}
1 +import { Test, TestingModule } from '@nestjs/testing';
2 +import { UserResolver } from './user.resolver';
3 +
4 +describe('UserResolver', () => {
5 + let resolver: UserResolver;
6 +
7 + beforeEach(async () => {
8 + const module: TestingModule = await Test.createTestingModule({
9 + providers: [UserResolver],
10 + }).compile();
11 +
12 + resolver = module.get<UserResolver>(UserResolver);
13 + });
14 +
15 + it('should be defined', () => {
16 + expect(resolver).toBeDefined();
17 + });
18 +});
1 +import { Resolver } from '@nestjs/graphql';
2 +
3 +@Resolver()
4 +export class UserResolver {}
1 +import { Test, TestingModule } from '@nestjs/testing';
2 +import { UserService } from './user.service';
3 +
4 +describe('UserService', () => {
5 + let service: UserService;
6 +
7 + beforeEach(async () => {
8 + const module: TestingModule = await Test.createTestingModule({
9 + providers: [UserService],
10 + }).compile();
11 +
12 + service = module.get<UserService>(UserService);
13 + });
14 +
15 + it('should be defined', () => {
16 + expect(service).toBeDefined();
17 + });
18 +});
1 +import { Injectable } from '@nestjs/common';
2 +
3 +@Injectable()
4 +export class UserService {}