import { ContractInfo } from "../model/contract-info.model"; import { ContractInfoSearchParam } from "../search/contract-info-search-param.model"; import { ContractInfoDto } from "../DTO/contract-info-dto.model"; import { ContractInfoDtoSearchParam } from "../search/contract-info-dto-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 ContractInfoService { static PATH = '/contractInfo'; constructor(private httpHandler: HttpHandler) {} createContractInfo(contractInfo: ContractInfo,user: User, header?: any): Promise { return this.httpHandler.post(`${HostConfig.DEV_HOST}${ContractInfoService.PATH}/create` ,contractInfo, header); } updateContractInfo(contractInfo: ContractInfo, header?: any): Promise { return this.httpHandler.post(`${HostConfig.DEV_HOST}${ContractInfoService.PATH}/update` ,contractInfo, header); } searchContractInfo(contractInfoSearchParam: ContractInfoSearchParam,page: number,size: number, header?: any): Promise> { return this.httpHandler.post>(`${HostConfig.DEV_HOST}${ContractInfoService.PATH}/search?page=${page}&size=${size}` ,contractInfoSearchParam, header); } findByOrgId(orgId: number, header?: any): Promise> { return this.httpHandler.get>(`${HostConfig.DEV_HOST}${ContractInfoService.PATH}/findByOrgId/${orgId}`, header); } findById(id: number, header?: any): Promise { return this.httpHandler.get(`${HostConfig.DEV_HOST}${ContractInfoService.PATH}/findById/${id}`, header); } searchContractInfoDTO(contractInfoSearchParam: ContractInfoDtoSearchParam,page: number,size: number,user: User, header?: any): Promise> { return this.httpHandler.post>(`${HostConfig.DEV_HOST}${ContractInfoService.PATH}/searchDTO?page=${page}&size=${size}` ,contractInfoSearchParam, header); } findDTOByOrgId(orgId: number, header?: any): Promise> { return this.httpHandler.get>(`${HostConfig.DEV_HOST}${ContractInfoService.PATH}/findDTOByOrgId/${orgId}`, header); } findDTOById(id: number, header?: any): Promise { return this.httpHandler.get(`${HostConfig.DEV_HOST}${ContractInfoService.PATH}/findDTOById/${id}`, header); } }