Skip to content

Pull request (merging) for reviewing#5

Open
tr0llex wants to merge 157 commits intomainfrom
merging_with_db
Open

Pull request (merging) for reviewing#5
tr0llex wants to merge 157 commits intomainfrom
merging_with_db

Conversation

@tr0llex
Copy link
Copy Markdown
Owner

@tr0llex tr0llex commented Jun 1, 2021

No description provided.


class TokenManager {
private:
InMemoryDb tarantool;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Приватные переменные tarantool -> tarantool_

int writeInMemory(const std::string& userName, const std::string& token, int status);
};

class Auth : public AuthInterface {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class Auth, все поля класса должны быть либо приватными либо защищенными. Доступ к полям через сеттеры- геттеры

int result = tokenMan.logoutUser(userName);
return result;
}
std::string loginUser (LoginData data) override {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data передается по значению

int writeInMemory(const std::string& userName, const std::string& token, int status);
};

class Auth : public AuthInterface {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Реализацию класса auth нужно вынести в cpp, а не hpp

public:
User currentUser;
Auth() = default;
int logoutUser (std::string userName) override {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int logoutUser (std::string userName) override. Передача строки по значению.

void logout();

protected:
virtual void createMessengerLayout(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему отвечает за некое создание Layout’a мессенджера должен ответ унаследованный класс? Более в целом не ясно почему widget отвечает за создание Layout’a.

Или может выбрано неверное название метода?

#include <cstdint>
#include <string>

class Compilation {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Структура с публичными полями

Comment on lines +13 to +16
class ICompilationManager {
public:
virtual Compilation runCompilation(const Snippet &snippet, const string &executionStdin) = 0;
};
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Как используется?

Comment on lines +35 to +43
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);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Если методы static и private, то их можно убрать из hpp и полностью перенести в .cpp файл.

Comment on lines +9 to +23
// 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));
// };
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants