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


Golang JSONObject.GetAsString方法代码示例

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


在下文中一共展示了JSONObject.GetAsString方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: SetFromJSON

func (p *loginAccountContext) SetFromJSON(obj jsonhelper.JSONObject) {
	p.username = obj.GetAsString("username")
	p.password = obj.GetAsString("password")
	p.inputValidated = false
	p.user = nil
	p.result = nil
}
开发者ID:pomack,项目名称:dsocial.go,代码行数:7,代码来源:login.go

示例2: FromJSON

func (p *Name) FromJSON(o jsonhelper.JSONObject) {
	p.GivenName = o.GetAsString("givenName")
	p.MiddleName = o.GetAsString("middleName")
	p.FamilyName = o.GetAsString("familyName")
	p.Prefix = o.GetAsString("prefix")
	p.Suffix = o.GetAsString("suffix")
	p.GivenNameSound = o.GetAsString("givenNameSound")
	p.FamilyNameSound = o.GetAsString("familyNameSound")
}
开发者ID:pombredanne,项目名称:contacts.go,代码行数:9,代码来源:structs.go

示例3: 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

示例4: SetFromJSON

func (p *createAccountContext) SetFromJSON(obj jsonhelper.JSONObject) {
	p.user = nil
	p.consumer = nil
	p.externalUser = nil
	theType := p.theType
	if theType == "" {
		theType = obj.GetAsString("type")
	}
	switch theType {
	case "user":
		p.user = new(dm.User)
		p.user.InitFromJSONObject(obj)
	case "consumer":
		p.consumer = new(dm.Consumer)
		p.consumer.InitFromJSONObject(obj)
	case "external_user":
		p.externalUser = new(dm.ExternalUser)
		p.externalUser.InitFromJSONObject(obj)
	}
}
开发者ID:pombredanne,项目名称:dsocial.go,代码行数:20,代码来源:create.go

示例5: InitFromJSONObject

func (p *Consumer) InitFromJSONObject(obj jsonhelper.JSONObject) {
	p.PersistableModel.InitFromJSONObject(obj)
	p.DomainName = obj.GetAsString("domain_name")
	p.HomePage = obj.GetAsString("home_page")
	p.AuthorizationPage = obj.GetAsString("authorization_page")
	p.ShortName = obj.GetAsString("short_name")
	p.Name = obj.GetAsString("name")
	p.Email = obj.GetAsString("email")
	p.PhoneNumber = obj.GetAsString("phone_number")
	p.IsTrusted = obj.GetAsBool("is_trusted")
	p.IsSuggested = obj.GetAsBool("is_suggested")
	p.AllowLogin = obj.GetAsBool("allow_login")
	p.DisableLoginAt = obj.GetAsInt64("disable_login_at")
}
开发者ID:pombredanne,项目名称:dsocial.go,代码行数:14,代码来源:accounts.go

示例6: SetFromJSON

func (p *setPasswordContext) SetFromJSON(obj jsonhelper.JSONObject) {
	p.password = obj.GetAsString("password")
	p.result = nil
}
开发者ID:pomack,项目名称:dsocial.go,代码行数:4,代码来源:set_password.go

示例7: Initialize

func (p *linkedInClient) Initialize(properties jsonhelper.JSONObject) {
	if p.currentCredentials == nil {
		p.currentCredentials = NewStandardAuthToken()
	}
	if properties == nil {
		return
	}
	if v := properties.GetAsString("linkedin.api.key"); len(v) > 0 {
		p.consumerKey = v
		//p.Credentials.Token = v
	}
	if v := properties.GetAsString("linkedin.client.redirect_uri"); len(v) > 0 {
		p.callbackUrl = v
	}
	if v := properties.GetAsString("linkedin.secret.key"); len(v) > 0 {
		p.consumerSecret = v
		//p.Credentials.Secret = v
	}
	if v := properties.GetAsString("linkedin.oauth1.scope"); len(v) > 0 {
		//p.Scope = v
	}
	if v := properties.GetAsString("linkedin.client.token"); len(v) > 0 {
		p.currentCredentials.SetToken(v)
	}
	if v := properties.GetAsString("linkedin.client.secret"); len(v) > 0 {
		p.currentCredentials.SetSecret(v)
	}
}
开发者ID:pomack,项目名称:oauth2_client.go,代码行数:28,代码来源:linkedin.go

示例8: FromJSON

func (p *yahooUserInfoIm) FromJSON(props jsonhelper.JSONObject) {
	p.handle = props.GetAsString("handle")
	p.id = props.GetAsInt("id")
	p.theType = props.GetAsString("type")
}
开发者ID:pomack,项目名称:oauth2_client.go,代码行数:5,代码来源:yahoo.go

示例9: Initialize

func (p *yahooClient) Initialize(properties jsonhelper.JSONObject) {
	if p.currentCredentials == nil {
		p.currentCredentials = &yahooAccessTokenResult{}
	}
	if properties == nil {
		return
	}
	if v := properties.GetAsString("yahoo.realm"); len(v) > 0 {
		p.realm = v
	}
	if v := properties.GetAsString("yahoo.consumer.key"); len(v) > 0 {
		p.consumerKey = v
		//p.Credentials.Token = v
	}
	if v := properties.GetAsString("yahoo.consumer.secret"); len(v) > 0 {
		p.consumerSecret = v
		//p.Credentials.Secret = v
	}
	if v := properties.GetAsString("yahoo.client.redirect_uri"); len(v) > 0 {
		p.callbackUrl = v
	}
	if v := properties.GetAsString("yahoo.oauth1.scope"); len(v) > 0 {
		//p.Scope = v
	}
	if v := properties.GetAsString("yahoo.client.token"); len(v) > 0 {
		p.currentCredentials.SetToken(v)
	}
	if v := properties.GetAsString("yahoo.client.secret"); len(v) > 0 {
		p.currentCredentials.SetSecret(v)
	}
}
开发者ID:pomack,项目名称:oauth2_client.go,代码行数:31,代码来源:yahoo.go

示例10: Initialize

func (p *smugMugClient) Initialize(properties jsonhelper.JSONObject) {
	if p.currentCredentials == nil {
		p.currentCredentials = NewStandardAuthToken()
	}
	if properties == nil {
		return
	}
	if v := properties.GetAsString("smugmug.realm"); len(v) > 0 {
		p.realm = v
	}
	if v := properties.GetAsString("smugmug.app.name"); len(v) > 0 {
		p.appName = v
	}
	if v := properties.GetAsString("smugmug.consumer.key"); len(v) > 0 {
		p.consumerKey = v
		//p.Credentials.Token = v
	}
	if v := properties.GetAsString("smugmug.consumer.secret"); len(v) > 0 {
		p.consumerSecret = v
		//p.Credentials.Secret = v
	}
	if v := properties.GetAsString("smugmug.client.redirect_uri"); len(v) > 0 {
		p.callbackUrl = v
	}
	if v := properties.GetAsString("smugmug.oauth1.scope"); len(v) > 0 {
		//p.Scope = v
	}
	if v := properties.GetAsString("smugmug.client.token"); len(v) > 0 {
		p.currentCredentials.SetToken(v)
	}
	if v := properties.GetAsString("smugmug.client.secret"); len(v) > 0 {
		p.currentCredentials.SetSecret(v)
	}
}
开发者ID:pomack,项目名称:oauth2_client.go,代码行数:34,代码来源:smugmug.go

示例11: FromJSON

func (p *facebookLocation) FromJSON(props jsonhelper.JSONObject) {
	p.id = props.GetAsString("id")
	p.name = props.GetAsString("name")
}
开发者ID:pomack,项目名称:oauth2_client.go,代码行数:4,代码来源:facebook.go

示例12: InitFromJSONObject

func (p *PersistableModel) InitFromJSONObject(obj jsonhelper.JSONObject) {
	p.Id = obj.GetAsString("id")
	p.Etag = obj.GetAsString("etag")
	p.CreatedAt = obj.GetAsInt64("created_at")
	p.ModifiedAt = obj.GetAsInt64("modified_at")
}
开发者ID:pombredanne,项目名称:dsocial.go,代码行数:6,代码来源:util.go

示例13: FromJSON

func (p *linkedInUserInfoResult) FromJSON(props jsonhelper.JSONObject) {
	p.id = props.GetAsString("id")
	p.firstName = props.GetAsString("firstName")
	p.lastName = props.GetAsString("lastName")
	p.publicProfileUrl = props.GetAsString("publicProfileUrl")
}
开发者ID:pomack,项目名称:oauth2_client.go,代码行数:6,代码来源:linkedin.go


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