Files
boluo-app-main/src/types/job.ts
2025-03-31 22:34:22 +08:00

154 lines
4.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { JobType, EmployType, SortType, UserJobType, JobManageStatus } from '@/constants/job';
import { DeclarationType } from '@/constants/product';
import type { IPaginationRequest, IPaginationResponse } from '@/types/common';
import { LocationInfo } from '@/types/location';
export interface JobInfo {
id: string; // 通告ID
title: string; // 通告标题
tags: string[]; // 关键字
employType: EmployType; // 工作类型 (全职/兼职/不限)
salary: string; // 工资
jobDescription: string; // 简述
publisher: string; // 发布者
publisherAvatar: string; // 发布者头像
sourceText?: string; // 详细描述(原始信息)
jobLocation: LocationInfo; // 地址信息
distance?: number; // 距离。一期没有
isAuthed?: boolean; // 是否认证
companyName?: string;
}
export interface CreateJobInfo extends Pick<JobInfo, 'title' | 'employType' | 'jobDescription'> {
category: JobType;
provinceCode: string;
cityCode: string;
countyCode: string;
address: string;
lowPriceForFullTime: number;
highPriceForFullTime: number;
lowPriceForPartyTime: number;
highPriceForPartyTime: number;
tags?: string[];
responsibilities?: string;
jobId?: string;
}
// 通告详细信息接口
export type JobDetails = JobInfo &
CreateJobInfo & {
imGroupId: string; // 来源于哪个群ID
imGroupNick: string; // 群名称
blGroupId: string; // 内部群 Id
isGroupMember: string; // 是否是群成员
isFollow: boolean; // 用户是否关注该群
sourceText: string; // 详细描述(原始信息)
created: number; // 更新时间
updated: number; // 更新时间
relateGroupCount?: number; // 关联群数量
declarationType: DeclarationType; // 报单类型
userId: string; // 发布人的 userId
verifyFailReason?: string; // 审核不通过的原因
};
export interface JobManageInfo {
id: string;
title: string;
jobLocation: string;
provinceCode: string;
cityCode: string;
countyCode: string;
status: JobManageStatus;
created: number;
updated: number;
}
// 获取通告分类响应接口
export interface GetJobTypesResponse {
types: JobType[]; // 通告分类列表
}
// 获取通告列表请求接口
export interface GetJobsRequest extends IPaginationRequest {
category?: JobType; // 可选参数,通告类型,默认为全部类型
cityCode?: string; // 可选参数,城市代码
isFollow?: boolean; // 可选参数,是否查询用户关注的通告
isOwner?: boolean; // 可选参数,是否查询用户创建的通告
employType?: EmployType; // 可选,兼职/全职,默认 both
keyWord?: string; // 可选参数,关键字搜索
sortType?: SortType; // 排序规则
latitude?: number; // 纬度,浮点数,范围为-90~90负数表示南纬
longitude?: number; // 经度,范围为-180~180负数表示西经
minSalary?: number;
maxSalary?: number;
blGroupId?: string; // 播络群 id
}
// 获取通告列表响应接口
export interface GetJobsResponse extends IPaginationResponse {
jobResults: JobInfo[]; // 通告列表
}
// 获取通告详情请求接口
export interface GetJobsDetailsRequest {
jobId: string; // 通告ID
latitude?: number; // 用户当前位置的纬度,浮点数,范围为-90~90负数表示南纬。一期没有
longitude?: number; // 用户当前位置的经度,范围为-180~180负数表示西经。一期没有
}
export interface SalaryRange {
minSalary: number;
maxSalary: number;
}
export interface MyBrowsedJobInfo extends JobInfo {
browseId: string;
browDate: string;
browTime: string;
}
export interface MyDeclaredJobInfo extends JobInfo {
declaredId: string;
/**
* 报单类型
* 0 用户自行报单获取微信号
* 1 用户联系客服
*/
type: number;
// 解锁时间 yyyy-MM-dd
useDate: string;
// 报单时间
declarationDate: string;
// 报单处理状态
declaredStatus: number;
// 报单处理时间
declaredDate: string;
// 备注
declaredMark?: string;
}
export interface GetUserJobRequest extends IPaginationRequest {
type: UserJobType; // 类型0 为我的报单记录, 1 为我的通告浏览记录
keyWord?: string; // 可选参数,关键字搜索
}
export interface GetUserJobResponse<T extends JobInfo> {
page: number; // 当前页码
pageSize: number; // 每页的通告数量
hasMore: boolean; // 是否有更多数据
data: {
[key in string]: T[]; // key 为日期, value 为通告列表
};
dataMap: Map<string, T[]>; // 前端获取到接口数据后将 data 转成 Map 结构
}
export interface GetMyRecommendJobRequest extends IPaginationRequest {}
export interface GetJobManagesRequest extends IPaginationRequest {
status?: JobManageStatus;
}
export interface GetJobManagesResponse extends IPaginationResponse {
jobResults: JobManageInfo[]; // 通告列表
}