Implemented fetchUserTitlesAsync func and embedded it in the code of the front in the trial mode. It needs to be restructured
31 lines
No EOL
1.1 KiB
C++
31 lines
No EOL
1.1 KiB
C++
#pragma once
|
|
#include "CppRestOpenAPIClient/ApiClient.h"
|
|
#include "CppRestOpenAPIClient/ApiConfiguration.h"
|
|
#include "CppRestOpenAPIClient/api/DefaultApi.h"
|
|
#include "CppRestOpenAPIClient/model/User.h"
|
|
#include "CppRestOpenAPIClient/model/GetUserTitles_200_response.h"
|
|
#include "CppRestOpenAPIClient/model/UserTitle.h"
|
|
#include "CppRestOpenAPIClient/model/Title.h"
|
|
#include "constants.hpp"
|
|
#include "structs.hpp"
|
|
#include <iostream>
|
|
#include <thread>
|
|
#include <functional>
|
|
#include <memory>
|
|
#include <cpprest/asyncrt_utils.h>
|
|
#include <boost/optional.hpp>
|
|
|
|
using namespace org::openapitools::client::api;
|
|
|
|
class BotToServer {
|
|
public:
|
|
BotToServer();
|
|
|
|
// Асинхронный метод: получить список тайтлов пользователя
|
|
pplx::task<std::vector<BotStructs::Title>> fetchUserTitlesAsync(const std::string& userId);
|
|
|
|
private:
|
|
std::shared_ptr<org::openapitools::client::api::ApiConfiguration> apiconfiguration;
|
|
std::shared_ptr<org::openapitools::client::api::ApiClient> apiclient;
|
|
std::shared_ptr<org::openapitools::client::api::DefaultApi> api;
|
|
}; |