|
|
@ -6,7 +6,7 @@ import ( |
|
|
|
"os" |
|
|
|
|
|
|
|
"git.aiterp.net/rpdata/api/internal/store" |
|
|
|
"git.aiterp.net/rpdata/api/model/character" |
|
|
|
"git.aiterp.net/rpdata/api/models/characters" |
|
|
|
) |
|
|
|
|
|
|
|
var fileName = flag.String("file", "./characters.json", "json file to load") |
|
|
@ -31,12 +31,12 @@ func main() { |
|
|
|
nicksAdded, nicksFailed := 0, 0 |
|
|
|
|
|
|
|
for _, info := range infos { |
|
|
|
char, err := character.New(info.Nicks[0], info.Name, info.ShortName, info.Author, "") |
|
|
|
char, err := characters.Add(info.Nicks[0], info.Name, info.ShortName, info.Author, "") |
|
|
|
if err != nil { |
|
|
|
log.Println(info.Nicks[0], "failed to insert:", err) |
|
|
|
charsFailed++ |
|
|
|
|
|
|
|
char, err = character.FindNick(info.Nicks[0]) |
|
|
|
char, err = characters.FindNick(info.Nicks[0]) |
|
|
|
if err != nil { |
|
|
|
continue |
|
|
|
} |
|
|
@ -46,7 +46,7 @@ func main() { |
|
|
|
} |
|
|
|
|
|
|
|
for _, alt := range info.Nicks[1:] { |
|
|
|
err := char.AddNick(alt) |
|
|
|
char, err = characters.AddNick(char, alt) |
|
|
|
if err != nil { |
|
|
|
log.Println(info.Nicks[0], "failed to add nick", alt, "error:", err) |
|
|
|
nicksFailed++ |
|
|
|