项目作者: anuragde

项目描述 :
Provides multiple API endpoints
高级语言: Java
项目地址: git://github.com/anuragde/RESTful-API-using-Spring-Boot-JPA-and-MySQL-for-Fleet-Management.git


RESTful-API-using-Spring-Boot-JPA-and-MySQL-for-Fleet-Management

Provides multiple API end points. Try it out @ http://vehicletracker.us-east-1.elasticbeanstalk.com/swagger-ui.html

  1. API endpoints to PUT /vehicles Vehicle details, POST /readings, GET, UPDATE, DELETE records.
  2. API metrics by actuator and API documentation by Springfox swagger.
  3. Generate alerts with given priority when following rules are triggered
    • Rule: engineRpm > readlineRpm, Priority: HIGH
    • Rule: fuelVolume < 10% of maxFuelVolume, Priority: MEDIUM
    • Rule: tire pressure of any tire < 32psi || > 36psi , Priority: LOW
    • Rule: engineCoolantLow = true || checkEngineLightOn = true, Priority: LOW
  4. API endpoints to GET all alerts generated for a vehicle and GET recent high alerts of a vehicle
  5. Text message is sent to vehicle’s registered mobile number via Amazon SNS when a high alert is triggered.

Run the application using the commands in rest.sh.

PUT /vehicles JSON Input format:

  1. [
  2. {
  3. "vin": "1HGCR2F3XFA027534",
  4. "make": "HONDA",
  5. "model": "ACCORD",
  6. "year": 2015,
  7. "redlineRpm": 5500,
  8. "maxFuelVolume": 15,
  9. "lastServiceDate": "2017-05-25T17:31:25.268Z"
  10. },
  11. {
  12. "vin": "WP1AB29P63LA60179",
  13. "make": "PORSCHE",
  14. "model": "CAYENNE",
  15. "year": 2015,
  16. "redlineRpm": 8000,
  17. "maxFuelVolume": 18,
  18. "lastServiceDate": "2017-03-25T17:31:25.268Z"
  19. }
  20. ]

POST /readings JSON Input format:

  1. {
  2. "vin": "1HGCR2F3XFA027534",
  3. "latitude": 41.803194,
  4. "longitude": -88.144406,
  5. "timestamp": "2017-05-25T17:31:25.268Z",
  6. "fuelVolume": 1.5,
  7. "speed": 85,
  8. "engineHp": 240,
  9. "checkEngineLightOn": false,
  10. "engineCoolantLow": true,
  11. "cruiseControlOn": true,
  12. "engineRpm": 6300,
  13. "tires": {
  14. "frontLeft": 34,
  15. "frontRight": 36,
  16. "rearLeft": 29,
  17. "rearRight": 34
  18. }
  19. }