Skip to content

Commit

Permalink
Merge branch 'develop' into Feature/#133-마이페이지_회원_정보_수정_기능을_제작한다
Browse files Browse the repository at this point in the history
  • Loading branch information
jimini1026 authored Aug 2, 2024
2 parents 6a4405c + 0dfa1db commit 0e29cc5
Show file tree
Hide file tree
Showing 121 changed files with 2,465 additions and 1,338 deletions.
93 changes: 74 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Rest Docs: https://www.doore.kro.kr/docs/doore.html
<br><br>

## 🧑🏻‍💻 기획 & 개발

### 2023.11.12 ~2024.3.1
<div align="center">
<table>
<tr>
Expand Down Expand Up @@ -76,9 +78,81 @@ Rest Docs: https://www.doore.kro.kr/docs/doore.html
</a>
<br/>
</td>
</tr>
<tr>
<td align="center">
BackEnd
</td>
<td align="center">
Infra
</td>
<td align="center">
BackEnd, Infra
</td>
<td align="center">
BackEnd, Infra
</td>
<td align="center">
BackEnd
</td>
</tr>
</table>
</div>


### 2024.3.1 ~ 진행중
<div align="center">
<table>
<tr>
<td align="center">
임연후
</td>
</td>
<td align="center">
이지민
</td>
<td align="center">
임지민
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/lcqff">
<img src="https://github.com/lcqff.png" width="80" alt="lcqff"/>
<br/>
<sub><b>lcqff</b></sub>
</a>
<br/>
</td>
<td align="center">
<a href="https://github.com/JJimini">
<img src="https://github.com/JJimini.png" width="80" alt="JJimini"/>
<br />
<sub><b>JJimini</b></sub>
</a>
<br/>
</td>
<td align="center">
<a href="https://github.com/jimini1026">
<img src="https://github.com/jimini1026.png" width="80" alt="jimini1026"/>
<br />
<sub><b>jimini1026</b></sub>
</a>
<br/>
</td>
</tr>
<tr>
<td align="center">
BackEnd, Infra
</td>
<td align="center">
BackEnd
</td>
<td align="center">
BackEnd
</td>
</tr>
</table>
</div>

## :pencil2: 기술 스택
Expand Down Expand Up @@ -143,25 +217,6 @@ Rest Docs: https://www.doore.kro.kr/docs/doore.html
   └─ test
```

## :hand: 역할 분담

#### 임연후(팜)
- **BackEnd**: 스터디 CRUD, 참여자 CRUD, S3 파일 저장, 학습자료 CRUD, RestDocs 세팅, Cors 설정

#### 송세연 (아마란스)
- **BackEnd**: 소셜 로그인, 팀원 목록 조회 및 검색
- **Infra**: 배포 서버 CICD 작성, 운영서버 Redis 세팅

#### 이수빈(짱구)
- **Infra**: CICD 파이프라인 구축, 백엔드 서버 도커 파일 작성, HTTPS 적용, CICD 캐싱 적용, CICD DB Docker 고도화, YML 서브모듈 도입, NGINX 설정

#### 이지민(미나)
- **BackEnd**: 커리큘럼 CRUD, 커리큘럼 관리

#### 손현경(보름)
- **BackEnd**: S3 이미지 저장, 팀원 초대 링크 생성, 팀원 추가
- **Infra**: CICD 파이프라인 구축, 백엔드 서버 도커 파일 작성

## :seedling: Features

### 소셜 로그인
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ dependencies {
implementation 'io.jsonwebtoken:jjwt:0.9.1'
implementation 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359'
implementation 'org.springframework.boot:spring-boot-starter-security'
// implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'

//restdocs
asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor'
Expand Down
14 changes: 8 additions & 6 deletions src/docs/asciidoc/garden.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ifndef::snippets[]
:snippets: ./build/generated-snippets
endif::[]

= ATTENDANCE API 문서
= Garden API 문서
:doctype: book
:icons: font
:source-highlighter: highlightjs
Expand All @@ -15,16 +15,18 @@ endif::[]
link:../doore.html[API 목록으로 돌아가기]


== `GET`: 1년치 잔디 조회
== `GET`: 텃밭 조회

NOTE: 최근 15주(월요일부터 시작)의 텃밭 데이터를 조회합니다.

.HTTP Request
include::{snippets}/garden-get-all/http-request.adoc[]
include::{snippets}/garden-get/http-request.adoc[]

.Path Parameters
include::{snippets}/garden-get-all/path-parameters.adoc[]
include::{snippets}/garden-get/path-parameters.adoc[]

.Response Body
include::{snippets}/garden-get-all/response-body.adoc[]
include::{snippets}/garden-get/response-body.adoc[]

.Response Fields
include::{snippets}/garden-get-all/response-fields.adoc[]
include::{snippets}/garden-get/response-fields.adoc[]
14 changes: 14 additions & 0 deletions src/docs/asciidoc/member.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,17 @@ include::{snippets}/delete-member/http-response.adoc[]

.HTTP Response
include::{snippets}/delete-member/http-response.adoc[]

== `GET`: 사이드바 정보 조회

.HTTP Request
include::{snippets}/get-sidebar-info/http-request.adoc[]

.Path Parameters
include::{snippets}/get-sidebar-info/path-parameters.adoc[]

.HTTP Response
include::{snippets}/get-sidebar-info/http-response.adoc[]

.Response Body's Fields
include::{snippets}/get-sidebar-info/response-body.adoc[]
11 changes: 11 additions & 0 deletions src/docs/asciidoc/memberTeam.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,14 @@ include::{snippets}/member-team-find/http-response.adoc[]

.Response Body
include::{snippets}/member-team-find/response-fields.adoc[]


== `DELETE`: 팀원 삭제
.HTTP Request
include::{snippets}/member-team-delete/http-request.adoc[]

.Query Parameters
include::{snippets}/member-team-delete/path-parameters.adoc[]

.HTTP Response
include::{snippets}/member-team-delete/http-response.adoc[]
16 changes: 16 additions & 0 deletions src/docs/asciidoc/study.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,19 @@ include::{snippets}/my-studies/http-response.adoc[]

.HTTP Response
include::{snippets}/my-studies/response-fields.adoc[]


== `GET`: 팀의 Study 랭킹(목록) 조회

.HTTP Request
include::{snippets}/team-studies-get/http-request.adoc[]

.Path Parameters
include::{snippets}/team-studies-get/path-parameters.adoc[]

.Query Parameters
include::{snippets}/team-studies-get/query-parameters.adoc[]

.HTTP Response
include::{snippets}/team-studies-get/http-response.adoc[]

28 changes: 28 additions & 0 deletions src/docs/asciidoc/team.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,31 @@ include::{snippets}/my-teams/http-response.adoc[]

.Response Body's Fields
include::{snippets}/my-teams/response-fields.adoc[]

== `GET`: 팀 상세 조회

.HTTP Request
include::{snippets}/get-team/http-request.adoc[]

.Path Parameters
include::{snippets}/get-team/path-parameters.adoc[]

.HTTP Response
include::{snippets}/get-team/http-response.adoc[]

.Response Body's Fields
include::{snippets}/get-team/response-fields.adoc[]

== `GET`: 팀 목록(랭킹) 조회

NOTE: 이번주(월요일부터 시작)의 기여도 총합을 기준으로 내림차순 나열됩니다.


.HTTP Request
include::{snippets}/get-team-week-rank/http-request.adoc[]

.HTTP Response
include::{snippets}/get-team-week-rank/http-response.adoc[]

.Response Body's Fields
include::{snippets}/get-team-week-rank/response-fields.adoc[]
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class AttendanceController {
private final AttendanceCommandService attendanceCommandService;

@PostMapping
public ResponseEntity<Void> createAttendance(@LoginMember Member member) {
public ResponseEntity<Void> createAttendance(@LoginMember final Member member) {
attendanceCommandService.createAttendance(member.getId());
return ResponseEntity.status(HttpStatus.CREATED).build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ public class AttendanceCommandService {
private final MemberRepository memberRepository;
private final AttendanceRepository attendanceRepository;

public void createAttendance(Long memberId) {
Member member = memberRepository.findById(memberId).orElseThrow(() -> new MemberException(NOT_FOUND_MEMBER));
public void createAttendance(final Long memberId) {
final Member member = memberRepository.findById(memberId).orElseThrow(() -> new MemberException(NOT_FOUND_MEMBER));

if (isMemberAlreadyAttend(member.getId())) {
throw new AttendanceException(ALREADY_ATTENDED);
}
Attendance attendance = Attendance.builder()
final Attendance attendance = Attendance.builder()
.memberId(memberId)
.build();
attendanceRepository.save(attendance);
}

private boolean isMemberAlreadyAttend(Long memberId) {
private boolean isMemberAlreadyAttend(final Long memberId) {
return attendanceRepository.existsByMemberIdAndDate(memberId, LocalDate.now());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

import doore.attendance.domain.Attendance;
import java.time.LocalDate;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface AttendanceRepository extends JpaRepository<Attendance, Long> {
@Query(value = "select count(*)>0 from Attendance a where a.memberId= :memberId and DATE(a.createdAt)=:date")
Boolean existsByMemberIdAndDate(@Param("memberId")Long memberId, @Param("date")LocalDate date);

List<Attendance> findAllByMemberIdIn(List<Long> memberIds);
}
9 changes: 8 additions & 1 deletion src/main/java/doore/config/CorsConfig.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package doore.config;

import com.amazonaws.HttpMethod;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
Expand All @@ -18,7 +19,13 @@ public class CorsConfig implements WebMvcConfigurer {
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins(allowedOrigins)
.allowedMethods(allowedMethods)
.allowedMethods(
HttpMethod.GET.name(),
HttpMethod.HEAD.name(),
HttpMethod.POST.name(),
HttpMethod.PATCH.name(),
HttpMethod.PUT.name(),
HttpMethod.DELETE.name())
.allowedHeaders("Origin", "Content-Type", "Accept", "Authorization")
.allowCredentials(true)
.maxAge(3600);
Expand Down
34 changes: 0 additions & 34 deletions src/main/java/doore/crop/domain/Crop.java

This file was deleted.

This file was deleted.

18 changes: 0 additions & 18 deletions src/main/java/doore/crop/exception/CropException.java

This file was deleted.

Loading

0 comments on commit 0e29cc5

Please sign in to comment.