package main
import "fmt"
import "encoding/json"
func main () {
info := "{\"product_id\":\"3493509111281241469\",\"enter_from_merge\":\"discover_page\",\"auto_coupon\":0,\"follow_status\":0,\"is_crossborder_goods\":0,\"pd_button_status\":2,\"with_sku\":1,\"recommend_info\":\"{\\\"product\\\":{\\\"page_num\\\":1,\\\"page_name\\\":\\\"product_detail\\\",\\\"reason\\\":\\\"viking_ecom_center_category:509:13.6774,viking_ecom_center_category_multi_interest:433:12.355\\\",\\\"is_new\\\":0,\\\"last_impr\\\":0,\\\"viking_ecom_center_category_multi_interest\\\":12.355035781860352,\\\"viking_ecom_center_category\\\":13.677404403686524,\\\"sim_id\\\":3493638477877224423,\\\"leaf_ctg\\\":20172,\\\"ctg1\\\":20009,\\\"pred_ctg1\\\":20009,\\\"pred_leaf_ctg\\\":20172,\\\"predict_score\\\":0.8763306140899658,\\\"product_click\\\":0.005102187395095825,\\\"order_submit\\\":0.014569640159606934,\\\"rough_ctr\\\":0.011441737413406372,\\\"rough_cvr\\\":0.028731346130371098,\\\"related_gid\\\":3493509111281241469},\\\"channel_id\\\":1111819,\\\"mix\\\":{\\\"ctr\\\":0.0,\\\"cvr\\\":0.0,\\\"nctr\\\":0.0,\\\"ncvr\\\":0.0,\\\"ctmn\\\":\\\"\\\",\\\"cvmn\\\":\\\"\\\",\\\"pos\\\":0,\\\"tab_id\\\":0,\\\"page_num\\\":1,\\\"price\\\":0}}\",\"is_global\":0,\"is_explaining\":0,\"from_entrance\":\"live_shopping_cart\",\"module_label\":\"guess_you_like_product\",\"action_type\":\"click\",\"screen_type\":0,\"enter_from\":\"live\",\"list_num\":1,\"product_activity_type\":\"nonactivity\",\"is_replay\":0,\"label_name_live\":\"quality_guaranteed,freight_insurance\",\"extra_campaign_type\":\"\",\"full_return\":\"0\",\"inventory_status\":0,\"category_name\":\"discover_page_temai_video_head\",\"ecom_group_type\":\"live\",\"enter_method\":\"video_head\",\"label_name\":\"securebuy_prd\",\"rank_id_source\":\"\",\"anchor_id\":\"109635194225\",\"is_package_sale\":0,\"reason_type\":\"product_ranking\",\"commodity_type\":\"6\",\"live_id\":1,\"avl_discount\":\"0\",\"kol_user_tag\":\"0\",\"coupon_id\":\"\",\"brand_verified\":\"0\",\"carrier_type\":\"live_popup_card\",\"with_coupon\":1,\"real_price\":\"0\",\"is_with_video\":0,\"has_rank_id\":\"6985126621615259935\",\"is_white_base\":0,\"carrier_source\":\"discover_page\",\"cash_rebate\":\"0\",\"product_source_page\":\"product_detail\",\"lottery_status\":0,\"coupon_type\":\"\",\"show_rank\":\"show_rank\",\"is_explain_apply\":0,\"insurance_commodity_flag\":\"0\",\"is_show\":\"0,0\",\"source_method\":\"video_head\",\"room_id\":\"7009294907403766532\",\"commodity_id\":\"3493509111281241469\",\"local_num\":0,\"source_page\":\"discover_page_temai_video_head\",\"request_id\":\"202109190058200101351541375D3211E2\",\"product_belong\":\"live\",\"cost_price\":\"29.9\",\"is_groupbuying\":0}"
var out map[string]interface{}
if jsonErr := json.Unmarshal([]byte(info), &out); jsonErr != nil {
fmt.Printf("Err: %v", jsonErr)
return
}
if guess, ok := out["module_label"].(string); ok && guess == "guess_you_like_product" {
fmt.Println(guess)
} else {
fmt.Println("没有这个字段")
}
}