feat(tgbot-back): start to develop back
Implemented fetchUserTitlesAsync func and embedded it in the code of the front in the trial mode. It needs to be restructured
This commit is contained in:
parent
4ca8b19adb
commit
847aec7bdd
9 changed files with 190 additions and 13 deletions
31
modules/bot/back/include/BotToServer.hpp
Normal file
31
modules/bot/back/include/BotToServer.hpp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#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;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue