add games

This commit is contained in:
2026-07-28 00:02:11 +07:00
parent 10b3d450e9
commit 65763a3e10
3 changed files with 9 additions and 1 deletions
Binary file not shown.
@@ -20,7 +20,6 @@ func NewGenerator(length int) IPasswordGenerator {
} }
func (g *generator) Generate() (string, error) { func (g *generator) Generate() (string, error) {
return "1", nil
password := make([]byte, g.length) password := make([]byte, g.length)
for i := range password { for i := range password {
num, err := rand.Int(rand.Reader, big.NewInt(int64(len(charset)))) num, err := rand.Int(rand.Reader, big.NewInt(int64(len(charset))))
@@ -174,6 +174,15 @@ func (s *ScenarioService) updateStory(ctx context.Context, id int, story *storyt
return errors.New("Такой код точки уже существует") return errors.New("Такой код точки уже существует")
} }
cleanPlaces := make([]*storytelling.Place, 0, len(story.Places))
for _, place := range story.Places {
if place.Code == "" {
continue
}
cleanPlaces = append(cleanPlaces, place)
}
story.Places = cleanPlaces
storyString, err := convertStory(story) storyString, err := convertStory(story)
if err != nil { if err != nil {
return err return err