Skip to content

Commit

Permalink
release v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
intae92 authored Sep 22, 2022
2 parents a56ac60 + e0b3792 commit ea466fb
Show file tree
Hide file tree
Showing 203 changed files with 3,279 additions and 2,291 deletions.
98 changes: 98 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<p align="center">
<img src="https://user-images.githubusercontent.com/83967672/186716387-7603cec6-d992-485b-a3c3-e50bf0e2c436.png" width="300" height="300">
</p>

<div align="center">
๐Ÿ“– ํ•จ๊ป˜ ์‚ฌ์šฉํ•˜๋Š” ์šฐ๋ฆฌ์˜ ๊ณต๊ฐ„, ์šฐ๋ฆฌ๊ฐ€ ์ฒดํฌํ•˜์ž!
</div>

<br>

<div align="center">

[![Application](http://img.shields.io/badge/Application-blue?style=flat-square&logo=googlechrome&logoColor=white&link=https://https://gongcheck.day//)](https://gongcheck.day/)
[![Tech Blog](http://img.shields.io/badge/Tech%20Blog-green?style=flat-square&logo=github&logoColor=white&link=https://gong-check.github.io/dev-blog/)](https://gong-check.github.io/dev-blog/)

</div>

<div align="center">

![](https://img.shields.io/github/workflow/status/woowacourse-teams/2022-gong-check/frontend?label=frontend&logo=github&style=flat-square)
![](https://img.shields.io/github/workflow/status/woowacourse-teams/2022-gong-check/sonarqube%20backend?label=backend&logo=github&style=flat-square)
![](https://img.shields.io/github/workflow/status/woowacourse-teams/2022-gong-check/sonar%20imagestorage?label=imagestorage&logo=github&style=flat-square)

</div>

## ๐Ÿ›  Tech Stacks

### Front-End

<img width="1190" alt="Screen Shot 2022-08-27 at 4 45 07 PM" src="https://user-images.githubusercontent.com/83967672/187020629-9dd735c0-e9b0-4928-ba37-32b38a67254e.png">

### Back-End

<img width="1190" alt="Screen Shot 2022-08-26 at 1 04 01 AM" src="https://user-images.githubusercontent.com/83967672/186714598-6796120d-3476-4792-932e-6f9eb22e5df3.png">

### Infra

<img width="1190" alt="Screen Shot 2022-08-26 at 1 05 05 AM" src="https://user-images.githubusercontent.com/83967672/186714751-0c967709-6034-419e-8542-243e7bd696fc.png">

<br>

## ๐Ÿ›ฐ Infrastructures

### Architecture

<img width="1015" alt="Screen Shot 2022-08-27 at 4 45 57 PM" src="https://user-images.githubusercontent.com/83967672/187020639-8bf9717f-c586-44c0-9fdf-b0416300566e.png">

### CI/CD Pipeline

<img width="1200" alt="Screen Shot 2022-08-27 at 4 46 27 PM" src="https://user-images.githubusercontent.com/83967672/187020661-7531ee0a-f7bd-4a91-af0c-96af810d6866.png">

<br>

## ๐Ÿซ‚ Members

| [์ฝ”์นด์ฝœ๋ผ](https://github.com/intae92) | [์˜จ์Šคํƒ€](https://github.com/cks3066) | [์–ด์ธ์˜ค](https://github.com/awesomeo184) | [์˜ค๋ฆฌ](https://github.com/jinyoungchoi95) | [์ฟผ๋ฆฌ์น˜](https://github.com/meatsby) | [์ฐฌ](https://github.com/kimchan123) | [๋ฒ”๊ณ ๋ž˜](https://github.com/cndqjacndqja) |
| :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: |
| <img src="https://avatars.githubusercontent.com/u/56149367?v=4" alt="Avatar" style="width:300px;" /> | <img src="https://avatars.githubusercontent.com/u/62434898?v=4" alt="Avatar" style="width:300px;" /> | <img src="https://avatars.githubusercontent.com/u/63030569?v=4" alt="Avatar" style="width:300px;" /> | <img src="https://avatars.githubusercontent.com/u/69106910?v=4" alt="Avatar" style="width:300px;" /> | <img src="https://avatars.githubusercontent.com/u/83967672?v=4" alt="Avatar" style="width:300px;" /> | <img src="https://avatars.githubusercontent.com/u/55445564?v=4" alt="Avatar" style="width:300px;" /> | <img src="https://avatars.githubusercontent.com/u/48307960?v=4" alt="Avatar" style="width:300px;" /> |
| ํ”„๋ก ํŠธ์—”๋“œ | ํ”„๋ก ํŠธ์—”๋“œ | ๋ฐฑ์—”๋“œ | ๋ฐฑ์—”๋“œ | ๋ฐฑ์—”๋“œ | ๋ฐฑ์—”๋“œ | ๋ฐฑ์—”๋“œ |

<br>

## ๐ŸŒŒ Team Culture

### ๐Ÿ›Ž ์†Œํ†ต

- ๋ชจ๋ฅด๋Š” ๊ฒƒ์„ ๋ถ€๋„๋Ÿฌ์›Œํ•˜์ง€ ๋ง์•„์š”.
- ์งˆ๋ฌธ์€ ์ž์œ ๋กญ๊ฒŒ, ์ฃผ์žฅ์€ ๊ทผ๊ฑฐ์žˆ๊ฒŒ ํ•ด์ฃผ์„ธ์š”.
- ๊ฐ ์Šคํ”„๋ฆฐํŠธ๋งˆ๋‹ค ์ฐํ•˜๊ฒŒ ํšŒ๊ณ ํ•ด์š”!

### ๐Ÿ“Œ ๊ณต์œ 

- ๋งค์ผ ์ถœ๊ทผํ•˜๊ณ  ๋ฐ์ผ๋ฆฌ ๋ฏธํŒ…์„ ์ง„ํ–‰ํ•ด์š”.
- ์ฃผ ๋‹จ์œ„๋กœ ํŒ€ ์ „์ฒด์˜ To-do ๋ฆฌ์ŠคํŠธ๋ฅผ ๊ณต์œ ํ•ด์š”.
- ๋งค์ผ ํ‡ด๊ทผ ์ „์— ๊ฐ„๋‹จํžˆ ์ฒดํฌ์•„์›ƒ ๋ฏธํŒ…์„ ์ง„ํ–‰ํ•ด์š”.

### ๐Ÿ”— ์•ฝ์†

- ์ˆ˜ํ‰์ ์ธ ๊ด€๊ณ„๋กœ ์„œ๋กœ๋ฅผ ์กด์ค‘ํ•ด์ฃผ์„ธ์š”.
- 10AM-6PM ์‹œ๊ฐ„์€ ์ž˜ ์ง€์ผœ์ฃผ์„ธ์š”.
- ๋Šฆ์œผ๋ฉด ๋ฒŒ์น™์ด ์žˆ์–ด์š”! โ˜•๏ธ

### ๐Ÿ– ์ด์Šˆ ๊ด€๋ฆฌ

- ์ƒ๊ฐ๋‚˜๋Š” ์ด์Šˆ๊ฐ€ ์žˆ์œผ๋ฉด ๋ฐ”๋กœ๋ฐ”๋กœ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”.
- ์‚ฌ์†Œํ•ด๋„ ๊ดœ์ฐฎ์•„์š”.
- ์ž์„ธํ•˜๊ฒŒ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”.
- ์ด์Šˆ ํ˜•์‹์— ๋„ˆ๋ฌด ๋ถ€๋‹ด ๊ฐ–์ง€๋ง์•„์š”.

### ๐Ÿ”Ž ์ฝ”๋“œ ๋ฆฌ๋ทฐ

- ๋ชจ๋“  ์‚ฌ๋žŒ์ด Approve ํ•ด์•ผ Merge ํ•  ์ˆ˜ ์žˆ์–ด์š”.
- PR ์€ ์ผ๊ณผ ์ค‘์—๋งŒ ๋‚ ๋ ค์ฃผ์„ธ์š”.
- ํ’ˆ์งˆ ๋†’์€ ์ฝ”๋“œ ๋ฆฌ๋ทฐ๋ฅผ ์œ„ํ•ด ๊ตฌ์ฒด์ ์œผ๋กœ PR ์„ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”.

### ๐Ÿ“ ํŒ€ ๋ธ”๋กœ๊ทธ

- ์„œ๋กœ ๋ฐฐ์šด ๋‚ด์šฉ์„ ์ผ์ฃผ์ผ์— ํ•œ ๋ฒˆ์”ฉ ๊ธ€๋กœ ์ž‘์„ฑํ•ด์„œ ๊ณต์œ ํ•ด์š”.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ public SpaceService(final HostRepository hostRepository, final SpaceRepository s
this.runningTaskRepository = runningTaskRepository;
}

public SpaceResponse findSpace(final Long hostId, final Long spaceId) {
Host host = hostRepository.getById(hostId);
Space space = spaceRepository.getByHostAndId(host, spaceId);
return SpaceResponse.from(space);
}

public SpacesResponse findSpaces(final Long hostId) {
Host host = hostRepository.getById(hostId);
List<Space> spaces = spaceRepository.findAllByHost(host);
Expand All @@ -67,23 +73,6 @@ public Long createSpace(final Long hostId, final SpaceCreateRequest request) {
.getId();
}

public SpaceResponse findSpace(final Long hostId, final Long spaceId) {
Host host = hostRepository.getById(hostId);
Space space = spaceRepository.getByHostAndId(host, spaceId);
return SpaceResponse.from(space);
}

@Transactional
public void changeSpace(final Long hostId, final Long spaceId, final SpaceChangeRequest request) {
Host host = hostRepository.getById(hostId);
Space space = spaceRepository.getByHostAndId(host, spaceId);
Name changeName = new Name(request.getName());
checkDuplicateSpaceName(changeName, host, space);

space.changeName(changeName);
space.changeImageUrl(request.getImageUrl());
}

@Transactional
public void removeSpace(final Long hostId, final Long spaceId) {
Host host = hostRepository.getById(hostId);
Expand All @@ -101,6 +90,17 @@ public void removeSpace(final Long hostId, final Long spaceId) {
spaceRepository.deleteById(spaceId);
}

@Transactional
public void changeSpace(final Long hostId, final Long spaceId, final SpaceChangeRequest request) {
Host host = hostRepository.getById(hostId);
Space space = spaceRepository.getByHostAndId(host, spaceId);
Name changeName = new Name(request.getName());
checkDuplicateSpaceName(changeName, host, space);

space.changeName(changeName);
space.changeImageUrl(request.getImageUrl());
}

private void checkDuplicateSpaceName(final Name spaceName, final Host host) {
if (spaceRepository.existsByHostAndName(host, spaceName)) {
String message = String.format("์ด๋ฏธ ์กด์žฌํ•˜๋Š” ์ด๋ฆ„์ž…๋‹ˆ๋‹ค. hostId = %d, spaceName = %s", host.getId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.context.request.async.AsyncRequestTimeoutException;

@RestControllerAdvice
@Slf4j
Expand Down Expand Up @@ -51,6 +52,11 @@ public ResponseEntity<ErrorResponse> handleInfrastructureException(final CustomE
return ResponseEntity.internalServerError().body(ErrorResponse.from(e.getErrorCode()));
}

@ExceptionHandler(AsyncRequestTimeoutException.class)
public void escapeFromAsyncRequestTimeoutException() {
// do nothing
}

@ExceptionHandler(Exception.class)
public ResponseEntity<ErrorResponse> handleInternalServerError(final Exception e) {
log.error("Stack Trace : {}", extractStackTrace(e));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.woowacourse.gongcheck.core.domain.host.Host;
import com.woowacourse.gongcheck.core.presentation.request.SpacePasswordChangeRequest;
import com.woowacourse.gongcheck.exception.NotFoundException;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.DisplayNameGeneration;
import org.junit.jupiter.api.DisplayNameGenerator;
Expand All @@ -19,7 +18,7 @@
import org.springframework.beans.factory.annotation.Autowired;

@ApplicationTest
@DisplayName("HostService ํด๋ž˜์Šค")
@DisplayName("HostService ํด๋ž˜์Šค์˜")
@DisplayNameGeneration(DisplayNameGenerator.ReplaceUnderscores.class)
class HostServiceTest {

Expand All @@ -36,48 +35,35 @@ class HostServiceTest {
class changeSpacePassword_๋ฉ”์†Œ๋“œ๋Š” {

@Nested
class ์กด์žฌํ•˜๋Š”_Host์˜_id์™€_์ˆ˜์ •ํ• _ํŒจ์Šค์›Œ๋“œ๋ฅผ_๋ฐ›๋Š”_๊ฒฝ์šฐ {
class ์กด์žฌํ•˜๋Š”_HostId์™€_์ˆ˜์ •ํ• _ํŒจ์Šค์›Œ๋“œ๋ฅผ_์ž…๋ ฅ๋ฐ›๋Š”_๊ฒฝ์šฐ {

private static final String ORIGIN_PASSWORD = "1234";
private static final String CHANGING_PASSWORD = "4567";
private static final long GITHUB_ID = 1234L;

private SpacePasswordChangeRequest spacePasswordChangeRequest;
private Long hostId;

@BeforeEach
void setUp() {
spacePasswordChangeRequest = new SpacePasswordChangeRequest(CHANGING_PASSWORD);
hostId = repository.save(Host_์ƒ์„ฑ(ORIGIN_PASSWORD, GITHUB_ID))
.getId();
}
private final Host host = repository.save(Host_์ƒ์„ฑ("1234", 1L));
private final SpacePasswordChangeRequest spacePasswordChangeRequest = new SpacePasswordChangeRequest(
CHANGING_PASSWORD);

@Test
void ํŒจ์Šค์›Œ๋“œ๋ฅผ_์ˆ˜์ •ํ•œ๋‹ค() {
hostService.changeSpacePassword(hostId, spacePasswordChangeRequest);
Host actual = repository.getById(Host.class, hostId);
hostService.changeSpacePassword(host.getId(), spacePasswordChangeRequest);
Host actual = repository.getById(Host.class, host.getId());

assertThat(actual.getSpacePassword().getValue()).isEqualTo(CHANGING_PASSWORD);
}
}

@Nested
class ์กด์žฌํ•˜์ง€_์•Š๋Š”_Host์˜_id๋ฅผ_๋ฐ›๋Š”_๊ฒฝ์šฐ {
class ์กด์žฌํ•˜์ง€_์•Š๋Š”_HostId๋ฅผ_์ž…๋ ฅ๋ฐ›๋Š”_๊ฒฝ์šฐ {

private static final String CHANGING_PASSWORD = "4567";
private static final long NON_EXIST_HOST_ID = 0L;

private SpacePasswordChangeRequest spacePasswordChangeRequest;
private Long hostId;

@BeforeEach
void setUp() {
spacePasswordChangeRequest = new SpacePasswordChangeRequest(CHANGING_PASSWORD);
hostId = 0L;
}
private final SpacePasswordChangeRequest spacePasswordChangeRequest = new SpacePasswordChangeRequest(
CHANGING_PASSWORD);

@Test
void ์˜ˆ์™ธ๋ฅผ_๋ฐœ์ƒ์‹œํ‚จ๋‹ค() {
assertThatThrownBy(() -> hostService.changeSpacePassword(hostId, spacePasswordChangeRequest))
assertThatThrownBy(() -> hostService.changeSpacePassword(NON_EXIST_HOST_ID, spacePasswordChangeRequest))
.isInstanceOf(NotFoundException.class)
.hasMessageContaining("์กด์žฌํ•˜์ง€ ์•Š๋Š” ํ˜ธ์ŠคํŠธ์ž…๋‹ˆ๋‹ค.");
}
Expand All @@ -88,31 +74,26 @@ void setUp() {
class createEntranceCode_๋ฉ”์†Œ๋“œ๋Š” {

@Nested
class ์กด์žฌํ•˜๋Š”_Host์˜_id๋ฅผ_๋ฐ›๋Š”_๊ฒฝ์šฐ {
class ์กด์žฌํ•˜๋Š”_HostId๋ฅผ_์ž…๋ ฅ๋ฐ›๋Š”_๊ฒฝ์šฐ {

private Long hostId;
private String expected;

@BeforeEach
void setUp() {
hostId = repository.save(Host_์ƒ์„ฑ("1234", 1111L))
.getId();
expected = entranceCodeProvider.createEntranceCode(hostId);
}
private final Host host = repository.save(Host_์ƒ์„ฑ("1234", 1L));
private final String expected = entranceCodeProvider.createEntranceCode(host.getId());

@Test
void ์ž…์žฅ์ฝ”๋“œ๋ฅผ_๋ฐ˜ํ™˜ํ•œ๋‹ค() {
String actual = hostService.createEntranceCode(hostId);
void entranceCode๋ฅผ_๋ฐ˜ํ™˜ํ•œ๋‹ค() {
String actual = hostService.createEntranceCode(host.getId());
assertThat(actual).isEqualTo(expected);
}
}

@Nested
class ์กด์žฌํ•˜์ง€_์•Š๋Š”_Host์˜_id๋ฅผ_๋ฐ›๋Š”_๊ฒฝ์šฐ {
class ์กด์žฌํ•˜์ง€_์•Š๋Š”_HostId๋ฅผ_์ž…๋ ฅ๋ฐ›๋Š”_๊ฒฝ์šฐ {

private static final long NON_EXIST_HOST_ID = 0L;

@Test
void ์˜ˆ์™ธ๋ฅผ_๋ฐœ์ƒ์‹œํ‚จ๋‹ค() {
assertThatThrownBy(() -> hostService.createEntranceCode(0L))
assertThatThrownBy(() -> hostService.createEntranceCode(NON_EXIST_HOST_ID))
.isInstanceOf(NotFoundException.class)
.hasMessageContaining("์กด์žฌํ•˜์ง€ ์•Š๋Š” ํ˜ธ์ŠคํŠธ์ž…๋‹ˆ๋‹ค.");
}
Expand Down
Loading

0 comments on commit ea466fb

Please sign in to comment.