Skip to content

Commit d9ea8c0

Browse files
committed
feat: refactor cli_curl.sh to dynamically retrieve movie details and validate poster
1 parent bac7d30 commit d9ea8c0

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed
Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
#!/bin/bash
22
set -ex
3+
source .env
34
URL="http://localhost:8005"
4-
URL="https://movie-poster-agent-svc.niceriver-71d47c14.francecentral.azurecontainerapps.io"
5-
curl -X POST "$URL/validate" \
5+
MOVIE_ID="525_346698_Romance_82051"
6+
curl -X GET "$MOVIE_GALLERY_ENDPOINT/movies/$MOVIE_ID" | jq .
7+
movie_title=$(curl -X GET "$MOVIE_GALLERY_ENDPOINT/movies/$MOVIE_ID" | jq .title)
8+
echo "Movie title: $movie_title"
9+
poster_description=$(curl -X GET "$MOVIE_GALLERY_ENDPOINT/movies/$MOVIE_ID" | jq .poster_description)
10+
echo "Poster description: $poster_description"
11+
poster_url=$(curl -X GET "$MOVIE_GALLERY_ENDPOINT/movies/$MOVIE_ID" | jq .poster_url)
12+
echo "Poster URL: $poster_url"
13+
genre=$(curl -X GET "$MOVIE_GALLERY_ENDPOINT/movies/$MOVIE_ID" | jq .payload.genre )
14+
echo "Genre: $genre"
15+
16+
17+
curl -X POST "$MOVIE_POSTER_AGENT_ENDPOINT/validate" \
618
-H "Content-Type: application/x-www-form-urlencoded" \
7-
-d "poster_description=The poster showcases two charismatic mice dressed in stylish outfits—one in a sharp black suit with a white shirt and a trendy hat, and the other in a colorful blazer with a playful tie. They both wear cool sunglasses, exuding confidence and charm. Behind them is a vibrant, gradient background transitioning from light blue at the top to deep blue at the bottom, adding a lively and dynamic feel. Surrounding the main characters are their diverse band members, each holding different musical instruments that hint at a fun and energetic performance. The scene is set against a backdrop of a bustling animated cityscape with musical notes floating around, emphasizing the film's focus on music and camaraderie. The overall aesthetic is bright, engaging, and full of movement, capturing the essence of an uplifting animated musical adventure." \
8-
-d "poster_url=https://gui-svc.niceriver-71d47c14.francecentral.azurecontainerapps.io/poster/525_420821_Animation_66602.png" \
9-
-d "movie_title=The Melody Mice" \
10-
-d "movie_genre=Anime" \
19+
-d "poster_description=${poster_description}" \
20+
-d "poster_url=${poster_url}" \
21+
-d "movie_title=${movie_title}" \
22+
-d "movie_genre=${genre}" \
1123
-d "language=french" | jq .

0 commit comments

Comments
 (0)