-
Notifications
You must be signed in to change notification settings - Fork 2
Добавил команду /givepass для продления проходок #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
не, лапитана не надо пинговать, @ArtemBalakin всё видит |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
такое грузить не оч хорошо, это должно контролится через gitignore, но следи все равно)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Да, мой косяк,проморгал
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а как ты видишь, какая цель у этого класса? т.е , какую задачу он решает
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Если на сервере какие-то тех. неполадки и нужно продлить пользователям проходки ибо они не виноваты в технических проблемах.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я имел в виду несколько иной подход: класс должен выполнять только действия, связанные с конкретной командой, например, продлением проходок. В текущей реализации он дополнительно занимается чтением и записью данных в файл.
В данном случае, класс небольшой, это не создаёт значительных проблем. Однако в более сложных проектах предпочтительно разделять функциональность, создавая отдельные утилитные классы для работы с файлами. Постоянное создание объектов для чтения и записи (Reader/Writer) вручную, вместо использования готовых экземпляров из одного класса, может привести к сложностям с отладкой ошибок, связанных с их настройками.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Да,я понимаю, просто посчитал что в данном случае так как проект маленький, то можно реализовать reader/writer не вынося их в отдельный класс. Для масштабируемости конечно лучше вынести, если надо, то могу реализовать
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Кстати, этого в задаче не было, но чисто на "подумать". Часто бывает, что либо в БД, либо с фронта( если он есть), приходит Json, с полями, названия которых отличаются от бековских.
Типа: в коде у нас lastPaymentDate, а приходит last_payment_date, есть представление, как такое разруливать?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В Gson если я правильно понимаю можно использовать аннотацию @SerializedName в котором указывается имя переменной с которой к нам приходит Json.
PlayerJoinListner-фиксирует заход каждого игрока и добавляет информацию по нему в json файл нужного формата
PlayerPass-содержит структуру Json
GivePassCommand-Реализация команды раздачи проходок