Add Files, Groups, and Admin modules to backend

This commit introduces the Files, Groups, and Admin modules, along with their respective services and controllers. Each module includes basic setup with injectable services, controllers, and initial test specs to ensure they are defined properly. This groundwork prepares the backend for further development and feature implementation.
This commit is contained in:
Mathis H (Avnyr) 2024-09-10 09:57:42 +02:00
parent dba8837f57
commit 6a759bd693
No known key found for this signature in database
GPG Key ID: FF69BF8BF95CDD58
15 changed files with 174 additions and 0 deletions

View File

@ -0,0 +1,20 @@
import { Test, TestingModule } from '@nestjs/testing';
import { AdminController } from './admin.controller';
import { AdminService } from './admin.service';
describe('AdminController', () => {
let controller: AdminController;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [AdminController],
providers: [AdminService],
}).compile();
controller = module.get<AdminController>(AdminController);
});
it('should be defined', () => {
expect(controller).toBeDefined();
});
});

View File

@ -0,0 +1,7 @@
import { Controller } from '@nestjs/common';
import { AdminService } from './admin.service';
@Controller('admin')
export class AdminController {
constructor(private readonly adminService: AdminService) {}
}

View File

@ -0,0 +1,9 @@
import { Module } from '@nestjs/common';
import { AdminService } from './admin.service';
import { AdminController } from './admin.controller';
@Module({
controllers: [AdminController],
providers: [AdminService],
})
export class AdminModule {}

View File

@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { AdminService } from './admin.service';
describe('AdminService', () => {
let service: AdminService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [AdminService],
}).compile();
service = module.get<AdminService>(AdminService);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});

View File

@ -0,0 +1,4 @@
import { Injectable } from '@nestjs/common';
@Injectable()
export class AdminService {}

View File

@ -0,0 +1,20 @@
import { Test, TestingModule } from '@nestjs/testing';
import { FilesController } from './files.controller';
import { FilesService } from './files.service';
describe('FilesController', () => {
let controller: FilesController;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [FilesController],
providers: [FilesService],
}).compile();
controller = module.get<FilesController>(FilesController);
});
it('should be defined', () => {
expect(controller).toBeDefined();
});
});

View File

@ -0,0 +1,7 @@
import { Controller } from '@nestjs/common';
import { FilesService } from './files.service';
@Controller('files')
export class FilesController {
constructor(private readonly filesService: FilesService) {}
}

View File

@ -0,0 +1,9 @@
import { Module } from '@nestjs/common';
import { FilesService } from './files.service';
import { FilesController } from './files.controller';
@Module({
controllers: [FilesController],
providers: [FilesService],
})
export class FilesModule {}

View File

@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { FilesService } from './files.service';
describe('FilesService', () => {
let service: FilesService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [FilesService],
}).compile();
service = module.get<FilesService>(FilesService);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});

View File

@ -0,0 +1,4 @@
import { Injectable } from '@nestjs/common';
@Injectable()
export class FilesService {}

View File

@ -0,0 +1,20 @@
import { Test, TestingModule } from '@nestjs/testing';
import { GroupsController } from './groups.controller';
import { GroupsService } from './groups.service';
describe('GroupsController', () => {
let controller: GroupsController;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [GroupsController],
providers: [GroupsService],
}).compile();
controller = module.get<GroupsController>(GroupsController);
});
it('should be defined', () => {
expect(controller).toBeDefined();
});
});

View File

@ -0,0 +1,7 @@
import { Controller } from '@nestjs/common';
import { GroupsService } from './groups.service';
@Controller('groups')
export class GroupsController {
constructor(private readonly groupsService: GroupsService) {}
}

View File

@ -0,0 +1,9 @@
import { Module } from '@nestjs/common';
import { GroupsService } from './groups.service';
import { GroupsController } from './groups.controller';
@Module({
controllers: [GroupsController],
providers: [GroupsService],
})
export class GroupsModule {}

View File

@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { GroupsService } from './groups.service';
describe('GroupsService', () => {
let service: GroupsService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [GroupsService],
}).compile();
service = module.get<GroupsService>(GroupsService);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});

View File

@ -0,0 +1,4 @@
import { Injectable } from '@nestjs/common';
@Injectable()
export class GroupsService {}