Repository navigation
加点位修正功能:用户改自己报的点,管理员改被上报的点 - #6
Open
qiuyijoy-lgtm wants to merge 3 commits into
Open
qiuyijoy-lgtm wants to merge 3 commits into
qiuyijoy-lgtm wants to merge 3 commits into
Conversation
用户端:详情页多一个「修正位置」入口,只对自己报的点显示。
全屏地图 + 准星,实时显示离原位置多远,取点走 unprojectClientPoint,
不会重蹈上次那个偏几百米的覆辙。
管理端:「我的」页面里多一块被上报点位的列表,只有管理员看得见。
能直接挪位置、能标记已处理,挪完自动标掉那条上报。
这不算违反「不做管理后台」——它不产内容,只是把 flagged_toilets
从 Studio 搬到手机上,因为改坐标必须对着地图改。
权限全部在数据库判定,前端只管不显示入口:
- fix_toilet_location:管理员随便挪,普通用户只能挪自己报的 ugc 点,
一次最多 3 公里,每小时最多 20 次
- admin_* 两个 RPC 第一句就查 is_admin()
- app_admins 表一条 policy 都不写,只能在 Studio 里加人
(select grant_admin_by_email('你的邮箱'))
- toilet_by_id 新增 can_fix_location,省得把 created_by 暴露给前端
- 每次挪动记进 toilet_location_edits,能查是谁挪的
toilet_reports 加 resolved_at,原来的 unique 换成部分唯一索引,
处理完之后同一个人还能再报。
顺手给 toilet_pins 那个 migration 补上 drop trigger if exists,
之前重复跑会炸。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Deploying pooping with
|
| Latest commit: |
45aabc8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bed1ed07.pooping-bwi.pages.dev |
| Branch Preview URL: | https://poo-poo-monster.pooping-bwi.pages.dev |
覆盖梁溪、滨湖(太湖新城)、新吴和锡山惠山近郊,不含江阴宜兴。 实测 Overpass 拿到 169 个点位,全部入库。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
原来一次只烤一个城市,build 不带参数时写死北京。这样加无锡要么不生效, 要么把北京挤掉——前端只 fetch 一个 bootstrap.json。改成默认烤全部首发城市, 按 id 去重合进同一个文件;withDistance 本来就按用户位置重排,城市之间不打架。 默认半径 8km 改 15km:无锡主城南北跨近 30 公里,8km 只烤进 64/169 个点, 放大后 156 个。每个城市仍被 p_limit=300 卡住,文件不会失控。 产物 gzip 后从 12KB 涨到 46KB,顺手改掉 MapPage 里那句过时注释。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
用户端:详情页多一个「修正位置」入口,只对自己报的点显示。
全屏地图 + 准星,实时显示离原位置多远,取点走 unprojectClientPoint,
不会重蹈上次那个偏几百米的覆辙。
管理端:「我的」页面里多一块被上报点位的列表,只有管理员看得见。
能直接挪位置、能标记已处理,挪完自动标掉那条上报。
这不算违反「不做管理后台」——它不产内容,只是把 flagged_toilets
从 Studio 搬到手机上,因为改坐标必须对着地图改。
权限全部在数据库判定,前端只管不显示入口:
toilet_reports 加 resolved_at,原来的 unique 换成部分唯一索引,
处理完之后同一个人还能再报。
顺手给 toilet_pins 那个 migration 补上 drop trigger if exists, 之前重复跑会炸。