Add image upload support for events and repair descriptions#212
Open
wen-templari wants to merge 5 commits intomainfrom
Open
Add image upload support for events and repair descriptions#212wen-templari wants to merge 5 commits intomainfrom
wen-templari wants to merge 5 commits intomainfrom
Conversation
This commit implements comprehensive image upload functionality that allows: - Clients to upload images when creating or updating events (problem description) - Members to upload images when committing or altering repairs (repair documentation) Key changes: - Database: Add images TEXT field to event and event_log tables (migration 000008) - Models: Add StringSlice type with SQL Scanner/Valuer for JSON serialization - API: Implement /upload endpoint with multipart file handling and validation - Supports JPEG, PNG, WebP formats - Max file size: 10MB - Content-type and magic byte validation - Uses existing Aliyun OSS storage - DTOs: Add Images []string field to CreateEventRequest, UpdateRequest, CommitRequest, AlterCommitRequest - Service: Add ActOptions struct and ActWithOptions method for passing images with event actions - Repository: Update CRUD operations to handle images JSON serialization - Router: Update Create, Update, Commit, AlterCommit handlers to accept and process images Images are stored separately: - Client images → event.images (problem documentation) - Member images → event_log.images (repair documentation per action) This separation maintains clear ownership and timeline tracking.
- Improve Dockerfile with better layer caching and explicit GOPROXY - Separate dependency download from source build for faster rebuilds - Add .dockerignore to exclude unnecessary files from build context - Add Dockerfile.vendor as fallback for network-restricted environments Changes to Dockerfile: - Copy go.mod and go.sum first for better dependency caching - Set GOPROXY to proxy.golang.org explicitly - Run go mod download before copying source code - This allows Docker to cache dependencies layer separately Alternative Dockerfile.vendor can be used if network issues persist: go mod vendor docker build -f Dockerfile.vendor -t saturday .
This reverts commit 29fc324.
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.
This commit implements comprehensive image upload functionality that allows:
Key changes:
Images are stored separately:
This separation maintains clear ownership and timeline tracking.