Skip to content

Commit

Permalink
feat: 好友状态过滤
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocyss committed Jul 18, 2024
1 parent c8bbc2b commit 4dd09ee
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/hooks/useApplying/handles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
ActivityError,
GreetError,
GoldHunterError,
FriendStatusError,
} from "@/types/deliverError";

import { useStore } from "../useStore";
Expand Down Expand Up @@ -157,6 +158,14 @@ export const jobContent: handleCFn = (h) =>
throw new JobDescriptionError(e.message);
}
});

export const jobFriendStatus: handleCFn = (h) =>
h.push(async (_, { card }) => {
const content = card?.friendStatus;
if (content && content != 0) {
throw new FriendStatusError("已经是好友了");
}
});
export const aiFiltering: handleCFn = (h) => {
const model = modelData.value.find(
(v) => formData.aiFiltering.model === v.key
Expand Down
6 changes: 4 additions & 2 deletions src/hooks/useApplying/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ export function createHandle(): {
if (formData.companySizeRange.enable) h.companySizeRange(handles);
// 猎头过滤
if (formData.goldHunterFilter.value) h.goldHunterFilter(handles);
// 好友状态过滤
if (formData.friendStatus.value) h.jobFriendStatus(handlesRes);
// 工作内容筛选
if (formData.jobContent.enable) h.jobContent(handlesRes);
// AI过滤
if (formData.aiFiltering.enable) h.aiFiltering(handlesRes);
// 活跃度过滤
if (formData.activityFilter.value) h.activityFilter(handlesRes);
// AI过滤
if (formData.aiFiltering.enable) h.aiFiltering(handlesRes);
// 自定义招呼语
if (formData.customGreeting.enable && !formData.aiGreeting.enable)
h.customGreeting(handlesAfter);
Expand Down
7 changes: 7 additions & 0 deletions src/hooks/useConfForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ export const formInfoData: FormInfoData = {
label: "猎头过滤",
help: "Boss中有一些猎头发布的工作,但是一般而言这种工作不太行,点击可以过滤猎头发布的职位",
},
friendStatus: {
label: "好友过滤(未测试)",
help: "通过检测card中的friendStatus字段来筛选是否回复,理论上能过滤的同boos不同岗位",
},
notification: {
label: "发送通知",
help: "可以在网站管理中打开通知权限,当停止时会自动发送桌面端通知提醒。",
Expand Down Expand Up @@ -269,6 +273,9 @@ export const defaultFormData: FormData = {
activityFilter: {
value: false,
},
friendStatus: {
value: false,
},
goldHunterFilter: {
value: false,
},
Expand Down
5 changes: 5 additions & 0 deletions src/pages/geek/job/config.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ const { deliverLock } = useCommon();
v-model="formData.goldHunterFilter.value"
border
/>
<el-checkbox
v-bind="formInfoData.friendStatus"
v-model="formData.friendStatus.value"
border
/>
</div>
</el-collapse-item>
<el-collapse-item title="延迟配置" name="2">
Expand Down
2 changes: 2 additions & 0 deletions src/types/deliverError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export const JobDescriptionError = createCustomError("工作内容筛选");
export type JobDescriptionError = InstanceType<typeof JobDescriptionError>;
export const AIFilteringError = createCustomError("AI筛选");
export type AIFilteringError = InstanceType<typeof AIFilteringError>;
export const FriendStatusError = createCustomError("好友状态");
export type FriendStatusError = InstanceType<typeof FriendStatusError>;
export const ActivityError = createCustomError("活跃度过滤");
export type ActivityError = InstanceType<typeof ActivityError>;
export const GoldHunterError = createCustomError("猎头过滤");
Expand Down
1 change: 1 addition & 0 deletions src/types/formData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface FormData {
customGreeting: FormDataInput;
greetingVariable: FormDataCheckbox;
activityFilter: FormDataCheckbox;
friendStatus: FormDataCheckbox;
goldHunterFilter: FormDataCheckbox;
notification: FormDataCheckbox;
aiGreeting: FormDataAi;
Expand Down
2 changes: 1 addition & 1 deletion update.log
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ v0.1.6-fix2 🤡 修复公司名筛选报错,修复部分功能无法正确筛
v0.2.0 🤡 修复所有已知的BUG
v0.2.0-1 🌟 使用partial-json来修复json错误。模型存储使用数组,更新版本后请重新配置模型
v0.2.0-2 🌟 适配更多GPT,多种不同的请求方式,更多的参数,更多的筛选,延迟配置,增加聊天气泡(后续会完善)
v0.2.1 🤡 修复无法获取到token的问题
v0.2.1 🤡🌟 修复无法获取到token的问题, 添加好友状态过滤(未测试)

0 comments on commit 4dd09ee

Please sign in to comment.