feat: first commit

This commit is contained in:
eleanor.mao
2025-03-31 22:34:22 +08:00
commit d25187c9c8
390 changed files with 57031 additions and 0 deletions

10
src/types/common.ts Normal file
View File

@ -0,0 +1,10 @@
export interface IPaginationRequest {
page?: number; // 页码,默认值为 1
pageSize?: number; //每页的数量,默认值为 10
}
export interface IPaginationResponse {
page: number; // 当前页码
pageSize: number; // 每页的数量
hasMore: boolean; // 是否有更多数据
}

15
src/types/company.ts Normal file
View File

@ -0,0 +1,15 @@
export interface ICertificationRequest {
name: string;
// code: string;
phone: string;
idCardNo: string;
companyName: string;
idCardSideAUrl?: string;
idCardSideBUrl?: string;
}
export interface ICertificationResponse {
userId: string;
authSuc: string; // 认证是否成功
msg: string; // 认证失败详细原因authSuc为false时才有值
}

51
src/types/group.ts Normal file
View File

@ -0,0 +1,51 @@
import { GroupStatus, GroupType } from '@/constants/group';
import { IPaginationRequest, IPaginationResponse } from '@/types/common';
export interface GroupInfo {
// 播络群 id
blGroupId: string;
// 群标题
imGroupNick: string;
// 通告数量
allJobs: number;
// 今日通告数量
todayUpdates: number;
// 群头像
groupAvatar: string;
groupType: GroupType;
// 人数
groupMemberCount?: number;
}
export interface GroupDetail extends GroupInfo {
// 机器人 id
robotId: string;
}
export interface BatchPublishGroup {
cityCode: string;
count: number;
}
export interface SimpleGroupInfo extends Pick<GroupInfo, 'blGroupId' | 'imGroupNick'> {
groupId: string;
}
// 后台接口还没做分页,这里前端先提前做好
export interface GetGroupsRequest extends IPaginationRequest {
type: GroupType;
imGroupNick?: string;
// 0allGroups 返回所有的1allGroups 返回已经申请的
status?: GroupStatus;
}
export interface GetGroupsResponse extends IPaginationResponse {
myCreatedGroups: GroupInfo[];
myJoinedGroups: GroupInfo[];
allGroups: GroupInfo[];
myFollowedGroups: GroupInfo[];
}
export interface GetGroupDetailsRequest {
blGroupId: string;
}

153
src/types/job.ts Normal file
View File

@ -0,0 +1,153 @@
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[]; // 通告列表
}

22
src/types/location.ts Normal file
View File

@ -0,0 +1,22 @@
export interface Coordinate {
latitude: number; // 纬度,浮点数,范围为-90~90负数表示南纬
longitude: number; // 经度,范围为-180~180负数表示西经
}
// 地区代码参考https://github.com/youzan/vant/blob/main/packages/vant-area-data/src/index.ts
export interface LocationInfo extends Coordinate {
id?: string; // 城市id,数据id 后端用来关联数据,没有业务意义
provinceCode: string; // provinceCode ,省代码, 比如广东省=440000
provinceDesc?: string; // 省中文描述,比如广东省
cityCode: string; // 城市代码,比如广州市=440100
cityDesc?: string; // 城市中文描述,比如广州市
countyCode?: string; // 区代码,比如白云区=440111
countyDes?: string; // 区描述,比如白云区
address?: string; // 详细地址,比如广东省广州市白云区 xxx 路 xxx 号
}
// 请求接口
export interface GetCityCodeRequest {
latitude: number; // 纬度,浮点数,范围为-90~90负数表示南纬
longitude: number; // 经度,范围为-180~180负数表示西经
}

10
src/types/login.ts Normal file
View File

@ -0,0 +1,10 @@
// 微信小程序用户登录请求接口
export interface LoginRequest {
code: string; // 微信登录凭证code
}
// 微信小程序用户登录响应接口
export interface LoginResponse {
token: string; // 服务器返回的 JWT token
expires: number; // token 有效期,单位为毫秒
}

134
src/types/material.ts Normal file
View File

@ -0,0 +1,134 @@
import { EmployType } from '@/constants/job';
import { AnchorReadType, AnchorSortType, GenderType, ProfileCreateSource, WorkedYears } from '@/constants/material';
import { IPaginationRequest, IPaginationResponse } from '@/types/common';
export interface MaterialVideoInfo {
url: string;
coverUrl: string;
type: 'image' | 'video';
title: string;
isDefault: boolean;
}
export interface MaterialProfile {
materialVideoInfoList: MaterialVideoInfo[];
// 基础信息
id: string;
userId: string;
name: string;
age: number;
height: number; // cm
weight: number; // kg
gender: GenderType;
shoeSize: number; // 鞋码
// 求职意向
employType: EmployType; // 工作类型
fullTimeMinPrice: number; // 全职期望薪资下限
fullTimeMaxPrice: number; // 全职期望薪资上限
partyTimeMinPrice: number; // 兼职期望薪资下限
partyTimeMaxPrice: number; // 兼职期望薪资上限
cityCodes: string; // 城市。多个城市用 、分割,如 '110100、141100'
acceptWorkForSit: boolean; // 是否接受坐班
// 直播经验
workedYear: WorkedYears; // 工作年限单位年无为0、半年 0.5、1、2、3、4、5年及以上用100表示默认为1年
workedAccounts: string; // 直播过的账号
newAccountExperience: number; // 是否有起号经验0无 1有
workedCategory: string; // 直播过的品类
workedSecCategoryStr: string; // 直播过的二级品类
style: string; // 风格。多个分割用 、分割
maxGmv: number; // 最高 GMV单位 w
maxOnline: number; // 最高在线人数
// 自身优势
advantages: string;
// 其他
approveStatus: boolean; // 审核状态0 待审 1 成功 2 不通过
isOpen: boolean; // 是否开放 1开放 0不开放
userOpen: boolean;
adminOpen: boolean;
createType: ProfileCreateSource;
creator: string; // 创建人id
progressBar: number; // 进度百分比
filledItems: number; // 已填资料项数
created: number; // 时间戳
updated: number; // 时间戳
}
export interface AnchorInfo {
// 基础信息
materialVideoInfoList: MaterialVideoInfo[];
id: string;
userId: string;
cover: string;
name: string;
age: number;
height: number;
weight: number;
gender: GenderType;
shoeSize: number;
employType: EmployType;
fullTimeMinPrice: number;
fullTimeMaxPrice: number;
partyTimeMinPrice: number;
partyTimeMaxPrice: number;
cityCodes: string;
workedYear: WorkedYears;
workedCategory: string;
workedSecCategoryStr: string;
distance: number;
isRead: boolean;
lastOnlineTime: number;
updated: number;
created: number;
sortTime: number;
}
export interface GetVideoInfoRequest {
sourcePath: string;
type: 'VIDEO' | 'IMAGE';
}
export interface UploadVideoResult {
id: string;
url: string; // 视频地址
coverUrl: string; // 封面地址
}
export interface IAnchorFilters {
gender?: GenderType;
employType?: EmployType;
lowPriceForFullTime?: number;
highPriceForFullTime?: number;
lowPriceForPartyTime?: number;
highPriceForPartyTime?: number;
category?: string;
readType?: AnchorReadType;
}
export interface GetAnchorListRequest extends IAnchorFilters, IPaginationRequest {
// sortId?: string; // 排序 id首次调用不传分页时传上一页的最后记录的id
jobId?: string;
cityCode?: string;
sortType?: AnchorSortType; // 排序规则
latitude?: number; // 纬度,浮点数,范围为-90~90负数表示南纬
longitude?: number; // 经度,范围为-180~180负数表示西经
}
export interface GetAnchorListResponse extends IPaginationResponse {
data: AnchorInfo[];
}
export interface GetReadProfileRequest {
resumeId: string;
jobId?: string;
}
export interface GetShareProfileRequest {
shareCode: string;
resumeId: string;
}
export interface UpdateProfileStatusRequest {
resumeId: string;
userId: string;
userOpen: boolean;
}

119
src/types/message.ts Normal file
View File

@ -0,0 +1,119 @@
import { ChatWatchType, MessageActionStatus, MessageType } from '@/constants/message';
import { JobDetails } from '@/types/job';
import { AnchorInfo } from '@/types/material';
import { UserInfo } from '@/types/user';
export interface UserMessage {
count: number;
}
export interface MainMessage {
chatId: string;
toUserId: string;
toUserName: string;
toUserAvatarUrl: string;
lastContactMsgContent: string;
unReadMsgCount: number;
lastContactTime: number;
}
export interface IJobMessage
extends Pick<
JobDetails,
| 'id'
| 'title'
| 'employType'
| 'salary'
| 'lowPriceForFullTime'
| 'highPriceForFullTime'
| 'lowPriceForPartyTime'
| 'highPriceForPartyTime'
> {}
export interface IMaterialMessage
extends Pick<
AnchorInfo,
'id' | 'name' | 'age' | 'height' | 'weight' | 'gender' | 'shoeSize' | 'workedSecCategoryStr'
> {}
export interface ILocationMessage {
name: string;
address: string;
latitude: number;
longitude: number;
}
export interface IChatUser extends Pick<UserInfo, 'userId' | 'nickName'> {}
export interface IChatMessage {
msgId: string;
type: MessageType;
content: string;
actionId: string;
actionObject: string;
senderUserId: string;
senderName: string;
senderAvatarUrl: string;
receiverUserId: string;
receiverName: string;
receiverAvatarUrl: string;
timestamp: number;
jobId: string;
isRead: boolean;
}
export interface IChatInfo {
chatId: string;
participants: IChatUser[];
lastContactTime: number;
lastContactContent: string;
unReadCount: number;
messages: IChatMessage[];
lastJobId: string;
}
export interface IMessageStatus {
msgId: string;
isRead: boolean;
}
export interface IChatActionDetail {
id: string;
chatId: string;
status: MessageActionStatus;
type: MessageType;
bizId: string;
created: string;
}
export interface PostMessageRequest {
chatId: string;
type: MessageType;
bizId: string;
content?: string;
actionObject?: string;
}
export interface PostConfirmActionRequest {
actionId: string;
status: boolean;
}
export interface PostActionDetailRequest {
type: MessageType;
bizId: string;
toUserId: string;
}
export interface GetNewChatMessagesRequest {
chatId: string;
// 上次接口调用返回的最新的msgId Message.msgId字段
lastMsgId?: string;
}
export interface ChatWatchRequest {
type: ChatWatchType;
status: boolean;
jobId: string;
toUserId: string;
}

108
src/types/product.ts Normal file
View File

@ -0,0 +1,108 @@
import { DeclarationType, OrderStatus, OrderType, ProductSpecId, ProductType } from '@/constants/product';
export interface DeclarationTypeResult {
type: DeclarationType;
publisher: string;
publisherAcctNo: string;
addGroupQrCode: string;
}
export interface ProductInfo {
productCode: ProductType;
productId: ProductType;
balance: number;
created: number;
updated: number;
// 报单类型信息,只有 use 接口返回值才有
declarationTypeResult?: DeclarationTypeResult;
}
export interface CustomerServiceInfo {
id: string;
robotId: string;
robotImNick: string;
robotImNo: string;
avatar: string;
vxQrCode: string;
}
export interface GetProductListRequest {
userId: string;
}
export interface GetProductDetailRequest {
userId: string;
productCode: ProductType;
}
export interface GetProductIsUnlockRequest {
userId: string;
productCode: ProductType;
// 通告id, productCode为 GETJOB 时必传
jobId?: string;
// 群id, productCode为 ADD_GROUP 时必传
blGroupId?: string;
}
export interface GetProductIsUnlockResponse {
userId: string;
jobId: string;
productId: string;
useDate: string;
useTime: string;
declarationTypeResult?: DeclarationTypeResult;
}
export interface PostUseProductRequest {
userId: string;
productCode: ProductType;
// 通告id, productCode为 GETJOB 时必传
jobId?: string;
// 群id, productCode为 ADD_GROUP 时必传
blGroupId?: string;
}
export interface CreatePayOrderParams {
appId: string;
timeStamp: string;
signType: 'MD5' | 'RSA' | 'HMAC-SHA256';
nonceStr: string;
packageVal: string;
paySign: string;
}
export interface OrderInfo {
payOrderNo: string;
// 支付订单状态0 待支付1 已支付2 已退款,3 已取消
status: OrderStatus;
payTime?: string;
finishPayTime?: string;
}
export interface CreatePayInfoRequest {
type: OrderType;
userId: string;
productCode: ProductType;
productSpecId: ProductSpecId;
/**
* 业务id比如jobId,groupId
* 当type为1时必须要传groupId
*/
bizId?: string;
// 应付金额,单位是分
amt: number;
// 支付渠道1 微信支付
payChannel: number;
// 支付类型1 小程序支付
payType: number;
mark?: string;
}
export interface CreatePayInfoResponse extends OrderInfo {
createPayInfo: string; // CreatePayInfo stringify 后的结果
}
export interface GetOrderInfoRequest {
payOrderNo: string;
userId: string;
}

17
src/types/store.ts Normal file
View File

@ -0,0 +1,17 @@
import { RoleType, PageType } from '@/constants/app';
import { UserMessage } from '@/types/message';
import { LocationInfo } from './location';
import { UserInfo } from './user';
export interface IState {
appState: AppState;
userInfo: UserInfo;
message: UserMessage;
}
export interface AppState {
roleType: RoleType;
homePageType: PageType;
location: LocationInfo;
}

56
src/types/user.ts Normal file
View File

@ -0,0 +1,56 @@
import { RoleType } from '@/constants/app';
import { CertificationStatusType } from '@/constants/company';
// 用户信息
export interface UserInfo {
userId: string; // 用户唯一标识
nickName: string; // 用户昵称
avatarUrl: string; // 用户头像
isDefaultAvatar: boolean; // 是不是默认头像
isDefaultNickname: boolean; // 是不是默认昵称
isBindPhone?: boolean; // 是否绑定手机号
phone: string;
created?: string;
updated?: string;
isBoss?: boolean; // 是否通告主
userBoss?: {
level: string;
expireTime: string;
isExpire: boolean;
};
isCreateResume?: boolean;
imAcctNo?: string;
bossAuthStatus?: CertificationStatusType;
existAvailableJob?: boolean;
/**
* 当前身份类型
* 1 普通用户
* 2 企业用户
*/
roleType: RoleType;
}
export interface SetPhoneRequest {
encryptedData: string;
iv: string;
}
export interface UpdateUserInfoRequest {
userId: string;
avatarUrl?: string; // 新头像的 URL
nickName?: string; // 新昵称
imAcctNo?: string;
}
export interface UpdateUserInfoResponse {
userId: string;
avatarUrl?: string; // 新头像的 URL
nickName?: string; // 新昵称
imAcctNo?: string;
}
// 关注群接口请求参数
export interface FollowGroupRequest {
userId: string;
blGroupId: string; // 必选要关注的群ID
}