improve the functions related to commenting on images

This commit is contained in:
landaiqing
2024-09-23 00:53:43 +08:00
parent 8d5d918a7d
commit 7aae53e533
32 changed files with 1004 additions and 86 deletions

View File

@@ -0,0 +1,20 @@
package randomname
import (
"math/rand"
"time"
)
// GenerateName 生成随机昵称
func GenerateName() string {
var name string
rand.New(rand.NewSource(time.Now().UnixNano()))
selectedType := RandomType(rand.Intn(2))
switch selectedType {
case AdjectiveAndPerson:
name = AdjectiveSlice[rand.Intn(AdjectiveSliceCount)] + PersonSlice[rand.Intn(PersonSliceCount)]
case PersonActSomething:
name = PersonSlice[rand.Intn(PersonSliceCount)] + ActSomethingSlice[rand.Intn(ActSomethingSliceCount)]
}
return name
}