35 lines
749 B
C++
35 lines
749 B
C++
//
|
|
// Created by selim on 03.01.2022.
|
|
//
|
|
|
|
#ifndef AUTOCAT_GNOME_API_H
|
|
#define AUTOCAT_GNOME_API_H
|
|
|
|
#include <string>
|
|
#include <libsoup/soup.h>
|
|
#include <nlohmann/json.hpp>
|
|
#include <concurrencpp/concurrencpp.h>
|
|
|
|
#include "../models/User.h"
|
|
#include "../models/Vehicle.h"
|
|
#include "../coro/Coro.h"
|
|
|
|
namespace cc = concurrencpp;
|
|
|
|
class Api {
|
|
private:
|
|
static const std::string _baseUrl;
|
|
static SoupSession* _session;
|
|
|
|
private:
|
|
template<typename T>
|
|
static cc::result<T> post(const std::string& method, const nlohmann::json& params);
|
|
|
|
public:
|
|
static cc::result<User> login(std::string email, std::string password);
|
|
static cc::result<Vehicle> check(const std::string& number, bool force = false);
|
|
};
|
|
|
|
|
|
#endif //AUTOCAT_GNOME_API_H
|