Conversation
…rite some models"
|
|
||
| class TokenManager { | ||
| private: | ||
| InMemoryDb tarantool; |
There was a problem hiding this comment.
Приватные переменные tarantool -> tarantool_
| int writeInMemory(const std::string& userName, const std::string& token, int status); | ||
| }; | ||
|
|
||
| class Auth : public AuthInterface { |
There was a problem hiding this comment.
class Auth, все поля класса должны быть либо приватными либо защищенными. Доступ к полям через сеттеры- геттеры
| int result = tokenMan.logoutUser(userName); | ||
| return result; | ||
| } | ||
| std::string loginUser (LoginData data) override { |
There was a problem hiding this comment.
data передается по значению
| int writeInMemory(const std::string& userName, const std::string& token, int status); | ||
| }; | ||
|
|
||
| class Auth : public AuthInterface { |
There was a problem hiding this comment.
Реализацию класса auth нужно вынести в cpp, а не hpp
| public: | ||
| User currentUser; | ||
| Auth() = default; | ||
| int logoutUser (std::string userName) override { |
There was a problem hiding this comment.
int logoutUser (std::string userName) override. Передача строки по значению.
| void logout(); | ||
|
|
||
| protected: | ||
| virtual void createMessengerLayout( |
There was a problem hiding this comment.
Почему отвечает за некое создание Layout’a мессенджера должен ответ унаследованный класс? Более в целом не ясно почему widget отвечает за создание Layout’a.
Или может выбрано неверное название метода?
| #include <cstdint> | ||
| #include <string> | ||
|
|
||
| class Compilation { |
There was a problem hiding this comment.
Структура с публичными полями
| class ICompilationManager { | ||
| public: | ||
| virtual Compilation runCompilation(const Snippet &snippet, const string &executionStdin) = 0; | ||
| }; |
| static void writeInputToFiles(const Compilation &compilation, const string &code, const string &input); | ||
|
|
||
| static void run(const Compilation &compilation); | ||
|
|
||
| static void removeOldDirs(); | ||
|
|
||
| void createDir(const Compilation &compilation); | ||
|
|
||
| static void readOutputFromFiles(Compilation &compilation); |
There was a problem hiding this comment.
Если методы static и private, то их можно убрать из hpp и полностью перенести в .cpp файл.
| // using ::testing::Return; | ||
| // class MockDb : public IMainDb { | ||
| // public: | ||
| // MOCK_METHOD(User*, searchUserLogin, (std::string login, std::string password), (override)); | ||
| // MOCK_METHOD(void, writeUser, (User& user), (override)); | ||
| // MOCK_METHOD(int, updateUser, (User& user), (override)); | ||
| // MOCK_METHOD(std::string, getCodeFromMessage, (uint32_t messageId), (override)); | ||
| // MOCK_METHOD(void, writeMessageToDialogue, (Message message), (override)); | ||
| // MOCK_METHOD(std::vector <Message>*, getNMessagesFromDialogue, (uint32_t dialogueId, uint32_t senderId, | ||
| // uint32_t receiverId, long count), (override)); | ||
| // MOCK_METHOD(std::vector <Dialogue>*, getDialoguessByUserId, (int userId), (override)); | ||
| // MOCK_METHOD(uint32_t, createDialogue, (uint32_t senderId, uint32_t receiverId), (override)); | ||
| // MOCK_METHOD(void, deleteMessageFromDialogue, (Message& message), (override)); | ||
| // MOCK_METHOD(void, deleteDialogue, (Dialogue& dialogue), (override)); | ||
| // }; |
No description provided.