all three types of API done

This commit is contained in:
Kallesh B S 2025-02-27 16:10:01 +05:30
parent 0b5859ed74
commit 2012144f62
2 changed files with 32 additions and 22 deletions

View File

@ -36,12 +36,7 @@ GET http://localhost:3000/oracle/GetAllServiceproviders
//GetSelectedServiceprovider //GetSelectedServiceprovider
GET http://localhost:3000/oracle/GetSelectedServiceprovider GET http://localhost:3000/oracle/GetSelectedServiceprovider/12
Content-Type: application/json
{
"p_spid":12
}
### ###
@ -96,17 +91,14 @@ Content-Type: application/json
//GetSPcontacts //GetSPcontacts
GET http://localhost:3000/oracle/GetSPcontacts GET http://localhost:3000/oracle/GetSPcontacts/12
Content-Type: application/json
{
"p_SPid":12
}
### ###
//GetSPDefaultcontact //GetSPDefaultcontact
GET http://localhost:3000/oracle/GetSPDefaultcontact/12
### ###
//InsertSPContacts //InsertSPContacts
@ -149,12 +141,13 @@ Content-Type: application/json
//SetSPDefaultcontact //SetSPDefaultcontact
POST http://localhost:3000/oracle/SetSPDefaultcontact/12
### ###
//InactivateSPContact //InactivateSPContact
POST http://localhost:3000/oracle/InactivateSPContact/12
### ###

View File

@ -1,4 +1,4 @@
import { Body, Controller, Get, Patch, Post, Put } from '@nestjs/common'; import { Body, Controller, Get, Param, ParseIntPipe, Patch, Post, Put } from '@nestjs/common';
import { OracleService } from './oracle.service'; import { OracleService } from './oracle.service';
import { GetSelectedServiceProviderDTO, GetSPcontactsDTO, InsertNewServiceProviderDTO, InsertRegionsDto, InsertSPContactsDTO, UpdateRegionDto, UpdateServiceProviderDTO, UpdateSPContactsDTO } from './oracle.dto'; import { GetSelectedServiceProviderDTO, GetSPcontactsDTO, InsertNewServiceProviderDTO, InsertRegionsDto, InsertSPContactsDTO, UpdateRegionDto, UpdateServiceProviderDTO, UpdateSPContactsDTO } from './oracle.dto';
@ -26,9 +26,9 @@ export class OracleController {
return this.oarcleService.getAllServiceproviders(); return this.oarcleService.getAllServiceproviders();
} }
@Get('/GetSelectedServiceprovider') @Get('/GetSelectedServiceprovider/:id')
getSelectedServiceprovider(@Body() body: GetSelectedServiceProviderDTO) { getSelectedServiceprovider(@Param('id', ParseIntPipe) id:number) {
return this.oarcleService.getSelectedServiceprovider(body.p_spid); return this.oarcleService.getSelectedServiceprovider(id);
} }
@Post('/InsertNewServiceProvider') @Post('/InsertNewServiceProvider')
@ -72,12 +72,17 @@ export class OracleController {
) )
} }
@Get('/GetSPcontacts') @Get('/GetSPcontacts/:id')
getSPcontacts(@Body() body: GetSPcontactsDTO) { getSPcontacts(@Param('id', ParseIntPipe) id:number) {
return this.oarcleService.getSPcontacts(body.p_SPid); return this.oarcleService.getSPcontacts(id);
} }
@Post('InsertSPContacts') @Get('/GetSPDefaultcontact/:id')
getSPDefaultcontact(@Param('id', ParseIntPipe) id:number){
return this.oarcleService.getSPDefaultcontact(id)
}
@Post('/InsertSPContacts')
insertSPContacts(@Body() body: InsertSPContactsDTO){ insertSPContacts(@Body() body: InsertSPContactsDTO){
return this.oarcleService.insertSPContacts( return this.oarcleService.insertSPContacts(
body.p_spid, body.p_spid,
@ -92,7 +97,7 @@ export class OracleController {
) )
} }
@Put('UpdateSPContacts') @Put('/UpdateSPContacts')
updateSPContacts(@Body() body: UpdateSPContactsDTO){ updateSPContacts(@Body() body: UpdateSPContactsDTO){
return this.oarcleService.updateSPContacts( return this.oarcleService.updateSPContacts(
body.p_spcontactid, body.p_spcontactid,
@ -106,4 +111,16 @@ export class OracleController {
body.p_user_id body.p_user_id
) )
} }
@Post('/SetSPDefaultcontact/:id')
setSPDefaultcontact(@Param('id', ParseIntPipe) id:number){
return this.oarcleService.setSPDefaultcontact(id)
}
@Post('/InactivateSPContact/:id')
inactivateSPContact(@Param('id', ParseIntPipe) id:number){
return this.oarcleService.inactivateSPContact(id)
}
} }