// CreateUser create a new user
CreateUser create a new user
// CreateUser create a new user
func (ur *UserMongoRepository) CreateUser(user models.User) error {
	hashedPwd, _ := models.GeneratePassword(user.Password)
	user.Password = string(hashedPwd)
	user.Id = bson.NewObjectId()
	session, db := database.GetSessionAndDB(database.MONGO_DB)
	err := db.C(USERS_COLLECTION).Insert(&user)
	database.MongoDBPool.Close(session)
	return err
}
func ( ur * UserMongoRepository ) CreateUser ( user models . User ) error { hashedPwd , _ := models . GeneratePassword ( user . Password ) user . Password = string ( hashedPwd ) user . Id = bson . NewObjectId ( ) session , db := database . GetSessionAndDB ( database . MONGO_DB ) err := db . C ( USERS_COLLECTION ) . Insert ( & user ) database . MongoDBPool . Close ( session ) return err }
CreateUser create a new user
CreateUser create a new user