// CreateUser creates a new user
CreateUser creates a new user
// CreateUser creates a new user
func (us *UserService) CreateUser(user models.User) error {
	us.UserRepos.OpenTransaction()
	hashedPwd, _ := models.GeneratePassword(user.Password)
	user.Password = string(hashedPwd)
	user.Id = bson.NewObjectId()
	err := us.UserRepos.CreateUser(user)
	releaseConnection(us)
	return err
}
func ( us * UserService ) CreateUser ( user models . User ) error { us . UserRepos . OpenTransaction ( ) hashedPwd , _ := models . GeneratePassword ( user . Password ) user . Password = string ( hashedPwd ) user . Id = bson . NewObjectId ( ) err := us . UserRepos . CreateUser ( user ) releaseConnection ( us ) return err }
CreateUser creates a new user
CreateUser creates a new user