Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 添加推送到Bing支持 #2379

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

feat: 添加推送到Bing支持 #2379

wants to merge 9 commits into from

Conversation

sysfox
Copy link
Contributor

@sysfox sysfox commented Feb 22, 2025

Description

Linked Issues

Additional context

- 在 errorCode.constant.ts 中添加 Bing 相关的错误代码
- 在 configs.dto.ts 中添加 BingSearchOptionDto 类用于配置 Bing 推送选项
- 在 helper.cron.service.ts 中实现 pushToBingSearch 方法进行 Bing 搜索推送
- 在默认配置中添加 bingSearchOptions 项
- 更新 BingSearchOptionDto 类,统一字段命名
- 在 IConfig 接口中添加 bingSearchOptions 字段
- 修改 CronService 中的 pushToBingSearch 方法,适配新配置
- 新增 BingSearchOptionsModel 类,用于 Bing 搜索的配置选项
- 该模型包括 enable 和 token 两个属性,与 BaiduSearchOptionsModel 类似
- 将 BingSearchOptionDto 重命名为 BingSearchOptionsDto,与 BaiduSearchOptionsDto 保持一致
- 更新相关引用和配置字段类型
@sysfox
Copy link
Contributor Author

sysfox commented Feb 22, 2025

@Innei
在开发过程中在前端保存设置,会在后端报错

ℹ ENV: development                                                                                                                                                                       13:25:52
✔ [P97018] Server listen on: http://127.0.0.1:2333                                                                                                                                       13:25:52
✔ [P97018] Admin Local Dashboard: http://127.0.0.1:2333/proxy/qaqdmin                                                                                                                    13:25:52
ℹ [P97018] If you want to debug local dev dashboard on production environment with https domain, you can go to: https://<your-prod-domain>/proxy/qaqdmin/dev-proxy                       13:25:52
ℹ [P97018] If you want to debug local dev dashboard on dev environment with same site domain, you can go to: http://localhost:2333/proxy/qaqdmin/dev-proxy                               13:25:52
ℹ Server is up. +2630ms                                                                                                                                                                  13:25:52
⚙  [LoggingInterceptor]  +++ 收到请求:PATCH -> /options/bingSearchOption                                                                                                                13:26:05

 WARN   [AllExceptionsFilter]  IP: 127.0.0.1 错误信息:(400) 设置不存在 Path: /options/bingSearchOption                                                                                   13:26:05

⚙  [LoggingInterceptor]  --- 响应异常请求:PATCH -> /options/bingSearchOption +3ms                                                                                                       13:26:05

能解释下原因吗
Snipaste_2025-02-22_13-30-03

@sysfox
Copy link
Contributor Author

sysfox commented Feb 22, 2025

删除数据库重新部署后服务正常,测试成功

@sysfox sysfox force-pushed the bing branch 2 times, most recently from 2a7167e to 276d4cb Compare February 22, 2025 10:27
- 在 CronService 类中添加了 pushToBingSearch 方法
- 使用 @CronOnce 装饰器设置任务执行时间为每天凌晨1点
- 任务名称为 'pushToBingSearch'
- 方法描述为 '推送到Bing'
- 在.gitignore文件中添加.eslintcache,避免eslint缓存文件被版本控制
- 修改了 Bing 站长提交结果的日志输出格式
- 当提交成功时,输出简短的成功日志
- 当提交失败时,仍输出详细的错误信息
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant