The methods of this API should allow:
1. Reading images from cloud storage. The API should accept information about the image as a parameter in the URL. An example URL should be:
- The s1000 is the size.
- The next part is the image ID
- The GUID that follows is the advertisement ID
The size given in the URL should be rounded to the nearest of the predefined values: 2560, 1200, 1024, 700, 512, 400, 360, 192, 128, and 64. The returned image should be in one of these predefined sizes. If an image in the given size is not available, it should return the image in the maximum available size.
2. Saving in cloud storage (Amazon S3) graphic files uploaded by the user (jpeg, png). Initially, it will compress them and reduce them to the maximum size we support, i.e. 2560x2560 pixels. The image should never be scaled up. After uploading such an image, the website will return the URL to the uploaded image in the maximum size (in the format described in point a). The website should give the image a short ID and save it in the storage using the size-idPicture-id-Announcements key.
3. Communication with the system event queue (RabbitMq):
- In a situation where the image is uploaded to the cloud, the website should post a message in the queue informing about adding the image to the advertisement. The message should contain the size, image id, and advertisement id.
- In a situation where a request for thumbnail generation appears in the queue, the website should generate and save in cloud storage a series of images reduced to predefined sizes (as in point a). The website should post a message in the queue informing about the completion of thumbnail generation.
- In a situation when a request to delete an advertisement appears in the queue, the website should delete all images related to the advertisement and post a message in the queue informing about the completion of image removal.