merge Sam and profesor m.s.c
This commit is contained in:
@@ -6,6 +6,7 @@ import { AuthModule } from './auth/auth.module';
|
||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||
import { UsersModule } from './users/users.module';
|
||||
import { User } from "./users/entities/user.entity";
|
||||
import { ProfesorModule } from './profesor/profesor.module';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
@@ -29,6 +30,7 @@ import { User } from "./users/entities/user.entity";
|
||||
synchronize:true,
|
||||
}),
|
||||
}),
|
||||
ProfesorModule,
|
||||
],
|
||||
controllers: [AppController],
|
||||
providers: [AppService],
|
||||
|
||||
@@ -8,41 +8,58 @@ export class profesor{
|
||||
|
||||
@Column({length:11 ,nullable:false})
|
||||
id_usuario: number;
|
||||
|
||||
@Column({length:10, nullable:true})
|
||||
num_trabajador: string;
|
||||
|
||||
@Column({length:80, nullable:false})
|
||||
nombre: string;
|
||||
|
||||
@Column({length:10, nullable:true})
|
||||
rfc: string;
|
||||
|
||||
@Column({length:3, nullable:true})
|
||||
homoclave: string;
|
||||
|
||||
@Column({length:13, nullable:true})
|
||||
tel_oficina: string;
|
||||
|
||||
@Column({length:10, nullable:true})
|
||||
extension: string;
|
||||
|
||||
@Column({length:13, nullable:true})
|
||||
tel_personal: string;
|
||||
|
||||
@Column({length:65, nullable:true})
|
||||
correo_pcp: string;
|
||||
|
||||
@Column({length:65, nullable:true})
|
||||
correo_per: string;
|
||||
|
||||
@Column({length:11, nullable:true})
|
||||
id_adscripcion: number;
|
||||
|
||||
@Column({length:11, nullable:true})
|
||||
id_categoria: number;
|
||||
|
||||
@Column({length:11, nullable:true})
|
||||
id_edificio: number;
|
||||
|
||||
@Column({length:256, nullable:true})
|
||||
ubicacion: string;
|
||||
|
||||
@Column({length:150, nullable:true})
|
||||
fotografia: string;
|
||||
|
||||
@Column({ nullable:false})
|
||||
activo: boolean = false;
|
||||
|
||||
@Column({ nullable:false})
|
||||
mostrar: boolean = true;
|
||||
|
||||
@Column({ nullable:false})
|
||||
fecha_alta: Date;
|
||||
|
||||
@Column({ nullable:false})
|
||||
fecha_actualizacion: Timestamp;
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { ProfesorController } from './profesor.controller';
|
||||
|
||||
describe('ProfesorController', () => {
|
||||
let controller: ProfesorController;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [ProfesorController],
|
||||
}).compile();
|
||||
|
||||
controller = module.get<ProfesorController>(ProfesorController);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(controller).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
import { Body, Controller, Delete, Get, Post } from '@nestjs/common';
|
||||
import { ProfesorService } from './profesor.service';
|
||||
|
||||
@Controller('profesor')
|
||||
export class profesorController {
|
||||
constructor(private profesorService: ProfesorService) {}
|
||||
|
||||
@Post("alta")
|
||||
async postRegister(@Body() data:profeDto){
|
||||
return this.profesorService.register(data);
|
||||
}
|
||||
|
||||
@Post("midificacion")
|
||||
async postModify(@Body() data:profeDto){
|
||||
return this.profesorService.modify(data);
|
||||
}
|
||||
|
||||
@Delete("borrado")
|
||||
async remove(@Body() data:profeDto){
|
||||
return this.profesorService.remove(data);
|
||||
}
|
||||
|
||||
@Get("profile")
|
||||
async profile(){
|
||||
return this.profesorService.profile();
|
||||
}
|
||||
|
||||
@Get("profile/filter")
|
||||
async filter(@Body() data:profeDto){
|
||||
return this.profesorService.filter(data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
|
||||
@Module({})
|
||||
export class ProfesorModule {}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { ProfesorService } from './profesor.service';
|
||||
|
||||
describe('ProfesorService', () => {
|
||||
let service: ProfesorService;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [ProfesorService],
|
||||
}).compile();
|
||||
|
||||
service = module.get<ProfesorService>(ProfesorService);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(service).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,26 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
export class ProfesorService {
|
||||
|
||||
async register(){
|
||||
|
||||
}
|
||||
|
||||
async modify(){
|
||||
|
||||
}
|
||||
|
||||
async remove(){
|
||||
|
||||
}
|
||||
|
||||
async profile(){
|
||||
|
||||
}
|
||||
|
||||
async filter(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user