// Room1APIClient.h
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Http.h"
#include "Room1APIClient.generated.h"
USTRUCT(BlueprintType)
struct FImageData
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite, Category = "API")
FString Path;
UPROPERTY(BlueprintReadWrite, Category = "API")
TMap<FString, FString> Metadata;
};
USTRUCT(BlueprintType)
struct FImageCategoryResponse
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite, Category = "API")
TMap<FString, TArray<FImageData>> Categories;
};
UCLASS()
class VR4BIZ_API ARoom1APIClient : public AActor
{
GENERATED_BODY()
public:
ARoom1APIClient();
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "API")
FString BaseUrl = "http://localhost:5001/api/v1";
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "API")
FString ApiKey = "your-api-key";
UFUNCTION(BlueprintCallable, Category = "API")
void GetImagesByCategory();
UFUNCTION(BlueprintCallable, Category = "API")
void GenerateOrb(const FString& ImagePath, const FString& Category);
protected:
virtual void BeginPlay() override;
private:
FHttpModule* Http;
void OnCategoriesResponseReceived(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bSuccess);
void OnOrbResponseReceived(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bSuccess);
};