Repository navigation
feat(event): attach photos to repair events - #234
Merged
Merged
Conversation
Load and sign photos only for event detail and uploads, so action responses no longer carry unsigned photo urls. Check status and the 20-photo limit under a row lock, delete objects from a failed batch, close uploaded file handles, and reuse the OSS client until the credentials change.
wen-templari
approved these changes
Oct 15, 2026
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.
Members need to record on-site photos on repair tickets, for later review and as evidence of the device's condition.
Needs your decision
weekend/prodneedsaliyun.access_key_idandaliyun.access_key_secretwith write access to bucketsunday-res, ideally a RAM user limited to that bucket (util/photo.go).router/event.go).router/main.go). Please check that the reverse proxy accepts bodies that large on/member/events/*/photos; nginx defaults to 1 MB.What changed
POST /member/events/{EventId}/photosaccepts up to 20 photos per event, 5 MB each, WebP or JPEG by content sniffing. Only the assigned member or an admin can upload, and only while the event isacceptedorcommitted. There is no delete endpoint.weekend/events/{id}/, recorded in a newevent_phototable (migration 000008).GET /member/events/{id}andGET /client/events/{id}returnphotoswith 1-hour signed URLs. Public endpoints do not return photos./uploadstub,util.Uploadand its docs page are removed.Verification
go test ./...passes. WithTEST_DB_DATASOURCEset, a repo test runs two concurrent 15-photo uploads against Postgres and checks that only one succeeds.