Skip to content
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

lab1 #3

Merged
merged 2 commits into from
Mar 13, 2025
Merged

lab1 #3

merged 2 commits into from
Mar 13, 2025

Conversation

Pr0meTheuSS
Copy link
Owner

No description provided.

Copy link

@SkivHisink SkivHisink left a comment

Choose a reason for hiding this comment

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

Мелкие комментарии необязательные к исправлению.

#include "models/sub_task.hpp"

namespace Worker {
class LexicographicWordGenerator {

Choose a reason for hiding this comment

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

В отдельный файл?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Поправил

size_t wordsPerPart = totalWords / subTask.partCount;
size_t remainingWords = totalWords % subTask.partCount;

std::cout << "subTask.partNumber: " << subTask.partNumber << std::endl;

Choose a reason for hiding this comment

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

Конструктор должен принимать поток куда писать, чтобы у нас была возможность выбора куда мы пишем

Copy link
Owner Author

Choose a reason for hiding this comment

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

Сделал

#include <string>

#include "models/crack_request.hpp"
#include "userver/formats/serialize/to.hpp"

Choose a reason for hiding this comment

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

!

Choose a reason for hiding this comment

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

В большинстве случаев для userver используете <>, а тут почему-то ""

Choose a reason for hiding this comment

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

И порядок include'ов тут отличается от всех остальных файлов

Copy link
Owner Author

Choose a reason for hiding this comment

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

Поправил


#include <userver/components/component_list.hpp>
#include <userver/server/handlers/http_handler_json_base.hpp>

Choose a reason for hiding this comment

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

?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Убрал


#include <userver/components/component_list.hpp>
#include <userver/server/handlers/http_handler_json_base.hpp>

Choose a reason for hiding this comment

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

?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Убрал

#include "models/crack_request.hpp"

namespace Manager {

Choose a reason for hiding this comment

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

Я бы так делал в *.cpp и читабильность была бы x10:

using HttpHandlerJsonBase = userver::server::handlers::HttpHandlerJsonBase;
using HttpRequest = userver::server::http::HttpRequest;
using HttpStatus = userver::server::http::HttpStatus;
using HttpMethod = userver::server::http::HttpMethod;
using ClientError = userver::server::handlers::ClientError;
using Value = userver::formats::json::Value;
using ValueBuilder = userver::formats::json::ValueBuilder;
using RequestContext = userver::server::request::RequestContext;

Choose a reason for hiding this comment

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

Но это необязательно, как вам удобнее.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Думал о таком, но привык, когда using для сокращений полных путей используются по минимуму


#include <userver/components/component_list.hpp>
#include <userver/server/handlers/http_handler_json_base.hpp>

Choose a reason for hiding this comment

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

?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Поправил

@Pr0meTheuSS Pr0meTheuSS merged commit 6571464 into main Mar 13, 2025
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.

2 participants