-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
perf: optimize the update logic of post editTime field #2195
Conversation
只有当修改文章标题 或文章内容时 去更新posts表的edit_time字段
/retitle perf: optimize the update logic of post editTime field /kind improvement |
Hello there!👋 Welcome to the project!💖 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
当 contents 表中对应 post id 的记录被修改则表示 post_id 重新发布了内容, posts 的 edit_time 应该被设置为新值,至于文章标题是否改变可以判断一下更新时的标题参数是否和旧标题相等 |
|
|
转为草稿或其他什么状态应该不需要修改edit_time,对发布状态的做修改就行,所以只需要对文章标题和内容做变更时处理 |
是的,但不需要管这个表 |
只有当修改文章标题 或文章内容时 去更新posts表的edit_time字段
hi @wxyShine , 经过测试,功能可能还是有些问题,我的操作步骤
|
修改此篇文章内容,ctrl + s / command + s即保存草稿 我发现修改标题是不生效的,那这种操作更新时间只能根据文章内容? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/cc @halo-dev/sig-halo
src/main/java/run/halo/app/factory/StringToEnumConverterFactory.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: guqing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
#### What type of PR is this? #### What this PR does / why we need it: 发布 1.6.0 #### Special notes for your reviewer: /cc @halo-dev/sig-halo ```markdown ## Features - SMTP 添加 STARTTLS 的设置支持。 #1861 halo-dev/console#552 @ntdgy @wangxiaoerYah - 为邮件通知模板添加更多的可用参数,`email`、`status`、`createTime`、`authorUrl`。 #2095 @Yhcrown @iRoZhi - 后台附件设置中添加 `去除图片 EXIF 信息` 的选项。 #2168 halo-dev/console#554 @SladeGranger @eziosudo @52lemon6 - 后台文章标签管理支持清理未使用标签。 halo-dev/console#587 @ruibaby - 重构后台的友情链接管理页面,现在支持拖动排序以及分组管理。 halo-dev/console#574 #2105 @Camsyn @daifiyum @gungnir479 ## Improvements - 优化文章编辑时间更新的逻辑,目前更改为仅在修改文章标题或者内容时才更新。 #2195 @wxyShine @ListenV - 修改后台管理页面为直接渲染而不是重定向,以更好地兼容反向代理。 #2259 @viticis - 后台在构建时提供 gzip 压缩的资源。 halo-dev/console#547 @2211898719 - 后台主题设置界面顶部提供了保存设置的按钮。 halo-dev/console#549 @Aanko - 修改后台页面的 lang 属性,由 `zh-cmn-Hans` 改为 `cmn-Han`,`zh-cmn-Hans` 已废弃。 halo-dev/console#576 @wordlesswind - 优化后台附件库列表以及选择附件弹框的布局。 halo-dev/console#580 @ruibaby - 修改后台底部的 `Power by Halo` 为 `Powered by Halo`。 halo-dev/console#597 @liaocp666 - 优化后台日志管理设置公开/隐藏状态的方式。 halo-dev/console#610 @zjy4fun @manction - 优化后台在个人资料中设置头像的逻辑,现在无需再提交个人资料表单。 halo-dev/console#619 @wxyShine - 优化后台图库批量从附件添加时,按照选择顺序倒序排列,即最先选择的图片在最前面。 halo-dev/console#631 @zjy4fun @zyy247796143 ## Bug Fixes - 修复文章详情页 `meta_description` 为空的问题。 #2282 @guqing @ruibaby - 修复批量删除外部云存储的时候,因为文件不存在导致的删除失败问题。 #2317 @JustinLiang522 @129duckflew - 修复了七牛云存储附件无法上传非图片文件的问题。 #2331 @AirboZH @hexWars - 修复未审核评论回复会发送邮件提醒的问题。 #2340 @AirboZH @cetr - 修复在单个分类所属文章页面页面变量中无法获取子分类中文章的问题。 #2405 @JustinLiang522 @HugeLeaf - 修复管理员资料表单中邮件地址的字符数限制。 halo-dev/console#571 @Yhcrown - 修复了无法设置日志、相册、链接页标题和每页显示条数的问题。 halo-dev/console#601 @JustinLiang522 @manction ## Dependencies - Docker 镜像的基础镜像使用 Eclipse Temurin 镜像替代 AdoptOpenJDK。 #2120 @wordlesswind ``` #### Does this PR introduce a user-facing change? ```release-note None ```
What type of PR is this?
/kind improvement
What this PR does / why we need it:
Article update time logic optimization;
Update the Edit_time field in the Posts table only when you change the post title or post content
Which issue(s) this PR fixes:
Fixes #2193
Special notes for your reviewer:
Does this PR introduce a user-facing change?