//------------------------------------------------------------------------------ // // This code was generated by a tool. // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ package cfg import "errors" type GameShopCenterControlData struct { Id int32 Pagetext string Discounttext string Text string Type int32 Index int32 Banner string Bg string Slogan string Point string Props []*Gameatn Restriction int32 Lv int32 On int32 Time int32 Times int32 Duration int32 Loop int32 } const TypeId_GameShopCenterControlData = 1201366464 func (*GameShopCenterControlData) GetTypeId() int32 { return 1201366464 } func (_v *GameShopCenterControlData)Deserialize(_buf map[string]interface{}) (err error) { { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) } {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["pagetext"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Pagetext error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Pagetext, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["discounttext"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Discounttext error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Discounttext, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["text"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Text error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Text, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["type"].(float64); !_ok_ { err = errors.New("type error"); return }; _v.Type = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["index"].(float64); !_ok_ { err = errors.New("index error"); return }; _v.Index = int32(_tempNum_) } { var _ok_ bool; if _v.Banner, _ok_ = _buf["banner"].(string); !_ok_ { err = errors.New("banner error"); return } } { var _ok_ bool; if _v.Bg, _ok_ = _buf["bg"].(string); !_ok_ { err = errors.New("bg error"); return } } {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["slogan"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Slogan error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Slogan, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } { var _ok_ bool; if _v.Point, _ok_ = _buf["point"].(string); !_ok_ { err = errors.New("point error"); return } } { var _arr_ []interface{} var _ok_ bool if _arr_, _ok_ = _buf["props"].([]interface{}); !_ok_ { err = errors.New("props error"); return } _v.Props = make([]*Gameatn, 0, len(_arr_)) for _, _e_ := range _arr_ { var _list_v_ *Gameatn { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } } _v.Props = append(_v.Props, _list_v_) } } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["restriction"].(float64); !_ok_ { err = errors.New("restriction error"); return }; _v.Restriction = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["lv"].(float64); !_ok_ { err = errors.New("lv error"); return }; _v.Lv = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["on"].(float64); !_ok_ { err = errors.New("on error"); return }; _v.On = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["time"].(float64); !_ok_ { err = errors.New("time error"); return }; _v.Time = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["times"].(float64); !_ok_ { err = errors.New("times error"); return }; _v.Times = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["duration"].(float64); !_ok_ { err = errors.New("duration error"); return }; _v.Duration = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["loop"].(float64); !_ok_ { err = errors.New("loop error"); return }; _v.Loop = int32(_tempNum_) } return } func DeserializeGameShopCenterControlData(_buf map[string]interface{}) (*GameShopCenterControlData, error) { v := &GameShopCenterControlData{} if err := v.Deserialize(_buf); err == nil { return v, nil } else { return nil, err } }