Ajout Gif livraison de paquets

This commit is contained in:
wpetit 2020-03-07 10:30:15 +01:00
parent 095780e3ce
commit e6d59aa1bc
1 changed files with 9 additions and 4 deletions

View File

@ -1,12 +1,17 @@
def getRandomDeliveryAttachment(Integer probability = 25) { def getRandomDeliveryAttachment(Integer probability = 25) {
def deliveryImages = [ def deliveryImages = [
'https://media.giphy.com/media/UtM8DmnahknE4/giphy.gif', 'https://media.giphy.com/media/UtM8DmnahknE4/giphy.gif',
'https://media.giphy.com/media/11VKF3OwuGHzNe/200w_d.gif', 'https://media.giphy.com/media/11VKF3OwuGHzNe/giphy.gif',
'https://media.giphy.com/media/d5pGYhWb3T1Hyyl8OB/200w_d.gif', 'https://media.giphy.com/media/d5pGYhWb3T1Hyyl8OB/giphy.gif',
'https://media.giphy.com/media/oTSy3rHigPd9S/giphy.gif' 'https://media.giphy.com/media/oTSy3rHigPd9S/giphy.gif',
'https://media.giphy.com/media/9DgxhWOxHDHtF8bvwl/giphy.gif',
'https://media.giphy.com/media/9DgxhWOxHDHtF8bvwl/giphy.gif',
'https://media.giphy.com/media/1g2JyW7p6mtZc6bOEY/giphy.gif',
'https://media.giphy.com/media/7AqsdBK15kiOc/giphy.gif',
'https://media.giphy.com/media/r2MkQEOe7niGk/giphy.gif'
] ]
Random rnd = new Random() Random rnd = new Random()
if (rnd.nextInt(100) < probability) { if (rnd.nextInt(100) > probability) {
return []; return [];
} }
def imageUrl = deliveryImages[rnd.nextInt(deliveryImages.size())] def imageUrl = deliveryImages[rnd.nextInt(deliveryImages.size())]