TeBkRestController.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * TeBkRestController.h
  3. *
  4. * Created on: 11-Mar-2015
  5. * Author: sumeetc
  6. */
  7. #ifndef TEBKRESTCONTROLLER_H_
  8. #define TEBKRESTCONTROLLER_H_
  9. #include "TeBkWorld.h"
  10. #include "vector"
  11. #include "CastUtil.h"
  12. #include "TeBkMessage.h"
  13. #include "DataSourceManager.h"
  14. #include <stdlib.h>
  15. #include "CacheManager.h"
  16. #include "Thread.h"
  17. #pragma @RestController path="/"
  18. class TeBkRestController {
  19. public:
  20. #pragma @GET path="/json" statusCode="200" ocontentType="application/json"
  21. TeBkMessage json();
  22. #pragma @GET path="/db" statusCode="200" ocontentType="application/json"
  23. TeBkWorld db();
  24. #pragma @GET path="/queries" statusCode="200" ocontentType="application/json"
  25. std::vector<TeBkWorld> queries(
  26. #pragma @QueryParam name="queries"
  27. std::string queries);
  28. #pragma @GET path="/updates" statusCode="200" ocontentType="application/json"
  29. std::vector<TeBkWorld> updates(
  30. #pragma @QueryParam name="queries"
  31. std::string queries);
  32. #pragma @GET path="/plaintext" statusCode="200" ocontentType="text/plain"
  33. std::string plaintext();
  34. #pragma @GET path="/cached-worlds" statusCode="200" ocontentType="application/json"
  35. std::vector<TeBkWorld> cachedWorlds(
  36. #pragma @QueryParam name="count"
  37. std::string count);
  38. void updateCache();
  39. TeBkRestController();
  40. virtual ~TeBkRestController();
  41. };
  42. #endif /* TEBKRESTCONTROLLER_H_ */