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

Homework3 completed #3

Merged
merged 31 commits into from
Apr 15, 2024
Merged

Homework3 completed #3

merged 31 commits into from
Apr 15, 2024

Conversation

cyberpunkoff
Copy link
Owner

Сделал третью домашнюю работу.

В этой работе:

  • контроллеры для бота и клиента
  • настроенный swagger
  • клиенты
  • ... и многое другое

Сейчас продумываю идеи для тестов, чувствую, что тут идеально подойдут айтишники, но пока не знаю, как их делать.

Copy link

github-actions bot commented Mar 1, 2024

🦞 Scrapper code coverage

Overall Project 39.27% -58.1% 👨‍💻
Files changed 3.04% 🤢

File Coverage
TelegramChatController.java 23.08% -76.92% 🤢
LinksController.java 16.67% -83.33% 🤢
RestControllerAdvice.java 2.8% -97.2% 🤢
ApiErrorResponse.java 0% 🤢
LinkUpdateRequest.java 0% 🤢
LinkAlreadyExistsException.java 0% 🤢
ChatAlreadyRegisteredException.java 0% 🤢
NoSuchChatException.java 0% 🤢
WebClientBotClient.java 0% 🤢
LinkResponse.java 0% 🤢
RemoveLinkRequest.java 0% 🤢
AddLinkRequest.java 0% 🤢
ListLinksResponse.java 0% 🤢

Repository owner deleted a comment from github-actions bot Mar 16, 2024
import org.springframework.web.reactive.function.client.WebClient;

public class WebClientScrapperClient implements ScrapperClient {
private final static String DEFAULT_BASE_URL = "http://127.0.0.1:8080";

Choose a reason for hiding this comment

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

Лучше в пропсы вынести, представь, что у тебя несколько конфигов-для локальных запусков, тестовый и продовый. В целом так лучше поступать со всеми эндпоинтами.

Copy link
Owner Author

@cyberpunkoff cyberpunkoff Apr 15, 2024

Choose a reason for hiding this comment

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

Я решил все-таки оставить тут этот BASE URL, а создание бина перенес в файл конфигурации, чтобы можно было задавать url в конфиге, надеюсь, так можно)

@Configuration
public class ClientConfiguration {
    @Bean
    public ScrapperClient scrapperClient(ApplicationConfig config) {
        return new WebClientScrapperClient(config.scrapperUrl());
    }
}

# Conflicts:
#	scrapper/src/main/java/edu/java/clients/stackoverflow/StackOverflowClient.java
#	scrapper/src/main/java/edu/java/clients/stackoverflow/StackOverflowWebClient.java
#	scrapper/src/test/java/edu/java/scrapper/clients/stackoverflow/StackOverflowWebClientTest.java
Copy link

🤖 Bot code coverage

Overall Project 32.44% -24.52% 🔥
Files changed 0% 🙈

File Coverage
UpdatesControllerErrorHandler.java 0% 🙈
LinkResponse.java 0% 🙈
RemoveLinkRequest.java 0% 🙈
ListLinksResponse.java 0% 🙈
AddLinkRequest.java 0% 🙈
LinkUpdateRequest.java 0% 🙈
WebClientScrapperClient.java 0% 🙈
ClientConfiguration.java 0% 🙈
UpdatesController.java 0% 🙈
ApplicationConfig.java 0% 🔥
NoSuchChatException.java 0% 🙈
ApiErrorResponse.java 0% 🙈

@cyberpunkoff cyberpunkoff merged commit cc043b5 into main Apr 15, 2024
6 checks passed
@cyberpunkoff cyberpunkoff deleted the hw3 branch April 15, 2024 16:41
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