Initial commit: NestJS backend for Child Gold Land

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-02 08:08:11 +02:00
co-authored by Cursor
commit edb79180a1
93 changed files with 11565 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
import { Body, Controller, HttpCode, Inject, Post, forwardRef } from '@nestjs/common'
import { Public } from '../common/decorators/public.decorator'
import { strictBodyPipe } from '../common/pipes/strict-body.pipe'
import { AuthService } from './auth.service'
import { LoginDto } from './dto/login.dto'
import { RegisterDto } from './dto/register.dto'
@Controller('api/auth')
export class AuthController {
constructor(@Inject(forwardRef(() => AuthService)) private readonly auth: AuthService) {}
@Public()
@HttpCode(200)
@Post('register')
register(@Body(strictBodyPipe(RegisterDto)) dto: RegisterDto) {
return this.auth.register(dto.username, dto.password, dto.name)
}
@Public()
@HttpCode(200)
@Post('login')
login(@Body(strictBodyPipe(LoginDto)) dto: LoginDto) {
return this.auth.login(dto.username, dto.password)
}
}