Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/change alias name #16

Open
wants to merge 65 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
bfbb990
modify: change reward module code to raw query
shunnyjang Oct 7, 2022
3e59ae8
완성한만큼 commit
shunnyjang Oct 7, 2022
9c6b084
fix: delete error occurred property
shunnyjang Oct 9, 2022
4a9c765
fix: wrong sql
shunnyjang Oct 9, 2022
2160b00
fix: wrong property type
shunnyjang Oct 10, 2022
6a04cba
feat: add description property
shunnyjang Oct 10, 2022
acc2296
fix: reward transaction bug
shunnyjang Oct 10, 2022
88b7f86
fix: add bucket deatil condition
shunnyjang Oct 10, 2022
3bba40c
feat: add prize description
shunnyjang Oct 10, 2022
dda4140
update: reward list api swagger
shunnyjang Oct 10, 2022
6c8786f
Fix Reward Bug and Bucket Detail Bug
shunnyjang Oct 10, 2022
818b7e8
modify: response type to object (#36)
shunnyjang Oct 10, 2022
dc79478
fix: body parameter name unmatched (#37)
shunnyjang Oct 10, 2022
a93b458
fix: add persist disabled (#38)
shunnyjang Oct 10, 2022
4af9519
Feat: Push Notification Schedule Setting (#39)
shunnyjang Oct 11, 2022
a2ec9ef
community, challenge criteria & notification after register answer (#40)
shunnyjang Oct 15, 2022
340a505
feat: signup and verify email (#41)
shunnyjang Oct 15, 2022
7f94c0e
hotfix: handle error transaction bug (#42)
shunnyjang Oct 15, 2022
3dda562
hotfix: handle error when email is duplicated when register (#43)
shunnyjang Oct 17, 2022
366462c
Hotfix/challenge reward bug (#44)
shunnyjang Oct 17, 2022
2b98d12
feat: check unread notification
shunnyjang Oct 17, 2022
6780ed6
feat: add friend nickname property
shunnyjang Oct 17, 2022
0dde48c
modify: set image null while modifying
shunnyjang Oct 17, 2022
8a52557
fix: handle duplicate email registered
shunnyjang Oct 17, 2022
65e730c
Merge pull request #45 from shunnyjang/feat/delete-photo-patch
shunnyjang Oct 17, 2022
c7efae1
fix: handle signup duplicate bug
shunnyjang Oct 17, 2022
76dd285
feat: intialize bucket answers
shunnyjang Oct 17, 2022
b4a0857
지금까지 한 작업물 commit
shunnyjang Oct 17, 2022
7a78a41
modify: delete property unused
shunnyjang Oct 18, 2022
a3e6277
modify: check whether challenge exists before create user
shunnyjang Oct 18, 2022
40c23fa
fix: error message and delete authentication (#46)
shunnyjang Oct 18, 2022
bbeda4d
fix range bug and authorization bug
shunnyjang Oct 18, 2022
31d7417
implement: auth service
shunnyjang Oct 18, 2022
c208e98
modify: replace serializer interceptor to destructing
shunnyjang Oct 18, 2022
4b6a77b
feat: add response message
shunnyjang Oct 18, 2022
9efca73
fix: return type error
shunnyjang Oct 18, 2022
0fb82f1
update: swagger docs
shunnyjang Oct 18, 2022
1884e40
Merge pull request #48 from shunnyjang/feat/response-message
shunnyjang Oct 18, 2022
b1046f2
modify: change user id from request body to jwt auth (#49)
shunnyjang Oct 18, 2022
61fe28c
feat: set hard coding auth code (#50)
shunnyjang Oct 18, 2022
b344e8c
fix: handle email error
shunnyjang Oct 18, 2022
d934891
feat: add sequence of challenges
shunnyjang Oct 19, 2022
622e6ad
modify: delete auth
shunnyjang Oct 19, 2022
121c47f
modify: change file directory name on production version
shunnyjang Oct 20, 2022
499b970
Merge branch 'main' of github.com:shunnyjang/Thirty-Backend into main
shunnyjang Oct 20, 2022
0622207
fix: image directory typo
shunnyjang Oct 20, 2022
aba55d6
fix: community retrieve query
shunnyjang Oct 26, 2022
9e18385
feat: add count of buckets in challenge (#51)
shunnyjang Oct 28, 2022
867b95a
feat: add newbie signup at onboarding
shunnyjang Nov 8, 2022
cb0bb1b
feat: edit password
shunnyjang Nov 8, 2022
4009984
Merge pull request #52 from shunnyjang/feat/newbie-signup
shunnyjang Nov 8, 2022
ee7b53d
initiate report module
shunnyjang Nov 9, 2022
c91a51c
feat: block, report logic
shunnyjang Nov 14, 2022
a4a2294
implement block app
shunnyjang Nov 15, 2022
cebef2d
feat: add checking target user is exists
shunnyjang Nov 15, 2022
d9e4852
feat: change report funct return value
shunnyjang Nov 15, 2022
4f50d43
feat: unblock
shunnyjang Nov 15, 2022
66373ed
feat: add target user data
shunnyjang Nov 15, 2022
7113b9c
feat: filter blocked user answer
shunnyjang Nov 15, 2022
9452e34
update: swagger docs
shunnyjang Nov 15, 2022
d486de7
Merge pull request #53 from shunnyjang/feat/blocked-user
shunnyjang Nov 15, 2022
ed0c392
update: swagger docs
shunnyjang Nov 15, 2022
5a8af57
Feat/check challenge owned (#54)
shunnyjang Jan 24, 2023
d0362b1
fix: alias name to make community object same (#55)
shunnyjang Feb 8, 2023
02d25ca
hotfix: change alias name
shunnyjang Feb 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion nest-cli.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src"
"sourceRoot": "src",
"compilerOptions": {
"assets": [{"include": "**/*.ejs"}],
"watchAssets": true
}
}
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@mikro-orm/nestjs": "^5.1.1",
"@mikro-orm/postgresql": "^5.3.1",
"@mikro-orm/sql-highlighter": "^1.0.1",
"@nestjs-modules/mailer": "^1.8.1",
"@nestjs/common": "^9.0.0",
"@nestjs/config": "^2.2.0",
"@nestjs/core": "^9.0.0",
Expand All @@ -51,9 +52,12 @@
"cookie-parser": "^1.4.6",
"crypto": "^1.0.1",
"dotenv": "^16.0.1",
"ejs": "^3.1.8",
"handlebars": "^4.7.7",
"joi": "^17.6.0",
"multer": "^1.4.5-lts.1",
"multer-s3": "^3.0.1",
"nodemailer": "^6.8.0",
"passport": "^0.6.0",
"passport-jwt": "^4.0.0",
"passport-local": "^1.0.0",
Expand Down
30 changes: 29 additions & 1 deletion src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@ import { UserModule } from './user/user.module';
import { ChallengeModule } from './challenge/challenge.module';
import { MikroORM } from '@mikro-orm/core';
import { AuthModule } from './auth/auth.module';
import { ConfigModule } from '@nestjs/config';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { CaslModule } from './casl/casl.module';
import { RewardModule } from './reward/reward.module';
import { NoticeModule } from './notice/notice.module';
import { RelationModule } from './relation/relation.module';
import { NotificationModule } from './notification/notification.module';
import { CommunityModule } from './community/community.module';
import { ThemeModule } from './theme/theme.module';
import { PushModule } from './push/push.module';
import { MailerModule } from '@nestjs-modules/mailer';
import { EjsAdapter } from '@nestjs-modules/mailer/dist/adapters/ejs.adapter';
import { EmailModule } from './email/email.module';
import { BlockModule } from './block/block.module';
import path from 'path';

@Module({
imports: [
Expand All @@ -26,6 +32,25 @@ import { ThemeModule } from './theme/theme.module';
envFilePath: `${process.cwd()}/.${process.env.NODE_ENV}.env`,
isGlobal: true,
}),
MailerModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: (config: ConfigService) => {
return {
transport: `smtps://${config.get('EMAIL_AUTH_ADDRESS')}:${config.get('EMAIL_AUTH_PASSWORD')}@${config.get('EMAIL_HOST')}`,
defaults: {
from: `${config.get('EMAIL_FROM_USER')} <${config.get('EMAIL_FROM_USER')}>`
},
template: {
dir: path.join(__dirname, '/templates/'),
adapter: new EjsAdapter(),
options: {
strict: true,
}
}
}
}
}),
AuthModule,
BucketsModule,
ChallengeModule,
Expand All @@ -37,6 +62,9 @@ import { ThemeModule } from './theme/theme.module';
NotificationModule,
CommunityModule,
ThemeModule,
PushModule,
EmailModule,
BlockModule,
],
})
export class AppModule implements NestModule, OnModuleInit {
Expand Down
100 changes: 90 additions & 10 deletions src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
import {
Body,
ClassSerializerInterceptor,
Controller,
Get,
Post,
Req,
Res,
UseGuards,
UseInterceptors,
} from '@nestjs/common';
import { Response } from 'express';
import { AuthService } from './auth.service';
import { RegisterUserDto } from './dto/register-user.dto';
import { JwtAuthGuard } from './guards/jwt-auth.guards';
import { LocalAuthGuard } from './guards/local-auth.guards';
import { ApiBody, ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger';
import {
ApiBadRequestResponse,
ApiBody,
ApiCreatedResponse,
ApiOperation,
ApiResponse,
ApiTags,
getSchemaPath,
} from '@nestjs/swagger';
import { LoginUserDto } from './dto/login-user.dto';
import { User } from 'src/entities';

Expand All @@ -25,10 +31,12 @@ export class AuthController {

@ApiOperation({ summary: `회원가입` })
@ApiBody({ type: RegisterUserDto })
@ApiResponse({
status: 201,
description: `회원가입 성공`,
type: User,
@ApiCreatedResponse({
schema: {
example: {
message: '이메일 전송 성공! 이메일을 인증해주세요.',
},
},
})
@Post('/signup')
@UseGuards(JwtAuthGuard)
Expand All @@ -37,14 +45,50 @@ export class AuthController {
return this.authService.signUp(registerUserDto);
}

@ApiOperation({ summary: `온보딩 회원가입` })
@ApiBody({
schema: {
allOf: [
{
properties: {
uuid: {
type: `string`,
description: `uuid of user`
}
}
},
{
$ref: getSchemaPath(RegisterUserDto)
}
]
},
})
@ApiCreatedResponse({
schema: {
example: {
message: '이메일 전송 성공! 이메일을 인증해주세요.',
},
},
})
@Post('/signup/newbie')
async signupAsNewbie(@Req() req, @Body() registerUserDto: RegisterUserDto) {
return this.authService.signupAsNewbie(registerUserDto);
}

@Post('/signup/resend')
resendSignupEmail(@Req() req, @Body('email') email: string) {
return this.authService.sendVerifyingEmail(email);
}

@ApiOperation({ summary: `회원탈퇴` })
@ApiResponse({
status: 201,
description: `회원탈퇴 성공, response body 없음`,
})
@Post('/signout')
async signout(@Body('id') id: string): Promise<void> {
return this.authService.signout(id);
@UseGuards(JwtAuthGuard)
async signout(@Req() req): Promise<void> {
return this.authService.signout(req.user.id);
}

@Post('/login')
Expand All @@ -61,7 +105,6 @@ export class AuthController {
},
},
})
@UseInterceptors(ClassSerializerInterceptor)
@UseGuards(LocalAuthGuard)
async login(
@Req() req,
Expand All @@ -78,6 +121,43 @@ export class AuthController {
};
}

@ApiOperation({ summary: `이메일 인증번호 인증` })
@ApiBody({
schema: {
properties: {
email: {
type: `string`,
example: `[email protected]`,
},
code: {
type: `number`,
example: `123456`,
},
},
},
})
@ApiCreatedResponse({
schema: {
example: {
message: '이메일 인증에 성공했습니다. 웰컴 투 써티!',
},
},
})
@ApiBadRequestResponse({
schema: {
example: {
message: '인증번호가 일치하지 않거나 만료된 인증번호 입니다.',
},
},
})
@Post('/activate')
activateUser(
@Body('email') email: string,
@Body('code') code: number,
): Promise<{ message: string }> {
return this.authService.activateUser(email, code);
}

@UseGuards(JwtAuthGuard)
@Get('/test')
async test(@Req() req): Promise<any> {
Expand Down
7 changes: 7 additions & 0 deletions src/auth/auth.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ import { LocalStrategy } from './strategies/local.strategy';
import { JwtStrategy } from './strategies/jwt.strategy';

import { ConfigModule, ConfigService } from '@nestjs/config';
import { PushModule } from 'src/push/push.module';
import { MikroOrmModule } from '@mikro-orm/nestjs';
import { AuthCode } from 'src/entities';
import { EmailModule } from 'src/email/email.module';

@Module({
imports: [
forwardRef(() => UserModule),
PassportModule,
ConfigModule,
PushModule,
EmailModule,
JwtModule.registerAsync({
imports: [ConfigModule],
inject: [ConfigService],
Expand All @@ -25,6 +31,7 @@ import { ConfigModule, ConfigService } from '@nestjs/config';
},
}),
}),
MikroOrmModule.forFeature([AuthCode]),
],
providers: [AuthService, LocalStrategy, JwtStrategy],
exports: [AuthService, JwtModule],
Expand Down
Loading