Skip to content
Snippets Groups Projects
Commit fe8c6626 authored by L4072's avatar L4072
Browse files

Comments conformed

parent b651be99
No related branches found
No related tags found
2 merge requests!59Development to master,!58Development to testing
......@@ -12,15 +12,15 @@ import { UserDTO } from './user.dto';
import { AuthGuard } from '../shared/auth.guard';
import { ValidationPipe } from '../shared/validation.pipe';
/*
UserController is being used for routing:
- Login
- Register
- Verify is checking for logged in user
See shared folder files for more information on decorators.
*/
/////////////////////////////////////////////////////////////////////
/// UserController is being used for routing: ///
/// - Login ///
/// - Register ///
/// ///
/// - Verify is checking for logged in user ///
/// ///
/// See shared folder files for more information on decorators. ///
/////////////////////////////////////////////////////////////////////
@Controller('user')
export class UserController {
......
import { createParamDecorator } from '@nestjs/common';
/*
UserDecorator
See auth.guard.ts in shared folder for more information
Returns user id and user name, this is mainly used to return user id
*/
///////////////////////////////////////////////////////////////////////////////
/// UserDecorator ///
/// ///
/// See auth.guard.ts in shared folder for more information ///
/// ///
/// Returns user id and user name, this is mainly used to return user id ///
///////////////////////////////////////////////////////////////////////////////
// used to pass user information to controllers
export const User = createParamDecorator((data, req) => {
......
import { IsString, IsNotEmpty, Length } from 'class-validator';
/*
Contains Validation for UserDTO
uses class-validator built in validations
see https://github.com/typestack/class-validator
*/
///////////////////////////////////////////////////////////
/// Contains Validation for UserDTO ///
/// uses class-validator built in validations ///
/// see https://github.com/typestack/class-validator ///
///////////////////////////////////////////////////////////
export class UserDTO {
@IsString()
......
......@@ -11,14 +11,14 @@ import * as jwt from 'jsonwebtoken';
import { Game_PersonEntity } from '../game/game.entity';
import { Exclude } from 'class-transformer';
/*
UserEntity reflects database table.
Before handling password to database we encrypt it with bcrypt.
password field will be excluded unless we call repository relation.
token will be created when user registers or logs in to the system.
*/
/////////////////////////////////////////////////////////////////////////////
/// UserEntity reflects database table. ///
/// ///
/// Before handling password to database we encrypt it with bcrypt. ///
/// password field will be excluded unless we call repository relation. ///
/// ///
/// token will be created when user registers or logs in to the system. ///
/////////////////////////////////////////////////////////////////////////////
@Entity('Person')
export class PersonEntity {
......
......@@ -5,16 +5,16 @@ import { UserController } from './user.controller';
import { UserService } from './user.service';
import { PersonEntity } from './user.entity';
/*
Entities
- PersonEntity
Controllers
- UserController
Provider
- UserService
*/
///////////////////////////
/// Entities ///
/// - PersonEntity ///
/// ///
/// Controllers ///
/// - UserController ///
/// ///
/// Provider ///
/// - UserService ///
///////////////////////////
@Module({
imports: [TypeOrmModule.forFeature([PersonEntity])],
......
......@@ -4,16 +4,17 @@ import { InjectRepository } from '@nestjs/typeorm';
import { PersonEntity } from './user.entity';
import { UserDTO } from './user.dto';
/*
UserService contains functions for
- Login
- Register
Both functions return logged in users tokenObject
See more info in UserEntity.
See more info on DTO in it's respective file
*/
///////////////////////////////////////////////////////////
/// UserService contains functions for ///
/// - Login ///
/// - Register ///
/// ///
/// Both functions return logged in users tokenObject ///
/// See more info in UserEntity. ///
/// ///
/// See more info on DTO in it's respective file ///
///////////////////////////////////////////////////////////
@Injectable()
export class UserService {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment