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

merge: 6주차 작업 master에 반영 #54

Merged
merged 26 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c4642e1
fix: Specification 오류 해결
peeerr Oct 6, 2024
98a1b79
Merge pull request #42 from kakao-tech-campus-2nd-step3/bug/41-column
peeerr Oct 6, 2024
769f951
fix: 회원 정보 수정 API 에러 해결
peeerr Oct 6, 2024
50dc391
Merge pull request #44 from kakao-tech-campus-2nd-step3/bug/43-member…
peeerr Oct 6, 2024
0a89607
refactor: 검색 결과 dto와 내 정보 dto 분리
peeerr Oct 9, 2024
de70f11
feat: 검색 결과 필드에 친구 요청 상태 추가
peeerr Oct 9, 2024
9ffdbe4
refactor: 지저분한 코드 개선
peeerr Oct 9, 2024
eb14110
test: 회원 검색 테스트 코드 수정
peeerr Oct 9, 2024
fdbaf3a
feat: 친구 상태를 단수형으로 수정 (FRIENDS -> FRIEND)
peeerr Oct 9, 2024
c240318
Merge pull request #46 from kakao-tech-campus-2nd-step3/feature/45-fr…
peeerr Oct 9, 2024
b28ba1e
feat: 일기 카테고리,파일의 저장,조회 구현
Oct 10, 2024
c1dec83
feat: 일기 위치 조회 기능 추가
Oct 10, 2024
599c0a6
feat: Swagger API 문서에 설명 추가
peeerr Oct 11, 2024
8c05137
feat: 한국 시간대로 설정
peeerr Oct 11, 2024
931bd63
Merge pull request #49 from kakao-tech-campus-2nd-step3/feature/48-sw…
peeerr Oct 11, 2024
534ea58
feat: RDS (MySQL) 연동
peeerr Oct 11, 2024
3aa56d3
feat: 일기 필터링 조건 추가
Oct 11, 2024
040a0d5
Merge pull request #51 from kakao-tech-campus-2nd-step3/deploy/50-rds
peeerr Oct 11, 2024
6e9832c
chore: GIS관련 의존성 추가
Oct 15, 2024
fca491f
refactor: 위경도 Point타입으로 변경
Oct 15, 2024
51b64fa
refactor: like더미 데이터에서 실제 데이터로 변경
Oct 15, 2024
3199f01
feat: 다이어리 저장, 조회에서 파일 부분 제거
Oct 15, 2024
2b9808c
refactor: imageUrl -> filename으로 다시 수정
Oct 15, 2024
69fe67f
style:
Oct 15, 2024
f4babd5
Merge branch 'weekly/6' into feature/47-Diary
peeerr Oct 16, 2024
1418219
Merge pull request #52 from HyeJiJUN11/feature/47-Diary
peeerr Oct 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/master_weekly_cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
with:
files: ./src/main/resources/application-prod.yml
env:
spring.datasource.url: ${{ secrets.RDS_URL }}
spring.datasource.username: ${{ secrets.RDS_USERNAME }}
spring.datasource.password: ${{ secrets.RDS_PASSWORD }}
aws.s3.bucket: ${{ secrets.AWS_S3_BUCKET }}
aws.s3.accessKey: ${{ secrets.AWS_S3_ACCESS_KEY }}
aws.s3.secretKey: ${{ secrets.AWS_S3_SECRET_KEY }}
Expand Down Expand Up @@ -56,4 +59,4 @@ jobs:
script: |
cd ./project
sudo fuser -k -n tcp 8080 || true
nohup java -jar app.jar > ./output.log 2>&1 &
nohup java -Duser.timezone=Asia/Seoul -jar app.jar > ./output.log 2>&1 &
3 changes: 3 additions & 0 deletions .github/workflows/pr_weekly_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
with:
files: ./src/main/resources/application-prod.yml
env:
spring.datasource.url: ${{ secrets.RDS_URL }}
spring.datasource.username: ${{ secrets.RDS_USERNAME }}
spring.datasource.password: ${{ secrets.RDS_PASSWORD }}
aws.s3.bucket: ${{ secrets.AWS_S3_BUCKET }}
aws.s3.accessKey: ${{ secrets.AWS_S3_ACCESS_KEY }}
aws.s3.secretKey: ${{ secrets.AWS_S3_SECRET_KEY }}
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependencies {

compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
implementation 'org.hibernate:hibernate-spatial:6.6.1.Final'
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.potatocake.everymoment.config;

import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.PrecisionModel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class GeometryConfig {
@Bean
public GeometryFactory geometryFactory() {
return new GeometryFactory(new PrecisionModel(), 4326);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
import com.potatocake.everymoment.dto.response.CategoryResponse;
import com.potatocake.everymoment.security.MemberDetails;
import com.potatocake.everymoment.service.CategoryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import java.util.List;
import lombok.RequiredArgsConstructor;
Expand All @@ -19,44 +25,64 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "Categories", description = "카테고리 관리 API")
@RequiredArgsConstructor
@RequestMapping("/api/categories")
@RestController
public class CategoryController {

private final CategoryService categoryService;

@Operation(summary = "카테고리 목록 조회", description = "사용자의 카테고리 목록을 조회합니다.")
@ApiResponse(responseCode = "200", description = "카테고리 목록 조회 성공", content = @Content(schema = @Schema(implementation = CategoryResponse.class)))
@GetMapping
public ResponseEntity<SuccessResponse<CategoryResponse>> getCategories(
@Parameter(description = "인증된 사용자 정보", hidden = true)
@AuthenticationPrincipal MemberDetails memberDetails) {
List<CategoryResponse> categories = categoryService.getCategories(memberDetails.getId());

return ResponseEntity.ok()
.body(SuccessResponse.ok(categories));
}

@Operation(summary = "카테고리 추가", description = "새로운 카테고리를 추가합니다.")
@ApiResponse(responseCode = "200", description = "카테고리 추가 성공")
@PostMapping
public ResponseEntity<SuccessResponse> addCategory(@RequestBody @Valid CategoryCreateRequest request,
@AuthenticationPrincipal MemberDetails memberDetails) {
public ResponseEntity<SuccessResponse> addCategory(
@Parameter(description = "카테고리 생성 정보", required = true)
@RequestBody @Valid CategoryCreateRequest request,
@Parameter(description = "인증된 사용자 정보", hidden = true)
@AuthenticationPrincipal MemberDetails memberDetails) {
categoryService.addCategory(memberDetails.getId(), request);

return ResponseEntity.ok()
.body(SuccessResponse.ok());
}

@Operation(summary = "카테고리 수정", description = "기존 카테고리를 수정합니다.")
@ApiResponse(responseCode = "200", description = "카테고리 수정 성공")
@PatchMapping("/{categoryId}")
public ResponseEntity<SuccessResponse> updateCategory(@PathVariable Long categoryId,
@RequestBody @Valid CategoryCreateRequest request,
@AuthenticationPrincipal MemberDetails memberDetails) {
public ResponseEntity<SuccessResponse> updateCategory(
@Parameter(description = "수정할 카테고리 ID", required = true)
@PathVariable Long categoryId,
@Parameter(description = "카테고리 수정 정보", required = true)
@RequestBody @Valid CategoryCreateRequest request,
@Parameter(description = "인증된 사용자 정보", hidden = true)
@AuthenticationPrincipal MemberDetails memberDetails) {
categoryService.updateCategory(categoryId, memberDetails.getId(), request);

return ResponseEntity.ok()
.body(SuccessResponse.ok());
}

@Operation(summary = "카테고리 삭제", description = "카테고리를 삭제합니다.")
@ApiResponse(responseCode = "200", description = "카테고리 삭제 성공")
@DeleteMapping("/{categoryId}")
public ResponseEntity<SuccessResponse> deleteCategory(@PathVariable Long categoryId,
@AuthenticationPrincipal MemberDetails memberDetails) {
public ResponseEntity<SuccessResponse> deleteCategory(
@Parameter(description = "삭제할 카테고리 ID", required = true)
@PathVariable Long categoryId,
@Parameter(description = "인증된 사용자 정보", hidden = true)
@AuthenticationPrincipal MemberDetails memberDetails) {
categoryService.deleteCategory(categoryId, memberDetails.getId());

return ResponseEntity.ok()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
import com.potatocake.everymoment.dto.request.CommentRequest;
import com.potatocake.everymoment.security.MemberDetails;
import com.potatocake.everymoment.service.CommentService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.DeleteMapping;
Expand All @@ -15,18 +18,23 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "Comments", description = "댓글 관리 API")
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/comments")
public class CommentController {

private final CommentService commentService;

//댓글 수정
@Operation(summary = "댓글 수정", description = "기존 댓글을 수정합니다.")
@ApiResponse(responseCode = "200", description = "댓글 수정 성공")
@PatchMapping("/{commentId}")
public ResponseEntity<SuccessResponse<Void>> updateComment(
@Parameter(description = "인증된 사용자 정보", hidden = true)
@AuthenticationPrincipal MemberDetails memberDetails,
@Parameter(description = "수정할 댓글 ID", required = true)
@PathVariable Long commentId,
@Parameter(description = "댓글 수정 정보", required = true)
@RequestBody CommentRequest commentRequest) {
Long memberId = memberDetails.getId();

Expand All @@ -36,10 +44,13 @@ public ResponseEntity<SuccessResponse<Void>> updateComment(
.body(SuccessResponse.ok());
}

//댓글 삭제
@Operation(summary = "댓글 삭제", description = "댓글을 삭제합니다.")
@ApiResponse(responseCode = "200", description = "댓글 삭제 성공")
@DeleteMapping("/{commentId}")
public ResponseEntity<SuccessResponse<Void>> deleteComment(
@Parameter(description = "인증된 사용자 정보", hidden = true)
@AuthenticationPrincipal MemberDetails memberDetails,
@Parameter(description = "삭제할 댓글 ID", required = true)
@PathVariable Long commentId) {
Long memberId = memberDetails.getId();

Expand Down
Loading
Loading