src/outbound/auth-api/auth-api.controller.ts
/realm
Methods |
getRealms |
getRealms()
|
Decorators :
@Get('')
|
Returns :
any
|
postRealms | ||||||
postRealms(body: RealmDto)
|
||||||
Decorators :
@Post()
|
||||||
Parameters :
Returns :
any
|
putRealm | |||||||||
putRealm(realmName: string, body: RealmEnabledDto)
|
|||||||||
Decorators :
@Put('enabled/:realmName')
|
|||||||||
Parameters :
Returns :
any
|
import {
Body,
Controller,
Get,
HttpStatus,
Param,
Post,
Put,
Req,
} from '@nestjs/common';
import { ApiResponse, ApiTags } from '@nestjs/swagger';
import { AuthApiService } from './auth-api.service';
import { RealmDto, RealmEnabledDto } from './dto/realm.dto';
@ApiTags('realm')
@Controller('/realm')
export class AuthApiController {
constructor(private readonly authApiService: AuthApiService) {}
@Post()
@ApiResponse({ status: HttpStatus.OK })
postRealms(@Body() body: RealmDto) {
return this.authApiService.postRealms(body);
}
@Get('')
@ApiResponse({ status: HttpStatus.OK })
getRealms() {
return this.authApiService.getRealms();
}
@Put('enabled/:realmName')
@ApiResponse({ status: HttpStatus.OK })
putRealm(
@Param(':realmName') realmName: string,
@Body() body: RealmEnabledDto,
) {
return this.authApiService.putRealm(realmName, body);
}
}