本文整理汇总了Golang中github.com/JacobXie/leanote/app/info.User.Email方法的典型用法代码示例。如果您正苦于以下问题:Golang User.Email方法的具体用法?Golang User.Email怎么用?Golang User.Email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/JacobXie/leanote/app/info.User
的用法示例。
在下文中一共展示了User.Email方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: AddUser
// 添加用户
func (this *UserService) AddUser(user info.User) bool {
if user.UserId == "" {
user.UserId = bson.NewObjectId()
}
user.CreatedTime = time.Now()
if user.Email != "" {
user.Email = strings.ToLower(user.Email)
// 发送验证邮箱
go func() {
emailService.RegisterSendActiveEmail(user, user.Email)
// 发送给我 [email protected]
emailService.SendEmail("[email protected]", "新增用户", "{header}用户名"+user.Email+"{footer}")
}()
}
return db.Insert(db.Users, user)
}
示例2: Init
//.........这里部分代码省略.........
// user
Users = Session.DB(dbname).C("users")
// group
Groups = Session.DB(dbname).C("groups")
GroupUsers = Session.DB(dbname).C("group_users")
// blog
Blogs = Session.DB(dbname).C("blogs")
// tag
Tags = Session.DB(dbname).C("tags")
NoteTags = Session.DB(dbname).C("note_tags")
TagCounts = Session.DB(dbname).C("tag_count")
// blog
UserBlogs = Session.DB(dbname).C("user_blogs")
BlogSingles = Session.DB(dbname).C("blog_singles")
Themes = Session.DB(dbname).C("themes")
// find password
Tokens = Session.DB(dbname).C("tokens")
// Suggestion
Suggestions = Session.DB(dbname).C("suggestions")
// Album & file
Albums = Session.DB(dbname).C("albums")
Files = Session.DB(dbname).C("files")
Attachs = Session.DB(dbname).C("attachs")
NoteImages = Session.DB(dbname).C("note_images")
Configs = Session.DB(dbname).C("configs")
EmailLogs = Session.DB(dbname).C("email_logs")
// 社交
BlogLikes = Session.DB(dbname).C("blog_likes")
BlogComments = Session.DB(dbname).C("blog_comments")
// 举报
Reports = Session.DB(dbname).C("reports")
// session
Sessions = Session.DB(dbname).C("sessions")
//Modified by JacobXie
//系统初始化,即初始化管理员和一些基本数据
countNum, err := Users.Count()
if err != nil {
panic(err)
}
if countNum == 0 {
//初始化管理员,admin,密码 admin123
user := info.User{}
user.UserId = bson.NewObjectId()
user.Email = "[email protected]"
user.Verified = true
user.Username = "admin"
user.UsernameRaw = "admin"
user.Pwd = GenPwd("admin123")
user.CreatedTime = time.Now()
user.Theme = "simple"
user.NotebookWidth = 160
user.NoteListWidth = 266
Insert(Users, user)