Challenge Overview
Bullet Train
This is the MEDIUM Level CompetitionNext day into the office He is informed, the new train arrival has been canceled. So, his supervisor asks him to search for a train with some clues and requests him to delete it.
Solving this problem you learn:
- Create new endpoint to search train that have same description values
- Create new endpoint to search train based on keyword
- Create new endpoint to Delete a train
What do you need to do next?
IMPORTANT:
- Follow the exact base API endpoint, automated testers will check the exact same address: http://localhost:8080/api/trains
- This is a continuation competition, please complete the previous Easy level before working on this level.
- Match the exact code status & wording (lowercase) for the returned message.
Task:
1. Search train that have same values
- Method : GET
- Url : /api/trains/sharing-tracks
- This need return train that have sharing-tracks === true values
- Response:
- Success:
- need return 200 code and
- list all train
- Error:
- When search with incorrect route for example: /api/trains/distance-between-stop
- need return 405 code and
- {message: "invalid endpoint"}
- When search with incorrect route for example: /api/trains/distance-between-stop
- Success:
2. Search trains which amenities values contains keyword
- Method : GET
- Url : /api/trains?amenities=[keyword]
- Response:
- Success:
- need return 200 code and
- list all train
- Error:
- When use other parameters than the amenities
- need return 405 code and
- {message: "invalid endpoint"}
- When search result empty
- need return 200 code and
- {message: “train not found”}
- When use other parameters than the amenities
- Success:
3. Create new endpoint to delete a train
- Method : DELETE
- Url : /api/trains/:id
- Delete Train with Id: 1
- Response:
- Success:
- need return 200 code and
- {message: “train removed successfully”}
- Error:
- If train not exists id: 10
- need return 404 code and
- {message: “train not found”}
- If train not exists id: 10
- Success:
Final Submission Guidelines
Topcoder Skill Builder | Java + Springboot + PostgreSQL Levels
Host Challenge & Submission Guideline | Challenge Link: http://www.topcoder.com/challenges/30168990Easy | Challenge Link: http://www.topcoder.com/challenges/30168991
Medium | Challenge Link: http://www.topcoder.com/challenges/30168980
Hard | Challenge Link: http://www.topcoder.com/challenges/30168986