feat: add job fair position functionality with detailed card display and data fetching
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
This commit is contained in:
@@ -95,6 +95,40 @@ export interface PortalJobFairDetailResult {
|
||||
data?: PortalJobFairItem;
|
||||
}
|
||||
|
||||
/** 招聘会关联岗位;由公共接口中的企业岗位列表展平得到。 */
|
||||
export interface PortalJobFairPosition {
|
||||
jobId?: number | string;
|
||||
fairRelationId?: string;
|
||||
jobTitle?: string;
|
||||
minSalary?: number;
|
||||
maxSalary?: number;
|
||||
education?: string;
|
||||
experience?: string;
|
||||
companyId?: number | string;
|
||||
companyName?: string;
|
||||
jobLocation?: string;
|
||||
jobAddress?: string;
|
||||
vacancies?: number | string;
|
||||
}
|
||||
|
||||
interface PortalJobFairCompanyWithJobs {
|
||||
companyId?: number | string;
|
||||
companyName?: string;
|
||||
jobInfoList?: PortalJobFairPosition[];
|
||||
}
|
||||
|
||||
interface PortalJobFairCompaniesWithJobsResult {
|
||||
code: number;
|
||||
msg?: string;
|
||||
data?: PortalJobFairCompanyWithJobs[];
|
||||
}
|
||||
|
||||
export interface PortalJobFairPositionResult {
|
||||
code: number;
|
||||
msg?: string;
|
||||
data?: PortalJobFairPosition[];
|
||||
}
|
||||
|
||||
const FAIR_API = {
|
||||
online: '/app/jobfair/public/jobfair',
|
||||
outdoor: '/app/outdoor-fair',
|
||||
@@ -172,3 +206,26 @@ export async function getPortalJobFairDetail(channel: JobFairChannel, jobFairId:
|
||||
},
|
||||
} as PortalJobFairDetailResult;
|
||||
}
|
||||
|
||||
/** 获取线上招聘会的关联岗位,并将企业分组数据转换为岗位卡片数据。 */
|
||||
export async function getPortalJobFairPositions(jobFairId: string) {
|
||||
const response = await request<PortalJobFairCompaniesWithJobsResult>(
|
||||
`${FAIR_API.online}/enterprises-with-jobs-by-job-fair-id`,
|
||||
{
|
||||
method: 'GET',
|
||||
params: { jobFairId },
|
||||
},
|
||||
);
|
||||
|
||||
return {
|
||||
code: response.code,
|
||||
msg: response.msg,
|
||||
data: (response.data || []).flatMap((company) =>
|
||||
(company.jobInfoList || []).map((position) => ({
|
||||
...position,
|
||||
companyId: position.companyId || company.companyId,
|
||||
companyName: position.companyName || company.companyName,
|
||||
})),
|
||||
),
|
||||
} as PortalJobFairPositionResult;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user