本文整理汇总了Golang中github.com/pomack/dsocial/go/models/dsocial.Contact.UserId方法的典型用法代码示例。如果您正苦于以下问题:Golang Contact.UserId方法的具体用法?Golang Contact.UserId怎么用?Golang Contact.UserId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/pomack/dsocial/go/models/dsocial.Contact
的用法示例。
在下文中一共展示了Contact.UserId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: AddIdsForDsocialContact
func AddIdsForDsocialContact(c *dm.Contact, ds DataStoreService, dsocialUserId string) (err os.Error) {
if c == nil {
return
}
if c.UserId == "" {
c.UserId = dsocialUserId
}
if c.Acl.OwnerId == "" {
c.Acl.OwnerId = dsocialUserId
}
if c.Id == "" {
c.Id = ds.GenerateId(dsocialUserId, "contact")
}
if c.PostalAddresses != nil {
for _, addr := range c.PostalAddresses {
if addr.Acl.OwnerId == "" {
addr.Acl.OwnerId = dsocialUserId
}
if addr.Id == "" {
addr.Id = ds.GenerateId(dsocialUserId, "address")
}
}
}
if c.Educations != nil {
for _, ed := range c.Educations {
if ed.Acl.OwnerId == "" {
ed.Acl.OwnerId = dsocialUserId
}
if ed.Id == "" {
ed.Id = ds.GenerateId(dsocialUserId, "education")
}
}
}
if c.WorkHistories != nil {
for _, wh := range c.WorkHistories {
if wh.Acl.OwnerId == "" {
wh.Acl.OwnerId = dsocialUserId
}
if wh.Id == "" {
wh.Id = ds.GenerateId(dsocialUserId, "workhistory")
}
}
}
if c.PhoneNumbers != nil {
for _, p := range c.PhoneNumbers {
if p.Acl.OwnerId == "" {
p.Acl.OwnerId = dsocialUserId
}
if p.Id == "" {
p.Id = ds.GenerateId(dsocialUserId, "phone")
}
}
}
if c.EmailAddresses != nil {
for _, e := range c.EmailAddresses {
if e.Acl.OwnerId == "" {
e.Acl.OwnerId = dsocialUserId
}
if e.Id == "" {
e.Id = ds.GenerateId(dsocialUserId, "email")
}
}
}
if c.Uris != nil {
for _, u := range c.Uris {
if u.Acl.OwnerId == "" {
u.Acl.OwnerId = dsocialUserId
}
if u.Id == "" {
u.Id = ds.GenerateId(dsocialUserId, "uri")
}
}
}
if c.Ims != nil {
for _, im := range c.Ims {
if im.Acl.OwnerId == "" {
im.Acl.OwnerId = dsocialUserId
}
if im.Id == "" {
im.Id = ds.GenerateId(dsocialUserId, "im")
}
}
}
if c.Relationships != nil {
for _, r := range c.Relationships {
if r.Acl.OwnerId == "" {
r.Acl.OwnerId = dsocialUserId
}
if r.Id == "" {
r.Id = ds.GenerateId(dsocialUserId, "relationship")
}
}
}
if c.Dates != nil {
for _, d := range c.Dates {
if d.Acl.OwnerId == "" {
d.Acl.OwnerId = dsocialUserId
}
if d.Id == "" {
d.Id = ds.GenerateId(dsocialUserId, "date")
//.........这里部分代码省略.........