AutoCatGnome/services/Api.h
2022-02-23 15:14:13 +03:00

30 lines
570 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 "../models/User.h"
#include "../coro/Task.h"
class Api {
private:
static const std::string _baseUrl;
static SoupSession* _session;
private:
template<typename T>
static boost::future<T> post(const std::string& method, const nlohmann::json& params);
public:
static boost::future<User> login(std::string email, std::string password);
};
#endif //AUTOCAT_GNOME_API_H