import { OrgRiskSource } from "../model/org-risk-source.model"; import { OrgRiskSourceSearchParam } from "../search/org-risk-source-search-param.model"; import { HostConfig } from '../config/host.config'; import { Injectable } from '@angular/core'; import { HttpHandler } from './http-handler.service'; import { Page } from '../response/page.type'; @Injectable({ providedIn: 'root', }) export class OrgRiskSourceService { static PATH = '/orgRiskSource'; constructor(private httpHandler: HttpHandler) {} createOrgRiskSource(orgRiskSource: OrgRiskSource, header?: any): Promise { return this.httpHandler.post(`${HostConfig.DEV_HOST}${OrgRiskSourceService.PATH}/create` ,orgRiskSource, header); } updateOrgRiskSource(orgRiskSource: OrgRiskSource, header?: any): Promise { return this.httpHandler.post(`${HostConfig.DEV_HOST}${OrgRiskSourceService.PATH}/update` ,orgRiskSource, header); } searchOrgRiskSource(orgRiskSourceSearchParam: OrgRiskSourceSearchParam,page: number,size: number, header?: any): Promise> { return this.httpHandler.post>(`${HostConfig.DEV_HOST}${OrgRiskSourceService.PATH}/search?page=${page}&size=${size}` ,orgRiskSourceSearchParam, header); } findByOrgId(orgId: number, header?: any): Promise> { return this.httpHandler.get>(`${HostConfig.DEV_HOST}${OrgRiskSourceService.PATH}/findByOrgId/${orgId}`, header); } findById(id: number, header?: any): Promise { return this.httpHandler.get(`${HostConfig.DEV_HOST}${OrgRiskSourceService.PATH}/findById/${id}`, header); } removeById(id: number, header?: any): Promise { return this.httpHandler.delete(`${HostConfig.DEV_HOST}${OrgRiskSourceService.PATH}/remove/${id}`, header); } removeByOrgId(orgId: number, header?: any): Promise { return this.httpHandler.delete(`${HostConfig.DEV_HOST}${OrgRiskSourceService.PATH}/removeByOrgId/${orgId}`, header); } }