go_dreamfactory/sys/configure/structs/MyBean.Items.go
2022-05-31 13:42:54 +08:00

46 lines
2.0 KiB
Go

//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
import "errors"
type MyBeanItems struct {
Id int32
Name string
Desc string
Price int32
ExpireTime *int32
BatchUseable bool
}
const TypeId_MyBeanItems = -1804629298
func (*MyBeanItems) GetTypeId() int32 {
return -1804629298
}
func (_v *MyBeanItems)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; if _v.Name, _ok_ = _buf["name"].(string); !_ok_ { err = errors.New("name error"); return } }
{ var _ok_ bool; if _v.Desc, _ok_ = _buf["desc"].(string); !_ok_ { err = errors.New("desc error"); return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["price"].(float64); !_ok_ { err = errors.New("price error"); return }; _v.Price = int32(_tempNum_) }
{ var _ok_ bool; var __json_expire_time__ interface{}; if __json_expire_time__, _ok_ = _buf["expire_time"]; !_ok_ || __json_expire_time__ == nil { _v.ExpireTime = nil } else { var __x__ int32; { var _ok_ bool; var _x_ float64; if _x_, _ok_ = __json_expire_time__.(float64); !_ok_ { err = errors.New("__x__ error"); return }; __x__ = int32(_x_) }; _v.ExpireTime = &__x__ }}
{ var _ok_ bool; if _v.BatchUseable, _ok_ = _buf["batch_useable"].(bool); !_ok_ { err = errors.New("batch_useable error"); return } }
return
}
func DeserializeMyBeanItems(_buf map[string]interface{}) (*MyBeanItems, error) {
v := &MyBeanItems{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
}