本文整理汇总了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
}
示例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")
}
示例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")
}
示例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)
}
}
示例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")
}
示例6: SetFromJSON
func (p *setPasswordContext) SetFromJSON(obj jsonhelper.JSONObject) {
p.password = obj.GetAsString("password")
p.result = nil
}
示例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)
}
}
示例8: FromJSON
func (p *yahooUserInfoIm) FromJSON(props jsonhelper.JSONObject) {
p.handle = props.GetAsString("handle")
p.id = props.GetAsInt("id")
p.theType = props.GetAsString("type")
}
示例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)
}
}
示例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)
}
}
示例11: FromJSON
func (p *facebookLocation) FromJSON(props jsonhelper.JSONObject) {
p.id = props.GetAsString("id")
p.name = props.GetAsString("name")
}
示例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")
}
示例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")
}