当前位置: 首页>>代码示例>>Golang>>正文


Golang JSONObject.GetAsBool方法代码示例

本文整理汇总了Golang中github.com/pomack/jsonhelper/go/jsonhelper.JSONObject.GetAsBool方法的典型用法代码示例。如果您正苦于以下问题:Golang JSONObject.GetAsBool方法的具体用法?Golang JSONObject.GetAsBool怎么用?Golang JSONObject.GetAsBool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/pomack/jsonhelper/go/jsonhelper.JSONObject的用法示例。


在下文中一共展示了JSONObject.GetAsBool方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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")
}
开发者ID:pomack,项目名称:oauth2_client.go,代码行数:34,代码来源:yahoo.go

示例2: FromJSON

func (p *smugMugUserInfoResult) FromJSON(props jsonhelper.JSONObject) {
	LogDebug("user info result from json: ", props)
	p.id = props.GetAsInt64("id")
	p.accountStatus = props.GetAsString("AccountStatus")
	p.accountType = props.GetAsString("AccountType")
	p.fileSizeLimit = props.GetAsInt64("FileSizeLimit")
	p.name = props.GetAsString("Name")
	p.nickname = props.GetAsString("NickName")
	p.smugVault = props.GetAsBool("SmugVault")
	p.url = props.GetAsString("URL")
}
开发者ID:pomack,项目名称:oauth2_client.go,代码行数:11,代码来源:smugmug.go

示例3: InitFromJSONObject

func (p *User) InitFromJSONObject(obj jsonhelper.JSONObject) {
	p.PersistableModel.InitFromJSONObject(obj)
	p.Role = obj.GetAsInt32("role")
	p.Name = obj.GetAsString("name")
	p.Username = obj.GetAsString("username")
	p.Email = obj.GetAsString("email")
	p.PhoneNumber = obj.GetAsString("phone_number")
	p.Address = obj.GetAsString("address")
	p.ContactId = obj.GetAsString("contact_id")
	p.AllowLogin = obj.GetAsBool("allow_login")
	p.IsPayingUser = obj.GetAsBool("is_paying_user")
	p.Notes = obj.GetAsString("notes")
	p.DisableLoginAt = obj.GetAsInt64("disable_login_at")
}
开发者ID:pombredanne,项目名称:dsocial.go,代码行数:14,代码来源:accounts.go


注:本文中的github.com/pomack/jsonhelper/go/jsonhelper.JSONObject.GetAsBool方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。