本文整理汇总了Golang中github.com/pomack/jsonhelper/go/jsonhelper.JSONObject.GetAsInt方法的典型用法代码示例。如果您正苦于以下问题:Golang JSONObject.GetAsInt方法的具体用法?Golang JSONObject.GetAsInt怎么用?Golang JSONObject.GetAsInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/pomack/jsonhelper/go/jsonhelper.JSONObject
的用法示例。
在下文中一共展示了JSONObject.GetAsInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: FromJSON
func (p *yahooUserInfoResult) FromJSON(props jsonhelper.JSONObject) {
p.guid = props.GetAsString("guid")
p.uri = props.GetAsString("uri")
p.birthYear = props.GetAsInt("birthYear")
p.birthdate = props.GetAsString("birthdate")
p.created = props.GetAsTime("created", YAHOO_DATETIME_FORMAT)
p.displayAge = props.GetAsInt("displayAge")
emails := props.GetAsArray("emails")
p.emails = make([]YahooUserInfoEmail, len(emails))
for i, email := range emails {
v := new(yahooUserInfoEmail)
v.FromJSON(jsonhelper.JSONValueToObject(email))
p.emails[i] = v
}
p.familyName = props.GetAsString("familyName")
p.givenName = props.GetAsString("givenName")
p.gender = props.GetAsString("gender")
ims := props.GetAsArray("ims")
p.ims = make([]YahooUserInfoIm, len(ims))
for i, im := range ims {
v := new(yahooUserInfoIm)
v.FromJSON(jsonhelper.JSONValueToObject(im))
p.ims[i] = v
}
p.lang = props.GetAsString("lang")
p.location = props.GetAsString("location")
p.memberSince = props.GetAsTime("memberSince", YAHOO_DATETIME_FORMAT)
p.nickname = props.GetAsString("nickname")
p.profileUrl = props.GetAsString("profileUrl")
p.searchable = props.GetAsBool("searchable")
p.timeZone = props.GetAsString("timeZone")
p.updated = props.GetAsTime("updated", YAHOO_DATETIME_FORMAT)
p.isConnected = props.GetAsBool("isConnected")
}
示例2: FromJSON
func (p *Date) FromJSON(o jsonhelper.JSONObject) {
p.Year = o.GetAsInt("year")
p.Month = o.GetAsInt("month")
p.Day = o.GetAsInt("day")
}