Private
Public Access
1
0

Initial commit: conversaions, status, version

This commit is contained in:
2023-06-16 23:35:41 -07:00
commit a2b14c88ea
8 changed files with 361 additions and 0 deletions

118
data/generators.go Normal file
View File

@@ -0,0 +1,118 @@
package data
import (
"math/rand"
"time"
"code.severnaya.net/kordophone-mock/v2/model"
"github.com/google/uuid"
)
func GenerateRandomName() string {
// Copilot generated these names.
names := []string{
"John",
"Jane",
"Joe",
"Jill",
"Jack",
"Jesse",
"Jenny",
"Jasper",
"Jill",
"Jen",
"Jared",
"Jesse",
"Jenny",
"Jasper",
"Jill",
"Jen",
"Jared",
"Jesse",
"Jenny",
"Jasper",
"Jill",
"Jen",
"Jared",
"Jesse",
"Jenny",
"Jasper",
"Jill",
"Jen",
"Jared",
"Jesse",
"Jenny",
"Jasper",
"Jill",
"Jen",
"Jared",
"Jesse",
"Jenny",
"Jasper",
"Jill",
"Jen",
"Jared",
"Jesse",
"Jenny",
"Jasper",
"Jill",
"Jen",
"Jared",
"Jesse",
"Jenny",
"Jasper",
"Jill",
"Jen",
"Jared",
"Jesse",
"Jenny",
"Jasper",
"Jill",
"Jen",
"Jared",
}
return names[rand.Intn(len(names))]
}
func GenerateRandomMessage() string {
// Copilot generated these messages.
messages := []string{
"Hello, how are you?",
"I'm doing well, how about you?",
"Good, thanks.",
"Great!",
"Awesome!",
"Wow!",
"Amazing!",
"Fantastic!",
"Stupendous!",
"Outstanding!",
"Unbelievable!",
"Unreal!",
"Whoa!",
"Rad!",
"Excellent!",
"Terrific!",
"Superb!",
"Marvelous!",
"Phenomenal!",
"Mind-blowing!",
"Incredible!",
"Extraordinary!",
}
return messages[rand.Intn(len(messages))]
}
func GenerateRandomConversation() model.Conversation {
conversation := model.Conversation{
Participants: []string{GenerateRandomName()},
UnreadCount: 0,
LastMessagePreview: GenerateRandomMessage(),
Guid: uuid.New().String(),
Date: time.Now().Add(-1 * time.Duration(rand.Intn(1000000)) * time.Second),
}
return conversation
}