feat: Enhance texture upload functionality and API response format
- Introduced a new upload endpoint for direct texture file uploads, allowing users to upload textures with validation for size and format. - Updated existing texture-related API responses to a standardized format, improving consistency across the application. - Refactored texture service methods to handle file uploads and reuse existing texture URLs based on hash checks. - Cleaned up Dockerfile and other files by removing unnecessary whitespace.
This commit is contained in:
@@ -33,6 +33,12 @@ func (r *textureRepository) FindByHash(ctx context.Context, hash string) (*model
|
||||
return handleNotFoundResult(&texture, err)
|
||||
}
|
||||
|
||||
func (r *textureRepository) FindByHashAndUploaderID(ctx context.Context, hash string, uploaderID int64) (*model.Texture, error) {
|
||||
var texture model.Texture
|
||||
err := r.db.WithContext(ctx).Where("hash = ? AND uploader_id = ?", hash, uploaderID).First(&texture).Error
|
||||
return handleNotFoundResult(&texture, err)
|
||||
}
|
||||
|
||||
func (r *textureRepository) FindByIDs(ctx context.Context, ids []int64) ([]*model.Texture, error) {
|
||||
if len(ids) == 0 {
|
||||
return []*model.Texture{}, nil
|
||||
|
||||
Reference in New Issue
Block a user