This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Using this class for base will default the primary key of the entity to be int. | |
/// </summary> | |
public class EntityBase : EntityBase<int> | |
{ | |
} | |
/// <summary> | |
/// The base entity. | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Module } from '@nestjs/common'; | |
import { PassportModule } from '@nestjs/passport'; | |
import { JwtModule } from '@nestjs/jwt'; | |
import { AuthController } from './auth.controller'; | |
import { AuthService } from './auth.service'; | |
import { JwtStrategy } from './jwt.strategy'; | |
import { UserService } from '../user/user.service'; | |
import { UserModule } from '../user/user.module'; | |
@Module({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { UserDto } from './dto/user.dto'; | |
import { AuthService } from './auth.service'; | |
import { Controller, Post, Body } from '@nestjs/common'; | |
@Controller('auth') | |
export class AuthController { | |
constructor(private readonly authService: AuthService) { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@nestjs/common'; | |
import { JwtService } from '@nestjs/jwt'; | |
import { JwtPayload } from './interfaces/jwt-payload.interface'; | |
import { UserDto } from './dto/user.dto'; | |
import { UserService } from '../user/user.service'; | |
@Injectable() | |
export class AuthService { | |
constructor( | |
private readonly jwtService: JwtService, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Module } from '@nestjs/common'; | |
import { TypeOrmModule } from '@nestjs/typeorm'; | |
import { User } from './user.entity'; | |
import { UserController } from './user.controller'; | |
import { UserService } from './user.service'; | |
@Module({ | |
imports: [TypeOrmModule.forFeature([User])], | |
providers: [UserService], | |
controllers: [UserController] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Controller, Post, Get, Body, Query, Put, Delete } from '@nestjs/common'; | |
import { UserService } from './user.service'; | |
import { CreateUserDto } from './dtos/create.user.dto'; | |
import { UpdateUserDto } from './dtos/update.user.dto'; | |
@Controller('User') | |
export class UserController { | |
constructor(private readonly userService: UserService) { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable, Query } from '@nestjs/common'; | |
import { InjectRepository } from '@nestjs/typeorm'; | |
import { Repository, UpdateResult, DeleteResult } from 'typeorm'; | |
import * as bcrypt from 'bcrypt-nodejs'; | |
import { User } from './user.entity'; | |
import { CreateUserDto } from './dtos/create.user.dto'; | |
import { UpdateUserDto } from './dtos/update.user.dto'; | |
@Injectable() | |
export class UserService { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PrimaryGeneratedColumn, Column, Entity, OneToMany, ManyToMany } from 'typeorm'; | |
@Entity() | |
export class User { | |
@PrimaryGeneratedColumn() | |
id: number; | |
@Column({ length: 128 }) | |
firstName: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static StringBuilder CreateTableHeader() | |
{ | |
StringBuilder s = new StringBuilder(); | |
//s.AppendLine("<html>"); | |
//s.AppendLine("<head>"); | |
//s.AppendLine("<meta charset=\"UTF - 8\">"); | |
//s.AppendLine("<meta name=\"viewport\" content=\"width = device - width, initial - scale = 1, maximum - scale = 1\">"); | |
//s.AppendLine("<style>body { padding: 0; margin: 0; }</style>"); | |
//s.AppendLine("</head>"); | |
//s.AppendLine("<body>"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Card = props => { | |
return ( | |
<div style={{marginLeft:'1em'}}> | |
<img width="75" src={props.avatar_url}/> | |
<div style={{display: 'inline-block', marginLeft: 10}}> | |
<div style={{fontSize:'1.25em', fontWeight:'bold'}}> | |
<div>Name: {props.name}</div> | |
<div>Company: {props.company}</div> | |
</div> | |
</div> |
NewerOlder