Skip to content
Snippets Groups Projects
Commit bd0d62c3 authored by Merov Linden's avatar Merov Linden
Browse files

DD-22 : WIP : Partial implementation of PUT associate_listing

parent e916b47f
No related branches found
No related tags found
No related merge requests found
......@@ -301,6 +301,29 @@ class LLSLMUpdateListingsResponder : public LLHTTPClient::Responder
}
}
};
class LLSLMAssociateListingsResponder : public LLHTTPClient::Responder
{
LOG_CLASS(LLSLMAssociateListingsResponder);
public:
LLSLMAssociateListingsResponder() {}
virtual void completed(U32 status, const std::string& reason, const LLSD& content) { }
void completedHeader(U32 status, const std::string& reason, const LLSD& content)
{
if (isGoodStatus(status))
{
LLMarketplaceData::instance().setSLMStatus(MarketplaceStatusCodes::MARKET_PLACE_MERCHANT);
}
else
{
log_SLM_error("Get merchant", status, reason, content.get("error_code"), content.get("error_description"));
}
}
};
// SLM Responders End
///////////////////////////////////////////////////////////////////////////////
......@@ -902,6 +925,23 @@ void LLMarketplaceData::updateSLMListing(const LLUUID& folder_id, S32 listing_id
}
// PUT /associate_inventory/:listing_folder_id/:version_folder_id/:listing_id
void LLMarketplaceData::associateSLMListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id)
{
LLSD headers = LLSD::emptyMap();
headers["Accept"] = "application/json";
headers["Content-Type"] = "application/json";
LLSD data = LLSD::emptyMap();
// Send request
std::string url = getSLMConnectURL("/associate_inventory/")
+ folder_id.asString() + "/"
+ version_id.asString() + "/"
+ llformat("%d",listing_id);
llinfos << "Merov : associate listing : " << url << llendl;
LLHTTPClient::put(url, data, new LLSLMAssociateListingsResponder(), headers);
}
std::string LLMarketplaceData::getSLMConnectURL(const std::string& route)
{
......
......@@ -165,6 +165,7 @@ class LLMarketplaceData
//void getSLMListing();
void createSLMListing(const LLUUID& folder_id);
void updateSLMListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id, bool is_listed);
void associateSLMListing(const LLUUID& folder_id, S32 listing_id, const LLUUID& version_id);
bool isEmpty() { return (mMarketplaceItems.size() == 0); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment