📦 Asset Service

API Endpoints Documentation

📋 Service Information

Service Name: Asset Service

Port: 8054

Base URL: http://localhost:8054

Description: Handles file uploads, asset management, and file serving

Features: File upload, asset storage, file download, category management, asset metadata

POST /api/v1/assets/upload

Upload Asset

Upload a file/asset to the system

📝 Request Example:

curl -X POST http://localhost:8054/api/v1/assets/upload \ -F "file=@/path/to/file.jpg" \ -F "name=My Asset" \ -F "description=Asset description" \ -F "category=images" \ -F "tags=tag1,tag2" \ -F "uploadedBy=admin"
📌 Form Parameters:

file - File to upload (required, MultipartFile)

name - Asset name (optional)

description - Asset description (optional)

category - Asset category (optional, default: "general")

tags - Comma-separated tags (optional)

uploadedBy - User who uploaded (optional, default: "system")

uploadPath - Custom upload path (optional)

200 - Success 500 - Server Error
GET /api/v1/assets

Get All Assets

Retrieve all assets in the system

📝 Request Example:

curl -X GET http://localhost:8054/api/v1/assets
200 - Success
GET /api/v1/assets/{id}

Get Asset by ID

Retrieve asset details by ID

📝 Request Example:

curl -X GET http://localhost:8054/api/v1/assets/{id}
📌 Path Parameters:

id - Asset ID (UUID)

200 - Success 404 - Not Found
GET /api/v1/assets/{id}/download

Download Asset

Download an asset file

📝 Request Example:

curl -X GET http://localhost:8054/api/v1/assets/{id}/download \ -o downloaded-file.jpg
📌 Path Parameters:

id - Asset ID (UUID)

200 - Success 404 - Not Found
DELETE /api/v1/assets/{id}

Delete Asset

Soft delete an asset (marks as deleted)

📝 Request Example:

curl -X DELETE http://localhost:8054/api/v1/assets/{id}
📌 Path Parameters:

id - Asset ID (UUID)

200 - Success 404 - Not Found
GET /api/v1/assets/category/{category}

Get Assets by Category

Get all assets in a specific category

📝 Request Example:

curl -X GET http://localhost:8054/api/v1/assets/category/images
📌 Path Parameters:

category - Category name (String)

200 - Success
GET /api/v1/health

Health Check

Check if the asset service is running

📝 Request Example:

curl -X GET http://localhost:8054/api/v1/health
200 - Success