NEW: [STUDIO-2476] design_staffpick

This reverts commit 4d13a44a2e4136d0c2e173e367e13f6a6ba00670.

Reason for revert: 123

Change-Id: I008a0ab3540589e5938fb3e1814571e00c467227
This commit is contained in:
战马 2023-04-19 08:50:22 +08:00 committed by Lane.Wei
parent 8eb84e8d4f
commit 0a9d33157a
18 changed files with 363 additions and 556 deletions

View file

@ -92,10 +92,12 @@ func_get_slice_info NetworkAgent::get_slice_info_ptr = nullptr;
func_query_bind_status NetworkAgent::query_bind_status_ptr = nullptr;
func_modify_printer_name NetworkAgent::modify_printer_name_ptr = nullptr;
func_get_camera_url NetworkAgent::get_camera_url_ptr = nullptr;
func_get_design_staffpick NetworkAgent::get_design_staffpick_ptr = nullptr;
func_start_pubilsh NetworkAgent::start_publish_ptr = nullptr;
func_get_profile_3mf NetworkAgent::get_profile_3mf_ptr = nullptr;
func_get_model_publish_url NetworkAgent::get_model_publish_url_ptr = nullptr;
func_get_model_mall_home_url NetworkAgent::get_model_mall_home_url_ptr = nullptr;
func_get_model_mall_detail_url NetworkAgent::get_model_mall_detail_url_ptr = nullptr;
func_get_my_profile NetworkAgent::get_my_profile_ptr = nullptr;
func_track_enable NetworkAgent::track_enable_ptr = nullptr;
func_track_event NetworkAgent::track_event_ptr = nullptr;
@ -238,11 +240,13 @@ int NetworkAgent::initialize_network_module(bool using_backup)
get_slice_info_ptr = reinterpret_cast<func_get_slice_info>(get_network_function("bambu_network_get_slice_info"));
query_bind_status_ptr = reinterpret_cast<func_query_bind_status>(get_network_function("bambu_network_query_bind_status"));
modify_printer_name_ptr = reinterpret_cast<func_modify_printer_name>(get_network_function("bambu_network_modify_printer_name"));
get_camera_url_ptr = reinterpret_cast<func_get_camera_url>(get_network_function("bambu_network_get_camera_url"));
get_camera_url_ptr = reinterpret_cast<func_get_camera_url>(get_network_function("bambu_network_get_camera_url"));
get_design_staffpick_ptr = reinterpret_cast<func_get_design_staffpick>(get_network_function("bambu_network_get_design_staffpick"));
start_publish_ptr = reinterpret_cast<func_start_pubilsh>(get_network_function("bambu_network_start_publish"));
get_profile_3mf_ptr = reinterpret_cast<func_get_profile_3mf>(get_network_function("bambu_network_get_profile_3mf"));
get_model_publish_url_ptr = reinterpret_cast<func_get_model_publish_url>(get_network_function("bambu_network_get_model_publish_url"));
get_model_mall_home_url_ptr = reinterpret_cast<func_get_model_mall_home_url>(get_network_function("bambu_network_get_model_mall_home_url"));
get_model_mall_detail_url_ptr = reinterpret_cast<func_get_model_mall_detail_url>(get_network_function("bambu_network_get_model_mall_detail_url"));
get_my_profile_ptr = reinterpret_cast<func_get_my_profile>(get_network_function("bambu_network_get_my_profile"));
track_enable_ptr = reinterpret_cast<func_track_enable>(get_network_function("bambu_network_track_enable"));
track_event_ptr = reinterpret_cast<func_track_event>(get_network_function("bambu_network_track_event"));
@ -339,10 +343,12 @@ int NetworkAgent::unload_network_module()
query_bind_status_ptr = nullptr;
modify_printer_name_ptr = nullptr;
get_camera_url_ptr = nullptr;
get_design_staffpick_ptr = nullptr;
start_publish_ptr = nullptr;
get_profile_3mf_ptr = nullptr;
get_model_publish_url_ptr = nullptr;
get_model_mall_home_url_ptr = nullptr;
get_model_mall_detail_url_ptr = nullptr;
get_my_profile_ptr = nullptr;
track_enable_ptr = nullptr;
track_event_ptr = nullptr;
@ -1088,6 +1094,17 @@ int NetworkAgent::get_camera_url(std::string dev_id, std::function<void(std::str
return ret;
}
int NetworkAgent::get_design_staffpick(int offset, int limit, std::function<void(std::string)> callback)
{
int ret = 0;
if (network_agent && get_design_staffpick_ptr) {
ret = get_design_staffpick_ptr(network_agent, offset, limit, callback);
if (ret)
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(" error: network_agent=%1%, ret=%2%")%network_agent %ret;
}
return ret;
}
int NetworkAgent::start_publish(PublishParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn, std::string *out)
{
int ret = 0;
@ -1131,6 +1148,17 @@ int NetworkAgent::get_model_mall_home_url(std::string* url)
return ret;
}
int NetworkAgent::get_model_mall_detail_url(std::string* url, std::string id)
{
int ret = 0;
if (network_agent && get_model_publish_url_ptr) {
ret = get_model_mall_detail_url_ptr(network_agent, url, id);
if (ret)
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(" error: network_agent=%1%, ret=%2%") % network_agent % ret;
}
return ret;
}
int NetworkAgent::get_my_profile(std::string token, unsigned int *http_code, std::string *http_body)
{
int ret = 0;