swagger updated
This commit is contained in:
parent
d65df441bb
commit
a82ef35a00
@ -1,9 +1,9 @@
|
||||
import { Body, Controller, Get, Param, ParseIntPipe, Patch, Post, Put, Query, UsePipes } from '@nestjs/common';
|
||||
import { OracleService } from './oracle.service';
|
||||
import { CreateBasicFeeDTO, CreateBondRateDTO, CreateCargoRateDTO, CreateCarnetSequenceDTO, CreateCfFeeDTO, CreateCsFeeDTO, CreateEfFeeDTO, CreateFeeCommDTO, CreateParamRecordDTO, CreateTableRecordDTO, InsertNewServiceProviderDTO, InsertRegionsDto, InsertSPContactsDTO, UpdateBasicFeeDTO, UpdateBondRateDTO, UpdateCargoRateDTO, UpdateCfFeeDTO, UpdateCsFeeDTO, UpdateEfFeeDTO, UpdateFeeCommDTO, UpdateParamRecordDTO, UpdateRegionDto, UpdateServiceProviderDTO, UpdateSPContactsDTO } from './oracle.dto';
|
||||
import { ActivateOrInactivateParamRecordDTO, CreateBasicFeeDTO, CreateBondRateDTO, CreateCargoRateDTO, CreateCarnetSequenceDTO, CreateCfFeeDTO, CreateCsFeeDTO, CreateEfFeeDTO, CreateFeeCommDTO, CreateParamRecordDTO, CreateTableRecordDTO, InsertNewServiceProviderDTO, InsertRegionsDto, InsertSPContactsDTO, UpdateBasicFeeDTO, UpdateBondRateDTO, UpdateCargoRateDTO, UpdateCfFeeDTO, UpdateCsFeeDTO, UpdateEfFeeDTO, UpdateFeeCommDTO, UpdateParamRecordDTO, UpdateRegionDto, UpdateServiceProviderDTO, UpdateSPContactsDTO } from './oracle.dto';
|
||||
import { ParamTableService } from './paramTable.service';
|
||||
import { ManageFeeService } from './manageFee.service';
|
||||
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
import { ApiOperation, ApiPropertyOptional, ApiQuery, ApiTags } from '@nestjs/swagger';
|
||||
|
||||
@Controller('oracle')
|
||||
export class OracleController {
|
||||
@ -173,6 +173,8 @@ export class OracleController {
|
||||
@ApiTags('Param Table - Oracle')
|
||||
@Get('/GetParamValues')
|
||||
@UsePipes()
|
||||
@ApiQuery({ name: 'id', required: false, type: Number, description: 'The ID of the parameter' })
|
||||
@ApiQuery({ name: 'type', required: false, type: String, description: 'The type of the parameter' })
|
||||
getParamValues(
|
||||
@Query('id') id: string,
|
||||
@Query('type') type: string
|
||||
@ -211,16 +213,15 @@ export class OracleController {
|
||||
}
|
||||
|
||||
@ApiTags('Param Table - Oracle')
|
||||
@Patch('/InActivateParamRecord')
|
||||
inActivateParamRecord(@Query('pid') pid,@Query('uid') uid) {
|
||||
return this.paramTableService.INACTIVATEPARAMRECORD(pid?Number(pid):pid,uid)
|
||||
@Put('/InActivateParamRecord')
|
||||
inActivateParamRecord(@Body() body: ActivateOrInactivateParamRecordDTO) {
|
||||
return this.paramTableService.INACTIVATEPARAMRECORD(body)
|
||||
}
|
||||
|
||||
@ApiTags('Param Table - Oracle')
|
||||
@Patch('/ReActivateParamRecord')
|
||||
@ApiOperation({ summary: 'Retrieve all users', description: 'This endpoint returns a list of all users.' })
|
||||
reActivateParamRecord(@Query('pid') pid,@Query('uid') uid) {
|
||||
return this.paramTableService.REACTIVATEPARAMRECORD(pid?Number(pid):pid,uid)
|
||||
@Put('/ReActivateParamRecord')
|
||||
reActivateParamRecord(@Body() body: ActivateOrInactivateParamRecordDTO) {
|
||||
return this.paramTableService.REACTIVATEPARAMRECORD(body)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -698,4 +698,15 @@ export class UpdateFeeCommDTO {
|
||||
@ApiProperty({ required: true })
|
||||
@IsString()
|
||||
P_USERID: string;
|
||||
}
|
||||
|
||||
export class ActivateOrInactivateParamRecordDTO{
|
||||
|
||||
@ApiProperty({required:true})
|
||||
@IsNumber()
|
||||
P_PARAMID:number;
|
||||
|
||||
@ApiProperty({required:true})
|
||||
@IsString()
|
||||
P_USERID:string;
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { OracleDBService } from 'src/db/db.service';
|
||||
import * as oracledb from 'oracledb'
|
||||
import { UpdateParamRecordDTO } from './oracle.dto';
|
||||
import { ActivateOrInactivateParamRecordDTO, UpdateParamRecordDTO } from './oracle.dto';
|
||||
|
||||
@Injectable()
|
||||
export class ParamTableService {
|
||||
@ -301,7 +301,7 @@ export class ParamTableService {
|
||||
} finally { }
|
||||
}
|
||||
|
||||
async INACTIVATEPARAMRECORD(P_PARAMID: number, P_USERID: string) {
|
||||
async INACTIVATEPARAMRECORD(body:ActivateOrInactivateParamRecordDTO) {
|
||||
let connection;
|
||||
try {
|
||||
// Connect to the Oracle database using oracledb
|
||||
@ -318,11 +318,11 @@ export class ParamTableService {
|
||||
END;`,
|
||||
{
|
||||
P_PARAMID: {
|
||||
val: P_PARAMID,
|
||||
val: body.P_PARAMID,
|
||||
type: oracledb.DB_TYPE_NUMBER
|
||||
},
|
||||
P_USERID: {
|
||||
val: P_USERID,
|
||||
val: body.P_USERID,
|
||||
type: oracledb.DB_TYPE_VARCHAR
|
||||
},
|
||||
}
|
||||
@ -338,7 +338,7 @@ export class ParamTableService {
|
||||
} finally { }
|
||||
}
|
||||
|
||||
async REACTIVATEPARAMRECORD(P_PARAMID: number, P_USERID: string) {
|
||||
async REACTIVATEPARAMRECORD(body:ActivateOrInactivateParamRecordDTO) {
|
||||
let connection;
|
||||
try {
|
||||
// Connect to the Oracle database using oracledb
|
||||
@ -355,11 +355,11 @@ export class ParamTableService {
|
||||
END;`,
|
||||
{
|
||||
P_PARAMID: {
|
||||
val: P_PARAMID,
|
||||
val: body.P_PARAMID,
|
||||
type: oracledb.DB_TYPE_NUMBER
|
||||
},
|
||||
P_USERID: {
|
||||
val: P_USERID,
|
||||
val: body.P_USERID,
|
||||
type: oracledb.DB_TYPE_VARCHAR
|
||||
},
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user