Skip to content

Commit

Permalink
Merge pull request #989 from woowacourse-teams/dev
Browse files Browse the repository at this point in the history
release: 2.1.2
  • Loading branch information
sakjung authored Apr 2, 2024
2 parents 2e0578b + 20e8560 commit a662d15
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
import com.woowacourse.zzimkkong.dto.slack.SlackResponse;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.http.client.reactive.ReactorClientHttpConnector;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.netty.http.client.HttpClient;
import reactor.netty.resources.ConnectionProvider;

import java.time.Duration;
import java.util.Objects;

@Service
Expand All @@ -19,7 +23,14 @@ public class SlackService {
public SlackService(@Value("${service.url}") final String titleLink,
final WebClient webClient) {
this.titleLink = titleLink;
slackWebClient = webClient;
ConnectionProvider provider = ConnectionProvider.builder("slack-pool")
.maxConnections(10)
.maxIdleTime(Duration.ofSeconds(2L))
.maxLifeTime(Duration.ofSeconds(2L))
.lifo()
.build();
HttpClient httpClient = HttpClient.create(provider);
slackWebClient = webClient.mutate().clientConnector(new ReactorClientHttpConnector(httpClient)).build();
}

public void sendCreateMessage(SlackResponse slackResponse) {
Expand All @@ -39,10 +50,8 @@ public void sendDeleteMessage(SlackResponse slackResponse) {

private void send(final Attachments attachments, final String slackUrl) {
if (!Objects.isNull(slackUrl)) {
slackWebClient.mutate()
.baseUrl(slackUrl)
.build()
.post()
slackWebClient.post()
.uri(slackUrl)
.contentType(MediaType.APPLICATION_JSON)
.bodyValue(attachments.toString())
.retrieve()
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zzimkkong-frontend",
"version": "2.1.1",
"version": "2.1.2",
"main": "src/index.tsx",
"license": "MIT",
"homepage": "https://github.com/woowacourse-teams/2021-zzimkkong",
Expand Down
13 changes: 10 additions & 3 deletions frontend/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,16 @@ const Header = ({ onClickLogin }: HeaderProps): JSX.Element => {
</Styled.HeaderLink>
<Styled.ButtonContainer>
{accessToken ? (
<Styled.TextButton variant="text" onClick={handleLogout}>
로그아웃
</Styled.TextButton>
<>
<Styled.TextLink
to={location.pathname.includes('/guest') ? PATH.GUEST_MAIN : PATH.MANAGER_MAP_LIST}
>
마이 페이지
</Styled.TextLink>
<Styled.TextButton variant="text" onClick={handleLogout}>
로그아웃
</Styled.TextButton>
</>
) : (
<>
<Styled.TextLink to={PATH.GUEST_NON_LOGIN_RESERVATION_SEARCH}>
Expand Down

0 comments on commit a662d15

Please sign in to comment.